diff --git a/dist/build.js b/dist/build.js index a927710..4e0578b 100644 --- a/dist/build.js +++ b/dist/build.js @@ -60,7 +60,7 @@ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 266); +/******/ return __webpack_require__(__webpack_require__.s = 288); /******/ }) /************************************************************************/ /******/ ([ @@ -68,7 +68,7 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(45); // // Single point of contact for Vue // @@ -103,7 +103,7 @@ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return isPromise; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__array__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__object__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__safe_types__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__safe_types__ = __webpack_require__(30); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__array__["d"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__object__["j"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_1__object__["k"]; }); @@ -187,7 +187,7 @@ var isPromise = function isPromise(val) { /* unused harmony export registerDirectives */ /* unused harmony export vueUse */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__vue__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_set__ = __webpack_require__(283); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__config_set__ = __webpack_require__(305); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__env__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__warn__ = __webpack_require__(20); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -759,10 +759,10 @@ var attemptBlur = function attemptBlur(el) { /* unused harmony export getBreakpointsDown */ /* unused harmony export getBreakpointsDownCached */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__vue__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_deep__ = __webpack_require__(66); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__memoize__ = __webpack_require__(47); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_defaults__ = __webpack_require__(119); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_deep__ = __webpack_require__(73); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__memoize__ = __webpack_require__(52); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config_defaults__ = __webpack_require__(127); @@ -1010,7 +1010,7 @@ var deepFreeze = function deepFreeze(obj) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_normalize_slot__ = __webpack_require__(26); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_normalize_slot__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_array__ = __webpack_require__(8); @@ -1319,7 +1319,7 @@ var getEnv = function getEnv(key) { var getNoWarn = function getNoWarn() { return getEnv('BOOTSTRAP_VUE_NO_WARN'); }; -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(116))) +/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(51))) /***/ }), /* 14 */ @@ -1552,7 +1552,7 @@ var looseEqual = function looseEqual(a, b) { /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_cache__ = __webpack_require__(125); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_cache__ = __webpack_require__(133); /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__utils_cache__["a" /* makePropCacheMixin */])('$attrs', 'bvAttrs')); @@ -1642,9 +1642,9 @@ var warnNoMutationObserverSupport = function warnNoMutationObserverSupport(sourc /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_dom__ = __webpack_require__(4); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_inspect__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_props__ = __webpack_require__(16); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_router__ = __webpack_require__(35); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_router__ = __webpack_require__(38); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__mixins_attrs__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__mixins_listeners__ = __webpack_require__(28); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__mixins_listeners__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__mixins_normalize_slot__ = __webpack_require__(7); function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } @@ -1956,6 +1956,357 @@ var eventOnOff = function eventOnOff(on) { /***/ }), /* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(272); + +/*global toString:true*/ + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Function equal to merge with the difference being that no reference + * to original objects is kept. + * + * @see merge + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function deepMerge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = deepMerge(result[key], val); + } else if (typeof val === 'object') { + result[key] = deepMerge({}, val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + deepMerge: deepMerge, + extend: extend, + trim: trim +}; + + +/***/ }), +/* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2990,7 +3341,7 @@ var eventOnOff = function eventOnOff(on) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_976", function() { return BIconXSquareFill; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_977", function() { return BIconZoomIn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_978", function() { return BIconZoomOut; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helpers_make_icon__ = __webpack_require__(285); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helpers_make_icon__ = __webpack_require__(307); // --- BEGIN AUTO-GENERATED FILE --- // // @IconsVersion: 1.0.0-alpha5 @@ -4038,7 +4389,453 @@ var BIconZoomIn=/*#__PURE__*/Object(__WEBPACK_IMPORTED_MODULE_0__helpers_make_ic var BIconZoomOut=/*#__PURE__*/Object(__WEBPACK_IMPORTED_MODULE_0__helpers_make_icon__["a" /* makeIcon */])('ZoomOut','');// --- END AUTO-GENERATED FILE --- /***/ }), -/* 24 */ +/* 25 */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + Modified by Evan You @yyx990803 +*/ + +var hasDocument = typeof document !== 'undefined' + +if (typeof DEBUG !== 'undefined' && DEBUG) { + if (!hasDocument) { + throw new Error( + 'vue-style-loader cannot be used in a non-browser environment. ' + + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." + ) } +} + +var listToStyles = __webpack_require__(293) + +/* +type StyleObject = { + id: number; + parts: Array +} + +type StyleObjectPart = { + css: string; + media: string; + sourceMap: ?string +} +*/ + +var stylesInDom = {/* + [id: number]: { + id: number, + refs: number, + parts: Array<(obj?: StyleObjectPart) => void> + } +*/} + +var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) +var singletonElement = null +var singletonCounter = 0 +var isProduction = false +var noop = function () {} +var options = null +var ssrIdKey = 'data-vue-ssr-id' + +// Force single-tag solution on IE6-9, which has a hard limit on the # of ']; + opts.cellXfs.forEach(function(xf, id) { + var payload = []; + payload.push(writextag('NumberFormat', null, {"ss:Format": escapexml(SSF._table[xf.numFmtId])})); + + var o = {"ss:ID": "s" + (21+id)}; + styles.push(writextag('Style', payload.join(""), o)); + }); + return writextag("Styles", styles.join("")); +} +function write_name_xlml(n) { return writextag("NamedRange", null, {"ss:Name": n.Name, "ss:RefersTo":"=" + a1_to_rc(n.Ref, {r:0,c:0})}); } +function write_names_xlml(wb) { + if(!((wb||{}).Workbook||{}).Names) return ""; +var names = wb.Workbook.Names; + var out = []; + for(var i = 0; i < names.length; ++i) { + var n = names[i]; + if(n.Sheet != null) continue; + if(n.Name.match(/^_xlfn\./)) continue; + out.push(write_name_xlml(n)); + } + return writextag("Names", out.join("")); +} +function write_ws_xlml_names(ws, opts, idx, wb) { + if(!ws) return ""; + if(!((wb||{}).Workbook||{}).Names) return ""; +var names = wb.Workbook.Names; + var out = []; + for(var i = 0; i < names.length; ++i) { + var n = names[i]; + if(n.Sheet != idx) continue; + /*switch(n.Name) { + case "_": continue; + }*/ + if(n.Name.match(/^_xlfn\./)) continue; + out.push(write_name_xlml(n)); + } + return out.join(""); +} +/* WorksheetOptions */ +function write_ws_xlml_wsopts(ws, opts, idx, wb) { + if(!ws) return ""; + var o = []; + /* NOTE: spec technically allows any order, but stick with implied order */ + + /* FitToPage */ + /* DoNotDisplayColHeaders */ + /* DoNotDisplayRowHeaders */ + /* ViewableRange */ + /* Selection */ + /* GridlineColor */ + /* Name */ + /* ExcelWorksheetType */ + /* IntlMacro */ + /* Unsynced */ + /* Selected */ + /* CodeName */ + + if(ws['!margins']) { + o.push(""); + if(ws['!margins'].header) o.push(writextag("Header", null, {'x:Margin':ws['!margins'].header})); + if(ws['!margins'].footer) o.push(writextag("Footer", null, {'x:Margin':ws['!margins'].footer})); + o.push(writextag("PageMargins", null, { + 'x:Bottom': ws['!margins'].bottom || "0.75", + 'x:Left': ws['!margins'].left || "0.7", + 'x:Right': ws['!margins'].right || "0.7", + 'x:Top': ws['!margins'].top || "0.75" + })); + o.push(""); + } + + /* PageSetup */ + /* DisplayPageBreak */ + /* TransitionExpressionEvaluation */ + /* TransitionFormulaEntry */ + /* Print */ + /* Zoom */ + /* PageLayoutZoom */ + /* PageBreakZoom */ + /* ShowPageBreakZoom */ + /* DefaultRowHeight */ + /* DefaultColumnWidth */ + /* StandardWidth */ + + if(wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) { + /* Visible */ + if(wb.Workbook.Sheets[idx].Hidden) o.push(writextag("Visible", (wb.Workbook.Sheets[idx].Hidden == 1 ? "SheetHidden" : "SheetVeryHidden"), {})); + else { + /* Selected */ + for(var i = 0; i < idx; ++i) if(wb.Workbook.Sheets[i] && !wb.Workbook.Sheets[i].Hidden) break; + if(i == idx) o.push(""); + } + } + + /* LeftColumnVisible */ + + if(((((wb||{}).Workbook||{}).Views||[])[0]||{}).RTL) o.push(""); + + /* GridlineColorIndex */ + /* DisplayFormulas */ + /* DoNotDisplayGridlines */ + /* DoNotDisplayHeadings */ + /* DoNotDisplayOutline */ + /* ApplyAutomaticOutlineStyles */ + /* NoSummaryRowsBelowDetail */ + /* NoSummaryColumnsRightDetail */ + /* DoNotDisplayZeros */ + /* ActiveRow */ + /* ActiveColumn */ + /* FilterOn */ + /* RangeSelection */ + /* TopRowVisible */ + /* TopRowBottomPane */ + /* LeftColumnRightPane */ + /* ActivePane */ + /* SplitHorizontal */ + /* SplitVertical */ + /* FreezePanes */ + /* FrozenNoSplit */ + /* TabColorIndex */ + /* Panes */ + + /* NOTE: Password not supported in XLML Format */ + if(ws['!protect']) { + o.push(writetag("ProtectContents", "True")); + if(ws['!protect'].objects) o.push(writetag("ProtectObjects", "True")); + if(ws['!protect'].scenarios) o.push(writetag("ProtectScenarios", "True")); + if(ws['!protect'].selectLockedCells != null && !ws['!protect'].selectLockedCells) o.push(writetag("EnableSelection", "NoSelection")); + else if(ws['!protect'].selectUnlockedCells != null && !ws['!protect'].selectUnlockedCells) o.push(writetag("EnableSelection", "UnlockedCells")); + [ + [ "formatCells", "AllowFormatCells" ], + [ "formatColumns", "AllowSizeCols" ], + [ "formatRows", "AllowSizeRows" ], + [ "insertColumns", "AllowInsertCols" ], + [ "insertRows", "AllowInsertRows" ], + [ "insertHyperlinks", "AllowInsertHyperlinks" ], + [ "deleteColumns", "AllowDeleteCols" ], + [ "deleteRows", "AllowDeleteRows" ], + [ "sort", "AllowSort" ], + [ "autoFilter", "AllowFilter" ], + [ "pivotTables", "AllowUsePivotTables" ] + ].forEach(function(x) { if(ws['!protect'][x[0]]) o.push("<"+x[1]+"/>"); }); + } + + if(o.length == 0) return ""; + return writextag("WorksheetOptions", o.join(""), {xmlns:XLMLNS.x}); +} +function write_ws_xlml_comment(comments) { + return comments.map(function(c) { + // TODO: formatted text + var t = xlml_unfixstr(c.t||""); + var d =writextag("ss:Data", t, {"xmlns":"http://www.w3.org/TR/REC-html40"}); + return writextag("Comment", d, {"ss:Author":c.a}); + }).join(""); +} +function write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr){ + if(!cell || (cell.v == undefined && cell.f == undefined)) return ""; + + var attr = {}; + if(cell.f) attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr)); + if(cell.F && cell.F.slice(0, ref.length) == ref) { + var end = decode_cell(cell.F.slice(ref.length + 1)); + attr["ss:ArrayRange"] = "RC:R" + (end.r == addr.r ? "" : "[" + (end.r - addr.r) + "]") + "C" + (end.c == addr.c ? "" : "[" + (end.c - addr.c) + "]"); + } + + if(cell.l && cell.l.Target) { + attr["ss:HRef"] = escapexml(cell.l.Target); + if(cell.l.Tooltip) attr["x:HRefScreenTip"] = escapexml(cell.l.Tooltip); + } + + if(ws['!merges']) { + var marr = ws['!merges']; + for(var mi = 0; mi != marr.length; ++mi) { + if(marr[mi].s.c != addr.c || marr[mi].s.r != addr.r) continue; + if(marr[mi].e.c > marr[mi].s.c) attr['ss:MergeAcross'] = marr[mi].e.c - marr[mi].s.c; + if(marr[mi].e.r > marr[mi].s.r) attr['ss:MergeDown'] = marr[mi].e.r - marr[mi].s.r; + } + } + + var t = "", p = ""; + switch(cell.t) { + case 'z': if(!opts.sheetStubs) return ""; break; + case 'n': t = 'Number'; p = String(cell.v); break; + case 'b': t = 'Boolean'; p = (cell.v ? "1" : "0"); break; + case 'e': t = 'Error'; p = BErr[cell.v]; break; + case 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z || SSF._table[14]; break; + case 's': t = 'String'; p = escapexlml(cell.v||""); break; + } + /* TODO: cell style */ + var os = get_cell_style(opts.cellXfs, cell, opts); + attr["ss:StyleID"] = "s" + (21+os); + attr["ss:Index"] = addr.c + 1; + var _v = (cell.v != null ? p : ""); + var m = cell.t == 'z' ? "" : ('' + _v + ''); + + if((cell.c||[]).length > 0) m += write_ws_xlml_comment(cell.c); + + return writextag("Cell", m, attr); +} +function write_ws_xlml_row(R, row) { + var o = ''; +} +/* TODO */ +function write_ws_xlml_table(ws, opts, idx, wb) { + if(!ws['!ref']) return ""; + var range = safe_decode_range(ws['!ref']); + var marr = ws['!merges'] || [], mi = 0; + var o = []; + if(ws['!cols']) ws['!cols'].forEach(function(n, i) { + process_col(n); + var w = !!n.width; + var p = col_obj_w(i, n); + var k = {"ss:Index":i+1}; + if(w) k['ss:Width'] = width2px(p.width); + if(n.hidden) k['ss:Hidden']="1"; + o.push(writextag("Column",null,k)); + }); + var dense = Array.isArray(ws); + for(var R = range.s.r; R <= range.e.r; ++R) { + var row = [write_ws_xlml_row(R, (ws['!rows']||[])[R])]; + for(var C = range.s.c; C <= range.e.c; ++C) { + var skip = false; + for(mi = 0; mi != marr.length; ++mi) { + if(marr[mi].s.c > C) continue; + if(marr[mi].s.r > R) continue; + if(marr[mi].e.c < C) continue; + if(marr[mi].e.r < R) continue; + if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true; + break; + } + if(skip) continue; + var addr = {r:R,c:C}; + var ref = encode_cell(addr), cell = dense ? (ws[R]||[])[C] : ws[ref]; + row.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr)); + } + row.push(""); + if(row.length > 2) o.push(row.join("")); + } + return o.join(""); +} +function write_ws_xlml(idx, opts, wb) { + var o = []; + var s = wb.SheetNames[idx]; + var ws = wb.Sheets[s]; + + var t = ws ? write_ws_xlml_names(ws, opts, idx, wb) : ""; + if(t.length > 0) o.push("" + t + ""); + + /* Table */ + t = ws ? write_ws_xlml_table(ws, opts, idx, wb) : ""; + if(t.length > 0) o.push("" + t + "
"); + + /* WorksheetOptions */ + o.push(write_ws_xlml_wsopts(ws, opts, idx, wb)); + + return o.join(""); +} +function write_xlml(wb, opts) { + if(!opts) opts = {}; + if(!wb.SSF) wb.SSF = SSF.get_table(); + if(wb.SSF) { + make_ssf(SSF); SSF.load_table(wb.SSF); + // $FlowIgnore + opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0; + opts.ssf = wb.SSF; + opts.cellXfs = []; + get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}}); + } + var d = []; + d.push(write_props_xlml(wb, opts)); + d.push(write_wb_xlml(wb, opts)); + d.push(""); + d.push(""); + for(var i = 0; i < wb.SheetNames.length; ++i) + d.push(writextag("Worksheet", write_ws_xlml(i, opts, wb), {"ss:Name":escapexml(wb.SheetNames[i])})); + d[2] = write_sty_xlml(wb, opts); + d[3] = write_names_xlml(wb, opts); + return XML_HEADER + writextag("Workbook", d.join(""), { + 'xmlns': XLMLNS.ss, + 'xmlns:o': XLMLNS.o, + 'xmlns:x': XLMLNS.x, + 'xmlns:ss': XLMLNS.ss, + 'xmlns:dt': XLMLNS.dt, + 'xmlns:html': XLMLNS.html + }); +} +/* [MS-OLEDS] 2.3.8 CompObjStream */ +function parse_compobj(obj) { + var v = {}; + var o = obj.content; +/* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */ + o.l = 28; + + v.AnsiUserType = o.read_shift(0, "lpstr-ansi"); + v.AnsiClipboardFormat = parse_ClipboardFormatOrAnsiString(o); + + if(o.length - o.l <= 4) return v; + + var m = o.read_shift(4); + if(m == 0 || m > 40) return v; + o.l-=4; v.Reserved1 = o.read_shift(0, "lpstr-ansi"); + + if(o.length - o.l <= 4) return v; + m = o.read_shift(4); + if(m !== 0x71b239f4) return v; + v.UnicodeClipboardFormat = parse_ClipboardFormatOrUnicodeString(o); + + m = o.read_shift(4); + if(m == 0 || m > 40) return v; + o.l-=4; v.Reserved2 = o.read_shift(0, "lpwstr"); +} + +/* + Continue logic for: + - 2.4.58 Continue + - 2.4.59 ContinueBigName + - 2.4.60 ContinueFrt + - 2.4.61 ContinueFrt11 + - 2.4.62 ContinueFrt12 +*/ +function slurp(R, blob, length, opts) { + var l = length; + var bufs = []; + var d = blob.slice(blob.l,blob.l+l); + if(opts && opts.enc && opts.enc.insitu) switch(R.n) { + case 'BOF': case 'FilePass': case 'FileLock': case 'InterfaceHdr': case 'RRDInfo': case 'RRDHead': case 'UsrExcl': break; + default: + if(d.length === 0) break; + opts.enc.insitu(d); + } + bufs.push(d); + blob.l += l; + var next = (XLSRecordEnum[__readUInt16LE(blob,blob.l)]); + var start = 0; + while(next != null && next.n.slice(0,8) === 'Continue') { + l = __readUInt16LE(blob,blob.l+2); + start = blob.l + 4; + if(next.n == 'ContinueFrt') start += 4; + else if(next.n.slice(0,11) == 'ContinueFrt') start += 12; + bufs.push(blob.slice(start,blob.l+4+l)); + blob.l += 4+l; + next = (XLSRecordEnum[__readUInt16LE(blob, blob.l)]); + } + var b = (bconcat(bufs)); + prep_blob(b, 0); + var ll = 0; b.lens = []; + for(var j = 0; j < bufs.length; ++j) { b.lens.push(ll); ll += bufs[j].length; } + return R.f(b, b.length, opts); +} + +function safe_format_xf(p, opts, date1904) { + if(p.t === 'z') return; + if(!p.XF) return; + var fmtid = 0; + try { + fmtid = p.z || p.XF.numFmtId || 0; + if(opts.cellNF) p.z = SSF._table[fmtid]; + } catch(e) { if(opts.WTF) throw e; } + if(!opts || opts.cellText !== false) try { + if(p.t === 'e') { p.w = p.w || BErr[p.v]; } + else if(fmtid === 0 || fmtid == "General") { + if(p.t === 'n') { + if((p.v|0) === p.v) p.w = SSF._general_int(p.v); + else p.w = SSF._general_num(p.v); + } + else p.w = SSF._general(p.v); + } + else p.w = SSF.format(fmtid,p.v, {date1904:!!date1904}); + } catch(e) { if(opts.WTF) throw e; } + if(opts.cellDates && fmtid && p.t == 'n' && SSF.is_date(SSF._table[fmtid] || String(fmtid))) { + var _d = SSF.parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); } + } +} + +function make_cell(val, ixfe, t) { + return ({v:val, ixfe:ixfe, t:t}); +} + +// 2.3.2 +function parse_workbook(blob, options) { + var wb = ({opts:{}}); + var Sheets = {}; + if(DENSE != null && options.dense == null) options.dense = DENSE; + var out = ((options.dense ? [] : {})); + var Directory = {}; + var range = ({}); + var last_formula = null; + var sst = ([]); + var cur_sheet = ""; + var Preamble = {}; + var lastcell, last_cell = "", cc, cmnt, rngC, rngR; + var sharedf = {}; + var arrayf = []; + var temp_val; + var country; + var cell_valid = true; + var XFs = []; /* XF records */ + var palette = []; + var Workbook = ({ Sheets:[], WBProps:{date1904:false}, Views:[{}] }), wsprops = {}; + var get_rgb = function getrgb(icv) { + if(icv < 8) return XLSIcv[icv]; + if(icv < 64) return palette[icv-8] || XLSIcv[icv]; + return XLSIcv[icv]; + }; + var process_cell_style = function pcs(cell, line, options) { + var xfd = line.XF.data; + if(!xfd || !xfd.patternType || !options || !options.cellStyles) return; + line.s = ({}); + line.s.patternType = xfd.patternType; + var t; + if((t = rgb2Hex(get_rgb(xfd.icvFore)))) { line.s.fgColor = {rgb:t}; } + if((t = rgb2Hex(get_rgb(xfd.icvBack)))) { line.s.bgColor = {rgb:t}; } + }; + var addcell = function addcell(cell, line, options) { + if(file_depth > 1) return; + if(options.sheetRows && cell.r >= options.sheetRows) cell_valid = false; + if(!cell_valid) return; + if(options.cellStyles && line.XF && line.XF.data) process_cell_style(cell, line, options); + delete line.ixfe; delete line.XF; + lastcell = cell; + last_cell = encode_cell(cell); + if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}}; + if(cell.r < range.s.r) range.s.r = cell.r; + if(cell.c < range.s.c) range.s.c = cell.c; + if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1; + if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1; + if(options.cellFormula && line.f) { + for(var afi = 0; afi < arrayf.length; ++afi) { + if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue; + if(arrayf[afi][0].e.c < cell.c || arrayf[afi][0].e.r < cell.r) continue; + line.F = encode_range(arrayf[afi][0]); + if(arrayf[afi][0].s.c != cell.c || arrayf[afi][0].s.r != cell.r) delete line.f; + if(line.f) line.f = "" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts); + break; + } + } + { + if(options.dense) { + if(!out[cell.r]) out[cell.r] = []; + out[cell.r][cell.c] = line; + } else out[last_cell] = line; + } + }; + var opts = ({ + enc: false, // encrypted + sbcch: 0, // cch in the preceding SupBook + snames: [], // sheetnames + sharedf: sharedf, // shared formulae by address + arrayf: arrayf, // array formulae array + rrtabid: [], // RRTabId + lastuser: "", // Last User from WriteAccess + biff: 8, // BIFF version + codepage: 0, // CP from CodePage record + winlocked: 0, // fLockWn from WinProtect + cellStyles: !!options && !!options.cellStyles, + WTF: !!options && !!options.wtf + }); + if(options.password) opts.password = options.password; + var themes; + var merges = []; + var objects = []; + var colinfo = [], rowinfo = []; + // eslint-disable-next-line no-unused-vars + var defwidth = 0, defheight = 0; // twips / MDW respectively + var seencol = false; + var supbooks = ([]); // 1-indexed, will hold extern names + supbooks.SheetNames = opts.snames; + supbooks.sharedf = opts.sharedf; + supbooks.arrayf = opts.arrayf; + supbooks.names = []; + supbooks.XTI = []; + var last_Rn = ''; + var file_depth = 0; /* TODO: make a real stack */ + var BIFF2Fmt = 0, BIFF2FmtTable = []; + var FilterDatabases = []; /* TODO: sort out supbooks and process elsewhere */ + var last_lbl; + + /* explicit override for some broken writers */ + opts.codepage = 1200; + set_cp(1200); + var seen_codepage = false; + while(blob.l < blob.length - 1) { + var s = blob.l; + var RecordType = blob.read_shift(2); + if(RecordType === 0 && last_Rn === 'EOF') break; + var length = (blob.l === blob.length ? 0 : blob.read_shift(2)); + var R = XLSRecordEnum[RecordType]; + //console.log(RecordType.toString(16), RecordType, R, blob.l, length, blob.length); + //if(!R) console.log(blob.slice(blob.l, blob.l + length)); + if(R && R.f) { + if(options.bookSheets) { + if(last_Rn === 'BoundSheet8' && R.n !== 'BoundSheet8') break; + } + last_Rn = R.n; + if(R.r === 2 || R.r == 12) { + var rt = blob.read_shift(2); length -= 2; + if(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error("rt mismatch: " + rt + "!=" + RecordType); + if(R.r == 12){ blob.l += 10; length -= 10; } // skip FRT + } + //console.error(R,blob.l,length,blob.length); + var val = ({}); + if(R.n === 'EOF') val = R.f(blob, length, opts); + else val = slurp(R, blob, length, opts); + var Rn = R.n; +if(file_depth == 0 && Rn != 'BOF') continue; + /* nested switch statements to workaround V8 128 limit */ + switch(Rn) { + /* Workbook Options */ + case 'Date1904': +wb.opts.Date1904 = Workbook.WBProps.date1904 = val; break; + case 'WriteProtect': wb.opts.WriteProtect = true; break; + case 'FilePass': + if(!opts.enc) blob.l = 0; + opts.enc = val; + if(!options.password) throw new Error("File is password-protected"); + if(val.valid == null) throw new Error("Encryption scheme unsupported"); + if(!val.valid) throw new Error("Password is incorrect"); + break; + case 'WriteAccess': opts.lastuser = val; break; + case 'FileSharing': break; //TODO + case 'CodePage': + var cpval = Number(val); + /* overrides based on test cases */ + switch(cpval) { + case 0x5212: cpval = 1200; break; + case 0x8000: cpval = 10000; break; + case 0x8001: cpval = 1252; break; + } + set_cp(opts.codepage = cpval); + seen_codepage = true; + break; + case 'RRTabId': opts.rrtabid = val; break; + case 'WinProtect': opts.winlocked = val; break; + case 'Template': break; // TODO + case 'BookBool': break; // TODO + case 'UsesELFs': break; + case 'MTRSettings': break; + case 'RefreshAll': + case 'CalcCount': + case 'CalcDelta': + case 'CalcIter': + case 'CalcMode': + case 'CalcPrecision': + case 'CalcSaveRecalc': + wb.opts[Rn] = val; break; + case 'CalcRefMode': opts.CalcRefMode = val; break; // TODO: implement R1C1 + case 'Uncalced': break; + case 'ForceFullCalculation': wb.opts.FullCalc = val; break; + case 'WsBool': + if(val.fDialog) out["!type"] = "dialog"; + break; // TODO + case 'XF': + XFs.push(val); break; + case 'ExtSST': break; // TODO + case 'BookExt': break; // TODO + case 'RichTextStream': break; + case 'BkHim': break; + + case 'SupBook': + supbooks.push([val]); + supbooks[supbooks.length-1].XTI = []; + break; + case 'ExternName': + supbooks[supbooks.length-1].push(val); + break; + case 'Index': break; // TODO + case 'Lbl': + last_lbl = ({ + Name: val.Name, + Ref: stringify_formula(val.rgce,range,null,supbooks,opts) + }); + if(val.itab > 0) last_lbl.Sheet = val.itab - 1; + supbooks.names.push(last_lbl); + if(!supbooks[0]) { supbooks[0] = []; supbooks[0].XTI = []; } + supbooks[supbooks.length-1].push(val); + if(val.Name == "_xlnm._FilterDatabase" && val.itab > 0) + if(val.rgce && val.rgce[0] && val.rgce[0][0] && val.rgce[0][0][0] == 'PtgArea3d') + FilterDatabases[val.itab - 1] = { ref: encode_range(val.rgce[0][0][1][2]) }; + break; + case 'ExternCount': opts.ExternCount = val; break; + case 'ExternSheet': + if(supbooks.length == 0) { supbooks[0] = []; supbooks[0].XTI = []; } + supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val); supbooks.XTI = supbooks.XTI.concat(val); break; + case 'NameCmt': + /* TODO: search for correct name */ + if(opts.biff < 8) break; + if(last_lbl != null) last_lbl.Comment = val[1]; + break; + + case 'Protect': out["!protect"] = val; break; /* for sheet or book */ + case 'Password': if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); break; + case 'Prot4Rev': case 'Prot4RevPass': break; /*TODO: Revision Control*/ + + case 'BoundSheet8': { + Directory[val.pos] = val; + opts.snames.push(val.name); + } break; + case 'EOF': { + if(--file_depth) break; + if(range.e) { + if(range.e.r > 0 && range.e.c > 0) { + range.e.r--; range.e.c--; + out["!ref"] = encode_range(range); + if(options.sheetRows && options.sheetRows <= range.e.r) { + var tmpri = range.e.r; + range.e.r = options.sheetRows - 1; + out["!fullref"] = out["!ref"]; + out["!ref"] = encode_range(range); + range.e.r = tmpri; + } + range.e.r++; range.e.c++; + } + if(merges.length > 0) out["!merges"] = merges; + if(objects.length > 0) out["!objects"] = objects; + if(colinfo.length > 0) out["!cols"] = colinfo; + if(rowinfo.length > 0) out["!rows"] = rowinfo; + Workbook.Sheets.push(wsprops); + } + if(cur_sheet === "") Preamble = out; else Sheets[cur_sheet] = out; + out = ((options.dense ? [] : {})); + } break; + case 'BOF': { + if(opts.biff === 8) opts.biff = { +0x0009:2, +0x0209:3, +0x0409:4 + }[RecordType] || { +0x0200:2, +0x0300:3, +0x0400:4, +0x0500:5, +0x0600:8, +0x0002:2, +0x0007:2 + }[val.BIFFVer] || 8; + if(opts.biff == 8 && val.BIFFVer == 0 && val.dt == 16) opts.biff = 2; + if(file_depth++) break; + cell_valid = true; + out = ((options.dense ? [] : {})); + + if(opts.biff < 8 && !seen_codepage) { seen_codepage = true; set_cp(opts.codepage = options.codepage || 1252); } + if(opts.biff < 5) { + if(cur_sheet === "") cur_sheet = "Sheet1"; + range = {s:{r:0,c:0},e:{r:0,c:0}}; + /* fake BoundSheet8 */ + var fakebs8 = {pos: blob.l - length, name:cur_sheet}; + Directory[fakebs8.pos] = fakebs8; + opts.snames.push(cur_sheet); + } + else cur_sheet = (Directory[s] || {name:""}).name; + if(val.dt == 0x20) out["!type"] = "chart"; + if(val.dt == 0x40) out["!type"] = "macro"; + merges = []; + objects = []; + opts.arrayf = arrayf = []; + colinfo = []; rowinfo = []; + defwidth = defheight = 0; + seencol = false; + wsprops = {Hidden:(Directory[s]||{hs:0}).hs, name:cur_sheet }; + } break; + + case 'Number': case 'BIFF2NUM': case 'BIFF2INT': { + if(out["!type"] == "chart") if(options.dense ? (out[val.r]||[])[val.c]: out[encode_cell({c:val.c, r:val.r})]) ++val.c; + temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe]||{}, v:val.val, t:'n'}); + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:val.c, r:val.r}, temp_val, options); + } break; + case 'BoolErr': { + temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:val.t}); + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:val.c, r:val.r}, temp_val, options); + } break; + case 'RK': { + temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.rknum, t:'n'}); + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:val.c, r:val.r}, temp_val, options); + } break; + case 'MulRk': { + for(var j = val.c; j <= val.C; ++j) { + var ixfe = val.rkrec[j-val.c][0]; + temp_val= ({ixfe:ixfe, XF:XFs[ixfe], v:val.rkrec[j-val.c][1], t:'n'}); + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:j, r:val.r}, temp_val, options); + } + } break; + case 'Formula': { + if(val.val == 'String') { last_formula = val; break; } + temp_val = make_cell(val.val, val.cell.ixfe, val.tt); + temp_val.XF = XFs[temp_val.ixfe]; + if(options.cellFormula) { + var _f = val.formula; + if(_f && _f[0] && _f[0][0] && _f[0][0][0] == 'PtgExp') { + var _fr = _f[0][0][1][0], _fc = _f[0][0][1][1]; + var _fe = encode_cell({r:_fr, c:_fc}); + if(sharedf[_fe]) temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts); + else temp_val.F = ((options.dense ? (out[_fr]||[])[_fc]: out[_fe]) || {}).F; + } else temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts); + } + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell(val.cell, temp_val, options); + last_formula = val; + } break; + case 'String': { + if(last_formula) { /* technically always true */ + last_formula.val = val; + temp_val = make_cell(val, last_formula.cell.ixfe, 's'); + temp_val.XF = XFs[temp_val.ixfe]; + if(options.cellFormula) { + temp_val.f = ""+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts); + } + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell(last_formula.cell, temp_val, options); + last_formula = null; + } else throw new Error("String record expects Formula"); + } break; + case 'Array': { + arrayf.push(val); + var _arraystart = encode_cell(val[0].s); + cc = options.dense ? (out[val[0].s.r]||[])[val[0].s.c] : out[_arraystart]; + if(options.cellFormula && cc) { + if(!last_formula) break; /* technically unreachable */ + if(!_arraystart || !cc) break; + cc.f = ""+stringify_formula(val[1], range, val[0], supbooks, opts); + cc.F = encode_range(val[0]); + } + } break; + case 'ShrFmla': { + if(!cell_valid) break; + if(!options.cellFormula) break; + if(last_cell) { + /* TODO: capture range */ + if(!last_formula) break; /* technically unreachable */ + sharedf[encode_cell(last_formula.cell)]= val[0]; + cc = options.dense ? (out[last_formula.cell.r]||[])[last_formula.cell.c] : out[encode_cell(last_formula.cell)]; + (cc||{}).f = ""+stringify_formula(val[0], range, lastcell, supbooks, opts); + } + } break; + case 'LabelSst': + temp_val=make_cell(sst[val.isst].t, val.ixfe, 's'); + if(sst[val.isst].h) temp_val.h = sst[val.isst].h; + temp_val.XF = XFs[temp_val.ixfe]; + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:val.c, r:val.r}, temp_val, options); + break; + case 'Blank': if(options.sheetStubs) { + temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], t:'z'}); + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:val.c, r:val.r}, temp_val, options); + } break; + case 'MulBlank': if(options.sheetStubs) { + for(var _j = val.c; _j <= val.C; ++_j) { + var _ixfe = val.ixfe[_j-val.c]; + temp_val= ({ixfe:_ixfe, XF:XFs[_ixfe], t:'z'}); + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:_j, r:val.r}, temp_val, options); + } + } break; + case 'RString': + case 'Label': case 'BIFF2STR': + temp_val=make_cell(val.val, val.ixfe, 's'); + temp_val.XF = XFs[temp_val.ixfe]; + if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F]; + safe_format_xf(temp_val, options, wb.opts.Date1904); + addcell({c:val.c, r:val.r}, temp_val, options); + break; + + case 'Dimensions': { + if(file_depth === 1) range = val; /* TODO: stack */ + } break; + case 'SST': { + sst = val; + } break; + case 'Format': { /* val = [id, fmt] */ + if(opts.biff == 4) { + BIFF2FmtTable[BIFF2Fmt++] = val[1]; + for(var b4idx = 0; b4idx < BIFF2Fmt + 163; ++b4idx) if(SSF._table[b4idx] == val[1]) break; + if(b4idx >= 163) SSF.load(val[1], BIFF2Fmt + 163); + } + else SSF.load(val[1], val[0]); + } break; + case 'BIFF2FORMAT': { + BIFF2FmtTable[BIFF2Fmt++] = val; + for(var b2idx = 0; b2idx < BIFF2Fmt + 163; ++b2idx) if(SSF._table[b2idx] == val) break; + if(b2idx >= 163) SSF.load(val, BIFF2Fmt + 163); + } break; + + case 'MergeCells': merges = merges.concat(val); break; + + case 'Obj': objects[val.cmo[0]] = opts.lastobj = val; break; + case 'TxO': opts.lastobj.TxO = val; break; + case 'ImData': opts.lastobj.ImData = val; break; + + case 'HLink': { + for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR) + for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) { + cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})]; + if(cc) cc.l = val[1]; + } + } break; + case 'HLinkTooltip': { + for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR) + for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) { + cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})]; + if(cc && cc.l) cc.l.Tooltip = val[1]; + } + } break; + + /* Comments */ + case 'Note': { + if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */ + cc = options.dense ? (out[val[0].r]||[])[val[0].c] : out[encode_cell(val[0])]; + var noteobj = objects[val[2]]; + if(!cc) { + if(options.dense) { + if(!out[val[0].r]) out[val[0].r] = []; + cc = out[val[0].r][val[0].c] = ({t:"z"}); + } else { + cc = out[encode_cell(val[0])] = ({t:"z"}); + } + range.e.r = Math.max(range.e.r, val[0].r); + range.s.r = Math.min(range.s.r, val[0].r); + range.e.c = Math.max(range.e.c, val[0].c); + range.s.c = Math.min(range.s.c, val[0].c); + } + if(!cc.c) cc.c = []; + cmnt = {a:val[1],t:noteobj.TxO.t}; + cc.c.push(cmnt); + } break; + + default: switch(R.n) { /* nested */ + case 'ClrtClient': break; + case 'XFExt': update_xfext(XFs[val.ixfe], val.ext); break; + + case 'DefColWidth': defwidth = val; break; + case 'DefaultRowHeight': defheight = val[1]; break; // TODO: flags + + case 'ColInfo': { + if(!opts.cellStyles) break; + while(val.e >= val.s) { + colinfo[val.e--] = { width: val.w/256 }; + if(!seencol) { seencol = true; find_mdw_colw(val.w/256); } + process_col(colinfo[val.e+1]); + } + } break; + case 'Row': { + var rowobj = {}; + if(val.level != null) { rowinfo[val.r] = rowobj; rowobj.level = val.level; } + if(val.hidden) { rowinfo[val.r] = rowobj; rowobj.hidden = true; } + if(val.hpt) { + rowinfo[val.r] = rowobj; + rowobj.hpt = val.hpt; rowobj.hpx = pt2px(val.hpt); + } + } break; + + case 'LeftMargin': + case 'RightMargin': + case 'TopMargin': + case 'BottomMargin': + if(!out['!margins']) default_margins(out['!margins'] = {}); + out['!margins'][Rn.slice(0,-6).toLowerCase()] = val; + break; + + case 'Setup': // TODO + if(!out['!margins']) default_margins(out['!margins'] = {}); + out['!margins'].header = val.header; + out['!margins'].footer = val.footer; + break; + + case 'Window2': // TODO + // $FlowIgnore + if(val.RTL) Workbook.Views[0].RTL = true; + break; + + case 'Header': break; // TODO + case 'Footer': break; // TODO + case 'HCenter': break; // TODO + case 'VCenter': break; // TODO + case 'Pls': break; // TODO + case 'GCW': break; + case 'LHRecord': break; + case 'DBCell': break; // TODO + case 'EntExU2': break; // TODO + case 'SxView': break; // TODO + case 'Sxvd': break; // TODO + case 'SXVI': break; // TODO + case 'SXVDEx': break; // TODO + case 'SxIvd': break; // TODO + case 'SXString': break; // TODO + case 'Sync': break; + case 'Addin': break; + case 'SXDI': break; // TODO + case 'SXLI': break; // TODO + case 'SXEx': break; // TODO + case 'QsiSXTag': break; // TODO + case 'Selection': break; + case 'Feat': break; + case 'FeatHdr': case 'FeatHdr11': break; + case 'Feature11': case 'Feature12': case 'List12': break; + case 'Country': country = val; break; + case 'RecalcId': break; + case 'DxGCol': break; // TODO: htmlify + case 'Fbi': case 'Fbi2': case 'GelFrame': break; + case 'Font': break; // TODO + case 'XFCRC': break; // TODO + case 'Style': break; // TODO + case 'StyleExt': break; // TODO + case 'Palette': palette = val; break; + case 'Theme': themes = val; break; + /* Protection */ + case 'ScenarioProtect': break; + case 'ObjProtect': break; + + /* Conditional Formatting */ + case 'CondFmt12': break; + + /* Table */ + case 'Table': break; // TODO + case 'TableStyles': break; // TODO + case 'TableStyle': break; // TODO + case 'TableStyleElement': break; // TODO + + /* PivotTable */ + case 'SXStreamID': break; // TODO + case 'SXVS': break; // TODO + case 'DConRef': break; // TODO + case 'SXAddl': break; // TODO + case 'DConBin': break; // TODO + case 'DConName': break; // TODO + case 'SXPI': break; // TODO + case 'SxFormat': break; // TODO + case 'SxSelect': break; // TODO + case 'SxRule': break; // TODO + case 'SxFilt': break; // TODO + case 'SxItm': break; // TODO + case 'SxDXF': break; // TODO + + /* Scenario Manager */ + case 'ScenMan': break; + + /* Data Consolidation */ + case 'DCon': break; + + /* Watched Cell */ + case 'CellWatch': break; + + /* Print Settings */ + case 'PrintRowCol': break; + case 'PrintGrid': break; + case 'PrintSize': break; + + case 'XCT': break; + case 'CRN': break; + + case 'Scl': { + //console.log("Zoom Level:", val[0]/val[1],val); + } break; + case 'SheetExt': { + /* empty */ + } break; + case 'SheetExtOptional': { + /* empty */ + } break; + + /* VBA */ + case 'ObNoMacros': { + /* empty */ + } break; + case 'ObProj': { + /* empty */ + } break; + case 'CodeName': { +if(!cur_sheet) Workbook.WBProps.CodeName = val || "ThisWorkbook"; + else wsprops.CodeName = val || wsprops.name; + } break; + case 'GUIDTypeLib': { + /* empty */ + } break; + + case 'WOpt': break; // TODO: WTF? + case 'PhoneticInfo': break; + + case 'OleObjectSize': break; + + /* Differential Formatting */ + case 'DXF': case 'DXFN': case 'DXFN12': case 'DXFN12List': case 'DXFN12NoCB': break; + + /* Data Validation */ + case 'Dv': case 'DVal': break; + + /* Data Series */ + case 'BRAI': case 'Series': case 'SeriesText': break; + + /* Data Connection */ + case 'DConn': break; + case 'DbOrParamQry': break; + case 'DBQueryExt': break; + + case 'OleDbConn': break; + case 'ExtString': break; + + /* Formatting */ + case 'IFmtRecord': break; + case 'CondFmt': case 'CF': case 'CF12': case 'CFEx': break; + + /* Explicitly Ignored */ + case 'Excel9File': break; + case 'Units': break; + case 'InterfaceHdr': case 'Mms': case 'InterfaceEnd': case 'DSF': break; + case 'BuiltInFnGroupCount': /* 2.4.30 0x0E or 0x10 but excel 2011 generates 0x11? */ break; + /* View Stuff */ + case 'Window1': case 'HideObj': case 'GridSet': case 'Guts': + case 'UserBView': case 'UserSViewBegin': case 'UserSViewEnd': break; + case 'Pane': break; + default: switch(R.n) { /* nested */ + /* Chart */ + case 'Dat': + case 'Begin': case 'End': + case 'StartBlock': case 'EndBlock': + case 'Frame': case 'Area': + case 'Axis': case 'AxisLine': case 'Tick': break; + case 'AxesUsed': + case 'CrtLayout12': case 'CrtLayout12A': case 'CrtLink': case 'CrtLine': case 'CrtMlFrt': case 'CrtMlFrtContinue': break; + case 'LineFormat': case 'AreaFormat': + case 'Chart': case 'Chart3d': case 'Chart3DBarShape': case 'ChartFormat': case 'ChartFrtInfo': break; + case 'PlotArea': case 'PlotGrowth': break; + case 'SeriesList': case 'SerParent': case 'SerAuxTrend': break; + case 'DataFormat': case 'SerToCrt': case 'FontX': break; + case 'CatSerRange': case 'AxcExt': case 'SerFmt': break; + case 'ShtProps': break; + case 'DefaultText': case 'Text': case 'CatLab': break; + case 'DataLabExtContents': break; + case 'Legend': case 'LegendException': break; + case 'Pie': case 'Scatter': break; + case 'PieFormat': case 'MarkerFormat': break; + case 'StartObject': case 'EndObject': break; + case 'AlRuns': case 'ObjectLink': break; + case 'SIIndex': break; + case 'AttachedLabel': case 'YMult': break; + + /* Chart Group */ + case 'Line': case 'Bar': break; + case 'Surf': break; + + /* Axis Group */ + case 'AxisParent': break; + case 'Pos': break; + case 'ValueRange': break; + + /* Pivot Chart */ + case 'SXViewEx9': break; // TODO + case 'SXViewLink': break; + case 'PivotChartBits': break; + case 'SBaseRef': break; + case 'TextPropsStream': break; + + /* Chart Misc */ + case 'LnExt': break; + case 'MkrExt': break; + case 'CrtCoopt': break; + + /* Query Table */ + case 'Qsi': case 'Qsif': case 'Qsir': case 'QsiSXTag': break; + case 'TxtQry': break; + + /* Filter */ + case 'FilterMode': break; + case 'AutoFilter': case 'AutoFilterInfo': break; + case 'AutoFilter12': break; + case 'DropDownObjIds': break; + case 'Sort': break; + case 'SortData': break; + + /* Drawing */ + case 'ShapePropsStream': break; + case 'MsoDrawing': case 'MsoDrawingGroup': case 'MsoDrawingSelection': break; + /* Pub Stuff */ + case 'WebPub': case 'AutoWebPub': break; + + /* Print Stuff */ + case 'HeaderFooter': case 'HFPicture': case 'PLV': + case 'HorizontalPageBreaks': case 'VerticalPageBreaks': break; + /* Behavioral */ + case 'Backup': case 'CompressPictures': case 'Compat12': break; + + /* Should not Happen */ + case 'Continue': case 'ContinueFrt12': break; + + /* Future Records */ + case 'FrtFontList': case 'FrtWrapper': break; + + default: switch(R.n) { /* nested */ + /* BIFF5 records */ + case 'TabIdConf': case 'Radar': case 'RadarArea': case 'DropBar': case 'Intl': case 'CoordList': case 'SerAuxErrBar': break; + + /* BIFF2-4 records */ + case 'BIFF2FONTCLR': case 'BIFF2FMTCNT': case 'BIFF2FONTXTRA': break; + case 'BIFF2XF': case 'BIFF3XF': case 'BIFF4XF': break; + case 'BIFF4FMTCNT': case 'BIFF2ROW': case 'BIFF2WINDOW2': break; + + /* Miscellaneous */ + case 'SCENARIO': case 'DConBin': case 'PicF': case 'DataLabExt': + case 'Lel': case 'BopPop': case 'BopPopCustom': case 'RealTimeData': + case 'Name': break; + case 'LHNGraph': case 'FnGroupName': case 'AddMenu': case 'LPr': break; + case 'ListObj': case 'ListField': break; + case 'RRSort': break; + case 'BigName': break; + case 'ToolbarHdr': case 'ToolbarEnd': break; + case 'DDEObjName': break; + case 'FRTArchId$': break; + default: if(options.WTF) throw 'Unrecognized Record ' + R.n; + }}}} + } else blob.l += length; + } + wb.SheetNames=keys(Directory).sort(function(a,b) { return Number(a) - Number(b); }).map(function(x){return Directory[x].name;}); + if(!options.bookSheets) wb.Sheets=Sheets; + if(wb.Sheets) FilterDatabases.forEach(function(r,i) { wb.Sheets[wb.SheetNames[i]]['!autofilter'] = r; }); + wb.Preamble=Preamble; + wb.Strings = sst; + wb.SSF = SSF.get_table(); + if(opts.enc) wb.Encryption = opts.enc; + if(themes) wb.Themes = themes; + wb.Metadata = {}; + if(country !== undefined) wb.Metadata.Country = country; + if(supbooks.names.length > 0) Workbook.Names = supbooks.names; + wb.Workbook = Workbook; + return wb; +} + +/* TODO: split props*/ +var PSCLSID = { + SI: "e0859ff2f94f6810ab9108002b27b3d9", + DSI: "02d5cdd59c2e1b10939708002b2cf9ae", + UDI: "05d5cdd59c2e1b10939708002b2cf9ae" +}; +function parse_xls_props(cfb, props, o) { + /* [MS-OSHARED] 2.3.3.2.2 Document Summary Information Property Set */ + var DSI = CFB.find(cfb, '!DocumentSummaryInformation'); + if(DSI && DSI.size > 0) try { + var DocSummary = parse_PropertySetStream(DSI, DocSummaryPIDDSI, PSCLSID.DSI); + for(var d in DocSummary) props[d] = DocSummary[d]; + } catch(e) {if(o.WTF) throw e;/* empty */} + + /* [MS-OSHARED] 2.3.3.2.1 Summary Information Property Set*/ + var SI = CFB.find(cfb, '!SummaryInformation'); + if(SI && SI.size > 0) try { + var Summary = parse_PropertySetStream(SI, SummaryPIDSI, PSCLSID.SI); + for(var s in Summary) if(props[s] == null) props[s] = Summary[s]; + } catch(e) {if(o.WTF) throw e;/* empty */} + + if(props.HeadingPairs && props.TitlesOfParts) { + load_props_pairs(props.HeadingPairs, props.TitlesOfParts, props, o); + delete props.HeadingPairs; delete props.TitlesOfParts; + } +} +function write_xls_props(wb, cfb) { + var DSEntries = [], SEntries = [], CEntries = []; + var i = 0, Keys; + if(wb.Props) { + Keys = keys(wb.Props); + // $FlowIgnore + for(i = 0; i < Keys.length; ++i) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Props[Keys[i]]]); + } + if(wb.Custprops) { + Keys = keys(wb.Custprops); + // $FlowIgnore + for(i = 0; i < Keys.length; ++i) if(!Object.prototype.hasOwnProperty.call((wb.Props||{}), Keys[i])) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Custprops[Keys[i]]]); + } + var CEntries2 = []; + for(i = 0; i < CEntries.length; ++i) { + if(XLSPSSkip.indexOf(CEntries[i][0]) > -1) continue; + if(CEntries[i][1] == null) continue; + CEntries2.push(CEntries[i]); + } + if(SEntries.length) CFB.utils.cfb_add(cfb, "/\u0005SummaryInformation", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI)); + if(DSEntries.length || CEntries2.length) CFB.utils.cfb_add(cfb, "/\u0005DocumentSummaryInformation", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI)); +} + +function parse_xlscfb(cfb, options) { +if(!options) options = {}; +fix_read_opts(options); +reset_cp(); +if(options.codepage) set_ansi(options.codepage); +var CompObj, WB; +if(cfb.FullPaths) { + if(CFB.find(cfb, '/encryption')) throw new Error("File is password-protected"); + CompObj = CFB.find(cfb, '!CompObj'); + WB = CFB.find(cfb, '/Workbook') || CFB.find(cfb, '/Book'); +} else { + switch(options.type) { + case 'base64': cfb = s2a(Base64.decode(cfb)); break; + case 'binary': cfb = s2a(cfb); break; + case 'buffer': break; + case 'array': if(!Array.isArray(cfb)) cfb = Array.prototype.slice.call(cfb); break; + } + prep_blob(cfb, 0); + WB = ({content: cfb}); +} +var WorkbookP; + +var _data; +if(CompObj) parse_compobj(CompObj); +if(options.bookProps && !options.bookSheets) WorkbookP = ({}); +else { + var T = has_buf ? 'buffer' : 'array'; + if(WB && WB.content) WorkbookP = parse_workbook(WB.content, options); + /* Quattro Pro 7-8 */ + else if((_data=CFB.find(cfb, 'PerfectOffice_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options)); + /* Quattro Pro 9 */ + else if((_data=CFB.find(cfb, 'NativeContent_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options)); + else throw new Error("Cannot find Workbook stream"); + if(options.bookVBA && cfb.FullPaths && CFB.find(cfb, '/_VBA_PROJECT_CUR/VBA/dir')) WorkbookP.vbaraw = make_vba_xls(cfb); +} + +var props = {}; +if(cfb.FullPaths) parse_xls_props(cfb, props, options); + +WorkbookP.Props = WorkbookP.Custprops = props; /* TODO: split up properties */ +if(options.bookFiles) WorkbookP.cfb = cfb; +/*WorkbookP.CompObjP = CompObjP; // TODO: storage? */ +return WorkbookP; +} + + +function write_xlscfb(wb, opts) { + var o = opts || {}; + var cfb = CFB.utils.cfb_new({root:"R"}); + var wbpath = "/Workbook"; + switch(o.bookType || "xls") { + case "xls": o.bookType = "biff8"; + /* falls through */ + case "xla": if(!o.bookType) o.bookType = "xla"; + /* falls through */ + case "biff8": wbpath = "/Workbook"; o.biff = 8; break; + case "biff5": wbpath = "/Book"; o.biff = 5; break; + default: throw new Error("invalid type " + o.bookType + " for XLS CFB"); + } + CFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o)); + if(o.biff == 8 && (wb.Props || wb.Custprops)) write_xls_props(wb, cfb); + // TODO: SI, DSI, CO + if(o.biff == 8 && wb.vbaraw) fill_vba_xls(cfb, CFB.read(wb.vbaraw, {type: typeof wb.vbaraw == "string" ? "binary" : "buffer"})); + return cfb; +} +/* [MS-XLSB] 2.3 Record Enumeration */ +var XLSBRecordEnum = { +0x0000: { n:"BrtRowHdr", f:parse_BrtRowHdr }, +0x0001: { n:"BrtCellBlank", f:parse_BrtCellBlank }, +0x0002: { n:"BrtCellRk", f:parse_BrtCellRk }, +0x0003: { n:"BrtCellError", f:parse_BrtCellError }, +0x0004: { n:"BrtCellBool", f:parse_BrtCellBool }, +0x0005: { n:"BrtCellReal", f:parse_BrtCellReal }, +0x0006: { n:"BrtCellSt", f:parse_BrtCellSt }, +0x0007: { n:"BrtCellIsst", f:parse_BrtCellIsst }, +0x0008: { n:"BrtFmlaString", f:parse_BrtFmlaString }, +0x0009: { n:"BrtFmlaNum", f:parse_BrtFmlaNum }, +0x000A: { n:"BrtFmlaBool", f:parse_BrtFmlaBool }, +0x000B: { n:"BrtFmlaError", f:parse_BrtFmlaError }, +0x0010: { n:"BrtFRTArchID$", f:parse_BrtFRTArchID$ }, +0x0013: { n:"BrtSSTItem", f:parse_RichStr }, +0x0014: { n:"BrtPCDIMissing" }, +0x0015: { n:"BrtPCDINumber" }, +0x0016: { n:"BrtPCDIBoolean" }, +0x0017: { n:"BrtPCDIError" }, +0x0018: { n:"BrtPCDIString" }, +0x0019: { n:"BrtPCDIDatetime" }, +0x001A: { n:"BrtPCDIIndex" }, +0x001B: { n:"BrtPCDIAMissing" }, +0x001C: { n:"BrtPCDIANumber" }, +0x001D: { n:"BrtPCDIABoolean" }, +0x001E: { n:"BrtPCDIAError" }, +0x001F: { n:"BrtPCDIAString" }, +0x0020: { n:"BrtPCDIADatetime" }, +0x0021: { n:"BrtPCRRecord" }, +0x0022: { n:"BrtPCRRecordDt" }, +0x0023: { n:"BrtFRTBegin" }, +0x0024: { n:"BrtFRTEnd" }, +0x0025: { n:"BrtACBegin" }, +0x0026: { n:"BrtACEnd" }, +0x0027: { n:"BrtName", f:parse_BrtName }, +0x0028: { n:"BrtIndexRowBlock" }, +0x002A: { n:"BrtIndexBlock" }, +0x002B: { n:"BrtFont", f:parse_BrtFont }, +0x002C: { n:"BrtFmt", f:parse_BrtFmt }, +0x002D: { n:"BrtFill", f:parse_BrtFill }, +0x002E: { n:"BrtBorder", f:parse_BrtBorder }, +0x002F: { n:"BrtXF", f:parse_BrtXF }, +0x0030: { n:"BrtStyle" }, +0x0031: { n:"BrtCellMeta" }, +0x0032: { n:"BrtValueMeta" }, +0x0033: { n:"BrtMdb" }, +0x0034: { n:"BrtBeginFmd" }, +0x0035: { n:"BrtEndFmd" }, +0x0036: { n:"BrtBeginMdx" }, +0x0037: { n:"BrtEndMdx" }, +0x0038: { n:"BrtBeginMdxTuple" }, +0x0039: { n:"BrtEndMdxTuple" }, +0x003A: { n:"BrtMdxMbrIstr" }, +0x003B: { n:"BrtStr" }, +0x003C: { n:"BrtColInfo", f:parse_ColInfo }, +0x003E: { n:"BrtCellRString" }, +0x003F: { n:"BrtCalcChainItem$", f:parse_BrtCalcChainItem$ }, +0x0040: { n:"BrtDVal", f:parse_BrtDVal }, +0x0041: { n:"BrtSxvcellNum" }, +0x0042: { n:"BrtSxvcellStr" }, +0x0043: { n:"BrtSxvcellBool" }, +0x0044: { n:"BrtSxvcellErr" }, +0x0045: { n:"BrtSxvcellDate" }, +0x0046: { n:"BrtSxvcellNil" }, +0x0080: { n:"BrtFileVersion" }, +0x0081: { n:"BrtBeginSheet" }, +0x0082: { n:"BrtEndSheet" }, +0x0083: { n:"BrtBeginBook", f:parsenoop, p:0 }, +0x0084: { n:"BrtEndBook" }, +0x0085: { n:"BrtBeginWsViews" }, +0x0086: { n:"BrtEndWsViews" }, +0x0087: { n:"BrtBeginBookViews" }, +0x0088: { n:"BrtEndBookViews" }, +0x0089: { n:"BrtBeginWsView", f:parse_BrtBeginWsView }, +0x008A: { n:"BrtEndWsView" }, +0x008B: { n:"BrtBeginCsViews" }, +0x008C: { n:"BrtEndCsViews" }, +0x008D: { n:"BrtBeginCsView" }, +0x008E: { n:"BrtEndCsView" }, +0x008F: { n:"BrtBeginBundleShs" }, +0x0090: { n:"BrtEndBundleShs" }, +0x0091: { n:"BrtBeginSheetData" }, +0x0092: { n:"BrtEndSheetData" }, +0x0093: { n:"BrtWsProp", f:parse_BrtWsProp }, +0x0094: { n:"BrtWsDim", f:parse_BrtWsDim, p:16 }, +0x0097: { n:"BrtPane", f:parse_BrtPane }, +0x0098: { n:"BrtSel" }, +0x0099: { n:"BrtWbProp", f:parse_BrtWbProp }, +0x009A: { n:"BrtWbFactoid" }, +0x009B: { n:"BrtFileRecover" }, +0x009C: { n:"BrtBundleSh", f:parse_BrtBundleSh }, +0x009D: { n:"BrtCalcProp" }, +0x009E: { n:"BrtBookView" }, +0x009F: { n:"BrtBeginSst", f:parse_BrtBeginSst }, +0x00A0: { n:"BrtEndSst" }, +0x00A1: { n:"BrtBeginAFilter", f:parse_UncheckedRfX }, +0x00A2: { n:"BrtEndAFilter" }, +0x00A3: { n:"BrtBeginFilterColumn" }, +0x00A4: { n:"BrtEndFilterColumn" }, +0x00A5: { n:"BrtBeginFilters" }, +0x00A6: { n:"BrtEndFilters" }, +0x00A7: { n:"BrtFilter" }, +0x00A8: { n:"BrtColorFilter" }, +0x00A9: { n:"BrtIconFilter" }, +0x00AA: { n:"BrtTop10Filter" }, +0x00AB: { n:"BrtDynamicFilter" }, +0x00AC: { n:"BrtBeginCustomFilters" }, +0x00AD: { n:"BrtEndCustomFilters" }, +0x00AE: { n:"BrtCustomFilter" }, +0x00AF: { n:"BrtAFilterDateGroupItem" }, +0x00B0: { n:"BrtMergeCell", f:parse_BrtMergeCell }, +0x00B1: { n:"BrtBeginMergeCells" }, +0x00B2: { n:"BrtEndMergeCells" }, +0x00B3: { n:"BrtBeginPivotCacheDef" }, +0x00B4: { n:"BrtEndPivotCacheDef" }, +0x00B5: { n:"BrtBeginPCDFields" }, +0x00B6: { n:"BrtEndPCDFields" }, +0x00B7: { n:"BrtBeginPCDField" }, +0x00B8: { n:"BrtEndPCDField" }, +0x00B9: { n:"BrtBeginPCDSource" }, +0x00BA: { n:"BrtEndPCDSource" }, +0x00BB: { n:"BrtBeginPCDSRange" }, +0x00BC: { n:"BrtEndPCDSRange" }, +0x00BD: { n:"BrtBeginPCDFAtbl" }, +0x00BE: { n:"BrtEndPCDFAtbl" }, +0x00BF: { n:"BrtBeginPCDIRun" }, +0x00C0: { n:"BrtEndPCDIRun" }, +0x00C1: { n:"BrtBeginPivotCacheRecords" }, +0x00C2: { n:"BrtEndPivotCacheRecords" }, +0x00C3: { n:"BrtBeginPCDHierarchies" }, +0x00C4: { n:"BrtEndPCDHierarchies" }, +0x00C5: { n:"BrtBeginPCDHierarchy" }, +0x00C6: { n:"BrtEndPCDHierarchy" }, +0x00C7: { n:"BrtBeginPCDHFieldsUsage" }, +0x00C8: { n:"BrtEndPCDHFieldsUsage" }, +0x00C9: { n:"BrtBeginExtConnection" }, +0x00CA: { n:"BrtEndExtConnection" }, +0x00CB: { n:"BrtBeginECDbProps" }, +0x00CC: { n:"BrtEndECDbProps" }, +0x00CD: { n:"BrtBeginECOlapProps" }, +0x00CE: { n:"BrtEndECOlapProps" }, +0x00CF: { n:"BrtBeginPCDSConsol" }, +0x00D0: { n:"BrtEndPCDSConsol" }, +0x00D1: { n:"BrtBeginPCDSCPages" }, +0x00D2: { n:"BrtEndPCDSCPages" }, +0x00D3: { n:"BrtBeginPCDSCPage" }, +0x00D4: { n:"BrtEndPCDSCPage" }, +0x00D5: { n:"BrtBeginPCDSCPItem" }, +0x00D6: { n:"BrtEndPCDSCPItem" }, +0x00D7: { n:"BrtBeginPCDSCSets" }, +0x00D8: { n:"BrtEndPCDSCSets" }, +0x00D9: { n:"BrtBeginPCDSCSet" }, +0x00DA: { n:"BrtEndPCDSCSet" }, +0x00DB: { n:"BrtBeginPCDFGroup" }, +0x00DC: { n:"BrtEndPCDFGroup" }, +0x00DD: { n:"BrtBeginPCDFGItems" }, +0x00DE: { n:"BrtEndPCDFGItems" }, +0x00DF: { n:"BrtBeginPCDFGRange" }, +0x00E0: { n:"BrtEndPCDFGRange" }, +0x00E1: { n:"BrtBeginPCDFGDiscrete" }, +0x00E2: { n:"BrtEndPCDFGDiscrete" }, +0x00E3: { n:"BrtBeginPCDSDTupleCache" }, +0x00E4: { n:"BrtEndPCDSDTupleCache" }, +0x00E5: { n:"BrtBeginPCDSDTCEntries" }, +0x00E6: { n:"BrtEndPCDSDTCEntries" }, +0x00E7: { n:"BrtBeginPCDSDTCEMembers" }, +0x00E8: { n:"BrtEndPCDSDTCEMembers" }, +0x00E9: { n:"BrtBeginPCDSDTCEMember" }, +0x00EA: { n:"BrtEndPCDSDTCEMember" }, +0x00EB: { n:"BrtBeginPCDSDTCQueries" }, +0x00EC: { n:"BrtEndPCDSDTCQueries" }, +0x00ED: { n:"BrtBeginPCDSDTCQuery" }, +0x00EE: { n:"BrtEndPCDSDTCQuery" }, +0x00EF: { n:"BrtBeginPCDSDTCSets" }, +0x00F0: { n:"BrtEndPCDSDTCSets" }, +0x00F1: { n:"BrtBeginPCDSDTCSet" }, +0x00F2: { n:"BrtEndPCDSDTCSet" }, +0x00F3: { n:"BrtBeginPCDCalcItems" }, +0x00F4: { n:"BrtEndPCDCalcItems" }, +0x00F5: { n:"BrtBeginPCDCalcItem" }, +0x00F6: { n:"BrtEndPCDCalcItem" }, +0x00F7: { n:"BrtBeginPRule" }, +0x00F8: { n:"BrtEndPRule" }, +0x00F9: { n:"BrtBeginPRFilters" }, +0x00FA: { n:"BrtEndPRFilters" }, +0x00FB: { n:"BrtBeginPRFilter" }, +0x00FC: { n:"BrtEndPRFilter" }, +0x00FD: { n:"BrtBeginPNames" }, +0x00FE: { n:"BrtEndPNames" }, +0x00FF: { n:"BrtBeginPName" }, +0x0100: { n:"BrtEndPName" }, +0x0101: { n:"BrtBeginPNPairs" }, +0x0102: { n:"BrtEndPNPairs" }, +0x0103: { n:"BrtBeginPNPair" }, +0x0104: { n:"BrtEndPNPair" }, +0x0105: { n:"BrtBeginECWebProps" }, +0x0106: { n:"BrtEndECWebProps" }, +0x0107: { n:"BrtBeginEcWpTables" }, +0x0108: { n:"BrtEndECWPTables" }, +0x0109: { n:"BrtBeginECParams" }, +0x010A: { n:"BrtEndECParams" }, +0x010B: { n:"BrtBeginECParam" }, +0x010C: { n:"BrtEndECParam" }, +0x010D: { n:"BrtBeginPCDKPIs" }, +0x010E: { n:"BrtEndPCDKPIs" }, +0x010F: { n:"BrtBeginPCDKPI" }, +0x0110: { n:"BrtEndPCDKPI" }, +0x0111: { n:"BrtBeginDims" }, +0x0112: { n:"BrtEndDims" }, +0x0113: { n:"BrtBeginDim" }, +0x0114: { n:"BrtEndDim" }, +0x0115: { n:"BrtIndexPartEnd" }, +0x0116: { n:"BrtBeginStyleSheet" }, +0x0117: { n:"BrtEndStyleSheet" }, +0x0118: { n:"BrtBeginSXView" }, +0x0119: { n:"BrtEndSXVI" }, +0x011A: { n:"BrtBeginSXVI" }, +0x011B: { n:"BrtBeginSXVIs" }, +0x011C: { n:"BrtEndSXVIs" }, +0x011D: { n:"BrtBeginSXVD" }, +0x011E: { n:"BrtEndSXVD" }, +0x011F: { n:"BrtBeginSXVDs" }, +0x0120: { n:"BrtEndSXVDs" }, +0x0121: { n:"BrtBeginSXPI" }, +0x0122: { n:"BrtEndSXPI" }, +0x0123: { n:"BrtBeginSXPIs" }, +0x0124: { n:"BrtEndSXPIs" }, +0x0125: { n:"BrtBeginSXDI" }, +0x0126: { n:"BrtEndSXDI" }, +0x0127: { n:"BrtBeginSXDIs" }, +0x0128: { n:"BrtEndSXDIs" }, +0x0129: { n:"BrtBeginSXLI" }, +0x012A: { n:"BrtEndSXLI" }, +0x012B: { n:"BrtBeginSXLIRws" }, +0x012C: { n:"BrtEndSXLIRws" }, +0x012D: { n:"BrtBeginSXLICols" }, +0x012E: { n:"BrtEndSXLICols" }, +0x012F: { n:"BrtBeginSXFormat" }, +0x0130: { n:"BrtEndSXFormat" }, +0x0131: { n:"BrtBeginSXFormats" }, +0x0132: { n:"BrtEndSxFormats" }, +0x0133: { n:"BrtBeginSxSelect" }, +0x0134: { n:"BrtEndSxSelect" }, +0x0135: { n:"BrtBeginISXVDRws" }, +0x0136: { n:"BrtEndISXVDRws" }, +0x0137: { n:"BrtBeginISXVDCols" }, +0x0138: { n:"BrtEndISXVDCols" }, +0x0139: { n:"BrtEndSXLocation" }, +0x013A: { n:"BrtBeginSXLocation" }, +0x013B: { n:"BrtEndSXView" }, +0x013C: { n:"BrtBeginSXTHs" }, +0x013D: { n:"BrtEndSXTHs" }, +0x013E: { n:"BrtBeginSXTH" }, +0x013F: { n:"BrtEndSXTH" }, +0x0140: { n:"BrtBeginISXTHRws" }, +0x0141: { n:"BrtEndISXTHRws" }, +0x0142: { n:"BrtBeginISXTHCols" }, +0x0143: { n:"BrtEndISXTHCols" }, +0x0144: { n:"BrtBeginSXTDMPS" }, +0x0145: { n:"BrtEndSXTDMPs" }, +0x0146: { n:"BrtBeginSXTDMP" }, +0x0147: { n:"BrtEndSXTDMP" }, +0x0148: { n:"BrtBeginSXTHItems" }, +0x0149: { n:"BrtEndSXTHItems" }, +0x014A: { n:"BrtBeginSXTHItem" }, +0x014B: { n:"BrtEndSXTHItem" }, +0x014C: { n:"BrtBeginMetadata" }, +0x014D: { n:"BrtEndMetadata" }, +0x014E: { n:"BrtBeginEsmdtinfo" }, +0x014F: { n:"BrtMdtinfo" }, +0x0150: { n:"BrtEndEsmdtinfo" }, +0x0151: { n:"BrtBeginEsmdb" }, +0x0152: { n:"BrtEndEsmdb" }, +0x0153: { n:"BrtBeginEsfmd" }, +0x0154: { n:"BrtEndEsfmd" }, +0x0155: { n:"BrtBeginSingleCells" }, +0x0156: { n:"BrtEndSingleCells" }, +0x0157: { n:"BrtBeginList" }, +0x0158: { n:"BrtEndList" }, +0x0159: { n:"BrtBeginListCols" }, +0x015A: { n:"BrtEndListCols" }, +0x015B: { n:"BrtBeginListCol" }, +0x015C: { n:"BrtEndListCol" }, +0x015D: { n:"BrtBeginListXmlCPr" }, +0x015E: { n:"BrtEndListXmlCPr" }, +0x015F: { n:"BrtListCCFmla" }, +0x0160: { n:"BrtListTrFmla" }, +0x0161: { n:"BrtBeginExternals" }, +0x0162: { n:"BrtEndExternals" }, +0x0163: { n:"BrtSupBookSrc", f:parse_RelID}, +0x0165: { n:"BrtSupSelf" }, +0x0166: { n:"BrtSupSame" }, +0x0167: { n:"BrtSupTabs" }, +0x0168: { n:"BrtBeginSupBook" }, +0x0169: { n:"BrtPlaceholderName" }, +0x016A: { n:"BrtExternSheet", f:parse_ExternSheet }, +0x016B: { n:"BrtExternTableStart" }, +0x016C: { n:"BrtExternTableEnd" }, +0x016E: { n:"BrtExternRowHdr" }, +0x016F: { n:"BrtExternCellBlank" }, +0x0170: { n:"BrtExternCellReal" }, +0x0171: { n:"BrtExternCellBool" }, +0x0172: { n:"BrtExternCellError" }, +0x0173: { n:"BrtExternCellString" }, +0x0174: { n:"BrtBeginEsmdx" }, +0x0175: { n:"BrtEndEsmdx" }, +0x0176: { n:"BrtBeginMdxSet" }, +0x0177: { n:"BrtEndMdxSet" }, +0x0178: { n:"BrtBeginMdxMbrProp" }, +0x0179: { n:"BrtEndMdxMbrProp" }, +0x017A: { n:"BrtBeginMdxKPI" }, +0x017B: { n:"BrtEndMdxKPI" }, +0x017C: { n:"BrtBeginEsstr" }, +0x017D: { n:"BrtEndEsstr" }, +0x017E: { n:"BrtBeginPRFItem" }, +0x017F: { n:"BrtEndPRFItem" }, +0x0180: { n:"BrtBeginPivotCacheIDs" }, +0x0181: { n:"BrtEndPivotCacheIDs" }, +0x0182: { n:"BrtBeginPivotCacheID" }, +0x0183: { n:"BrtEndPivotCacheID" }, +0x0184: { n:"BrtBeginISXVIs" }, +0x0185: { n:"BrtEndISXVIs" }, +0x0186: { n:"BrtBeginColInfos" }, +0x0187: { n:"BrtEndColInfos" }, +0x0188: { n:"BrtBeginRwBrk" }, +0x0189: { n:"BrtEndRwBrk" }, +0x018A: { n:"BrtBeginColBrk" }, +0x018B: { n:"BrtEndColBrk" }, +0x018C: { n:"BrtBrk" }, +0x018D: { n:"BrtUserBookView" }, +0x018E: { n:"BrtInfo" }, +0x018F: { n:"BrtCUsr" }, +0x0190: { n:"BrtUsr" }, +0x0191: { n:"BrtBeginUsers" }, +0x0193: { n:"BrtEOF" }, +0x0194: { n:"BrtUCR" }, +0x0195: { n:"BrtRRInsDel" }, +0x0196: { n:"BrtRREndInsDel" }, +0x0197: { n:"BrtRRMove" }, +0x0198: { n:"BrtRREndMove" }, +0x0199: { n:"BrtRRChgCell" }, +0x019A: { n:"BrtRREndChgCell" }, +0x019B: { n:"BrtRRHeader" }, +0x019C: { n:"BrtRRUserView" }, +0x019D: { n:"BrtRRRenSheet" }, +0x019E: { n:"BrtRRInsertSh" }, +0x019F: { n:"BrtRRDefName" }, +0x01A0: { n:"BrtRRNote" }, +0x01A1: { n:"BrtRRConflict" }, +0x01A2: { n:"BrtRRTQSIF" }, +0x01A3: { n:"BrtRRFormat" }, +0x01A4: { n:"BrtRREndFormat" }, +0x01A5: { n:"BrtRRAutoFmt" }, +0x01A6: { n:"BrtBeginUserShViews" }, +0x01A7: { n:"BrtBeginUserShView" }, +0x01A8: { n:"BrtEndUserShView" }, +0x01A9: { n:"BrtEndUserShViews" }, +0x01AA: { n:"BrtArrFmla", f:parse_BrtArrFmla }, +0x01AB: { n:"BrtShrFmla", f:parse_BrtShrFmla }, +0x01AC: { n:"BrtTable" }, +0x01AD: { n:"BrtBeginExtConnections" }, +0x01AE: { n:"BrtEndExtConnections" }, +0x01AF: { n:"BrtBeginPCDCalcMems" }, +0x01B0: { n:"BrtEndPCDCalcMems" }, +0x01B1: { n:"BrtBeginPCDCalcMem" }, +0x01B2: { n:"BrtEndPCDCalcMem" }, +0x01B3: { n:"BrtBeginPCDHGLevels" }, +0x01B4: { n:"BrtEndPCDHGLevels" }, +0x01B5: { n:"BrtBeginPCDHGLevel" }, +0x01B6: { n:"BrtEndPCDHGLevel" }, +0x01B7: { n:"BrtBeginPCDHGLGroups" }, +0x01B8: { n:"BrtEndPCDHGLGroups" }, +0x01B9: { n:"BrtBeginPCDHGLGroup" }, +0x01BA: { n:"BrtEndPCDHGLGroup" }, +0x01BB: { n:"BrtBeginPCDHGLGMembers" }, +0x01BC: { n:"BrtEndPCDHGLGMembers" }, +0x01BD: { n:"BrtBeginPCDHGLGMember" }, +0x01BE: { n:"BrtEndPCDHGLGMember" }, +0x01BF: { n:"BrtBeginQSI" }, +0x01C0: { n:"BrtEndQSI" }, +0x01C1: { n:"BrtBeginQSIR" }, +0x01C2: { n:"BrtEndQSIR" }, +0x01C3: { n:"BrtBeginDeletedNames" }, +0x01C4: { n:"BrtEndDeletedNames" }, +0x01C5: { n:"BrtBeginDeletedName" }, +0x01C6: { n:"BrtEndDeletedName" }, +0x01C7: { n:"BrtBeginQSIFs" }, +0x01C8: { n:"BrtEndQSIFs" }, +0x01C9: { n:"BrtBeginQSIF" }, +0x01CA: { n:"BrtEndQSIF" }, +0x01CB: { n:"BrtBeginAutoSortScope" }, +0x01CC: { n:"BrtEndAutoSortScope" }, +0x01CD: { n:"BrtBeginConditionalFormatting" }, +0x01CE: { n:"BrtEndConditionalFormatting" }, +0x01CF: { n:"BrtBeginCFRule" }, +0x01D0: { n:"BrtEndCFRule" }, +0x01D1: { n:"BrtBeginIconSet" }, +0x01D2: { n:"BrtEndIconSet" }, +0x01D3: { n:"BrtBeginDatabar" }, +0x01D4: { n:"BrtEndDatabar" }, +0x01D5: { n:"BrtBeginColorScale" }, +0x01D6: { n:"BrtEndColorScale" }, +0x01D7: { n:"BrtCFVO" }, +0x01D8: { n:"BrtExternValueMeta" }, +0x01D9: { n:"BrtBeginColorPalette" }, +0x01DA: { n:"BrtEndColorPalette" }, +0x01DB: { n:"BrtIndexedColor" }, +0x01DC: { n:"BrtMargins", f:parse_BrtMargins }, +0x01DD: { n:"BrtPrintOptions" }, +0x01DE: { n:"BrtPageSetup" }, +0x01DF: { n:"BrtBeginHeaderFooter" }, +0x01E0: { n:"BrtEndHeaderFooter" }, +0x01E1: { n:"BrtBeginSXCrtFormat" }, +0x01E2: { n:"BrtEndSXCrtFormat" }, +0x01E3: { n:"BrtBeginSXCrtFormats" }, +0x01E4: { n:"BrtEndSXCrtFormats" }, +0x01E5: { n:"BrtWsFmtInfo", f:parse_BrtWsFmtInfo }, +0x01E6: { n:"BrtBeginMgs" }, +0x01E7: { n:"BrtEndMGs" }, +0x01E8: { n:"BrtBeginMGMaps" }, +0x01E9: { n:"BrtEndMGMaps" }, +0x01EA: { n:"BrtBeginMG" }, +0x01EB: { n:"BrtEndMG" }, +0x01EC: { n:"BrtBeginMap" }, +0x01ED: { n:"BrtEndMap" }, +0x01EE: { n:"BrtHLink", f:parse_BrtHLink }, +0x01EF: { n:"BrtBeginDCon" }, +0x01F0: { n:"BrtEndDCon" }, +0x01F1: { n:"BrtBeginDRefs" }, +0x01F2: { n:"BrtEndDRefs" }, +0x01F3: { n:"BrtDRef" }, +0x01F4: { n:"BrtBeginScenMan" }, +0x01F5: { n:"BrtEndScenMan" }, +0x01F6: { n:"BrtBeginSct" }, +0x01F7: { n:"BrtEndSct" }, +0x01F8: { n:"BrtSlc" }, +0x01F9: { n:"BrtBeginDXFs" }, +0x01FA: { n:"BrtEndDXFs" }, +0x01FB: { n:"BrtDXF" }, +0x01FC: { n:"BrtBeginTableStyles" }, +0x01FD: { n:"BrtEndTableStyles" }, +0x01FE: { n:"BrtBeginTableStyle" }, +0x01FF: { n:"BrtEndTableStyle" }, +0x0200: { n:"BrtTableStyleElement" }, +0x0201: { n:"BrtTableStyleClient" }, +0x0202: { n:"BrtBeginVolDeps" }, +0x0203: { n:"BrtEndVolDeps" }, +0x0204: { n:"BrtBeginVolType" }, +0x0205: { n:"BrtEndVolType" }, +0x0206: { n:"BrtBeginVolMain" }, +0x0207: { n:"BrtEndVolMain" }, +0x0208: { n:"BrtBeginVolTopic" }, +0x0209: { n:"BrtEndVolTopic" }, +0x020A: { n:"BrtVolSubtopic" }, +0x020B: { n:"BrtVolRef" }, +0x020C: { n:"BrtVolNum" }, +0x020D: { n:"BrtVolErr" }, +0x020E: { n:"BrtVolStr" }, +0x020F: { n:"BrtVolBool" }, +0x0210: { n:"BrtBeginCalcChain$" }, +0x0211: { n:"BrtEndCalcChain$" }, +0x0212: { n:"BrtBeginSortState" }, +0x0213: { n:"BrtEndSortState" }, +0x0214: { n:"BrtBeginSortCond" }, +0x0215: { n:"BrtEndSortCond" }, +0x0216: { n:"BrtBookProtection" }, +0x0217: { n:"BrtSheetProtection" }, +0x0218: { n:"BrtRangeProtection" }, +0x0219: { n:"BrtPhoneticInfo" }, +0x021A: { n:"BrtBeginECTxtWiz" }, +0x021B: { n:"BrtEndECTxtWiz" }, +0x021C: { n:"BrtBeginECTWFldInfoLst" }, +0x021D: { n:"BrtEndECTWFldInfoLst" }, +0x021E: { n:"BrtBeginECTwFldInfo" }, +0x0224: { n:"BrtFileSharing" }, +0x0225: { n:"BrtOleSize" }, +0x0226: { n:"BrtDrawing", f:parse_RelID }, +0x0227: { n:"BrtLegacyDrawing" }, +0x0228: { n:"BrtLegacyDrawingHF" }, +0x0229: { n:"BrtWebOpt" }, +0x022A: { n:"BrtBeginWebPubItems" }, +0x022B: { n:"BrtEndWebPubItems" }, +0x022C: { n:"BrtBeginWebPubItem" }, +0x022D: { n:"BrtEndWebPubItem" }, +0x022E: { n:"BrtBeginSXCondFmt" }, +0x022F: { n:"BrtEndSXCondFmt" }, +0x0230: { n:"BrtBeginSXCondFmts" }, +0x0231: { n:"BrtEndSXCondFmts" }, +0x0232: { n:"BrtBkHim" }, +0x0234: { n:"BrtColor" }, +0x0235: { n:"BrtBeginIndexedColors" }, +0x0236: { n:"BrtEndIndexedColors" }, +0x0239: { n:"BrtBeginMRUColors" }, +0x023A: { n:"BrtEndMRUColors" }, +0x023C: { n:"BrtMRUColor" }, +0x023D: { n:"BrtBeginDVals" }, +0x023E: { n:"BrtEndDVals" }, +0x0241: { n:"BrtSupNameStart" }, +0x0242: { n:"BrtSupNameValueStart" }, +0x0243: { n:"BrtSupNameValueEnd" }, +0x0244: { n:"BrtSupNameNum" }, +0x0245: { n:"BrtSupNameErr" }, +0x0246: { n:"BrtSupNameSt" }, +0x0247: { n:"BrtSupNameNil" }, +0x0248: { n:"BrtSupNameBool" }, +0x0249: { n:"BrtSupNameFmla" }, +0x024A: { n:"BrtSupNameBits" }, +0x024B: { n:"BrtSupNameEnd" }, +0x024C: { n:"BrtEndSupBook" }, +0x024D: { n:"BrtCellSmartTagProperty" }, +0x024E: { n:"BrtBeginCellSmartTag" }, +0x024F: { n:"BrtEndCellSmartTag" }, +0x0250: { n:"BrtBeginCellSmartTags" }, +0x0251: { n:"BrtEndCellSmartTags" }, +0x0252: { n:"BrtBeginSmartTags" }, +0x0253: { n:"BrtEndSmartTags" }, +0x0254: { n:"BrtSmartTagType" }, +0x0255: { n:"BrtBeginSmartTagTypes" }, +0x0256: { n:"BrtEndSmartTagTypes" }, +0x0257: { n:"BrtBeginSXFilters" }, +0x0258: { n:"BrtEndSXFilters" }, +0x0259: { n:"BrtBeginSXFILTER" }, +0x025A: { n:"BrtEndSXFilter" }, +0x025B: { n:"BrtBeginFills" }, +0x025C: { n:"BrtEndFills" }, +0x025D: { n:"BrtBeginCellWatches" }, +0x025E: { n:"BrtEndCellWatches" }, +0x025F: { n:"BrtCellWatch" }, +0x0260: { n:"BrtBeginCRErrs" }, +0x0261: { n:"BrtEndCRErrs" }, +0x0262: { n:"BrtCrashRecErr" }, +0x0263: { n:"BrtBeginFonts" }, +0x0264: { n:"BrtEndFonts" }, +0x0265: { n:"BrtBeginBorders" }, +0x0266: { n:"BrtEndBorders" }, +0x0267: { n:"BrtBeginFmts" }, +0x0268: { n:"BrtEndFmts" }, +0x0269: { n:"BrtBeginCellXFs" }, +0x026A: { n:"BrtEndCellXFs" }, +0x026B: { n:"BrtBeginStyles" }, +0x026C: { n:"BrtEndStyles" }, +0x0271: { n:"BrtBigName" }, +0x0272: { n:"BrtBeginCellStyleXFs" }, +0x0273: { n:"BrtEndCellStyleXFs" }, +0x0274: { n:"BrtBeginComments" }, +0x0275: { n:"BrtEndComments" }, +0x0276: { n:"BrtBeginCommentAuthors" }, +0x0277: { n:"BrtEndCommentAuthors" }, +0x0278: { n:"BrtCommentAuthor", f:parse_BrtCommentAuthor }, +0x0279: { n:"BrtBeginCommentList" }, +0x027A: { n:"BrtEndCommentList" }, +0x027B: { n:"BrtBeginComment", f:parse_BrtBeginComment}, +0x027C: { n:"BrtEndComment" }, +0x027D: { n:"BrtCommentText", f:parse_BrtCommentText }, +0x027E: { n:"BrtBeginOleObjects" }, +0x027F: { n:"BrtOleObject" }, +0x0280: { n:"BrtEndOleObjects" }, +0x0281: { n:"BrtBeginSxrules" }, +0x0282: { n:"BrtEndSxRules" }, +0x0283: { n:"BrtBeginActiveXControls" }, +0x0284: { n:"BrtActiveX" }, +0x0285: { n:"BrtEndActiveXControls" }, +0x0286: { n:"BrtBeginPCDSDTCEMembersSortBy" }, +0x0288: { n:"BrtBeginCellIgnoreECs" }, +0x0289: { n:"BrtCellIgnoreEC" }, +0x028A: { n:"BrtEndCellIgnoreECs" }, +0x028B: { n:"BrtCsProp", f:parse_BrtCsProp }, +0x028C: { n:"BrtCsPageSetup" }, +0x028D: { n:"BrtBeginUserCsViews" }, +0x028E: { n:"BrtEndUserCsViews" }, +0x028F: { n:"BrtBeginUserCsView" }, +0x0290: { n:"BrtEndUserCsView" }, +0x0291: { n:"BrtBeginPcdSFCIEntries" }, +0x0292: { n:"BrtEndPCDSFCIEntries" }, +0x0293: { n:"BrtPCDSFCIEntry" }, +0x0294: { n:"BrtBeginListParts" }, +0x0295: { n:"BrtListPart" }, +0x0296: { n:"BrtEndListParts" }, +0x0297: { n:"BrtSheetCalcProp" }, +0x0298: { n:"BrtBeginFnGroup" }, +0x0299: { n:"BrtFnGroup" }, +0x029A: { n:"BrtEndFnGroup" }, +0x029B: { n:"BrtSupAddin" }, +0x029C: { n:"BrtSXTDMPOrder" }, +0x029D: { n:"BrtCsProtection" }, +0x029F: { n:"BrtBeginWsSortMap" }, +0x02A0: { n:"BrtEndWsSortMap" }, +0x02A1: { n:"BrtBeginRRSort" }, +0x02A2: { n:"BrtEndRRSort" }, +0x02A3: { n:"BrtRRSortItem" }, +0x02A4: { n:"BrtFileSharingIso" }, +0x02A5: { n:"BrtBookProtectionIso" }, +0x02A6: { n:"BrtSheetProtectionIso" }, +0x02A7: { n:"BrtCsProtectionIso" }, +0x02A8: { n:"BrtRangeProtectionIso" }, +0x02A9: { n:"BrtDValList" }, +0x0400: { n:"BrtRwDescent" }, +0x0401: { n:"BrtKnownFonts" }, +0x0402: { n:"BrtBeginSXTupleSet" }, +0x0403: { n:"BrtEndSXTupleSet" }, +0x0404: { n:"BrtBeginSXTupleSetHeader" }, +0x0405: { n:"BrtEndSXTupleSetHeader" }, +0x0406: { n:"BrtSXTupleSetHeaderItem" }, +0x0407: { n:"BrtBeginSXTupleSetData" }, +0x0408: { n:"BrtEndSXTupleSetData" }, +0x0409: { n:"BrtBeginSXTupleSetRow" }, +0x040A: { n:"BrtEndSXTupleSetRow" }, +0x040B: { n:"BrtSXTupleSetRowItem" }, +0x040C: { n:"BrtNameExt" }, +0x040D: { n:"BrtPCDH14" }, +0x040E: { n:"BrtBeginPCDCalcMem14" }, +0x040F: { n:"BrtEndPCDCalcMem14" }, +0x0410: { n:"BrtSXTH14" }, +0x0411: { n:"BrtBeginSparklineGroup" }, +0x0412: { n:"BrtEndSparklineGroup" }, +0x0413: { n:"BrtSparkline" }, +0x0414: { n:"BrtSXDI14" }, +0x0415: { n:"BrtWsFmtInfoEx14" }, +0x0416: { n:"BrtBeginConditionalFormatting14" }, +0x0417: { n:"BrtEndConditionalFormatting14" }, +0x0418: { n:"BrtBeginCFRule14" }, +0x0419: { n:"BrtEndCFRule14" }, +0x041A: { n:"BrtCFVO14" }, +0x041B: { n:"BrtBeginDatabar14" }, +0x041C: { n:"BrtBeginIconSet14" }, +0x041D: { n:"BrtDVal14", f: parse_BrtDVal14 }, +0x041E: { n:"BrtBeginDVals14" }, +0x041F: { n:"BrtColor14" }, +0x0420: { n:"BrtBeginSparklines" }, +0x0421: { n:"BrtEndSparklines" }, +0x0422: { n:"BrtBeginSparklineGroups" }, +0x0423: { n:"BrtEndSparklineGroups" }, +0x0425: { n:"BrtSXVD14" }, +0x0426: { n:"BrtBeginSXView14" }, +0x0427: { n:"BrtEndSXView14" }, +0x0428: { n:"BrtBeginSXView16" }, +0x0429: { n:"BrtEndSXView16" }, +0x042A: { n:"BrtBeginPCD14" }, +0x042B: { n:"BrtEndPCD14" }, +0x042C: { n:"BrtBeginExtConn14" }, +0x042D: { n:"BrtEndExtConn14" }, +0x042E: { n:"BrtBeginSlicerCacheIDs" }, +0x042F: { n:"BrtEndSlicerCacheIDs" }, +0x0430: { n:"BrtBeginSlicerCacheID" }, +0x0431: { n:"BrtEndSlicerCacheID" }, +0x0433: { n:"BrtBeginSlicerCache" }, +0x0434: { n:"BrtEndSlicerCache" }, +0x0435: { n:"BrtBeginSlicerCacheDef" }, +0x0436: { n:"BrtEndSlicerCacheDef" }, +0x0437: { n:"BrtBeginSlicersEx" }, +0x0438: { n:"BrtEndSlicersEx" }, +0x0439: { n:"BrtBeginSlicerEx" }, +0x043A: { n:"BrtEndSlicerEx" }, +0x043B: { n:"BrtBeginSlicer" }, +0x043C: { n:"BrtEndSlicer" }, +0x043D: { n:"BrtSlicerCachePivotTables" }, +0x043E: { n:"BrtBeginSlicerCacheOlapImpl" }, +0x043F: { n:"BrtEndSlicerCacheOlapImpl" }, +0x0440: { n:"BrtBeginSlicerCacheLevelsData" }, +0x0441: { n:"BrtEndSlicerCacheLevelsData" }, +0x0442: { n:"BrtBeginSlicerCacheLevelData" }, +0x0443: { n:"BrtEndSlicerCacheLevelData" }, +0x0444: { n:"BrtBeginSlicerCacheSiRanges" }, +0x0445: { n:"BrtEndSlicerCacheSiRanges" }, +0x0446: { n:"BrtBeginSlicerCacheSiRange" }, +0x0447: { n:"BrtEndSlicerCacheSiRange" }, +0x0448: { n:"BrtSlicerCacheOlapItem" }, +0x0449: { n:"BrtBeginSlicerCacheSelections" }, +0x044A: { n:"BrtSlicerCacheSelection" }, +0x044B: { n:"BrtEndSlicerCacheSelections" }, +0x044C: { n:"BrtBeginSlicerCacheNative" }, +0x044D: { n:"BrtEndSlicerCacheNative" }, +0x044E: { n:"BrtSlicerCacheNativeItem" }, +0x044F: { n:"BrtRangeProtection14" }, +0x0450: { n:"BrtRangeProtectionIso14" }, +0x0451: { n:"BrtCellIgnoreEC14" }, +0x0457: { n:"BrtList14" }, +0x0458: { n:"BrtCFIcon" }, +0x0459: { n:"BrtBeginSlicerCachesPivotCacheIDs" }, +0x045A: { n:"BrtEndSlicerCachesPivotCacheIDs" }, +0x045B: { n:"BrtBeginSlicers" }, +0x045C: { n:"BrtEndSlicers" }, +0x045D: { n:"BrtWbProp14" }, +0x045E: { n:"BrtBeginSXEdit" }, +0x045F: { n:"BrtEndSXEdit" }, +0x0460: { n:"BrtBeginSXEdits" }, +0x0461: { n:"BrtEndSXEdits" }, +0x0462: { n:"BrtBeginSXChange" }, +0x0463: { n:"BrtEndSXChange" }, +0x0464: { n:"BrtBeginSXChanges" }, +0x0465: { n:"BrtEndSXChanges" }, +0x0466: { n:"BrtSXTupleItems" }, +0x0468: { n:"BrtBeginSlicerStyle" }, +0x0469: { n:"BrtEndSlicerStyle" }, +0x046A: { n:"BrtSlicerStyleElement" }, +0x046B: { n:"BrtBeginStyleSheetExt14" }, +0x046C: { n:"BrtEndStyleSheetExt14" }, +0x046D: { n:"BrtBeginSlicerCachesPivotCacheID" }, +0x046E: { n:"BrtEndSlicerCachesPivotCacheID" }, +0x046F: { n:"BrtBeginConditionalFormattings" }, +0x0470: { n:"BrtEndConditionalFormattings" }, +0x0471: { n:"BrtBeginPCDCalcMemExt" }, +0x0472: { n:"BrtEndPCDCalcMemExt" }, +0x0473: { n:"BrtBeginPCDCalcMemsExt" }, +0x0474: { n:"BrtEndPCDCalcMemsExt" }, +0x0475: { n:"BrtPCDField14" }, +0x0476: { n:"BrtBeginSlicerStyles" }, +0x0477: { n:"BrtEndSlicerStyles" }, +0x0478: { n:"BrtBeginSlicerStyleElements" }, +0x0479: { n:"BrtEndSlicerStyleElements" }, +0x047A: { n:"BrtCFRuleExt" }, +0x047B: { n:"BrtBeginSXCondFmt14" }, +0x047C: { n:"BrtEndSXCondFmt14" }, +0x047D: { n:"BrtBeginSXCondFmts14" }, +0x047E: { n:"BrtEndSXCondFmts14" }, +0x0480: { n:"BrtBeginSortCond14" }, +0x0481: { n:"BrtEndSortCond14" }, +0x0482: { n:"BrtEndDVals14" }, +0x0483: { n:"BrtEndIconSet14" }, +0x0484: { n:"BrtEndDatabar14" }, +0x0485: { n:"BrtBeginColorScale14" }, +0x0486: { n:"BrtEndColorScale14" }, +0x0487: { n:"BrtBeginSxrules14" }, +0x0488: { n:"BrtEndSxrules14" }, +0x0489: { n:"BrtBeginPRule14" }, +0x048A: { n:"BrtEndPRule14" }, +0x048B: { n:"BrtBeginPRFilters14" }, +0x048C: { n:"BrtEndPRFilters14" }, +0x048D: { n:"BrtBeginPRFilter14" }, +0x048E: { n:"BrtEndPRFilter14" }, +0x048F: { n:"BrtBeginPRFItem14" }, +0x0490: { n:"BrtEndPRFItem14" }, +0x0491: { n:"BrtBeginCellIgnoreECs14" }, +0x0492: { n:"BrtEndCellIgnoreECs14" }, +0x0493: { n:"BrtDxf14" }, +0x0494: { n:"BrtBeginDxF14s" }, +0x0495: { n:"BrtEndDxf14s" }, +0x0499: { n:"BrtFilter14" }, +0x049A: { n:"BrtBeginCustomFilters14" }, +0x049C: { n:"BrtCustomFilter14" }, +0x049D: { n:"BrtIconFilter14" }, +0x049E: { n:"BrtPivotCacheConnectionName" }, +0x0800: { n:"BrtBeginDecoupledPivotCacheIDs" }, +0x0801: { n:"BrtEndDecoupledPivotCacheIDs" }, +0x0802: { n:"BrtDecoupledPivotCacheID" }, +0x0803: { n:"BrtBeginPivotTableRefs" }, +0x0804: { n:"BrtEndPivotTableRefs" }, +0x0805: { n:"BrtPivotTableRef" }, +0x0806: { n:"BrtSlicerCacheBookPivotTables" }, +0x0807: { n:"BrtBeginSxvcells" }, +0x0808: { n:"BrtEndSxvcells" }, +0x0809: { n:"BrtBeginSxRow" }, +0x080A: { n:"BrtEndSxRow" }, +0x080C: { n:"BrtPcdCalcMem15" }, +0x0813: { n:"BrtQsi15" }, +0x0814: { n:"BrtBeginWebExtensions" }, +0x0815: { n:"BrtEndWebExtensions" }, +0x0816: { n:"BrtWebExtension" }, +0x0817: { n:"BrtAbsPath15" }, +0x0818: { n:"BrtBeginPivotTableUISettings" }, +0x0819: { n:"BrtEndPivotTableUISettings" }, +0x081B: { n:"BrtTableSlicerCacheIDs" }, +0x081C: { n:"BrtTableSlicerCacheID" }, +0x081D: { n:"BrtBeginTableSlicerCache" }, +0x081E: { n:"BrtEndTableSlicerCache" }, +0x081F: { n:"BrtSxFilter15" }, +0x0820: { n:"BrtBeginTimelineCachePivotCacheIDs" }, +0x0821: { n:"BrtEndTimelineCachePivotCacheIDs" }, +0x0822: { n:"BrtTimelineCachePivotCacheID" }, +0x0823: { n:"BrtBeginTimelineCacheIDs" }, +0x0824: { n:"BrtEndTimelineCacheIDs" }, +0x0825: { n:"BrtBeginTimelineCacheID" }, +0x0826: { n:"BrtEndTimelineCacheID" }, +0x0827: { n:"BrtBeginTimelinesEx" }, +0x0828: { n:"BrtEndTimelinesEx" }, +0x0829: { n:"BrtBeginTimelineEx" }, +0x082A: { n:"BrtEndTimelineEx" }, +0x082B: { n:"BrtWorkBookPr15" }, +0x082C: { n:"BrtPCDH15" }, +0x082D: { n:"BrtBeginTimelineStyle" }, +0x082E: { n:"BrtEndTimelineStyle" }, +0x082F: { n:"BrtTimelineStyleElement" }, +0x0830: { n:"BrtBeginTimelineStylesheetExt15" }, +0x0831: { n:"BrtEndTimelineStylesheetExt15" }, +0x0832: { n:"BrtBeginTimelineStyles" }, +0x0833: { n:"BrtEndTimelineStyles" }, +0x0834: { n:"BrtBeginTimelineStyleElements" }, +0x0835: { n:"BrtEndTimelineStyleElements" }, +0x0836: { n:"BrtDxf15" }, +0x0837: { n:"BrtBeginDxfs15" }, +0x0838: { n:"brtEndDxfs15" }, +0x0839: { n:"BrtSlicerCacheHideItemsWithNoData" }, +0x083A: { n:"BrtBeginItemUniqueNames" }, +0x083B: { n:"BrtEndItemUniqueNames" }, +0x083C: { n:"BrtItemUniqueName" }, +0x083D: { n:"BrtBeginExtConn15" }, +0x083E: { n:"BrtEndExtConn15" }, +0x083F: { n:"BrtBeginOledbPr15" }, +0x0840: { n:"BrtEndOledbPr15" }, +0x0841: { n:"BrtBeginDataFeedPr15" }, +0x0842: { n:"BrtEndDataFeedPr15" }, +0x0843: { n:"BrtTextPr15" }, +0x0844: { n:"BrtRangePr15" }, +0x0845: { n:"BrtDbCommand15" }, +0x0846: { n:"BrtBeginDbTables15" }, +0x0847: { n:"BrtEndDbTables15" }, +0x0848: { n:"BrtDbTable15" }, +0x0849: { n:"BrtBeginDataModel" }, +0x084A: { n:"BrtEndDataModel" }, +0x084B: { n:"BrtBeginModelTables" }, +0x084C: { n:"BrtEndModelTables" }, +0x084D: { n:"BrtModelTable" }, +0x084E: { n:"BrtBeginModelRelationships" }, +0x084F: { n:"BrtEndModelRelationships" }, +0x0850: { n:"BrtModelRelationship" }, +0x0851: { n:"BrtBeginECTxtWiz15" }, +0x0852: { n:"BrtEndECTxtWiz15" }, +0x0853: { n:"BrtBeginECTWFldInfoLst15" }, +0x0854: { n:"BrtEndECTWFldInfoLst15" }, +0x0855: { n:"BrtBeginECTWFldInfo15" }, +0x0856: { n:"BrtFieldListActiveItem" }, +0x0857: { n:"BrtPivotCacheIdVersion" }, +0x0858: { n:"BrtSXDI15" }, +0x0859: { n:"BrtBeginModelTimeGroupings" }, +0x085A: { n:"BrtEndModelTimeGroupings" }, +0x085B: { n:"BrtBeginModelTimeGrouping" }, +0x085C: { n:"BrtEndModelTimeGrouping" }, +0x085D: { n:"BrtModelTimeGroupingCalcCol" }, +0x0C00: { n:"BrtUid" }, +0x0C01: { n:"BrtRevisionPtr" }, +0x13e7: { n:"BrtBeginCalcFeatures" }, +0x13e8: { n:"BrtEndCalcFeatures" }, +0x13e9: { n:"BrtCalcFeature" }, +0xFFFF: { n:"" } +}; + +var XLSBRE = evert_key(XLSBRecordEnum, 'n'); + +/* [MS-XLS] 2.3 Record Enumeration */ +var XLSRecordEnum = { +0x0003: { n:"BIFF2NUM", f:parse_BIFF2NUM }, +0x0004: { n:"BIFF2STR", f:parse_BIFF2STR }, +0x0006: { n:"Formula", f:parse_Formula }, +0x0009: { n:'BOF', f:parse_BOF }, +0x000a: { n:'EOF', f:parsenoop2 }, +0x000c: { n:"CalcCount", f:parseuint16 }, +0x000d: { n:"CalcMode", f:parseuint16 }, +0x000e: { n:"CalcPrecision", f:parsebool }, +0x000f: { n:"CalcRefMode", f:parsebool }, +0x0010: { n:"CalcDelta", f:parse_Xnum }, +0x0011: { n:"CalcIter", f:parsebool }, +0x0012: { n:"Protect", f:parsebool }, +0x0013: { n:"Password", f:parseuint16 }, +0x0014: { n:"Header", f:parse_XLHeaderFooter }, +0x0015: { n:"Footer", f:parse_XLHeaderFooter }, +0x0017: { n:"ExternSheet", f:parse_ExternSheet }, +0x0018: { n:"Lbl", f:parse_Lbl }, +0x0019: { n:"WinProtect", f:parsebool }, +0x001a: { n:"VerticalPageBreaks" }, +0x001b: { n:"HorizontalPageBreaks" }, +0x001c: { n:"Note", f:parse_Note }, +0x001d: { n:"Selection" }, +0x0022: { n:"Date1904", f:parsebool }, +0x0023: { n:"ExternName", f:parse_ExternName }, +0x0024: { n:"COLWIDTH" }, +0x0026: { n:"LeftMargin", f:parse_Xnum }, +0x0027: { n:"RightMargin", f:parse_Xnum }, +0x0028: { n:"TopMargin", f:parse_Xnum }, +0x0029: { n:"BottomMargin", f:parse_Xnum }, +0x002a: { n:"PrintRowCol", f:parsebool }, +0x002b: { n:"PrintGrid", f:parsebool }, +0x002f: { n:"FilePass", f:parse_FilePass }, +0x0031: { n:"Font", f:parse_Font }, +0x0033: { n:"PrintSize", f:parseuint16 }, +0x003c: { n:"Continue" }, +0x003d: { n:"Window1", f:parse_Window1 }, +0x0040: { n:"Backup", f:parsebool }, +0x0041: { n:"Pane", f:parse_Pane }, +0x0042: { n:'CodePage', f:parseuint16 }, +0x004d: { n:"Pls" }, +0x0050: { n:"DCon" }, +0x0051: { n:"DConRef" }, +0x0052: { n:"DConName" }, +0x0055: { n:"DefColWidth", f:parseuint16 }, +0x0059: { n:"XCT" }, +0x005a: { n:"CRN" }, +0x005b: { n:"FileSharing" }, +0x005c: { n:'WriteAccess', f:parse_WriteAccess }, +0x005d: { n:"Obj", f:parse_Obj }, +0x005e: { n:"Uncalced" }, +0x005f: { n:"CalcSaveRecalc", f:parsebool }, +0x0060: { n:"Template" }, +0x0061: { n:"Intl" }, +0x0063: { n:"ObjProtect", f:parsebool }, +0x007d: { n:"ColInfo", f:parse_ColInfo }, +0x0080: { n:"Guts", f:parse_Guts }, +0x0081: { n:"WsBool", f:parse_WsBool }, +0x0082: { n:"GridSet", f:parseuint16 }, +0x0083: { n:"HCenter", f:parsebool }, +0x0084: { n:"VCenter", f:parsebool }, +0x0085: { n:'BoundSheet8', f:parse_BoundSheet8 }, +0x0086: { n:"WriteProtect" }, +0x008c: { n:"Country", f:parse_Country }, +0x008d: { n:"HideObj", f:parseuint16 }, +0x0090: { n:"Sort" }, +0x0092: { n:"Palette", f:parse_Palette }, +0x0097: { n:"Sync" }, +0x0098: { n:"LPr" }, +0x0099: { n:"DxGCol" }, +0x009a: { n:"FnGroupName" }, +0x009b: { n:"FilterMode" }, +0x009c: { n:"BuiltInFnGroupCount", f:parseuint16 }, +0x009d: { n:"AutoFilterInfo" }, +0x009e: { n:"AutoFilter" }, +0x00a0: { n:"Scl", f:parse_Scl }, +0x00a1: { n:"Setup", f:parse_Setup }, +0x00ae: { n:"ScenMan" }, +0x00af: { n:"SCENARIO" }, +0x00b0: { n:"SxView" }, +0x00b1: { n:"Sxvd" }, +0x00b2: { n:"SXVI" }, +0x00b4: { n:"SxIvd" }, +0x00b5: { n:"SXLI" }, +0x00b6: { n:"SXPI" }, +0x00b8: { n:"DocRoute" }, +0x00b9: { n:"RecipName" }, +0x00bd: { n:"MulRk", f:parse_MulRk }, +0x00be: { n:"MulBlank", f:parse_MulBlank }, +0x00c1: { n:'Mms', f:parsenoop2 }, +0x00c5: { n:"SXDI" }, +0x00c6: { n:"SXDB" }, +0x00c7: { n:"SXFDB" }, +0x00c8: { n:"SXDBB" }, +0x00c9: { n:"SXNum" }, +0x00ca: { n:"SxBool", f:parsebool }, +0x00cb: { n:"SxErr" }, +0x00cc: { n:"SXInt" }, +0x00cd: { n:"SXString" }, +0x00ce: { n:"SXDtr" }, +0x00cf: { n:"SxNil" }, +0x00d0: { n:"SXTbl" }, +0x00d1: { n:"SXTBRGIITM" }, +0x00d2: { n:"SxTbpg" }, +0x00d3: { n:"ObProj" }, +0x00d5: { n:"SXStreamID" }, +0x00d7: { n:"DBCell" }, +0x00d8: { n:"SXRng" }, +0x00d9: { n:"SxIsxoper" }, +0x00da: { n:"BookBool", f:parseuint16 }, +0x00dc: { n:"DbOrParamQry" }, +0x00dd: { n:"ScenarioProtect", f:parsebool }, +0x00de: { n:"OleObjectSize" }, +0x00e0: { n:"XF", f:parse_XF }, +0x00e1: { n:'InterfaceHdr', f:parse_InterfaceHdr }, +0x00e2: { n:'InterfaceEnd', f:parsenoop2 }, +0x00e3: { n:"SXVS" }, +0x00e5: { n:"MergeCells", f:parse_MergeCells }, +0x00e9: { n:"BkHim" }, +0x00eb: { n:"MsoDrawingGroup" }, +0x00ec: { n:"MsoDrawing" }, +0x00ed: { n:"MsoDrawingSelection" }, +0x00ef: { n:"PhoneticInfo" }, +0x00f0: { n:"SxRule" }, +0x00f1: { n:"SXEx" }, +0x00f2: { n:"SxFilt" }, +0x00f4: { n:"SxDXF" }, +0x00f5: { n:"SxItm" }, +0x00f6: { n:"SxName" }, +0x00f7: { n:"SxSelect" }, +0x00f8: { n:"SXPair" }, +0x00f9: { n:"SxFmla" }, +0x00fb: { n:"SxFormat" }, +0x00fc: { n:"SST", f:parse_SST }, +0x00fd: { n:"LabelSst", f:parse_LabelSst }, +0x00ff: { n:"ExtSST", f:parse_ExtSST }, +0x0100: { n:"SXVDEx" }, +0x0103: { n:"SXFormula" }, +0x0122: { n:"SXDBEx" }, +0x0137: { n:"RRDInsDel" }, +0x0138: { n:"RRDHead" }, +0x013b: { n:"RRDChgCell" }, +0x013d: { n:"RRTabId", f:parseuint16a }, +0x013e: { n:"RRDRenSheet" }, +0x013f: { n:"RRSort" }, +0x0140: { n:"RRDMove" }, +0x014a: { n:"RRFormat" }, +0x014b: { n:"RRAutoFmt" }, +0x014d: { n:"RRInsertSh" }, +0x014e: { n:"RRDMoveBegin" }, +0x014f: { n:"RRDMoveEnd" }, +0x0150: { n:"RRDInsDelBegin" }, +0x0151: { n:"RRDInsDelEnd" }, +0x0152: { n:"RRDConflict" }, +0x0153: { n:"RRDDefName" }, +0x0154: { n:"RRDRstEtxp" }, +0x015f: { n:"LRng" }, +0x0160: { n:"UsesELFs", f:parsebool }, +0x0161: { n:"DSF", f:parsenoop2 }, +0x0191: { n:"CUsr" }, +0x0192: { n:"CbUsr" }, +0x0193: { n:"UsrInfo" }, +0x0194: { n:"UsrExcl" }, +0x0195: { n:"FileLock" }, +0x0196: { n:"RRDInfo" }, +0x0197: { n:"BCUsrs" }, +0x0198: { n:"UsrChk" }, +0x01a9: { n:"UserBView" }, +0x01aa: { n:"UserSViewBegin" }, +0x01ab: { n:"UserSViewEnd" }, +0x01ac: { n:"RRDUserView" }, +0x01ad: { n:"Qsi" }, +0x01ae: { n:"SupBook", f:parse_SupBook }, +0x01af: { n:"Prot4Rev", f:parsebool }, +0x01b0: { n:"CondFmt" }, +0x01b1: { n:"CF" }, +0x01b2: { n:"DVal" }, +0x01b5: { n:"DConBin" }, +0x01b6: { n:"TxO", f:parse_TxO }, +0x01b7: { n:"RefreshAll", f:parsebool }, +0x01b8: { n:"HLink", f:parse_HLink }, +0x01b9: { n:"Lel" }, +0x01ba: { n:"CodeName", f:parse_XLUnicodeString }, +0x01bb: { n:"SXFDBType" }, +0x01bc: { n:"Prot4RevPass", f:parseuint16 }, +0x01bd: { n:"ObNoMacros" }, +0x01be: { n:"Dv" }, +0x01c0: { n:"Excel9File", f:parsenoop2 }, +0x01c1: { n:"RecalcId", f:parse_RecalcId, r:2}, +0x01c2: { n:"EntExU2", f:parsenoop2 }, +0x0200: { n:"Dimensions", f:parse_Dimensions }, +0x0201: { n:"Blank", f:parse_Blank }, +0x0203: { n:"Number", f:parse_Number }, +0x0204: { n:"Label", f:parse_Label }, +0x0205: { n:"BoolErr", f:parse_BoolErr }, +0x0206: { n:"Formula", f:parse_Formula }, +0x0207: { n:"String", f:parse_String }, +0x0208: { n:'Row', f:parse_Row }, +0x020b: { n:"Index" }, +0x0221: { n:"Array", f:parse_Array }, +0x0225: { n:"DefaultRowHeight", f:parse_DefaultRowHeight }, +0x0236: { n:"Table" }, +0x023e: { n:"Window2", f:parse_Window2 }, +0x027e: { n:"RK", f:parse_RK }, +0x0293: { n:"Style" }, +0x0406: { n:"Formula", f:parse_Formula }, +0x0418: { n:"BigName" }, +0x041e: { n:"Format", f:parse_Format }, +0x043c: { n:"ContinueBigName" }, +0x04bc: { n:"ShrFmla", f:parse_ShrFmla }, +0x0800: { n:"HLinkTooltip", f:parse_HLinkTooltip }, +0x0801: { n:"WebPub" }, +0x0802: { n:"QsiSXTag" }, +0x0803: { n:"DBQueryExt" }, +0x0804: { n:"ExtString" }, +0x0805: { n:"TxtQry" }, +0x0806: { n:"Qsir" }, +0x0807: { n:"Qsif" }, +0x0808: { n:"RRDTQSIF" }, +0x0809: { n:'BOF', f:parse_BOF }, +0x080a: { n:"OleDbConn" }, +0x080b: { n:"WOpt" }, +0x080c: { n:"SXViewEx" }, +0x080d: { n:"SXTH" }, +0x080e: { n:"SXPIEx" }, +0x080f: { n:"SXVDTEx" }, +0x0810: { n:"SXViewEx9" }, +0x0812: { n:"ContinueFrt" }, +0x0813: { n:"RealTimeData" }, +0x0850: { n:"ChartFrtInfo" }, +0x0851: { n:"FrtWrapper" }, +0x0852: { n:"StartBlock" }, +0x0853: { n:"EndBlock" }, +0x0854: { n:"StartObject" }, +0x0855: { n:"EndObject" }, +0x0856: { n:"CatLab" }, +0x0857: { n:"YMult" }, +0x0858: { n:"SXViewLink" }, +0x0859: { n:"PivotChartBits" }, +0x085a: { n:"FrtFontList" }, +0x0862: { n:"SheetExt" }, +0x0863: { n:"BookExt", r:12}, +0x0864: { n:"SXAddl" }, +0x0865: { n:"CrErr" }, +0x0866: { n:"HFPicture" }, +0x0867: { n:'FeatHdr', f:parsenoop2 }, +0x0868: { n:"Feat" }, +0x086a: { n:"DataLabExt" }, +0x086b: { n:"DataLabExtContents" }, +0x086c: { n:"CellWatch" }, +0x0871: { n:"FeatHdr11" }, +0x0872: { n:"Feature11" }, +0x0874: { n:"DropDownObjIds" }, +0x0875: { n:"ContinueFrt11" }, +0x0876: { n:"DConn" }, +0x0877: { n:"List12" }, +0x0878: { n:"Feature12" }, +0x0879: { n:"CondFmt12" }, +0x087a: { n:"CF12" }, +0x087b: { n:"CFEx" }, +0x087c: { n:"XFCRC", f:parse_XFCRC, r:12 }, +0x087d: { n:"XFExt", f:parse_XFExt, r:12 }, +0x087e: { n:"AutoFilter12" }, +0x087f: { n:"ContinueFrt12" }, +0x0884: { n:"MDTInfo" }, +0x0885: { n:"MDXStr" }, +0x0886: { n:"MDXTuple" }, +0x0887: { n:"MDXSet" }, +0x0888: { n:"MDXProp" }, +0x0889: { n:"MDXKPI" }, +0x088a: { n:"MDB" }, +0x088b: { n:"PLV" }, +0x088c: { n:"Compat12", f:parsebool, r:12 }, +0x088d: { n:"DXF" }, +0x088e: { n:"TableStyles", r:12 }, +0x088f: { n:"TableStyle" }, +0x0890: { n:"TableStyleElement" }, +0x0892: { n:"StyleExt" }, +0x0893: { n:"NamePublish" }, +0x0894: { n:"NameCmt", f:parse_NameCmt, r:12 }, +0x0895: { n:"SortData" }, +0x0896: { n:"Theme", f:parse_Theme, r:12 }, +0x0897: { n:"GUIDTypeLib" }, +0x0898: { n:"FnGrp12" }, +0x0899: { n:"NameFnGrp12" }, +0x089a: { n:"MTRSettings", f:parse_MTRSettings, r:12 }, +0x089b: { n:"CompressPictures", f:parsenoop2 }, +0x089c: { n:"HeaderFooter" }, +0x089d: { n:"CrtLayout12" }, +0x089e: { n:"CrtMlFrt" }, +0x089f: { n:"CrtMlFrtContinue" }, +0x08a3: { n:"ForceFullCalculation", f:parse_ForceFullCalculation }, +0x08a4: { n:"ShapePropsStream" }, +0x08a5: { n:"TextPropsStream" }, +0x08a6: { n:"RichTextStream" }, +0x08a7: { n:"CrtLayout12A" }, +0x1001: { n:"Units" }, +0x1002: { n:"Chart" }, +0x1003: { n:"Series" }, +0x1006: { n:"DataFormat" }, +0x1007: { n:"LineFormat" }, +0x1009: { n:"MarkerFormat" }, +0x100a: { n:"AreaFormat" }, +0x100b: { n:"PieFormat" }, +0x100c: { n:"AttachedLabel" }, +0x100d: { n:"SeriesText" }, +0x1014: { n:"ChartFormat" }, +0x1015: { n:"Legend" }, +0x1016: { n:"SeriesList" }, +0x1017: { n:"Bar" }, +0x1018: { n:"Line" }, +0x1019: { n:"Pie" }, +0x101a: { n:"Area" }, +0x101b: { n:"Scatter" }, +0x101c: { n:"CrtLine" }, +0x101d: { n:"Axis" }, +0x101e: { n:"Tick" }, +0x101f: { n:"ValueRange" }, +0x1020: { n:"CatSerRange" }, +0x1021: { n:"AxisLine" }, +0x1022: { n:"CrtLink" }, +0x1024: { n:"DefaultText" }, +0x1025: { n:"Text" }, +0x1026: { n:"FontX", f:parseuint16 }, +0x1027: { n:"ObjectLink" }, +0x1032: { n:"Frame" }, +0x1033: { n:"Begin" }, +0x1034: { n:"End" }, +0x1035: { n:"PlotArea" }, +0x103a: { n:"Chart3d" }, +0x103c: { n:"PicF" }, +0x103d: { n:"DropBar" }, +0x103e: { n:"Radar" }, +0x103f: { n:"Surf" }, +0x1040: { n:"RadarArea" }, +0x1041: { n:"AxisParent" }, +0x1043: { n:"LegendException" }, +0x1044: { n:"ShtProps", f:parse_ShtProps }, +0x1045: { n:"SerToCrt" }, +0x1046: { n:"AxesUsed" }, +0x1048: { n:"SBaseRef" }, +0x104a: { n:"SerParent" }, +0x104b: { n:"SerAuxTrend" }, +0x104e: { n:"IFmtRecord" }, +0x104f: { n:"Pos" }, +0x1050: { n:"AlRuns" }, +0x1051: { n:"BRAI" }, +0x105b: { n:"SerAuxErrBar" }, +0x105c: { n:"ClrtClient", f:parse_ClrtClient }, +0x105d: { n:"SerFmt" }, +0x105f: { n:"Chart3DBarShape" }, +0x1060: { n:"Fbi" }, +0x1061: { n:"BopPop" }, +0x1062: { n:"AxcExt" }, +0x1063: { n:"Dat" }, +0x1064: { n:"PlotGrowth" }, +0x1065: { n:"SIIndex" }, +0x1066: { n:"GelFrame" }, +0x1067: { n:"BopPopCustom" }, +0x1068: { n:"Fbi2" }, + +0x0000: { n:"Dimensions", f:parse_Dimensions }, +0x0002: { n:"BIFF2INT", f:parse_BIFF2INT }, +0x0005: { n:"BoolErr", f:parse_BoolErr }, +0x0007: { n:"String", f:parse_BIFF2STRING }, +0x0008: { n:"BIFF2ROW" }, +0x000b: { n:"Index" }, +0x0016: { n:"ExternCount", f:parseuint16 }, +0x001e: { n:"BIFF2FORMAT", f:parse_BIFF2Format }, +0x001f: { n:"BIFF2FMTCNT" }, /* 16-bit cnt of BIFF2FORMAT records */ +0x0020: { n:"BIFF2COLINFO" }, +0x0021: { n:"Array", f:parse_Array }, +0x0025: { n:"DefaultRowHeight", f:parse_DefaultRowHeight }, +0x0032: { n:"BIFF2FONTXTRA", f:parse_BIFF2FONTXTRA }, +0x0034: { n:"DDEObjName" }, +0x003e: { n:"BIFF2WINDOW2" }, +0x0043: { n:"BIFF2XF" }, +0x0045: { n:"BIFF2FONTCLR" }, +0x0056: { n:"BIFF4FMTCNT" }, /* 16-bit cnt, similar to BIFF2 */ +0x007e: { n:"RK" }, /* Not necessarily same as 0x027e */ +0x007f: { n:"ImData", f:parse_ImData }, +0x0087: { n:"Addin" }, +0x0088: { n:"Edg" }, +0x0089: { n:"Pub" }, +0x0091: { n:"Sub" }, +0x0094: { n:"LHRecord" }, +0x0095: { n:"LHNGraph" }, +0x0096: { n:"Sound" }, +0x00a9: { n:"CoordList" }, +0x00ab: { n:"GCW" }, +0x00bc: { n:"ShrFmla" }, /* Not necessarily same as 0x04bc */ +0x00bf: { n:"ToolbarHdr" }, +0x00c0: { n:"ToolbarEnd" }, +0x00c2: { n:"AddMenu" }, +0x00c3: { n:"DelMenu" }, +0x00d6: { n:"RString", f:parse_RString }, +0x00df: { n:"UDDesc" }, +0x00ea: { n:"TabIdConf" }, +0x0162: { n:"XL5Modify" }, +0x01a5: { n:"FileSharing2" }, +0x0209: { n:'BOF', f:parse_BOF }, +0x0218: { n:"Lbl", f:parse_Lbl }, +0x0223: { n:"ExternName", f:parse_ExternName }, +0x0231: { n:"Font" }, +0x0243: { n:"BIFF3XF" }, +0x0409: { n:'BOF', f:parse_BOF }, +0x0443: { n:"BIFF4XF" }, +0x086d: { n:"FeatInfo" }, +0x0873: { n:"FeatInfo11" }, +0x0881: { n:"SXAddl12" }, +0x08c0: { n:"AutoWebPub" }, +0x08c1: { n:"ListObj" }, +0x08c2: { n:"ListField" }, +0x08c3: { n:"ListDV" }, +0x08c4: { n:"ListCondFmt" }, +0x08c5: { n:"ListCF" }, +0x08c6: { n:"FMQry" }, +0x08c7: { n:"FMSQry" }, +0x08c8: { n:"PLV" }, +0x08c9: { n:"LnExt" }, +0x08ca: { n:"MkrExt" }, +0x08cb: { n:"CrtCoopt" }, +0x08d6: { n:"FRTArchId$", r:12 }, + +0x7262: {} +}; + +var XLSRE = evert_key(XLSRecordEnum, 'n'); +function write_biff_rec(ba, type, payload, length) { + var t = +type || +XLSRE[type]; + if(isNaN(t)) return; + var len = length || (payload||[]).length || 0; + var o = ba.next(4); + o.write_shift(2, t); + o.write_shift(2, len); + if(len > 0 && is_buf(payload)) ba.push(payload); +} + +function write_biff_continue(ba, type, payload, length) { + var len = length || (payload||[]).length || 0; + if(len <= 8224) return write_biff_rec(ba, type, payload, len); + var t = +type || +XLSRE[type]; + if(isNaN(t)) return; + var parts = payload.parts || [], sidx = 0; + var i = 0, w = 0; + while(w + (parts[sidx] || 8224) <= 8224) { w+= (parts[sidx] || 8224); sidx++; } + var o = ba.next(4); + o.write_shift(2, t); + o.write_shift(2, w); + ba.push(payload.slice(i, i + w)); + i += w; + while(i < len) { + o = ba.next(4); + o.write_shift(2, 0x3c); // TODO: figure out correct continue type + w = 0; + while(w + (parts[sidx] || 8224) <= 8224) { w+= (parts[sidx] || 8224); sidx++; } + o.write_shift(2, w); + ba.push(payload.slice(i, i+w)); i+= w; + } +} + +function write_BIFF2Cell(out, r, c) { + if(!out) out = new_buf(7); + out.write_shift(2, r); + out.write_shift(2, c); + out.write_shift(2, 0); + out.write_shift(1, 0); + return out; +} + +function write_BIFF2BERR(r, c, val, t) { + var out = new_buf(9); + write_BIFF2Cell(out, r, c); + if(t == 'e') { out.write_shift(1, val); out.write_shift(1, 1); } + else { out.write_shift(1, val?1:0); out.write_shift(1, 0); } + return out; +} + +/* TODO: codepage, large strings */ +function write_BIFF2LABEL(r, c, val) { + var out = new_buf(8 + 2*val.length); + write_BIFF2Cell(out, r, c); + out.write_shift(1, val.length); + out.write_shift(val.length, val, 'sbcs'); + return out.l < out.length ? out.slice(0, out.l) : out; +} + +function write_ws_biff2_cell(ba, cell, R, C) { + if(cell.v != null) switch(cell.t) { + case 'd': case 'n': + var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v; + if((v == (v|0)) && (v >= 0) && (v < 65536)) + write_biff_rec(ba, 0x0002, write_BIFF2INT(R, C, v)); + else + write_biff_rec(ba, 0x0003, write_BIFF2NUM(R,C, v)); + return; + case 'b': case 'e': write_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, cell.v, cell.t)); return; + /* TODO: codepage, sst */ + case 's': case 'str': + write_biff_rec(ba, 0x0004, write_BIFF2LABEL(R, C, cell.v)); + return; + } + write_biff_rec(ba, 0x0001, write_BIFF2Cell(null, R, C)); +} + +function write_ws_biff2(ba, ws, idx, opts) { + var dense = Array.isArray(ws); + var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols = []; + if(range.e.c > 0xFF || range.e.r > 0x3FFF) { + if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384"); + range.e.c = Math.min(range.e.c, 0xFF); + range.e.r = Math.min(range.e.c, 0x3FFF); + ref = encode_range(range); + } + for(var R = range.s.r; R <= range.e.r; ++R) { + rr = encode_row(R); + for(var C = range.s.c; C <= range.e.c; ++C) { + if(R === range.s.r) cols[C] = encode_col(C); + ref = cols[C] + rr; + var cell = dense ? (ws[R]||[])[C] : ws[ref]; + if(!cell) continue; + /* write cell */ + write_ws_biff2_cell(ba, cell, R, C, opts); + } + } +} + +/* Based on test files */ +function write_biff2_buf(wb, opts) { + var o = opts || {}; + if(DENSE != null && o.dense == null) o.dense = DENSE; + var ba = buf_array(); + var idx = 0; + for(var i=0;i 0xFF || range.e.r >= MAX_ROWS) { + if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384"); + range.e.c = Math.min(range.e.c, 0xFF); + range.e.r = Math.min(range.e.c, MAX_ROWS-1); + } + + write_biff_rec(ba, 0x0809, write_BOF(wb, 0x10, opts)); + /* [Uncalced] Index */ + write_biff_rec(ba, "CalcMode", writeuint16(1)); + write_biff_rec(ba, "CalcCount", writeuint16(100)); + write_biff_rec(ba, "CalcRefMode", writebool(true)); + write_biff_rec(ba, "CalcIter", writebool(false)); + write_biff_rec(ba, "CalcDelta", write_Xnum(0.001)); + write_biff_rec(ba, "CalcSaveRecalc", writebool(true)); + write_biff_rec(ba, "PrintRowCol", writebool(false)); + write_biff_rec(ba, "PrintGrid", writebool(false)); + write_biff_rec(ba, "GridSet", writeuint16(1)); + write_biff_rec(ba, "Guts", write_Guts([0,0])); + /* DefaultRowHeight WsBool [Sync] [LPr] [HorizontalPageBreaks] [VerticalPageBreaks] */ + /* Header (string) */ + /* Footer (string) */ + write_biff_rec(ba, "HCenter", writebool(false)); + write_biff_rec(ba, "VCenter", writebool(false)); + /* ... */ + write_biff_rec(ba, 0x200, write_Dimensions(range, opts)); + /* ... */ + + if(b8) ws['!links'] = []; + for(var R = range.s.r; R <= range.e.r; ++R) { + rr = encode_row(R); + for(var C = range.s.c; C <= range.e.c; ++C) { + if(R === range.s.r) cols[C] = encode_col(C); + ref = cols[C] + rr; + var cell = dense ? (ws[R]||[])[C] : ws[ref]; + if(!cell) continue; + /* write cell */ + write_ws_biff8_cell(ba, cell, R, C, opts); + if(b8 && cell.l) ws['!links'].push([ref, cell.l]); + } + } + var cname = _sheet.CodeName || _sheet.name || s; + /* ... */ + if(b8 && _WB.Views) write_biff_rec(ba, "Window2", write_Window2(_WB.Views[0])); + /* ... */ + if(b8 && (ws['!merges']||[]).length) write_biff_rec(ba, "MergeCells", write_MergeCells(ws['!merges'])); + /* [LRng] *QUERYTABLE [PHONETICINFO] CONDFMTS */ + if(b8) write_ws_biff8_hlinks(ba, ws); + /* [DVAL] */ + write_biff_rec(ba, "CodeName", write_XLUnicodeString(cname, opts)); + /* *WebPub *CellWatch [SheetExt] */ + if(b8) write_FEAT(ba, ws); + /* *FEAT11 *RECORD12 */ + write_biff_rec(ba, "EOF"); + return ba.end(); +} + +/* [MS-XLS] 2.1.7.20.3 */ +function write_biff8_global(wb, bufs, opts) { + var A = buf_array(); + var _WB = ((wb||{}).Workbook||{}); + var _sheets = (_WB.Sheets||[]); + var _wb = _WB.WBProps||{}; + var b8 = opts.biff == 8, b5 = opts.biff == 5; + write_biff_rec(A, 0x0809, write_BOF(wb, 0x05, opts)); + if(opts.bookType == "xla") write_biff_rec(A, "Addin"); + write_biff_rec(A, "InterfaceHdr", b8 ? writeuint16(0x04b0) : null); + write_biff_rec(A, "Mms", writezeroes(2)); + if(b5) write_biff_rec(A, "ToolbarHdr"); + if(b5) write_biff_rec(A, "ToolbarEnd"); + write_biff_rec(A, "InterfaceEnd"); + write_biff_rec(A, "WriteAccess", write_WriteAccess("SheetJS", opts)); + /* [FileSharing] */ + write_biff_rec(A, "CodePage", writeuint16(b8 ? 0x04b0 : 0x04E4)); + /* *2047 Lel */ + if(b8) write_biff_rec(A, "DSF", writeuint16(0)); + if(b8) write_biff_rec(A, "Excel9File"); + write_biff_rec(A, "RRTabId", write_RRTabId(wb.SheetNames.length)); + if(b8 && wb.vbaraw) write_biff_rec(A, "ObProj"); + /* [ObNoMacros] */ + if(b8 && wb.vbaraw) { + var cname = _wb.CodeName || "ThisWorkbook"; + write_biff_rec(A, "CodeName", write_XLUnicodeString(cname, opts)); + } + write_biff_rec(A, "BuiltInFnGroupCount", writeuint16(0x11)); + /* *FnGroupName *FnGrp12 */ + /* *Lbl */ + /* [OleObjectSize] */ + write_biff_rec(A, "WinProtect", writebool(false)); + write_biff_rec(A, "Protect", writebool(false)); + write_biff_rec(A, "Password", writeuint16(0)); + if(b8) write_biff_rec(A, "Prot4Rev", writebool(false)); + if(b8) write_biff_rec(A, "Prot4RevPass", writeuint16(0)); + write_biff_rec(A, "Window1", write_Window1(opts)); + write_biff_rec(A, "Backup", writebool(false)); + write_biff_rec(A, "HideObj", writeuint16(0)); + write_biff_rec(A, "Date1904", writebool(safe1904(wb)=="true")); + write_biff_rec(A, "CalcPrecision", writebool(true)); + if(b8) write_biff_rec(A, "RefreshAll", writebool(false)); + write_biff_rec(A, "BookBool", writeuint16(0)); + /* ... */ + write_FONTS_biff8(A, wb, opts); + write_FMTS_biff8(A, wb.SSF, opts); + write_CELLXFS_biff8(A, opts); + /* ... */ + if(b8) write_biff_rec(A, "UsesELFs", writebool(false)); + var a = A.end(); + + var C = buf_array(); + /* METADATA [MTRSettings] [ForceFullCalculation] */ + if(b8) write_biff_rec(C, "Country", write_Country()); + /* *SUPBOOK *LBL *RTD [RecalcId] *HFPicture *MSODRAWINGGROUP */ + + /* BIFF8: [SST *Continue] ExtSST */ + if(b8 && opts.Strings) write_biff_continue(C, "SST", write_SST(opts.Strings, opts)); + + /* *WebPub [WOpt] [CrErr] [BookExt] *FeatHdr *DConn [THEME] [CompressPictures] [Compat12] [GUIDTypeLib] */ + write_biff_rec(C, "EOF"); + var c = C.end(); + + var B = buf_array(); + var blen = 0, j = 0; + for(j = 0; j < wb.SheetNames.length; ++j) blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length; + var start = a.length + blen + c.length; + for(j = 0; j < wb.SheetNames.length; ++j) { + var _sheet = _sheets[j] || ({}); + write_biff_rec(B, "BoundSheet8", write_BoundSheet8({pos:start, hs:_sheet.Hidden||0, dt:0, name:wb.SheetNames[j]}, opts)); + start += bufs[j].length; + } + /* 1*BoundSheet8 */ + var b = B.end(); + if(blen != b.length) throw new Error("BS8 " + blen + " != " + b.length); + + var out = []; + if(a.length) out.push(a); + if(b.length) out.push(b); + if(c.length) out.push(c); + return __toBuffer([out]); +} + +/* [MS-XLS] 2.1.7.20 Workbook Stream */ +function write_biff8_buf(wb, opts) { + var o = opts || {}; + var bufs = []; + + if(wb && !wb.SSF) { + wb.SSF = SSF.get_table(); + } + if(wb && wb.SSF) { + make_ssf(SSF); SSF.load_table(wb.SSF); + // $FlowIgnore + o.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0; + o.ssf = wb.SSF; + } + + o.Strings = []; o.Strings.Count = 0; o.Strings.Unique = 0; + fix_write_opts(o); + + o.cellXfs = []; + get_cell_style(o.cellXfs, {}, {revssf:{"General":0}}); + + if(!wb.Props) wb.Props = {}; + + for(var i = 0; i < wb.SheetNames.length; ++i) bufs[bufs.length] = write_ws_biff8(i, o, wb); + bufs.unshift(write_biff8_global(wb, bufs, o)); + return __toBuffer([bufs]); +} + +function write_biff_buf(wb, opts) { + var o = opts || {}; + switch(o.biff || 2) { + case 8: case 5: return write_biff8_buf(wb, opts); + case 4: case 3: case 2: return write_biff2_buf(wb, opts); + } + throw new Error("invalid type " + o.bookType + " for BIFF"); +} +/* note: browser DOM element cannot see mso- style attrs, must parse */ +var HTML_ = (function() { + function html_to_sheet(str, _opts) { + var opts = _opts || {}; + if(DENSE != null && opts.dense == null) opts.dense = DENSE; + var ws = opts.dense ? ([]) : ({}); + str = str.replace(//g, ""); + var mtch = str.match(/"); + var mtch2 = str.match(/<\/table/i); + var i = mtch.index, j = mtch2 && mtch2.index || str.length; + var rows = split_regex(str.slice(i, j), /(:?]*>)/i, ""); + var R = -1, C = 0, RS = 0, CS = 0; + var range = {s:{r:10000000, c:10000000},e:{r:0,c:0}}; + var merges = []; + for(i = 0; i < rows.length; ++i) { + var row = rows[i].trim(); + var hd = row.slice(0,3).toLowerCase(); + if(hd == "/i); + for(j = 0; j < cells.length; ++j) { + var cell = cells[j].trim(); + if(!cell.match(/")) > -1) m = m.slice(cc+1); + for(var midx = 0; midx < merges.length; ++midx) { + var _merge = merges[midx]; + if(_merge.s.c == C && _merge.s.r < R && R <= _merge.e.r) { C = _merge.e.c + 1; midx = -1; } + } + var tag = parsexmltag(cell.slice(0, cell.indexOf(">"))); + CS = tag.colspan ? +tag.colspan : 1; + if((RS = +tag.rowspan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}}); + var _t = tag.t || ""; + /* TODO: generate stub cells */ + if(!m.length) { C += CS; continue; } + m = htmldecode(m); + if(range.s.r > R) range.s.r = R; if(range.e.r < R) range.e.r = R; + if(range.s.c > C) range.s.c = C; if(range.e.c < C) range.e.c = C; + if(!m.length) continue; + var o = {t:'s', v:m}; + if(opts.raw || !m.trim().length || _t == 's'){} + else if(m === 'TRUE') o = {t:'b', v:true}; + else if(m === 'FALSE') o = {t:'b', v:false}; + else if(!isNaN(fuzzynum(m))) o = {t:'n', v:fuzzynum(m)}; + else if(!isNaN(fuzzydate(m).getDate())) { + o = ({t:'d', v:parseDate(m)}); + if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}); + o.z = opts.dateNF || SSF._table[14]; + } + if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; } + else ws[encode_cell({r:R, c:C})] = o; + C += CS; + } + } + ws['!ref'] = encode_range(range); + if(merges.length) ws["!merges"] = merges; + return ws; + } + function html_to_book(str, opts) { + return sheet_to_workbook(html_to_sheet(str, opts), opts); + } + function make_html_row(ws, r, R, o) { + var M = (ws['!merges'] ||[]); + var oo = []; + for(var C = r.s.c; C <= r.e.c; ++C) { + var RS = 0, CS = 0; + for(var j = 0; j < M.length; ++j) { + if(M[j].s.r > R || M[j].s.c > C) continue; + if(M[j].e.r < R || M[j].e.c < C) continue; + if(M[j].s.r < R || M[j].s.c < C) { RS = -1; break; } + RS = M[j].e.r - M[j].s.r + 1; CS = M[j].e.c - M[j].s.c + 1; break; + } + if(RS < 0) continue; + var coord = encode_cell({r:R,c:C}); + var cell = o.dense ? (ws[R]||[])[C] : ws[coord]; + /* TODO: html entities */ + var w = (cell && cell.v != null) && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) || "")) || ""; + var sp = ({}); + if(RS > 1) sp.rowspan = RS; + if(CS > 1) sp.colspan = CS; + sp.t = cell && cell.t || 'z'; + if(o.editable) w = '' + w + ''; + sp.id = (o.id || "sjs") + "-" + coord; + if(sp.t != "z") { sp.v = cell.v; if(cell.z != null) sp.z = cell.z; } + oo.push(writextag('td', w, sp)); + } + var preamble = ""; + return preamble + oo.join("") + ""; + } + function make_html_preamble(ws, R, o) { + var out = []; + return out.join("") + ''; + } + var _BEGIN = 'SheetJS Table Export'; + var _END = ''; + function sheet_to_html(ws, opts/*, wb:?Workbook*/) { + var o = opts || {}; + var header = o.header != null ? o.header : _BEGIN; + var footer = o.footer != null ? o.footer : _END; + var out = [header]; + var r = decode_range(ws['!ref']); + o.dense = Array.isArray(ws); + out.push(make_html_preamble(ws, r, o)); + for(var R = r.s.r; R <= r.e.r; ++R) out.push(make_html_row(ws, r, R, o)); + out.push("
" + footer); + return out.join(""); + + } + return { + to_workbook: html_to_book, + to_sheet: html_to_sheet, + _row: make_html_row, + BEGIN: _BEGIN, + END: _END, + _preamble: make_html_preamble, + from_sheet: sheet_to_html + }; +})(); + +function sheet_add_dom(ws, table, _opts) { + var opts = _opts || {}; + if(DENSE != null) opts.dense = DENSE; + var or_R = 0, or_C = 0; + if(opts.origin != null) { + if(typeof opts.origin == 'number') or_R = opts.origin; + else { + var _origin = typeof opts.origin == "string" ? decode_cell(opts.origin) : opts.origin; + or_R = _origin.r; or_C = _origin.c; + } + } + var rows = table.getElementsByTagName('tr'); + var sheetRows = Math.min(opts.sheetRows||10000000, rows.length); + var range = {s:{r:0,c:0},e:{r:or_R,c:or_C}}; + if(ws["!ref"]) { + var _range = decode_range(ws["!ref"]); + range.s.r = Math.min(range.s.r, _range.s.r); + range.s.c = Math.min(range.s.c, _range.s.c); + range.e.r = Math.max(range.e.r, _range.e.r); + range.e.c = Math.max(range.e.c, _range.e.c); + if(or_R == -1) range.e.r = or_R = _range.e.r + 1; + } + var merges = [], midx = 0; + var rowinfo = ws["!rows"] || (ws["!rows"] = []); + var _R = 0, R = 0, _C = 0, C = 0, RS = 0, CS = 0; + if(!ws["!cols"]) ws['!cols'] = []; + for(; _R < rows.length && R < sheetRows; ++_R) { + var row = rows[_R]; + if (is_dom_element_hidden(row)) { + if (opts.display) continue; + rowinfo[R] = {hidden: true}; + } + var elts = (row.children); + for(_C = C = 0; _C < elts.length; ++_C) { + var elt = elts[_C]; + if (opts.display && is_dom_element_hidden(elt)) continue; + var v = elt.hasAttribute('v') ? elt.getAttribute('v') : htmldecode(elt.innerHTML); + var z = elt.getAttribute('z'); + for(midx = 0; midx < merges.length; ++midx) { + var m = merges[midx]; + if(m.s.c == C + or_C && m.s.r < R + or_R && R + or_R <= m.e.r) { C = m.e.c+1 - or_C; midx = -1; } + } + /* TODO: figure out how to extract nonstandard mso- style */ + CS = +elt.getAttribute("colspan") || 1; + if( ((RS = (+elt.getAttribute("rowspan") || 1)))>1 || CS>1) merges.push({s:{r:R + or_R,c:C + or_C},e:{r:R + or_R + (RS||1) - 1, c:C + or_C + (CS||1) - 1}}); + var o = {t:'s', v:v}; + var _t = elt.getAttribute("t") || ""; + if(v != null) { + if(v.length == 0) o.t = _t || 'z'; + else if(opts.raw || v.trim().length == 0 || _t == "s"){} + else if(v === 'TRUE') o = {t:'b', v:true}; + else if(v === 'FALSE') o = {t:'b', v:false}; + else if(!isNaN(fuzzynum(v))) o = {t:'n', v:fuzzynum(v)}; + else if(!isNaN(fuzzydate(v).getDate())) { + o = ({t:'d', v:parseDate(v)}); + if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}); + o.z = opts.dateNF || SSF._table[14]; + } + } + if(o.z === undefined && z != null) o.z = z; + if(opts.dense) { if(!ws[R + or_R]) ws[R + or_R] = []; ws[R + or_R][C + or_C] = o; } + else ws[encode_cell({c:C + or_C, r:R + or_R})] = o; + if(range.e.c < C + or_C) range.e.c = C + or_C; + C += CS; + } + ++R; + } + if(merges.length) ws['!merges'] = (ws["!merges"] || []).concat(merges); + range.e.r = Math.max(range.e.r, R - 1 + or_R); + ws['!ref'] = encode_range(range); + if(R >= sheetRows) ws['!fullref'] = encode_range((range.e.r = rows.length-_R+R-1 + or_R,range)); // We can count the real number of rows to parse but we don't to improve the performance + return ws; +} + +function parse_dom_table(table, _opts) { + var opts = _opts || {}; + var ws = opts.dense ? ([]) : ({}); + return sheet_add_dom(ws, table, _opts); +} + +function table_to_book(table, opts) { + return sheet_to_workbook(parse_dom_table(table, opts), opts); +} + +function is_dom_element_hidden(element) { + var display = ''; + var get_computed_style = get_get_computed_style_function(element); + if(get_computed_style) display = get_computed_style(element).getPropertyValue('display'); + if(!display) display = element.style.display; // Fallback for cases when getComputedStyle is not available (e.g. an old browser or some Node.js environments) or doesn't work (e.g. if the element is not inserted to a document) + return display === 'none'; +} + +/* global getComputedStyle */ +function get_get_computed_style_function(element) { + // The proper getComputedStyle implementation is the one defined in the element window + if(element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === 'function') return element.ownerDocument.defaultView.getComputedStyle; + // If it is not available, try to get one from the global namespace + if(typeof getComputedStyle === 'function') return getComputedStyle; + return null; +} +/* OpenDocument */ +var parse_content_xml = (function() { + + var parse_text_p = function(text) { + /* 6.1.2 White Space Characters */ + var fixed = text + .replace(/[\t\r\n]/g, " ").trim().replace(/ +/g, " ") + .replace(//g," ") + .replace(//g, function($$,$1) { return Array(parseInt($1,10)+1).join(" "); }) + .replace(/]*\/>/g,"\t") + .replace(//g,"\n"); + var v = unescapexml(fixed.replace(/<[^>]*>/g,"")); + + return [v]; + }; + + var number_formats = { + /* ods name: [short ssf fmt, long ssf fmt] */ + day: ["d", "dd"], + month: ["m", "mm"], + year: ["y", "yy"], + hours: ["h", "hh"], + minutes: ["m", "mm"], + seconds: ["s", "ss"], + "am-pm": ["A/P", "AM/PM"], + "day-of-week": ["ddd", "dddd"], + era: ["e", "ee"], + /* there is no native representation of LO "Q" format */ + quarter: ["\\Qm", "m\\\"th quarter\""] + }; + + return function pcx(d, _opts) { + var opts = _opts || {}; + if(DENSE != null && opts.dense == null) opts.dense = DENSE; + var str = xlml_normalize(d); + var state = [], tmp; + var tag; + var NFtag = {name:""}, NF = "", pidx = 0; + var sheetag; + var rowtag; + var Sheets = {}, SheetNames = []; + var ws = opts.dense ? ([]) : ({}); + var Rn, q; + var ctag = ({value:""}); + var textp = "", textpidx = 0, textptag; + var textR = []; + var R = -1, C = -1, range = {s: {r:1000000,c:10000000}, e: {r:0, c:0}}; + var row_ol = 0; + var number_format_map = {}; + var merges = [], mrange = {}, mR = 0, mC = 0; + var rowinfo = [], rowpeat = 1, colpeat = 1; + var arrayf = []; + var WB = {Names:[]}; + var atag = ({}); + var _Ref = ["", ""]; + var comments = [], comment = ({}); + var creator = "", creatoridx = 0; + var isstub = false, intable = false; + var i = 0; + xlmlregex.lastIndex = 0; + str = str.replace(//mg,"").replace(//gm,""); + while((Rn = xlmlregex.exec(str))) switch((Rn[3]=Rn[3].replace(/_.*$/,""))) { + + case 'table': case '工作表': // 9.1.2 + if(Rn[1]==='/') { + if(range.e.c >= range.s.c && range.e.r >= range.s.r) ws['!ref'] = encode_range(range); + if(opts.sheetRows > 0 && opts.sheetRows <= range.e.r) { + ws['!fullref'] = ws['!ref']; + range.e.r = opts.sheetRows - 1; + ws['!ref'] = encode_range(range); + } + if(merges.length) ws['!merges'] = merges; + if(rowinfo.length) ws["!rows"] = rowinfo; + sheetag.name = sheetag['名称'] || sheetag.name; + if(typeof JSON !== 'undefined') JSON.stringify(sheetag); + SheetNames.push(sheetag.name); + Sheets[sheetag.name] = ws; + intable = false; + } + else if(Rn[0].charAt(Rn[0].length-2) !== '/') { + sheetag = parsexmltag(Rn[0], false); + R = C = -1; + range.s.r = range.s.c = 10000000; range.e.r = range.e.c = 0; + ws = opts.dense ? ([]) : ({}); merges = []; + rowinfo = []; + intable = true; + } + break; + + case 'table-row-group': // 9.1.9 + if(Rn[1] === "/") --row_ol; else ++row_ol; + break; + case 'table-row': case '行': // 9.1.3 + if(Rn[1] === '/') { R+=rowpeat; rowpeat = 1; break; } + rowtag = parsexmltag(Rn[0], false); + if(rowtag['行号']) R = rowtag['行号'] - 1; else if(R == -1) R = 0; + rowpeat = +rowtag['number-rows-repeated'] || 1; + /* TODO: remove magic */ + if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol}; + C = -1; break; + case 'covered-table-cell': // 9.1.5 + if(Rn[1] !== '/') ++C; + if(opts.sheetStubs) { + if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = {t:'z'}; } + else ws[encode_cell({r:R,c:C})] = {t:'z'}; + } + textp = ""; textR = []; + break; /* stub */ + case 'table-cell': case '数据': + if(Rn[0].charAt(Rn[0].length-2) === '/') { + ++C; + ctag = parsexmltag(Rn[0], false); + colpeat = parseInt(ctag['number-columns-repeated']||"1", 10); + q = ({t:'z', v:null}); + if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula)); + if((ctag['数据类型'] || ctag['value-type']) == "string") { + q.t = "s"; q.v = unescapexml(ctag['string-value'] || ""); + if(opts.dense) { + if(!ws[R]) ws[R] = []; + ws[R][C] = q; + } else { + ws[encode_cell({r:R,c:C})] = q; + } + } + C+= colpeat-1; + } else if(Rn[1]!=='/') { + ++C; + colpeat = 1; + var rptR = rowpeat ? R + rowpeat - 1 : R; + if(C > range.e.c) range.e.c = C; + if(C < range.s.c) range.s.c = C; + if(R < range.s.r) range.s.r = R; + if(rptR > range.e.r) range.e.r = rptR; + ctag = parsexmltag(Rn[0], false); + comments = []; comment = ({}); + q = ({t:ctag['数据类型'] || ctag['value-type'], v:null}); + if(opts.cellFormula) { + if(ctag.formula) ctag.formula = unescapexml(ctag.formula); + if(ctag['number-matrix-columns-spanned'] && ctag['number-matrix-rows-spanned']) { + mR = parseInt(ctag['number-matrix-rows-spanned'],10) || 0; + mC = parseInt(ctag['number-matrix-columns-spanned'],10) || 0; + mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}}; + q.F = encode_range(mrange); + arrayf.push([mrange, q.F]); + } + if(ctag.formula) q.f = ods_to_csf_formula(ctag.formula); + else for(i = 0; i < arrayf.length; ++i) + if(R >= arrayf[i][0].s.r && R <= arrayf[i][0].e.r) + if(C >= arrayf[i][0].s.c && C <= arrayf[i][0].e.c) + q.F = arrayf[i][1]; + } + if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) { + mR = parseInt(ctag['number-rows-spanned'],10) || 0; + mC = parseInt(ctag['number-columns-spanned'],10) || 0; + mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}}; + merges.push(mrange); + } + + /* 19.675.2 table:number-columns-repeated */ + if(ctag['number-columns-repeated']) colpeat = parseInt(ctag['number-columns-repeated'], 10); + + /* 19.385 office:value-type */ + switch(q.t) { + case 'boolean': q.t = 'b'; q.v = parsexmlbool(ctag['boolean-value']); break; + case 'float': q.t = 'n'; q.v = parseFloat(ctag.value); break; + case 'percentage': q.t = 'n'; q.v = parseFloat(ctag.value); break; + case 'currency': q.t = 'n'; q.v = parseFloat(ctag.value); break; + case 'date': q.t = 'd'; q.v = parseDate(ctag['date-value']); + if(!opts.cellDates) { q.t = 'n'; q.v = datenum(q.v); } + q.z = 'm/d/yy'; break; + case 'time': q.t = 'n'; q.v = parse_isodur(ctag['time-value'])/86400; break; + case 'number': q.t = 'n'; q.v = parseFloat(ctag['数据数值']); break; + default: + if(q.t === 'string' || q.t === 'text' || !q.t) { + q.t = 's'; + if(ctag['string-value'] != null) { textp = unescapexml(ctag['string-value']); textR = []; } + } else throw new Error('Unsupported value type ' + q.t); + } + } else { + isstub = false; + if(q.t === 's') { + q.v = textp || ''; + if(textR.length) q.R = textR; + isstub = textpidx == 0; + } + if(atag.Target) q.l = atag; + if(comments.length > 0) { q.c = comments; comments = []; } + if(textp && opts.cellText !== false) q.w = textp; + if(isstub) { q.t = "z"; delete q.v; } + if(!isstub || opts.sheetStubs) { + if(!(opts.sheetRows && opts.sheetRows <= R)) { + for(var rpt = 0; rpt < rowpeat; ++rpt) { + colpeat = parseInt(ctag['number-columns-repeated']||"1", 10); + if(opts.dense) { + if(!ws[R + rpt]) ws[R + rpt] = []; + ws[R + rpt][C] = rpt == 0 ? q : dup(q); + while(--colpeat > 0) ws[R + rpt][C + colpeat] = dup(q); + } else { + ws[encode_cell({r:R + rpt,c:C})] = q; + while(--colpeat > 0) ws[encode_cell({r:R + rpt,c:C + colpeat})] = dup(q); + } + if(range.e.c <= C) range.e.c = C; + } + } + } + colpeat = parseInt(ctag['number-columns-repeated']||"1", 10); + C += colpeat-1; colpeat = 0; + q = {}; + textp = ""; textR = []; + } + atag = ({}); + break; // 9.1.4 + + /* pure state */ + case 'document': // TODO: is the root for FODS + case 'document-content': case '电子表格文档': // 3.1.3.2 + case 'spreadsheet': case '主体': // 3.7 + case 'scripts': // 3.12 + case 'styles': // TODO + case 'font-face-decls': // 3.14 + if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;} + else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]); + break; + + case 'annotation': // 14.1 + if(Rn[1]==='/'){ + if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp; + comment.t = textp; + if(textR.length) comment.R = textR; + comment.a = creator; + comments.push(comment); + } + else if(Rn[0].charAt(Rn[0].length-2) !== '/') {state.push([Rn[3], false]);} + creator = ""; creatoridx = 0; + textp = ""; textpidx = 0; textR = []; + break; + + case 'creator': // 4.3.2.7 + if(Rn[1]==='/') { creator = str.slice(creatoridx,Rn.index); } + else creatoridx = Rn.index + Rn[0].length; + break; + + /* ignore state */ + case 'meta': case '元数据': // TODO: FODS/UOF + case 'settings': // TODO: + case 'config-item-set': // TODO: + case 'config-item-map-indexed': // TODO: + case 'config-item-map-entry': // TODO: + case 'config-item-map-named': // TODO: + case 'shapes': // 9.2.8 + case 'frame': // 10.4.2 + case 'text-box': // 10.4.3 + case 'image': // 10.4.4 + case 'data-pilot-tables': // 9.6.2 + case 'list-style': // 16.30 + case 'form': // 13.13 + case 'dde-links': // 9.8 + case 'event-listeners': // TODO + case 'chart': // TODO + if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;} + else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], false]); + textp = ""; textpidx = 0; textR = []; + break; + + case 'scientific-number': // TODO: + break; + case 'currency-symbol': // TODO: + break; + case 'currency-style': // TODO: + break; + case 'number-style': // 16.27.2 + case 'percentage-style': // 16.27.9 + case 'date-style': // 16.27.10 + case 'time-style': // 16.27.18 + if(Rn[1]==='/'){ + number_format_map[NFtag.name] = NF; + if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp; + } else if(Rn[0].charAt(Rn[0].length-2) !== '/') { + NF = ""; + NFtag = parsexmltag(Rn[0], false); + state.push([Rn[3], true]); + } break; + + case 'script': break; // 3.13 + case 'libraries': break; // TODO: + case 'automatic-styles': break; // 3.15.3 + case 'master-styles': break; // TODO: + + case 'default-style': // TODO: + case 'page-layout': break; // TODO: + case 'style': // 16.2 + break; + case 'map': break; // 16.3 + case 'font-face': break; // 16.21 + + case 'paragraph-properties': break; // 17.6 + case 'table-properties': break; // 17.15 + case 'table-column-properties': break; // 17.16 + case 'table-row-properties': break; // 17.17 + case 'table-cell-properties': break; // 17.18 + + case 'number': // 16.27.3 + switch(state[state.length-1][0]) { + case 'time-style': + case 'date-style': + tag = parsexmltag(Rn[0], false); + NF += number_formats[Rn[3]][tag.style==='long'?1:0]; break; + } break; + + case 'fraction': break; // TODO 16.27.6 + + case 'day': // 16.27.11 + case 'month': // 16.27.12 + case 'year': // 16.27.13 + case 'era': // 16.27.14 + case 'day-of-week': // 16.27.15 + case 'week-of-year': // 16.27.16 + case 'quarter': // 16.27.17 + case 'hours': // 16.27.19 + case 'minutes': // 16.27.20 + case 'seconds': // 16.27.21 + case 'am-pm': // 16.27.22 + switch(state[state.length-1][0]) { + case 'time-style': + case 'date-style': + tag = parsexmltag(Rn[0], false); + NF += number_formats[Rn[3]][tag.style==='long'?1:0]; break; + } break; + + case 'boolean-style': break; // 16.27.23 + case 'boolean': break; // 16.27.24 + case 'text-style': break; // 16.27.25 + case 'text': // 16.27.26 + if(Rn[0].slice(-2) === "/>") break; + else if(Rn[1]==="/") switch(state[state.length-1][0]) { + case 'number-style': + case 'date-style': + case 'time-style': + NF += str.slice(pidx, Rn.index); + break; + } + else pidx = Rn.index + Rn[0].length; + break; + + case 'named-range': // 9.4.12 + tag = parsexmltag(Rn[0], false); + _Ref = ods_to_csf_3D(tag['cell-range-address']); + var nrange = ({Name:tag.name, Ref:_Ref[0] + '!' + _Ref[1]}); + if(intable) nrange.Sheet = SheetNames.length; + WB.Names.push(nrange); + break; + + case 'text-content': break; // 16.27.27 + case 'text-properties': break; // 16.27.27 + case 'embedded-text': break; // 16.27.4 + + case 'body': case '电子表格': break; // 3.3 16.9.6 19.726.3 + + case 'forms': break; // 12.25.2 13.2 + case 'table-column': break; // 9.1.6 + case 'table-header-rows': break; // 9.1.7 + case 'table-rows': break; // 9.1.12 + /* TODO: outline levels */ + case 'table-column-group': break; // 9.1.10 + case 'table-header-columns': break; // 9.1.11 + case 'table-columns': break; // 9.1.12 + + case 'null-date': break; // 9.4.2 TODO: date1904 + + case 'graphic-properties': break; // 17.21 + case 'calculation-settings': break; // 9.4.1 + case 'named-expressions': break; // 9.4.11 + case 'label-range': break; // 9.4.9 + case 'label-ranges': break; // 9.4.10 + case 'named-expression': break; // 9.4.13 + case 'sort': break; // 9.4.19 + case 'sort-by': break; // 9.4.20 + case 'sort-groups': break; // 9.4.22 + + case 'tab': break; // 6.1.4 + case 'line-break': break; // 6.1.5 + case 'span': break; // 6.1.7 + case 'p': case '文本串': // 5.1.3 + if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) { + var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag); + textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0]; + } else { textptag = parsexmltag(Rn[0], false); textpidx = Rn.index + Rn[0].length; } + break; // + case 's': break; // + + case 'database-range': // 9.4.15 + if(Rn[1]==='/') break; + try { + _Ref = ods_to_csf_3D(parsexmltag(Rn[0])['target-range-address']); + Sheets[_Ref[0]]['!autofilter'] = { ref:_Ref[1] }; + } catch(e) {/* empty */} + break; + + case 'date': break; // <*:date> + + case 'object': break; // 10.4.6.2 + case 'title': case '标题': break; // <*:title> OR + case 'desc': break; // <*:desc> + case 'binary-data': break; // 10.4.5 TODO: b64 blob + + /* 9.2 Advanced Tables */ + case 'table-source': break; // 9.2.6 + case 'scenario': break; // 9.2.6 + + case 'iteration': break; // 9.4.3 + case 'content-validations': break; // 9.4.4 + case 'filter': break; // 9.5.2 + case 'filter-and': break; // 9.5.3 + case 'filter-or': break; // 9.5.4 + case 'filter-condition': break; // 9.5.5 + + case 'list-level-style-bullet': break; // 16.31 + case 'page-count': break; // TODO + case 'time': break; // TODO + + /* 9.3 Advanced Table Cells */ + case 'cell-range-source': break; // 9.3.1 + case 'property': break; // 13.8 + + case 'a': // 6.1.8 hyperlink + if(Rn[1]!== '/') { + atag = parsexmltag(Rn[0], false); + if(!atag.href) break; + atag.Target = atag.href; delete atag.href; + if(atag.Target.charAt(0) == "#" && atag.Target.indexOf(".") > -1) { + _Ref = ods_to_csf_3D(atag.Target.slice(1)); + atag.Target = "#" + _Ref[0] + "!" + _Ref[1]; + } + } + break; + + /* non-standard */ + case 'table-protection': break; + case 'data-pilot-grand-total': break; // '; + return function wso() { + return XML_HEADER + payload; + }; +})(); +var write_content_ods = (function() { + /* 6.1.2 White Space Characters */ + var write_text_p = function(text) { + return escapexml(text) + .replace(/ +/g, function($$){return '';}) + .replace(/\t/g, "") + .replace(/\n/g, "") + .replace(/^ /, "").replace(/ $/, ""); + }; + + var null_cell_xml = ' \n'; + var covered_cell_xml = ' \n'; + var write_ws = function(ws, wb, i) { + /* Section 9 Tables */ + var o = []; + o.push(' \n'); + var R=0,C=0, range = decode_range(ws['!ref']); + var marr = ws['!merges'] || [], mi = 0; + var dense = Array.isArray(ws); + for(R = 0; R < range.s.r; ++R) o.push(' \n'); + for(; R <= range.e.r; ++R) { + o.push(' \n'); + for(C=0; C < range.s.c; ++C) o.push(null_cell_xml); + for(; C <= range.e.c; ++C) { + var skip = false, ct = {}, textp = ""; + for(mi = 0; mi != marr.length; ++mi) { + if(marr[mi].s.c > C) continue; + if(marr[mi].s.r > R) continue; + if(marr[mi].e.c < C) continue; + if(marr[mi].e.r < R) continue; + if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true; + ct['table:number-columns-spanned'] = (marr[mi].e.c - marr[mi].s.c + 1); + ct['table:number-rows-spanned'] = (marr[mi].e.r - marr[mi].s.r + 1); + break; + } + if(skip) { o.push(covered_cell_xml); continue; } + var ref = encode_cell({r:R, c:C}), cell = dense ? (ws[R]||[])[C]: ws[ref]; + if(cell && cell.f) { + ct['table:formula'] = escapexml(csf_to_ods_formula(cell.f)); + if(cell.F) { + if(cell.F.slice(0, ref.length) == ref) { + var _Fref = decode_range(cell.F); + ct['table:number-matrix-columns-spanned'] = (_Fref.e.c - _Fref.s.c + 1); + ct['table:number-matrix-rows-spanned'] = (_Fref.e.r - _Fref.s.r + 1); + } + } + } + if(!cell) { o.push(null_cell_xml); continue; } + switch(cell.t) { + case 'b': + textp = (cell.v ? 'TRUE' : 'FALSE'); + ct['office:value-type'] = "boolean"; + ct['office:boolean-value'] = (cell.v ? 'true' : 'false'); + break; + case 'n': + textp = (cell.w||String(cell.v||0)); + ct['office:value-type'] = "float"; + ct['office:value'] = (cell.v||0); + break; + case 's': case 'str': + textp = cell.v == null ? "" : cell.v; + ct['office:value-type'] = "string"; + break; + case 'd': + textp = (cell.w||(parseDate(cell.v).toISOString())); + ct['office:value-type'] = "date"; + ct['office:date-value'] = (parseDate(cell.v).toISOString()); + ct['table:style-name'] = "ce1"; + break; + //case 'e': + default: o.push(null_cell_xml); continue; + } + var text_p = write_text_p(textp); + if(cell.l && cell.l.Target) { + var _tgt = cell.l.Target; _tgt = _tgt.charAt(0) == "#" ? "#" + csf_to_ods_3D(_tgt.slice(1)) : _tgt; + text_p = writextag('text:a', text_p, {'xlink:href': _tgt}); + } + o.push(' ' + writextag('table:table-cell', writextag('text:p', text_p, {}), ct) + '\n'); + } + o.push(' \n'); + } + o.push(' \n'); + return o.join(""); + }; + + var write_automatic_styles_ods = function(o) { + o.push(' \n'); + + o.push(' \n'); + o.push(' \n'); + o.push(' /\n'); + o.push(' \n'); + o.push(' /\n'); + o.push(' \n'); + o.push(' \n'); + + /* table */ + o.push(' \n'); // style:master-page-name="mp1">\n'); + o.push(' \n'); + o.push(' \n'); + + /* table cells, text */ + o.push(' \n'); + + /* page-layout */ + + o.push(' \n'); + }; + + return function wcx(wb, opts) { + var o = [XML_HEADER]; + /* 3.1.3.2 */ + var attr = wxt_helper({ + 'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0", + 'xmlns:table': "urn:oasis:names:tc:opendocument:xmlns:table:1.0", + 'xmlns:style': "urn:oasis:names:tc:opendocument:xmlns:style:1.0", + 'xmlns:text': "urn:oasis:names:tc:opendocument:xmlns:text:1.0", + 'xmlns:draw': "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0", + 'xmlns:fo': "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", + 'xmlns:xlink': "http://www.w3.org/1999/xlink", + 'xmlns:dc': "http://purl.org/dc/elements/1.1/", + 'xmlns:meta': "urn:oasis:names:tc:opendocument:xmlns:meta:1.0", + 'xmlns:number': "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0", + 'xmlns:presentation': "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0", + 'xmlns:svg': "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0", + 'xmlns:chart': "urn:oasis:names:tc:opendocument:xmlns:chart:1.0", + 'xmlns:dr3d': "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0", + 'xmlns:math': "http://www.w3.org/1998/Math/MathML", + 'xmlns:form': "urn:oasis:names:tc:opendocument:xmlns:form:1.0", + 'xmlns:script': "urn:oasis:names:tc:opendocument:xmlns:script:1.0", + 'xmlns:ooo': "http://openoffice.org/2004/office", + 'xmlns:ooow': "http://openoffice.org/2004/writer", + 'xmlns:oooc': "http://openoffice.org/2004/calc", + 'xmlns:dom': "http://www.w3.org/2001/xml-events", + 'xmlns:xforms': "http://www.w3.org/2002/xforms", + 'xmlns:xsd': "http://www.w3.org/2001/XMLSchema", + 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance", + 'xmlns:sheet': "urn:oasis:names:tc:opendocument:sh33tjs:1.0", + 'xmlns:rpt': "http://openoffice.org/2005/report", + 'xmlns:of': "urn:oasis:names:tc:opendocument:xmlns:of:1.2", + 'xmlns:xhtml': "http://www.w3.org/1999/xhtml", + 'xmlns:grddl': "http://www.w3.org/2003/g/data-view#", + 'xmlns:tableooo': "http://openoffice.org/2009/table", + 'xmlns:drawooo': "http://openoffice.org/2010/draw", + 'xmlns:calcext': "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0", + 'xmlns:loext': "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0", + 'xmlns:field': "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0", + 'xmlns:formx': "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0", + 'xmlns:css3t': "http://www.w3.org/TR/css3-text/", + 'office:version': "1.2" + }); + + var fods = wxt_helper({ + 'xmlns:config': "urn:oasis:names:tc:opendocument:xmlns:config:1.0", + 'office:mimetype': "application/vnd.oasis.opendocument.spreadsheet" + }); + + if(opts.bookType == "fods") o.push('\n'); + else o.push('\n'); + write_automatic_styles_ods(o); + o.push(' \n'); + o.push(' \n'); + for(var i = 0; i != wb.SheetNames.length; ++i) o.push(write_ws(wb.Sheets[wb.SheetNames[i]], wb, i, opts)); + o.push(' \n'); + o.push(' \n'); + if(opts.bookType == "fods") o.push(''); + else o.push(''); + return o.join(""); + }; +})(); + +function write_ods(wb, opts) { + if(opts.bookType == "fods") return write_content_ods(wb, opts); + +var zip = zip_new(); + var f = ""; + + var manifest = []; + var rdf = []; + + /* Part 3 Section 3.3 MIME Media Type */ + f = "mimetype"; + zip_add_file(zip, f, "application/vnd.oasis.opendocument.spreadsheet"); + + /* Part 1 Section 2.2 Documents */ + f = "content.xml"; + zip_add_file(zip, f, write_content_ods(wb, opts)); + manifest.push([f, "text/xml"]); + rdf.push([f, "ContentFile"]); + + /* TODO: these are hard-coded styles to satiate excel */ + f = "styles.xml"; + zip_add_file(zip, f, write_styles_ods(wb, opts)); + manifest.push([f, "text/xml"]); + rdf.push([f, "StylesFile"]); + + /* TODO: this is hard-coded to satiate excel */ + f = "meta.xml"; + zip_add_file(zip, f, write_meta_ods()); + manifest.push([f, "text/xml"]); + rdf.push([f, "MetadataFile"]); + + /* Part 3 Section 6 Metadata Manifest File */ + f = "manifest.rdf"; + zip_add_file(zip, f, write_rdf(rdf/*, opts*/)); + manifest.push([f, "application/rdf+xml"]); + + /* Part 3 Section 4 Manifest File */ + f = "META-INF/manifest.xml"; + zip_add_file(zip, f, write_manifest(manifest/*, opts*/)); + + return zip; +} + +function write_sheet_index(wb, sheet) { + if(!sheet) return 0; + var idx = wb.SheetNames.indexOf(sheet); + if(idx == -1) throw new Error("Sheet not found: " + sheet); + return idx; +} + +function write_obj_str(factory) { + return function write_str(wb, o) { + var idx = write_sheet_index(wb, o.sheet); + return factory.from_sheet(wb.Sheets[wb.SheetNames[idx]], o, wb); + }; +} + +var write_htm_str = write_obj_str(HTML_); +var write_csv_str = write_obj_str({from_sheet:sheet_to_csv}); +var write_slk_str = write_obj_str(typeof SYLK !== "undefined" ? SYLK : {}); +var write_dif_str = write_obj_str(typeof DIF !== "undefined" ? DIF : {}); +var write_prn_str = write_obj_str(typeof PRN !== "undefined" ? PRN : {}); +var write_rtf_str = write_obj_str(typeof RTF !== "undefined" ? RTF : {}); +var write_txt_str = write_obj_str({from_sheet:sheet_to_txt}); +var write_dbf_buf = write_obj_str(typeof DBF !== "undefined" ? DBF : {}); +var write_eth_str = write_obj_str(typeof ETH !== "undefined" ? ETH : {}); + +function fix_opts_func(defaults) { + return function fix_opts(opts) { + for(var i = 0; i != defaults.length; ++i) { + var d = defaults[i]; + if(opts[d[0]] === undefined) opts[d[0]] = d[1]; + if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]); + } + }; +} + +var fix_read_opts = function(opts) { +fix_opts_func([ + ['cellNF', false], /* emit cell number format string as .z */ + ['cellHTML', true], /* emit html string as .h */ + ['cellFormula', true], /* emit formulae as .f */ + ['cellStyles', false], /* emits style/theme as .s */ + ['cellText', true], /* emit formatted text as .w */ + ['cellDates', false], /* emit date cells with type `d` */ + + ['sheetStubs', false], /* emit empty cells */ + ['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */ + + ['bookDeps', false], /* parse calculation chains */ + ['bookSheets', false], /* only try to get sheet names (no Sheets) */ + ['bookProps', false], /* only try to get properties (no Sheets) */ + ['bookFiles', false], /* include raw file structure (keys, files, cfb) */ + ['bookVBA', false], /* include vba raw data (vbaraw) */ + + ['password',''], /* password */ + ['WTF', false] /* WTF mode (throws errors) */ +])(opts); +}; + +var fix_write_opts = fix_opts_func([ + ['cellDates', false], /* write date cells with type `d` */ + + ['bookSST', false], /* Generate Shared String Table */ + + ['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */ + + ['compression', false], /* Use file compression */ + + ['WTF', false] /* WTF mode (throws errors) */ +]); +function get_sheet_type(n) { + if(RELS.WS.indexOf(n) > -1) return "sheet"; + if(RELS.CS && n == RELS.CS) return "chart"; + if(RELS.DS && n == RELS.DS) return "dialog"; + if(RELS.MS && n == RELS.MS) return "macro"; + return (n && n.length) ? n : "sheet"; +} +function safe_parse_wbrels(wbrels, sheets) { + if(!wbrels) return 0; + try { + wbrels = sheets.map(function pwbr(w) { if(!w.id) w.id = w.strRelID; return [w.name, wbrels['!id'][w.id].Target, get_sheet_type(wbrels['!id'][w.id].Type)]; }); + } catch(e) { return null; } + return !wbrels || wbrels.length === 0 ? null : wbrels; +} + +function safe_parse_sheet(zip, path, relsPath, sheet, idx, sheetRels, sheets, stype, opts, wb, themes, styles) { + try { + sheetRels[sheet]=parse_rels(getzipstr(zip, relsPath, true), path); + var data = getzipdata(zip, path); + var _ws; + switch(stype) { + case 'sheet': _ws = parse_ws(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break; + case 'chart': _ws = parse_cs(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); + if(!_ws || !_ws['!drawel']) break; + var dfile = resolve_path(_ws['!drawel'].Target, path); + var drelsp = get_rels_path(dfile); + var draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfile)); + var chartp = resolve_path(draw, dfile); + var crelsp = get_rels_path(chartp); + _ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, true), chartp), wb, _ws); + break; + case 'macro': _ws = parse_ms(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break; + case 'dialog': _ws = parse_ds(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break; + default: throw new Error("Unrecognized sheet type " + stype); + } + sheets[sheet] = _ws; + + /* scan rels for comments */ + var comments = []; + if(sheetRels && sheetRels[sheet]) keys(sheetRels[sheet]).forEach(function(n) { + if(sheetRels[sheet][n].Type == RELS.CMNT) { + var dfile = resolve_path(sheetRels[sheet][n].Target, path); + comments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts); + if(!comments || !comments.length) return; + sheet_insert_comments(_ws, comments); + } + }); + } catch(e) { if(opts.WTF) throw e; } +} + +function strip_front_slash(x) { return x.charAt(0) == '/' ? x.slice(1) : x; } + +function parse_zip(zip, opts) { + make_ssf(SSF); + opts = opts || {}; + fix_read_opts(opts); + + /* OpenDocument Part 3 Section 2.2.1 OpenDocument Package */ + if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts); + /* UOC */ + if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts); + /* Numbers */ + if(safegetzipfile(zip, 'Index/Document.iwa')) throw new Error('Unsupported NUMBERS file'); + + var entries = zipentries(zip); + var dir = parse_ct((getzipstr(zip, '[Content_Types].xml'))); + var xlsb = false; + var sheets, binname; + if(dir.workbooks.length === 0) { + binname = "xl/workbook.xml"; + if(getzipdata(zip,binname, true)) dir.workbooks.push(binname); + } + if(dir.workbooks.length === 0) { + binname = "xl/workbook.bin"; + if(!getzipdata(zip,binname,true)) throw new Error("Could not find workbook"); + dir.workbooks.push(binname); + xlsb = true; + } + if(dir.workbooks[0].slice(-3) == "bin") xlsb = true; + + var themes = ({}); + var styles = ({}); + if(!opts.bookSheets && !opts.bookProps) { + strs = []; + if(dir.sst) try { strs=parse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } catch(e) { if(opts.WTF) throw e; } + + if(opts.cellStyles && dir.themes.length) themes = parse_theme(getzipstr(zip, dir.themes[0].replace(/^\//,''), true)||"",dir.themes[0], opts); + + if(dir.style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes, opts); + } + + /*var externbooks = */dir.links.map(function(link) { + try { + var rels = parse_rels(getzipstr(zip, get_rels_path(strip_front_slash(link))), link); + return parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts); + } catch(e) {} + }); + + var wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts); + + var props = {}, propdata = ""; + + if(dir.coreprops.length) { + propdata = getzipdata(zip, strip_front_slash(dir.coreprops[0]), true); + if(propdata) props = parse_core_props(propdata); + if(dir.extprops.length !== 0) { + propdata = getzipdata(zip, strip_front_slash(dir.extprops[0]), true); + if(propdata) parse_ext_props(propdata, props, opts); + } + } + + var custprops = {}; + if(!opts.bookSheets || opts.bookProps) { + if (dir.custprops.length !== 0) { + propdata = getzipstr(zip, strip_front_slash(dir.custprops[0]), true); + if(propdata) custprops = parse_cust_props(propdata, opts); + } + } + + var out = ({}); + if(opts.bookSheets || opts.bookProps) { + if(wb.Sheets) sheets = wb.Sheets.map(function pluck(x){ return x.name; }); + else if(props.Worksheets && props.SheetNames.length > 0) sheets=props.SheetNames; + if(opts.bookProps) { out.Props = props; out.Custprops = custprops; } + if(opts.bookSheets && typeof sheets !== 'undefined') out.SheetNames = sheets; + if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out; + } + sheets = {}; + + var deps = {}; + if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain)),dir.calcchain,opts); + + var i=0; + var sheetRels = ({}); + var path, relsPath; + + { + var wbsheets = wb.Sheets; + props.Worksheets = wbsheets.length; + props.SheetNames = []; + for(var j = 0; j != wbsheets.length; ++j) { + props.SheetNames[j] = wbsheets[j].name; + } + } + + var wbext = xlsb ? "bin" : "xml"; + var wbrelsi = dir.workbooks[0].lastIndexOf("/"); + var wbrelsfile = (dir.workbooks[0].slice(0, wbrelsi+1) + "_rels/" + dir.workbooks[0].slice(wbrelsi+1) + ".rels").replace(/^\//,""); + if(!safegetzipfile(zip, wbrelsfile)) wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels'; + var wbrels = parse_rels(getzipstr(zip, wbrelsfile, true), wbrelsfile); + if(wbrels) wbrels = safe_parse_wbrels(wbrels, wb.Sheets); + + /* Numbers iOS hack */ + var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0; + wsloop: for(i = 0; i != props.Worksheets; ++i) { + var stype = "sheet"; + if(wbrels && wbrels[i]) { + path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, ""); + if(!safegetzipfile(zip, path)) path = wbrels[i][1]; + if(!safegetzipfile(zip, path)) path = wbrelsfile.replace(/_rels\/.*$/,"") + wbrels[i][1]; + stype = wbrels[i][2]; + } else { + path = 'xl/worksheets/sheet'+(i+1-nmode)+"." + wbext; + path = path.replace(/sheet0\./,"sheet."); + } + relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels"); + if(opts && opts.sheets != null) switch(typeof opts.sheets) { + case "number": if(i != opts.sheets) continue wsloop; break; + case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break; + default: if(Array.isArray && Array.isArray(opts.sheets)) { + var snjseen = false; + for(var snj = 0; snj != opts.sheets.length; ++snj) { + if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1; + if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1; + } + if(!snjseen) continue wsloop; + } + } + safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles); + } + + out = ({ + Directory: dir, + Workbook: wb, + Props: props, + Custprops: custprops, + Deps: deps, + Sheets: sheets, + SheetNames: props.SheetNames, + Strings: strs, + Styles: styles, + Themes: themes, + SSF: SSF.get_table() + }); + if(opts && opts.bookFiles) { + out.keys = entries; + out.files = zip.files; + } + if(opts && opts.bookVBA) { + if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true); + else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true); + } + return out; +} + +/* [MS-OFFCRYPTO] 2.1.1 */ +function parse_xlsxcfb(cfb, _opts) { + var opts = _opts || {}; + var f = 'Workbook', data = CFB.find(cfb, f); + try { + f = '/!DataSpaces/Version'; + data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); + /*var version = */parse_DataSpaceVersionInfo(data.content); + + /* 2.3.4.1 */ + f = '/!DataSpaces/DataSpaceMap'; + data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); + var dsm = parse_DataSpaceMap(data.content); + if(dsm.length !== 1 || dsm[0].comps.length !== 1 || dsm[0].comps[0].t !== 0 || dsm[0].name !== "StrongEncryptionDataSpace" || dsm[0].comps[0].v !== "EncryptedPackage") + throw new Error("ECMA-376 Encrypted file bad " + f); + + /* 2.3.4.2 */ + f = '/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace'; + data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); + var seds = parse_DataSpaceDefinition(data.content); + if(seds.length != 1 || seds[0] != "StrongEncryptionTransform") + throw new Error("ECMA-376 Encrypted file bad " + f); + + /* 2.3.4.3 */ + f = '/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary'; + data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); + /*var hdr = */parse_Primary(data.content); + } catch(e) {} + + f = '/EncryptionInfo'; + data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); + var einfo = parse_EncryptionInfo(data.content); + + /* 2.3.4.4 */ + f = '/EncryptedPackage'; + data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); + +/*global decrypt_agile */ +if(einfo[0] == 0x04 && typeof decrypt_agile !== 'undefined') return decrypt_agile(einfo[1], data.content, opts.password || "", opts); +/*global decrypt_std76 */ +if(einfo[0] == 0x02 && typeof decrypt_std76 !== 'undefined') return decrypt_std76(einfo[1], data.content, opts.password || "", opts); + throw new Error("File is password-protected"); +} + +function write_zip(wb, opts) { + _shapeid = 1024; + if(opts.bookType == "ods") return write_ods(wb, opts); + if(wb && !wb.SSF) { + wb.SSF = SSF.get_table(); + } + if(wb && wb.SSF) { + make_ssf(SSF); SSF.load_table(wb.SSF); + // $FlowIgnore + opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0; + opts.ssf = wb.SSF; + } + opts.rels = {}; opts.wbrels = {}; + opts.Strings = []; opts.Strings.Count = 0; opts.Strings.Unique = 0; + if(browser_has_Map) opts.revStrings = new Map(); + else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; } + var wbext = opts.bookType == "xlsb" ? "bin" : "xml"; + var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1; + var ct = new_ct(); + fix_write_opts(opts = opts || {}); +var zip = zip_new(); + var f = "", rId = 0; + + opts.cellXfs = []; + get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}}); + + if(!wb.Props) wb.Props = {}; + + f = "docProps/core.xml"; + zip_add_file(zip, f, write_core_props(wb.Props, opts)); + ct.coreprops.push(f); + add_rels(opts.rels, 2, f, RELS.CORE_PROPS); + +f = "docProps/app.xml"; + if(wb.Props && wb.Props.SheetNames){/* empty */} + else if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames; + else { + var _sn = []; + for(var _i = 0; _i < wb.SheetNames.length; ++_i) + if((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]); + wb.Props.SheetNames = _sn; + } + wb.Props.Worksheets = wb.Props.SheetNames.length; + zip_add_file(zip, f, write_ext_props(wb.Props, opts)); + ct.extprops.push(f); + add_rels(opts.rels, 3, f, RELS.EXT_PROPS); + + if(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) { + f = "docProps/custom.xml"; + zip_add_file(zip, f, write_cust_props(wb.Custprops, opts)); + ct.custprops.push(f); + add_rels(opts.rels, 4, f, RELS.CUST_PROPS); + } + + for(rId=1;rId <= wb.SheetNames.length; ++rId) { + var wsrels = {'!id':{}}; + var ws = wb.Sheets[wb.SheetNames[rId-1]]; + var _type = (ws || {})["!type"] || "sheet"; + switch(_type) { + case "chart": + /* falls through */ + default: + f = "xl/worksheets/sheet" + rId + "." + wbext; + zip_add_file(zip, f, write_ws(rId-1, f, opts, wb, wsrels)); + ct.sheets.push(f); + add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]); + } + + if(ws) { + var comments = ws['!comments']; + var need_vml = false; + if(comments && comments.length > 0) { + var cf = "xl/comments" + rId + "." + wbext; + zip_add_file(zip, cf, write_cmnt(comments, cf, opts)); + ct.comments.push(cf); + add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT); + need_vml = true; + } + if(ws['!legacy']) { + if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_comments_vml(rId, ws['!comments'])); + } + delete ws['!comments']; + delete ws['!legacy']; + } + + if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels)); + } + + if(opts.Strings != null && opts.Strings.length > 0) { + f = "xl/sharedStrings." + wbext; + zip_add_file(zip, f, write_sst(opts.Strings, f, opts)); + ct.strs.push(f); + add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST); + } + + f = "xl/workbook." + wbext; + zip_add_file(zip, f, write_wb(wb, f, opts)); + ct.workbooks.push(f); + add_rels(opts.rels, 1, f, RELS.WB); + + /* TODO: something more intelligent with themes */ + + f = "xl/theme/theme1.xml"; + zip_add_file(zip, f, write_theme(wb.Themes, opts)); + ct.themes.push(f); + add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME); + + /* TODO: something more intelligent with styles */ + + f = "xl/styles." + wbext; + zip_add_file(zip, f, write_sty(wb, f, opts)); + ct.styles.push(f); + add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY); + + if(wb.vbaraw && vbafmt) { + f = "xl/vbaProject.bin"; + zip_add_file(zip, f, wb.vbaraw); + ct.vba.push(f); + add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA); + } + + zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts)); + zip_add_file(zip, '_rels/.rels', write_rels(opts.rels)); + zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels)); + + delete opts.revssf; delete opts.ssf; + return zip; +} +function firstbyte(f,o) { + var x = ""; + switch((o||{}).type || "base64") { + case 'buffer': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]]; + case 'base64': x = Base64.decode(f.slice(0,12)); break; + case 'binary': x = f; break; + case 'array': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]]; + default: throw new Error("Unrecognized type " + (o && o.type || "undefined")); + } + return [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3), x.charCodeAt(4), x.charCodeAt(5), x.charCodeAt(6), x.charCodeAt(7)]; +} + +function read_cfb(cfb, opts) { + if(CFB.find(cfb, "EncryptedPackage")) return parse_xlsxcfb(cfb, opts); + return parse_xlscfb(cfb, opts); +} + +function read_zip(data, opts) { +var zip, d = data; + var o = opts||{}; + if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64"; + zip = zip_read(d, o); + return parse_zip(zip, o); +} + +function read_plaintext(data, o) { + var i = 0; + main: while(i < data.length) switch(data.charCodeAt(i)) { + case 0x0A: case 0x0D: case 0x20: ++i; break; + case 0x3C: return parse_xlml(data.slice(i),o); + default: break main; + } + return PRN.to_workbook(data, o); +} + +function read_plaintext_raw(data, o) { + var str = "", bytes = firstbyte(data, o); + switch(o.type) { + case 'base64': str = Base64.decode(data); break; + case 'binary': str = data; break; + case 'buffer': str = data.toString('binary'); break; + case 'array': str = cc2str(data); break; + default: throw new Error("Unrecognized type " + o.type); + } + if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str); + return read_plaintext(str, o); +} + +function read_utf16(data, o) { + var d = data; + if(o.type == 'base64') d = Base64.decode(d); + d = cptable.utils.decode(1200, d.slice(2), 'str'); + o.type = "binary"; + return read_plaintext(d, o); +} + +function bstrify(data) { + return !data.match(/[^\x00-\x7F]/) ? data : utf8write(data); +} + +function read_prn(data, d, o, str) { + if(str) { o.type = "string"; return PRN.to_workbook(data, o); } + return PRN.to_workbook(d, o); +} + +function readSync(data, opts) { + reset_cp(); + if(typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) return readSync(new Uint8Array(data), opts); + var d = data, n = [0,0,0,0], str = false; + var o = opts||{}; + if(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; } + _ssfopts = {}; + if(o.dateNF) _ssfopts.dateNF = o.dateNF; + if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64"; + if(o.type == "file") { o.type = has_buf ? "buffer" : "binary"; d = read_binary(data); } + if(o.type == "string") { str = true; o.type = "binary"; o.codepage = 65001; d = bstrify(data); } + if(o.type == 'array' && typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && typeof ArrayBuffer !== 'undefined') { + // $FlowIgnore + var ab=new ArrayBuffer(3), vu=new Uint8Array(ab); vu.foo="bar"; + // $FlowIgnore + if(!vu.foo) {o=dup(o); o.type='array'; return readSync(ab2a(d), o);} + } + switch((n = firstbyte(d, o))[0]) { + case 0xD0: if(n[1] === 0xCF && n[2] === 0x11 && n[3] === 0xE0 && n[4] === 0xA1 && n[5] === 0xB1 && n[6] === 0x1A && n[7] === 0xE1) return read_cfb(CFB.read(d, o), o); break; + case 0x09: if(n[1] <= 0x04) return parse_xlscfb(d, o); break; + case 0x3C: return parse_xlml(d, o); + case 0x49: if(n[1] === 0x44) return read_wb_ID(d, o); break; + case 0x54: if(n[1] === 0x41 && n[2] === 0x42 && n[3] === 0x4C) return DIF.to_workbook(d, o); break; + case 0x50: return (n[1] === 0x4B && n[2] < 0x09 && n[3] < 0x09) ? read_zip(d, o) : read_prn(data, d, o, str); + case 0xEF: return n[3] === 0x3C ? parse_xlml(d, o) : read_prn(data, d, o, str); + case 0xFF: if(n[1] === 0xFE) { return read_utf16(d, o); } break; + case 0x00: if(n[1] === 0x00 && n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o); break; + case 0x03: case 0x83: case 0x8B: case 0x8C: return DBF.to_workbook(d, o); + case 0x7B: if(n[1] === 0x5C && n[2] === 0x72 && n[3] === 0x74) return RTF.to_workbook(d, o); break; + case 0x0A: case 0x0D: case 0x20: return read_plaintext_raw(d, o); + } + if(DBF.versions.indexOf(n[0]) > -1 && n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o); + return read_prn(data, d, o, str); +} + +function readFileSync(filename, opts) { + var o = opts||{}; o.type = 'file'; + return readSync(filename, o); +} +function write_cfb_ctr(cfb, o) { + switch(o.type) { + case "base64": case "binary": break; + case "buffer": case "array": o.type = ""; break; + case "file": return write_dl(o.file, CFB.write(cfb, {type:has_buf ? 'buffer' : ""})); + case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files"); + default: throw new Error("Unrecognized type " + o.type); + } + return CFB.write(cfb, o); +} + +function write_zip_type(wb, opts) { + var o = opts||{}; + var z = write_zip(wb, o); + var oopts = {}; + if(o.compression) oopts.compression = 'DEFLATE'; + if(o.password) oopts.type = has_buf ? "nodebuffer" : "string"; + else switch(o.type) { + case "base64": oopts.type = "base64"; break; + case "binary": oopts.type = "string"; break; + case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files"); + case "buffer": + case "file": oopts.type = has_buf ? "nodebuffer" : "string"; break; + default: throw new Error("Unrecognized type " + o.type); + } + var out = z.FullPaths ? CFB.write(z, {fileType:"zip", type: {"nodebuffer": "buffer", "string": "binary"}[oopts.type] || oopts.type}) : z.generate(oopts); +/*jshint -W083 */ + if(o.password && typeof encrypt_agile !== 'undefined') return write_cfb_ctr(encrypt_agile(out, o.password), o); // eslint-disable-line no-undef +/*jshint +W083 */ + if(o.type === "file") return write_dl(o.file, out); + return o.type == "string" ? utf8read(out) : out; +} + +function write_cfb_type(wb, opts) { + var o = opts||{}; + var cfb = write_xlscfb(wb, o); + return write_cfb_ctr(cfb, o); +} + +function write_string_type(out, opts, bom) { + if(!bom) bom = ""; + var o = bom + out; + switch(opts.type) { + case "base64": return Base64.encode(utf8write(o)); + case "binary": return utf8write(o); + case "string": return out; + case "file": return write_dl(opts.file, o, 'utf8'); + case "buffer": { + if(has_buf) return Buffer_from(o, 'utf8'); + else return write_string_type(o, {type:'binary'}).split("").map(function(c) { return c.charCodeAt(0); }); + } + } + throw new Error("Unrecognized type " + opts.type); +} + +function write_stxt_type(out, opts) { + switch(opts.type) { + case "base64": return Base64.encode(out); + case "binary": return out; + case "string": return out; /* override in sheet_to_txt */ + case "file": return write_dl(opts.file, out, 'binary'); + case "buffer": { + if(has_buf) return Buffer_from(out, 'binary'); + else return out.split("").map(function(c) { return c.charCodeAt(0); }); + } + } + throw new Error("Unrecognized type " + opts.type); +} + +/* TODO: test consistency */ +function write_binary_type(out, opts) { + switch(opts.type) { + case "string": + case "base64": + case "binary": + var bstr = ""; + // $FlowIgnore + for(var i = 0; i < out.length; ++i) bstr += String.fromCharCode(out[i]); + return opts.type == 'base64' ? Base64.encode(bstr) : opts.type == 'string' ? utf8read(bstr) : bstr; + case "file": return write_dl(opts.file, out); + case "buffer": return out; + default: throw new Error("Unrecognized type " + opts.type); + } +} + +function writeSync(wb, opts) { + reset_cp(); + check_wb(wb); + var o = opts||{}; + if(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; } + if(o.type == "array") { o.type = "binary"; var out = (writeSync(wb, o)); o.type = "array"; return s2ab(out); } + switch(o.bookType || 'xlsb') { + case 'xml': + case 'xlml': return write_string_type(write_xlml(wb, o), o); + case 'slk': + case 'sylk': return write_string_type(write_slk_str(wb, o), o); + case 'htm': + case 'html': return write_string_type(write_htm_str(wb, o), o); + case 'txt': return write_stxt_type(write_txt_str(wb, o), o); + case 'csv': return write_string_type(write_csv_str(wb, o), o, "\ufeff"); + case 'dif': return write_string_type(write_dif_str(wb, o), o); + case 'dbf': return write_binary_type(write_dbf_buf(wb, o), o); + case 'prn': return write_string_type(write_prn_str(wb, o), o); + case 'rtf': return write_string_type(write_rtf_str(wb, o), o); + case 'eth': return write_string_type(write_eth_str(wb, o), o); + case 'fods': return write_string_type(write_ods(wb, o), o); + case 'biff2': if(!o.biff) o.biff = 2; /* falls through */ + case 'biff3': if(!o.biff) o.biff = 3; /* falls through */ + case 'biff4': if(!o.biff) o.biff = 4; return write_binary_type(write_biff_buf(wb, o), o); + case 'biff5': if(!o.biff) o.biff = 5; /* falls through */ + case 'biff8': + case 'xla': + case 'xls': if(!o.biff) o.biff = 8; return write_cfb_type(wb, o); + case 'xlsx': + case 'xlsm': + case 'xlam': + case 'xlsb': + case 'ods': return write_zip_type(wb, o); + default: throw new Error ("Unrecognized bookType |" + o.bookType + "|"); + } +} + +function resolve_book_type(o) { + if(o.bookType) return; + var _BT = { + "xls": "biff8", + "htm": "html", + "slk": "sylk", + "socialcalc": "eth", + "Sh33tJS": "WTF" + }; + var ext = o.file.slice(o.file.lastIndexOf(".")).toLowerCase(); + if(ext.match(/^\.[a-z]+$/)) o.bookType = ext.slice(1); + o.bookType = _BT[o.bookType] || o.bookType; +} + +function writeFileSync(wb, filename, opts) { + var o = opts||{}; o.type = 'file'; + o.file = filename; + resolve_book_type(o); + return writeSync(wb, o); +} + +function writeFileAsync(filename, wb, opts, cb) { + var o = opts||{}; o.type = 'file'; + o.file = filename; + resolve_book_type(o); + o.type = 'buffer'; + var _cb = cb; if(!(_cb instanceof Function)) _cb = (opts); + return _fs.writeFile(filename, writeSync(wb, o), _cb); +} +function make_json_row(sheet, r, R, cols, header, hdr, dense, o) { + var rr = encode_row(R); + var defval = o.defval, raw = o.raw || !Object.prototype.hasOwnProperty.call(o, "raw"); + var isempty = true; + var row = (header === 1) ? [] : {}; + if(header !== 1) { + if(Object.defineProperty) try { Object.defineProperty(row, '__rowNum__', {value:R, enumerable:false}); } catch(e) { row.__rowNum__ = R; } + else row.__rowNum__ = R; + } + if(!dense || sheet[R]) for (var C = r.s.c; C <= r.e.c; ++C) { + var val = dense ? sheet[R][C] : sheet[cols[C] + rr]; + if(val === undefined || val.t === undefined) { + if(defval === undefined) continue; + if(hdr[C] != null) { row[hdr[C]] = defval; } + continue; + } + var v = val.v; + switch(val.t){ + case 'z': if(v == null) break; continue; + case 'e': v = void 0; break; + case 's': case 'd': case 'b': case 'n': break; + default: throw new Error('unrecognized type ' + val.t); + } + if(hdr[C] != null) { + if(v == null) { + if(defval !== undefined) row[hdr[C]] = defval; + else if(raw && v === null) row[hdr[C]] = null; + else continue; + } else { + row[hdr[C]] = raw || (o.rawNumbers && val.t == "n") ? v : format_cell(val,v,o); + } + if(v != null) isempty = false; + } + } + return { row: row, isempty: isempty }; +} + + +function sheet_to_json(sheet, opts) { + if(sheet == null || sheet["!ref"] == null) return []; + var val = {t:'n',v:0}, header = 0, offset = 1, hdr = [], v=0, vv=""; + var r = {s:{r:0,c:0},e:{r:0,c:0}}; + var o = opts || {}; + var range = o.range != null ? o.range : sheet["!ref"]; + if(o.header === 1) header = 1; + else if(o.header === "A") header = 2; + else if(Array.isArray(o.header)) header = 3; + else if(o.header == null) header = 0; + switch(typeof range) { + case 'string': r = safe_decode_range(range); break; + case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break; + default: r = range; + } + if(header > 0) offset = 0; + var rr = encode_row(r.s.r); + var cols = []; + var out = []; + var outi = 0, counter = 0; + var dense = Array.isArray(sheet); + var R = r.s.r, C = 0, CC = 0; + if(dense && !sheet[R]) sheet[R] = []; + for(C = r.s.c; C <= r.e.c; ++C) { + cols[C] = encode_col(C); + val = dense ? sheet[R][C] : sheet[cols[C] + rr]; + switch(header) { + case 1: hdr[C] = C - r.s.c; break; + case 2: hdr[C] = cols[C]; break; + case 3: hdr[C] = o.header[C - r.s.c]; break; + default: + if(val == null) val = {w: "__EMPTY", t: "s"}; + vv = v = format_cell(val, null, o); + counter = 0; + for(CC = 0; CC < hdr.length; ++CC) if(hdr[CC] == vv) vv = v + "_" + (++counter); + hdr[C] = vv; + } + } + for (R = r.s.r + offset; R <= r.e.r; ++R) { + var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o); + if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) out[outi++] = row.row; + } + out.length = outi; + return out; +} + +var qreg = /"/g; +function make_csv_row(sheet, r, R, cols, fs, rs, FS, o) { + var isempty = true; + var row = [], txt = "", rr = encode_row(R); + for(var C = r.s.c; C <= r.e.c; ++C) { + if (!cols[C]) continue; + var val = o.dense ? (sheet[R]||[])[C]: sheet[cols[C] + rr]; + if(val == null) txt = ""; + else if(val.v != null) { + isempty = false; + txt = ''+(o.rawNumbers && val.t == "n" ? val.v : format_cell(val, null, o)); + for(var i = 0, cc = 0; i !== txt.length; ++i) if((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34 || o.forceQuotes) {txt = "\"" + txt.replace(qreg, '""') + "\""; break; } + if(txt == "ID") txt = '"ID"'; + } else if(val.f != null && !val.F) { + isempty = false; + txt = '=' + val.f; if(txt.indexOf(",") >= 0) txt = '"' + txt.replace(qreg, '""') + '"'; + } else txt = ""; + /* NOTE: Excel CSV does not support array formulae */ + row.push(txt); + } + if(o.blankrows === false && isempty) return null; + return row.join(FS); +} + +function sheet_to_csv(sheet, opts) { + var out = []; + var o = opts == null ? {} : opts; + if(sheet == null || sheet["!ref"] == null) return ""; + var r = safe_decode_range(sheet["!ref"]); + var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0); + var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0); + var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$"); + var row = "", cols = []; + o.dense = Array.isArray(sheet); + var colinfo = o.skipHidden && sheet["!cols"] || []; + var rowinfo = o.skipHidden && sheet["!rows"] || []; + for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C); + for(var R = r.s.r; R <= r.e.r; ++R) { + if ((rowinfo[R]||{}).hidden) continue; + row = make_csv_row(sheet, r, R, cols, fs, rs, FS, o); + if(row == null) { continue; } + if(o.strip) row = row.replace(endregex,""); + out.push(row + RS); + } + delete o.dense; + return out.join(""); +} + +function sheet_to_txt(sheet, opts) { + if(!opts) opts = {}; opts.FS = "\t"; opts.RS = "\n"; + var s = sheet_to_csv(sheet, opts); + if(typeof cptable == 'undefined' || opts.type == 'string') return s; + var o = cptable.utils.encode(1200, s, 'str'); + return String.fromCharCode(255) + String.fromCharCode(254) + o; +} + +function sheet_to_formulae(sheet) { + var y = "", x, val=""; + if(sheet == null || sheet["!ref"] == null) return []; + var r = safe_decode_range(sheet['!ref']), rr = "", cols = [], C; + var cmds = []; + var dense = Array.isArray(sheet); + for(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C); + for(var R = r.s.r; R <= r.e.r; ++R) { + rr = encode_row(R); + for(C = r.s.c; C <= r.e.c; ++C) { + y = cols[C] + rr; + x = dense ? (sheet[R]||[])[C] : sheet[y]; + val = ""; + if(x === undefined) continue; + else if(x.F != null) { + y = x.F; + if(!x.f) continue; + val = x.f; + if(y.indexOf(":") == -1) y = y + ":" + y; + } + if(x.f != null) val = x.f; + else if(x.t == 'z') continue; + else if(x.t == 'n' && x.v != null) val = "" + x.v; + else if(x.t == 'b') val = x.v ? "TRUE" : "FALSE"; + else if(x.w !== undefined) val = "'" + x.w; + else if(x.v === undefined) continue; + else if(x.t == 's') val = "'" + x.v; + else val = ""+x.v; + cmds[cmds.length] = y + "=" + val; + } + } + return cmds; +} + +function sheet_add_json(_ws, js, opts) { + var o = opts || {}; + var offset = +!o.skipHeader; + var ws = _ws || ({}); + var _R = 0, _C = 0; + if(ws && o.origin != null) { + if(typeof o.origin == 'number') _R = o.origin; + else { + var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin; + _R = _origin.r; _C = _origin.c; + } + } + var cell; + var range = ({s: {c:0, r:0}, e: {c:_C, r:_R + js.length - 1 + offset}}); + if(ws['!ref']) { + var _range = safe_decode_range(ws['!ref']); + range.e.c = Math.max(range.e.c, _range.e.c); + range.e.r = Math.max(range.e.r, _range.e.r); + if(_R == -1) { _R = _range.e.r + 1; range.e.r = _R + js.length - 1 + offset; } + } else { + if(_R == -1) { _R = 0; range.e.r = js.length - 1 + offset; } + } + var hdr = o.header || [], C = 0; + + js.forEach(function (JS, R) { + keys(JS).forEach(function(k) { + if((C=hdr.indexOf(k)) == -1) hdr[C=hdr.length] = k; + var v = JS[k]; + var t = 'z'; + var z = ""; + var ref = encode_cell({c:_C + C,r:_R + R + offset}); + cell = utils.sheet_get_cell(ws, ref); + if(v && typeof v === 'object' && !(v instanceof Date)){ + ws[ref] = v; + } else { + if(typeof v == 'number') t = 'n'; + else if(typeof v == 'boolean') t = 'b'; + else if(typeof v == 'string') t = 's'; + else if(v instanceof Date) { + t = 'd'; + if(!o.cellDates) { t = 'n'; v = datenum(v); } + z = (o.dateNF || SSF._table[14]); + } + if(!cell) ws[ref] = cell = ({t:t, v:v}); + else { + cell.t = t; cell.v = v; + delete cell.w; delete cell.R; + if(z) cell.z = z; + } + if(z) cell.z = z; + } + }); + }); + range.e.c = Math.max(range.e.c, _C + hdr.length - 1); + var __R = encode_row(_R); + if(offset) for(C = 0; C < hdr.length; ++C) ws[encode_col(C + _C) + __R] = {t:'s', v:hdr[C]}; + ws['!ref'] = encode_range(range); + return ws; +} +function json_to_sheet(js, opts) { return sheet_add_json(null, js, opts); } + +var utils = { + encode_col: encode_col, + encode_row: encode_row, + encode_cell: encode_cell, + encode_range: encode_range, + decode_col: decode_col, + decode_row: decode_row, + split_cell: split_cell, + decode_cell: decode_cell, + decode_range: decode_range, + format_cell: format_cell, + get_formulae: sheet_to_formulae, + make_csv: sheet_to_csv, + make_json: sheet_to_json, + make_formulae: sheet_to_formulae, + sheet_add_aoa: sheet_add_aoa, + sheet_add_json: sheet_add_json, + sheet_add_dom: sheet_add_dom, + aoa_to_sheet: aoa_to_sheet, + json_to_sheet: json_to_sheet, + table_to_sheet: parse_dom_table, + table_to_book: table_to_book, + sheet_to_csv: sheet_to_csv, + sheet_to_txt: sheet_to_txt, + sheet_to_json: sheet_to_json, + sheet_to_html: HTML_.from_sheet, + sheet_to_formulae: sheet_to_formulae, + sheet_to_row_object_array: sheet_to_json +}; + +(function(utils) { +utils.consts = utils.consts || {}; +function add_consts(R/*Array*/) { R.forEach(function(a){ utils.consts[a[0]] = a[1]; }); } + +function get_default(x, y, z) { return x[y] != null ? x[y] : (x[y] = z); } + +/* get cell, creating a stub if necessary */ +function ws_get_cell_stub(ws, R, C) { + /* A1 cell address */ + if(typeof R == "string") { + /* dense */ + if(Array.isArray(ws)) { + var RC = decode_cell(R); + if(!ws[RC.r]) ws[RC.r] = []; + return ws[RC.r][RC.c] || (ws[RC.r][RC.c] = {t:'z'}); + } + return ws[R] || (ws[R] = {t:'z'}); + } + /* cell address object */ + if(typeof R != "number") return ws_get_cell_stub(ws, encode_cell(R)); + /* R and C are 0-based indices */ + return ws_get_cell_stub(ws, encode_cell({r:R,c:C||0})); +} +utils.sheet_get_cell = ws_get_cell_stub; + +/* find sheet index for given name / validate index */ +function wb_sheet_idx(wb, sh) { + if(typeof sh == "number") { + if(sh >= 0 && wb.SheetNames.length > sh) return sh; + throw new Error("Cannot find sheet # " + sh); + } else if(typeof sh == "string") { + var idx = wb.SheetNames.indexOf(sh); + if(idx > -1) return idx; + throw new Error("Cannot find sheet name |" + sh + "|"); + } else throw new Error("Cannot find sheet |" + sh + "|"); +} + +/* simple blank workbook object */ +utils.book_new = function() { + return { SheetNames: [], Sheets: {} }; +}; + +/* add a worksheet to the end of a given workbook */ +utils.book_append_sheet = function(wb, ws, name) { + if(!name) for(var i = 1; i <= 0xFFFF; ++i, name = undefined) if(wb.SheetNames.indexOf(name = "Sheet" + i) == -1) break; + if(!name || wb.SheetNames.length >= 0xFFFF) throw new Error("Too many worksheets"); + check_ws_name(name); + if(wb.SheetNames.indexOf(name) >= 0) throw new Error("Worksheet with name |" + name + "| already exists!"); + + wb.SheetNames.push(name); + wb.Sheets[name] = ws; +}; + +/* set sheet visibility (visible/hidden/very hidden) */ +utils.book_set_sheet_visibility = function(wb, sh, vis) { + get_default(wb,"Workbook",{}); + get_default(wb.Workbook,"Sheets",[]); + + var idx = wb_sheet_idx(wb, sh); + // $FlowIgnore + get_default(wb.Workbook.Sheets,idx, {}); + + switch(vis) { + case 0: case 1: case 2: break; + default: throw new Error("Bad sheet visibility setting " + vis); + } + // $FlowIgnore + wb.Workbook.Sheets[idx].Hidden = vis; +}; +add_consts([ + ["SHEET_VISIBLE", 0], + ["SHEET_HIDDEN", 1], + ["SHEET_VERY_HIDDEN", 2] +]); + +/* set number format */ +utils.cell_set_number_format = function(cell, fmt) { + cell.z = fmt; + return cell; +}; + +/* set cell hyperlink */ +utils.cell_set_hyperlink = function(cell, target, tooltip) { + if(!target) { + delete cell.l; + } else { + cell.l = ({ Target: target }); + if(tooltip) cell.l.Tooltip = tooltip; + } + return cell; +}; +utils.cell_set_internal_link = function(cell, range, tooltip) { return utils.cell_set_hyperlink(cell, "#" + range, tooltip); }; + +/* add to cell comments */ +utils.cell_add_comment = function(cell, text, author) { + if(!cell.c) cell.c = []; + cell.c.push({t:text, a:author||"SheetJS"}); +}; + +/* set array formula and flush related cells */ +utils.sheet_set_array_formula = function(ws, range, formula) { + var rng = typeof range != "string" ? range : safe_decode_range(range); + var rngstr = typeof range == "string" ? range : encode_range(range); + for(var R = rng.s.r; R <= rng.e.r; ++R) for(var C = rng.s.c; C <= rng.e.c; ++C) { + var cell = ws_get_cell_stub(ws, R, C); + cell.t = 'n'; + cell.F = rngstr; + delete cell.v; + if(R == rng.s.r && C == rng.s.c) cell.f = formula; + } + return ws; +}; + +return utils; +})(utils); + +if(has_buf && "function" != 'undefined') (function() { + var Readable = __webpack_require__(374).Readable; + + var write_csv_stream = function(sheet, opts) { + var stream = Readable(); + var o = opts == null ? {} : opts; + if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; } + var r = safe_decode_range(sheet["!ref"]); + var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0); + var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0); + var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$"); + var row = "", cols = []; + o.dense = Array.isArray(sheet); + var colinfo = o.skipHidden && sheet["!cols"] || []; + var rowinfo = o.skipHidden && sheet["!rows"] || []; + for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C); + var R = r.s.r; + var BOM = false; + stream._read = function() { + if(!BOM) { BOM = true; return stream.push("\uFEFF"); } + while(R <= r.e.r) { + ++R; + if ((rowinfo[R-1]||{}).hidden) continue; + row = make_csv_row(sheet, r, R-1, cols, fs, rs, FS, o); + if(row != null) { + if(o.strip) row = row.replace(endregex,""); + stream.push(row + RS); + break; + } + } + if(R > r.e.r) return stream.push(null); + }; + return stream; + }; + + var write_html_stream = function(ws, opts) { + var stream = Readable(); + + var o = opts || {}; + var header = o.header != null ? o.header : HTML_.BEGIN; + var footer = o.footer != null ? o.footer : HTML_.END; + stream.push(header); + var r = decode_range(ws['!ref']); + o.dense = Array.isArray(ws); + stream.push(HTML_._preamble(ws, r, o)); + var R = r.s.r; + var end = false; + stream._read = function() { + if(R > r.e.r) { + if(!end) { end = true; stream.push("" + footer); } + return stream.push(null); + } + while(R <= r.e.r) { + stream.push(HTML_._row(ws, r, R, o)); + ++R; + break; + } + }; + return stream; + }; + + var write_json_stream = function(sheet, opts) { + var stream = Readable({objectMode:true}); + + if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; } + var val = {t:'n',v:0}, header = 0, offset = 1, hdr = [], v=0, vv=""; + var r = {s:{r:0,c:0},e:{r:0,c:0}}; + var o = opts || {}; + var range = o.range != null ? o.range : sheet["!ref"]; + if(o.header === 1) header = 1; + else if(o.header === "A") header = 2; + else if(Array.isArray(o.header)) header = 3; + switch(typeof range) { + case 'string': r = safe_decode_range(range); break; + case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break; + default: r = range; + } + if(header > 0) offset = 0; + var rr = encode_row(r.s.r); + var cols = []; + var counter = 0; + var dense = Array.isArray(sheet); + var R = r.s.r, C = 0, CC = 0; + if(dense && !sheet[R]) sheet[R] = []; + for(C = r.s.c; C <= r.e.c; ++C) { + cols[C] = encode_col(C); + val = dense ? sheet[R][C] : sheet[cols[C] + rr]; + switch(header) { + case 1: hdr[C] = C - r.s.c; break; + case 2: hdr[C] = cols[C]; break; + case 3: hdr[C] = o.header[C - r.s.c]; break; + default: + if(val == null) val = {w: "__EMPTY", t: "s"}; + vv = v = format_cell(val, null, o); + counter = 0; + for(CC = 0; CC < hdr.length; ++CC) if(hdr[CC] == vv) vv = v + "_" + (++counter); + hdr[C] = vv; + } + } + R = r.s.r + offset; + stream._read = function() { + if(R > r.e.r) return stream.push(null); + while(R <= r.e.r) { + //if ((rowinfo[R-1]||{}).hidden) continue; + var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o); + ++R; + if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) { + stream.push(row.row); + break; + } + } + }; + return stream; + }; + + XLSX.stream = { + to_json: write_json_stream, + to_html: write_html_stream, + to_csv: write_csv_stream + }; +})(); + +if(typeof parse_xlscfb !== "undefined") XLSX.parse_xlscfb = parse_xlscfb; +XLSX.parse_zip = parse_zip; +XLSX.read = readSync; //xlsread +XLSX.readFile = readFileSync; //readFile +XLSX.readFileSync = readFileSync; +XLSX.write = writeSync; +XLSX.writeFile = writeFileSync; +XLSX.writeFileSync = writeFileSync; +XLSX.writeFileAsync = writeFileAsync; +XLSX.utils = utils; +XLSX.SSF = SSF; +if(typeof CFB !== "undefined") XLSX.CFB = CFB; +} +/*global define */ +if(true) make_xlsx_lib(exports); +else if(typeof module !== 'undefined' && module.exports) make_xlsx_lib(module.exports); +else if(typeof define === 'function' && define.amd) define(function() { if(!XLSX.version) make_xlsx_lib(XLSX); return XLSX; }); +else make_xlsx_lib(XLSX); +/*exported XLS, ODS */ +var XLS = XLSX, ODS = XLSX; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(27), __webpack_require__(122).Buffer, __webpack_require__(51))) + +/***/ }), +/* 368 */ +/***/ (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 + + var i + for (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('') +} + + +/***/ }), +/* 369 */ +/***/ (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 +} + + +/***/ }), +/* 370 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), +/* 371 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer, global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;var require;/* + +JSZip - A Javascript class for generating and reading zip files + + +(c) 2009-2014 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE + +Note: since JSZip 3 removed critical functionality, this version assigns to the +`JSZipSync` variable. Another JSZip version can be loaded in parallel. +*/ +(function(e){ + if("object"==typeof exports&&"undefined"!=typeof module&&"undefined"==typeof DO_NOT_EXPORT_JSZIP)module.exports=e(); + else if("function"=="function"&&__webpack_require__(372)&&"undefined"==typeof DO_NOT_EXPORT_JSZIP){JSZipSync=e();!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (e), + __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{ + var f; + "undefined"!=typeof globalThis?f=globalThis: + "undefined"!=typeof window?f=window: + "undefined"!=typeof global?f=global: + "undefined"!=typeof $ && $.global?f=$.global: + "undefined"!=typeof self&&(f=self),f.JSZipSync=e() + } +}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } + else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); + + } + + return output; +}; + +// public method for decoding +exports.decode = function(input, utf8) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + while (i < input.length) { + + enc1 = _keyStr.indexOf(input.charAt(i++)); + enc2 = _keyStr.indexOf(input.charAt(i++)); + enc3 = _keyStr.indexOf(input.charAt(i++)); + enc4 = _keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + + } + + return output; + +}; + +},{}],2:[function(_dereq_,module,exports){ +'use strict'; +function CompressedObject() { + this.compressedSize = 0; + this.uncompressedSize = 0; + this.crc32 = 0; + this.compressionMethod = null; + this.compressedContent = null; +} + +CompressedObject.prototype = { + /** + * Return the decompressed content in an unspecified format. + * The format will depend on the decompressor. + * @return {Object} the decompressed content. + */ + getContent: function() { + return null; // see implementation + }, + /** + * Return the compressed content in an unspecified format. + * The format will depend on the compressed conten source. + * @return {Object} the compressed content. + */ + getCompressedContent: function() { + return null; // see implementation + } +}; +module.exports = CompressedObject; + +},{}],3:[function(_dereq_,module,exports){ +'use strict'; +exports.STORE = { + magic: "\x00\x00", + compress: function(content) { + return content; // no compression + }, + uncompress: function(content) { + return content; // no compression + }, + compressInputType: null, + uncompressInputType: null +}; +exports.DEFLATE = _dereq_('./flate'); + +},{"./flate":8}],4:[function(_dereq_,module,exports){ +'use strict'; + +var utils = _dereq_('./utils'); + +var table = [ + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +]; + +/** + * + * Javascript crc32 + * http://www.webtoolkit.info/ + * + */ +module.exports = function crc32(input, crc) { + if (typeof input === "undefined" || !input.length) { + return 0; + } + + var isArray = utils.getTypeOf(input) !== "string"; + + if (typeof(crc) == "undefined") { + crc = 0; + } + var x = 0; + var y = 0; + var b = 0; + + crc = crc ^ (-1); + for (var i = 0, iTop = input.length; i < iTop; i++) { + b = isArray ? input[i] : input.charCodeAt(i); + y = (crc ^ b) & 0xFF; + x = table[y]; + crc = (crc >>> 8) ^ x; + } + + return crc ^ (-1); +}; +// vim: set shiftwidth=4 softtabstop=4: + +},{"./utils":21}],5:[function(_dereq_,module,exports){ +'use strict'; +var utils = _dereq_('./utils'); + +function DataReader(data) { + this.data = null; // type : see implementation + this.length = 0; + this.index = 0; +} +DataReader.prototype = { + /** + * Check that the offset will not go too far. + * @param {string} offset the additional offset to check. + * @throws {Error} an Error if the offset is out of bounds. + */ + checkOffset: function(offset) { + this.checkIndex(this.index + offset); + }, + /** + * Check that the specifed index will not be too far. + * @param {string} newIndex the index to check. + * @throws {Error} an Error if the index is out of bounds. + */ + checkIndex: function(newIndex) { + if (this.length < newIndex || newIndex < 0) { + throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?"); + } + }, + /** + * Change the index. + * @param {number} newIndex The new index. + * @throws {Error} if the new index is out of the data. + */ + setIndex: function(newIndex) { + this.checkIndex(newIndex); + this.index = newIndex; + }, + /** + * Skip the next n bytes. + * @param {number} n the number of bytes to skip. + * @throws {Error} if the new index is out of the data. + */ + skip: function(n) { + this.setIndex(this.index + n); + }, + /** + * Get the byte at the specified index. + * @param {number} i the index to use. + * @return {number} a byte. + */ + byteAt: function(i) { + // see implementations + }, + /** + * Get the next number with a given byte size. + * @param {number} size the number of bytes to read. + * @return {number} the corresponding number. + */ + readInt: function(size) { + var result = 0, + i; + this.checkOffset(size); + for (i = this.index + size - 1; i >= this.index; i--) { + result = (result << 8) + this.byteAt(i); + } + this.index += size; + return result; + }, + /** + * Get the next string with a given byte size. + * @param {number} size the number of bytes to read. + * @return {string} the corresponding string. + */ + readString: function(size) { + return utils.transformTo("string", this.readData(size)); + }, + /** + * Get raw data without conversion, bytes. + * @param {number} size the number of bytes to read. + * @return {Object} the raw data, implementation specific. + */ + readData: function(size) { + // see implementations + }, + /** + * Find the last occurence of a zip signature (4 bytes). + * @param {string} sig the signature to find. + * @return {number} the index of the last occurence, -1 if not found. + */ + lastIndexOfSignature: function(sig) { + // see implementations + }, + /** + * Get the next date. + * @return {Date} the date. + */ + readDate: function() { + var dostime = this.readInt(4); + return new Date( + ((dostime >> 25) & 0x7f) + 1980, // year + ((dostime >> 21) & 0x0f) - 1, // month + (dostime >> 16) & 0x1f, // day + (dostime >> 11) & 0x1f, // hour + (dostime >> 5) & 0x3f, // minute + (dostime & 0x1f) << 1); // second + } +}; +module.exports = DataReader; + +},{"./utils":21}],6:[function(_dereq_,module,exports){ +'use strict'; +exports.base64 = false; +exports.binary = false; +exports.dir = false; +exports.createFolders = false; +exports.date = null; +exports.compression = null; +exports.comment = null; + +},{}],7:[function(_dereq_,module,exports){ +'use strict'; +var utils = _dereq_('./utils'); + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.string2binary = function(str) { + return utils.string2binary(str); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.string2Uint8Array = function(str) { + return utils.transformTo("uint8array", str); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.uint8Array2String = function(array) { + return utils.transformTo("string", array); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.string2Blob = function(str) { + var buffer = utils.transformTo("arraybuffer", str); + return utils.arrayBuffer2Blob(buffer); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.arrayBuffer2Blob = function(buffer) { + return utils.arrayBuffer2Blob(buffer); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.transformTo = function(outputType, input) { + return utils.transformTo(outputType, input); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.getTypeOf = function(input) { + return utils.getTypeOf(input); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.checkSupport = function(type) { + return utils.checkSupport(type); +}; + +/** + * @deprecated + * This value will be removed in a future version without replacement. + */ +exports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS; + +/** + * @deprecated + * This value will be removed in a future version without replacement. + */ +exports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS; + + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.pretty = function(str) { + return utils.pretty(str); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.findCompression = function(compressionMethod) { + return utils.findCompression(compressionMethod); +}; + +/** + * @deprecated + * This function will be removed in a future version without replacement. + */ +exports.isRegExp = function (object) { + return utils.isRegExp(object); +}; + + +},{"./utils":21}],8:[function(_dereq_,module,exports){ +'use strict'; +var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined'); + +var pako = _dereq_("pako"); +exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array"; +exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array"; + +exports.magic = "\x08\x00"; +exports.compress = function(input) { + return pako.deflateRaw(input); +}; +exports.uncompress = function(input) { + return pako.inflateRaw(input); +}; + +},{"pako":24}],9:[function(_dereq_,module,exports){ +'use strict'; + +var base64 = _dereq_('./base64'); + +/** +Usage: + zip = new JSZip(); + zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing"); + zip.folder("images").file("smile.gif", base64Data, {base64: true}); + zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")}); + zip.remove("tempfile"); + + base64zip = zip.generate(); + +**/ + +/** + * Representation a of zip file in js + * @constructor + * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional). + * @param {Object=} options the options for creating this objects (optional). + */ +function JSZipSync(data, options) { + // if this constructor is used without `new`, it adds `new` before itself: + if(!(this instanceof JSZipSync)) return new JSZipSync(data, options); + + // object containing the files : + // { + // "folder/" : {...}, + // "folder/data.txt" : {...} + // } + this.files = {}; + + this.comment = null; + + // Where we are in the hierarchy + this.root = ""; + if (data) { + this.load(data, options); + } + this.clone = function() { + var newObj = new JSZipSync(); + for (var i in this) { + if (typeof this[i] !== "function") { + newObj[i] = this[i]; + } + } + return newObj; + }; +} +JSZipSync.prototype = _dereq_('./object'); +JSZipSync.prototype.load = _dereq_('./load'); +JSZipSync.support = _dereq_('./support'); +JSZipSync.defaults = _dereq_('./defaults'); + +/** + * @deprecated + * This namespace will be removed in a future version without replacement. + */ +JSZipSync.utils = _dereq_('./deprecatedPublicUtils'); + +JSZipSync.base64 = { + /** + * @deprecated + * This method will be removed in a future version without replacement. + */ + encode : function(input) { + return base64.encode(input); + }, + /** + * @deprecated + * This method will be removed in a future version without replacement. + */ + decode : function(input) { + return base64.decode(input); + } +}; +JSZipSync.compressions = _dereq_('./compressions'); +module.exports = JSZipSync; + +},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_,module,exports){ +'use strict'; +var base64 = _dereq_('./base64'); +var ZipEntries = _dereq_('./zipEntries'); +module.exports = function(data, options) { + var files, zipEntries, i, input; + options = options || {}; + if (options.base64) { + data = base64.decode(data); + } + + zipEntries = new ZipEntries(data, options); + files = zipEntries.files; + for (i = 0; i < files.length; i++) { + input = files[i]; + this.file(input.fileName, input.decompressed, { + binary: true, + optimizedBinaryString: true, + date: input.date, + dir: input.dir, + comment : input.fileComment.length ? input.fileComment : null, + createFolders: options.createFolders + }); + } + if (zipEntries.zipComment.length) { + this.comment = zipEntries.zipComment; + } + + return this; +}; + +},{"./base64":1,"./zipEntries":22}],11:[function(_dereq_,module,exports){ +(function (Buffer){ +'use strict'; +var Buffer_from = /*::(*/function(){}/*:: :any)*/; +if(typeof Buffer !== 'undefined') { + var nbfs = !Buffer.from; + if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; } + Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer); + // $FlowIgnore + if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); }; +} +module.exports = function(data, encoding){ + return typeof data == 'number' ? Buffer.alloc(data) : Buffer_from(data, encoding); +}; +module.exports.test = function(b){ + return Buffer.isBuffer(b); +}; +}).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined)) +},{}],12:[function(_dereq_,module,exports){ +'use strict'; +var Uint8ArrayReader = _dereq_('./uint8ArrayReader'); + +function NodeBufferReader(data) { + this.data = data; + this.length = this.data.length; + this.index = 0; +} +NodeBufferReader.prototype = new Uint8ArrayReader(); + +/** + * @see DataReader.readData + */ +NodeBufferReader.prototype.readData = function(size) { + this.checkOffset(size); + var result = this.data.slice(this.index, this.index + size); + this.index += size; + return result; +}; +module.exports = NodeBufferReader; + +},{"./uint8ArrayReader":18}],13:[function(_dereq_,module,exports){ +'use strict'; +var support = _dereq_('./support'); +var utils = _dereq_('./utils'); +var crc32 = _dereq_('./crc32'); +var signature = _dereq_('./signature'); +var defaults = _dereq_('./defaults'); +var base64 = _dereq_('./base64'); +var compressions = _dereq_('./compressions'); +var CompressedObject = _dereq_('./compressedObject'); +var nodeBuffer = _dereq_('./nodeBuffer'); +var utf8 = _dereq_('./utf8'); +var StringWriter = _dereq_('./stringWriter'); +var Uint8ArrayWriter = _dereq_('./uint8ArrayWriter'); + +/** + * Returns the raw data of a ZipObject, decompress the content if necessary. + * @param {ZipObject} file the file to use. + * @return {String|ArrayBuffer|Uint8Array|Buffer} the data. + */ +var getRawData = function(file) { + if (file._data instanceof CompressedObject) { + file._data = file._data.getContent(); + file.options.binary = true; + file.options.base64 = false; + + if (utils.getTypeOf(file._data) === "uint8array") { + var copy = file._data; + // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array. + // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file). + file._data = new Uint8Array(copy.length); + // with an empty Uint8Array, Opera fails with a "Offset larger than array size" + if (copy.length !== 0) { + file._data.set(copy, 0); + } + } + } + return file._data; +}; + +/** + * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it. + * @param {ZipObject} file the file to use. + * @return {String|ArrayBuffer|Uint8Array|Buffer} the data. + */ +var getBinaryData = function(file) { + var result = getRawData(file), + type = utils.getTypeOf(result); + if (type === "string") { + if (!file.options.binary) { + // unicode text ! + // unicode string => binary string is a painful process, check if we can avoid it. + if (support.nodebuffer) { + return nodeBuffer(result, "utf-8"); + } + } + return file.asBinary(); + } + return result; +}; + +/** + * Transform this._data into a string. + * @param {function} filter a function String -> String, applied if not null on the result. + * @return {String} the string representing this._data. + */ +var dataToString = function(asUTF8) { + var result = getRawData(this); + if (result === null || typeof result === "undefined") { + return ""; + } + // if the data is a base64 string, we decode it before checking the encoding ! + if (this.options.base64) { + result = base64.decode(result); + } + if (asUTF8 && this.options.binary) { + // JSZip.prototype.utf8decode supports arrays as input + // skip to array => string step, utf8decode will do it. + result = out.utf8decode(result); + } + else { + // no utf8 transformation, do the array => string step. + result = utils.transformTo("string", result); + } + + if (!asUTF8 && !this.options.binary) { + result = utils.transformTo("string", out.utf8encode(result)); + } + return result; +}; +/** + * A simple object representing a file in the zip file. + * @constructor + * @param {string} name the name of the file + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data + * @param {Object} options the options of the file + */ +var ZipObject = function(name, data, options) { + this.name = name; + this.dir = options.dir; + this.date = options.date; + this.comment = options.comment; + + this._data = data; + this.options = options; + + /* + * This object contains initial values for dir and date. + * With them, we can check if the user changed the deprecated metadata in + * `ZipObject#options` or not. + */ + this._initialMetadata = { + dir : options.dir, + date : options.date + }; +}; + +ZipObject.prototype = { + /** + * Return the content as UTF8 string. + * @return {string} the UTF8 string. + */ + asText: function() { + return dataToString.call(this, true); + }, + /** + * Returns the binary content. + * @return {string} the content as binary. + */ + asBinary: function() { + return dataToString.call(this, false); + }, + /** + * Returns the content as a nodejs Buffer. + * @return {Buffer} the content as a Buffer. + */ + asNodeBuffer: function() { + var result = getBinaryData(this); + return utils.transformTo("nodebuffer", result); + }, + /** + * Returns the content as an Uint8Array. + * @return {Uint8Array} the content as an Uint8Array. + */ + asUint8Array: function() { + var result = getBinaryData(this); + return utils.transformTo("uint8array", result); + }, + /** + * Returns the content as an ArrayBuffer. + * @return {ArrayBuffer} the content as an ArrayBufer. + */ + asArrayBuffer: function() { + return this.asUint8Array().buffer; + } +}; + +/** + * Transform an integer into a string in hexadecimal. + * @private + * @param {number} dec the number to convert. + * @param {number} bytes the number of bytes to generate. + * @returns {string} the result. + */ +var decToHex = function(dec, bytes) { + var hex = "", + i; + for (i = 0; i < bytes; i++) { + hex += String.fromCharCode(dec & 0xff); + dec = dec >>> 8; + } + return hex; +}; + +/** + * Merge the objects passed as parameters into a new one. + * @private + * @param {...Object} var_args All objects to merge. + * @return {Object} a new object with the data of the others. + */ +var extend = function() { + var result = {}, i, attr; + for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers + for (attr in arguments[i]) { + if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") { + result[attr] = arguments[i][attr]; + } + } + } + return result; +}; + +/** + * Transforms the (incomplete) options from the user into the complete + * set of options to create a file. + * @private + * @param {Object} o the options from the user. + * @return {Object} the complete set of options. + */ +var prepareFileAttrs = function(o) { + o = o || {}; + if (o.base64 === true && (o.binary === null || o.binary === undefined)) { + o.binary = true; + } + o = extend(o, defaults); + o.date = o.date || new Date(); + if (o.compression !== null) o.compression = o.compression.toUpperCase(); + + return o; +}; + +/** + * Add a file in the current folder. + * @private + * @param {string} name the name of the file + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file + * @param {Object} o the options of the file + * @return {Object} the new file. + */ +var fileAdd = function(name, data, o) { + // be sure sub folders exist + var dataType = utils.getTypeOf(data), + parent; + + o = prepareFileAttrs(o); + + if (o.createFolders && (parent = parentFolder(name))) { + folderAdd.call(this, parent, true); + } + + if (o.dir || data === null || typeof data === "undefined") { + o.base64 = false; + o.binary = false; + data = null; + } + else if (dataType === "string") { + if (o.binary && !o.base64) { + // optimizedBinaryString == true means that the file has already been filtered with a 0xFF mask + if (o.optimizedBinaryString !== true) { + // this is a string, not in a base64 format. + // Be sure that this is a correct "binary string" + data = utils.string2binary(data); + } + } + } + else { // arraybuffer, uint8array, ... + o.base64 = false; + o.binary = true; + + if (!dataType && !(data instanceof CompressedObject)) { + throw new Error("The data of '" + name + "' is in an unsupported format !"); + } + + // special case : it's way easier to work with Uint8Array than with ArrayBuffer + if (dataType === "arraybuffer") { + data = utils.transformTo("uint8array", data); + } + } + + var object = new ZipObject(name, data, o); + this.files[name] = object; + return object; +}; + +/** + * Find the parent folder of the path. + * @private + * @param {string} path the path to use + * @return {string} the parent folder, or "" + */ +var parentFolder = function (path) { + if (path.slice(-1) == '/') { + path = path.substring(0, path.length - 1); + } + var lastSlash = path.lastIndexOf('/'); + return (lastSlash > 0) ? path.substring(0, lastSlash) : ""; +}; + +/** + * Add a (sub) folder in the current folder. + * @private + * @param {string} name the folder's name + * @param {boolean=} [createFolders] If true, automatically create sub + * folders. Defaults to false. + * @return {Object} the new folder. + */ +var folderAdd = function(name, createFolders) { + // Check the name ends with a / + if (name.slice(-1) != "/") { + name += "/"; // IE doesn't like substr(-1) + } + + createFolders = (typeof createFolders !== 'undefined') ? createFolders : false; + + // Does this folder already exist? + if (!this.files[name]) { + fileAdd.call(this, name, null, { + dir: true, + createFolders: createFolders + }); + } + return this.files[name]; +}; + +/** + * Generate a JSZip.CompressedObject for a given zipOject. + * @param {ZipObject} file the object to read. + * @param {JSZip.compression} compression the compression to use. + * @return {JSZip.CompressedObject} the compressed result. + */ +var generateCompressedObjectFrom = function(file, compression) { + var result = new CompressedObject(), + content; + + // the data has not been decompressed, we might reuse things ! + if (file._data instanceof CompressedObject) { + result.uncompressedSize = file._data.uncompressedSize; + result.crc32 = file._data.crc32; + + if (result.uncompressedSize === 0 || file.dir) { + compression = compressions['STORE']; + result.compressedContent = ""; + result.crc32 = 0; + } + else if (file._data.compressionMethod === compression.magic) { + result.compressedContent = file._data.getCompressedContent(); + } + else { + content = file._data.getContent(); + // need to decompress / recompress + result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content)); + } + } + else { + // have uncompressed data + content = getBinaryData(file); + if (!content || content.length === 0 || file.dir) { + compression = compressions['STORE']; + content = ""; + } + result.uncompressedSize = content.length; + result.crc32 = crc32(content); + result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content)); + } + + result.compressedSize = result.compressedContent.length; + result.compressionMethod = compression.magic; + + return result; +}; + +/** + * Generate the various parts used in the construction of the final zip file. + * @param {string} name the file name. + * @param {ZipObject} file the file content. + * @param {JSZip.CompressedObject} compressedObject the compressed object. + * @param {number} offset the current offset from the start of the zip file. + * @return {object} the zip parts. + */ +var generateZipParts = function(name, file, compressedObject, offset) { + var data = compressedObject.compressedContent, + utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)), + comment = file.comment || "", + utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)), + useUTF8ForFileName = utfEncodedFileName.length !== file.name.length, + useUTF8ForComment = utfEncodedComment.length !== comment.length, + o = file.options, + dosTime, + dosDate, + extraFields = "", + unicodePathExtraField = "", + unicodeCommentExtraField = "", + dir, date; + + + // handle the deprecated options.dir + if (file._initialMetadata.dir !== file.dir) { + dir = file.dir; + } else { + dir = o.dir; + } + + // handle the deprecated options.date + if(file._initialMetadata.date !== file.date) { + date = file.date; + } else { + date = o.date; + } + + + dosTime = date.getHours(); + dosTime = dosTime << 6; + dosTime = dosTime | date.getMinutes(); + dosTime = dosTime << 5; + dosTime = dosTime | date.getSeconds() / 2; + + dosDate = date.getFullYear() - 1980; + dosDate = dosDate << 4; + dosDate = dosDate | (date.getMonth() + 1); + dosDate = dosDate << 5; + dosDate = dosDate | date.getDate(); + + if (useUTF8ForFileName) { + // set the unicode path extra field. unzip needs at least one extra + // field to correctly handle unicode path, so using the path is as good + // as any other information. This could improve the situation with + // other archive managers too. + // This field is usually used without the utf8 flag, with a non + // unicode path in the header (winrar, winzip). This helps (a bit) + // with the messy Windows' default compressed folders feature but + // breaks on p7zip which doesn't seek the unicode path extra field. + // So for now, UTF-8 everywhere ! + unicodePathExtraField = + // Version + decToHex(1, 1) + + // NameCRC32 + decToHex(crc32(utfEncodedFileName), 4) + + // UnicodeName + utfEncodedFileName; + + extraFields += + // Info-ZIP Unicode Path Extra Field + "\x75\x70" + + // size + decToHex(unicodePathExtraField.length, 2) + + // content + unicodePathExtraField; + } + + if(useUTF8ForComment) { + + unicodeCommentExtraField = + // Version + decToHex(1, 1) + + // CommentCRC32 + decToHex(this.crc32(utfEncodedComment), 4) + + // UnicodeName + utfEncodedComment; + + extraFields += + // Info-ZIP Unicode Path Extra Field + "\x75\x63" + + // size + decToHex(unicodeCommentExtraField.length, 2) + + // content + unicodeCommentExtraField; + } + + var header = ""; + + // version needed to extract + header += "\x0A\x00"; + // general purpose bit flag + // set bit 11 if utf8 + header += (useUTF8ForFileName || useUTF8ForComment) ? "\x00\x08" : "\x00\x00"; + // compression method + header += compressedObject.compressionMethod; + // last mod file time + header += decToHex(dosTime, 2); + // last mod file date + header += decToHex(dosDate, 2); + // crc-32 + header += decToHex(compressedObject.crc32, 4); + // compressed size + header += decToHex(compressedObject.compressedSize, 4); + // uncompressed size + header += decToHex(compressedObject.uncompressedSize, 4); + // file name length + header += decToHex(utfEncodedFileName.length, 2); + // extra field length + header += decToHex(extraFields.length, 2); + + + var fileRecord = signature.LOCAL_FILE_HEADER + header + utfEncodedFileName + extraFields; + + var dirRecord = signature.CENTRAL_FILE_HEADER + + // version made by (00: DOS) + "\x14\x00" + + // file header (common to file and central directory) + header + + // file comment length + decToHex(utfEncodedComment.length, 2) + + // disk number start + "\x00\x00" + + // internal file attributes TODO + "\x00\x00" + + // external file attributes + (dir === true ? "\x10\x00\x00\x00" : "\x00\x00\x00\x00") + + // relative offset of local header + decToHex(offset, 4) + + // file name + utfEncodedFileName + + // extra field + extraFields + + // file comment + utfEncodedComment; + + return { + fileRecord: fileRecord, + dirRecord: dirRecord, + compressedObject: compressedObject + }; +}; + + +// return the actual prototype of JSZip +var out = { + /** + * Read an existing zip and merge the data in the current JSZip object. + * The implementation is in jszip-load.js, don't forget to include it. + * @param {String|ArrayBuffer|Uint8Array|Buffer} stream The stream to load + * @param {Object} options Options for loading the stream. + * options.base64 : is the stream in base64 ? default : false + * @return {JSZip} the current JSZip object + */ + load: function(stream, options) { + throw new Error("Load method is not defined. Is the file jszip-load.js included ?"); + }, + + /** + * Filter nested files/folders with the specified function. + * @param {Function} search the predicate to use : + * function (relativePath, file) {...} + * It takes 2 arguments : the relative path and the file. + * @return {Array} An array of matching elements. + */ + filter: function(search) { + var result = [], + filename, relativePath, file, fileClone; + for (filename in this.files) { + if (!this.files.hasOwnProperty(filename)) { + continue; + } + file = this.files[filename]; + // return a new object, don't let the user mess with our internal objects :) + fileClone = new ZipObject(file.name, file._data, extend(file.options)); + relativePath = filename.slice(this.root.length, filename.length); + if (filename.slice(0, this.root.length) === this.root && // the file is in the current root + search(relativePath, fileClone)) { // and the file matches the function + result.push(fileClone); + } + } + return result; + }, + + /** + * Add a file to the zip file, or search a file. + * @param {string|RegExp} name The name of the file to add (if data is defined), + * the name of the file to find (if no data) or a regex to match files. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded + * @param {Object} o File options + * @return {JSZip|Object|Array} this JSZip object (when adding a file), + * a file (when searching by string) or an array of files (when searching by regex). + */ + file: function(name, data, o) { + if (arguments.length === 1) { + if (utils.isRegExp(name)) { + var regexp = name; + return this.filter(function(relativePath, file) { + return !file.dir && regexp.test(relativePath); + }); + } + else { // text + return this.filter(function(relativePath, file) { + return !file.dir && relativePath === name; + })[0] || null; + } + } + else { // more than one argument : we have data ! + name = this.root + name; + fileAdd.call(this, name, data, o); + } + return this; + }, + + /** + * Add a directory to the zip file, or search. + * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders. + * @return {JSZip} an object with the new directory as the root, or an array containing matching folders. + */ + folder: function(arg) { + if (!arg) { + return this; + } + + if (utils.isRegExp(arg)) { + return this.filter(function(relativePath, file) { + return file.dir && arg.test(relativePath); + }); + } + + // else, name is a new folder + var name = this.root + arg; + var newFolder = folderAdd.call(this, name); + + // Allow chaining by returning a new object with this folder as the root + var ret = this.clone(); + ret.root = newFolder.name; + return ret; + }, + + /** + * Delete a file, or a directory and all sub-files, from the zip + * @param {string} name the name of the file to delete + * @return {JSZip} this JSZip object + */ + remove: function(name) { + name = this.root + name; + var file = this.files[name]; + if (!file) { + // Look for any folders + if (name.slice(-1) != "/") { + name += "/"; + } + file = this.files[name]; + } + + if (file && !file.dir) { + // file + delete this.files[name]; + } else { + // maybe a folder, delete recursively + var kids = this.filter(function(relativePath, file) { + return file.name.slice(0, name.length) === name; + }); + for (var i = 0; i < kids.length; i++) { + delete this.files[kids[i].name]; + } + } + + return this; + }, + + /** + * Generate the complete zip file + * @param {Object} options the options to generate the zip file : + * - base64, (deprecated, use type instead) true to generate base64. + * - compression, "STORE" by default. + * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob. + * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file + */ + generate: function(options) { + options = extend(options || {}, { + base64: true, + compression: "STORE", + type: "base64", + comment: null + }); + + utils.checkSupport(options.type); + + var zipData = [], + localDirLength = 0, + centralDirLength = 0, + writer, i, + utfEncodedComment = utils.transformTo("string", this.utf8encode(options.comment || this.comment || "")); + + // first, generate all the zip parts. + for (var name in this.files) { + if (!this.files.hasOwnProperty(name)) { + continue; + } + var file = this.files[name]; + + var compressionName = file.options.compression || options.compression.toUpperCase(); + var compression = compressions[compressionName]; + if (!compression) { + throw new Error(compressionName + " is not a valid compression method !"); + } + + var compressedObject = generateCompressedObjectFrom.call(this, file, compression); + + var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength); + localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize; + centralDirLength += zipPart.dirRecord.length; + zipData.push(zipPart); + } + + var dirEnd = ""; + + // end of central dir signature + dirEnd = signature.CENTRAL_DIRECTORY_END + + // number of this disk + "\x00\x00" + + // number of the disk with the start of the central directory + "\x00\x00" + + // total number of entries in the central directory on this disk + decToHex(zipData.length, 2) + + // total number of entries in the central directory + decToHex(zipData.length, 2) + + // size of the central directory 4 bytes + decToHex(centralDirLength, 4) + + // offset of start of central directory with respect to the starting disk number + decToHex(localDirLength, 4) + + // .ZIP file comment length + decToHex(utfEncodedComment.length, 2) + + // .ZIP file comment + utfEncodedComment; + + + // we have all the parts (and the total length) + // time to create a writer ! + var typeName = options.type.toLowerCase(); + if(typeName==="uint8array"||typeName==="arraybuffer"||typeName==="blob"||typeName==="nodebuffer") { + writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length); + }else{ + writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length); + } + + for (i = 0; i < zipData.length; i++) { + writer.append(zipData[i].fileRecord); + writer.append(zipData[i].compressedObject.compressedContent); + } + for (i = 0; i < zipData.length; i++) { + writer.append(zipData[i].dirRecord); + } + + writer.append(dirEnd); + + var zip = writer.finalize(); + + + + switch(options.type.toLowerCase()) { + // case "zip is an Uint8Array" + case "uint8array" : + case "arraybuffer" : + case "nodebuffer" : + return utils.transformTo(options.type.toLowerCase(), zip); + case "blob" : + return utils.arrayBuffer2Blob(utils.transformTo("arraybuffer", zip)); + // case "zip is a string" + case "base64" : + return (options.base64) ? base64.encode(zip) : zip; + default : // case "string" : + return zip; + } + + }, + + /** + * @deprecated + * This method will be removed in a future version without replacement. + */ + crc32: function (input, crc) { + return crc32(input, crc); + }, + + /** + * @deprecated + * This method will be removed in a future version without replacement. + */ + utf8encode: function (string) { + return utils.transformTo("string", utf8.utf8encode(string)); + }, + + /** + * @deprecated + * This method will be removed in a future version without replacement. + */ + utf8decode: function (input) { + return utf8.utf8decode(input); + } +}; +module.exports = out; + +},{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(_dereq_,module,exports){ +'use strict'; +exports.LOCAL_FILE_HEADER = "PK\x03\x04"; +exports.CENTRAL_FILE_HEADER = "PK\x01\x02"; +exports.CENTRAL_DIRECTORY_END = "PK\x05\x06"; +exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07"; +exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06"; +exports.DATA_DESCRIPTOR = "PK\x07\x08"; + +},{}],15:[function(_dereq_,module,exports){ +'use strict'; +var DataReader = _dereq_('./dataReader'); +var utils = _dereq_('./utils'); + +function StringReader(data, optimizedBinaryString) { + this.data = data; + if (!optimizedBinaryString) { + this.data = utils.string2binary(this.data); + } + this.length = this.data.length; + this.index = 0; +} +StringReader.prototype = new DataReader(); +/** + * @see DataReader.byteAt + */ +StringReader.prototype.byteAt = function(i) { + return this.data.charCodeAt(i); +}; +/** + * @see DataReader.lastIndexOfSignature + */ +StringReader.prototype.lastIndexOfSignature = function(sig) { + return this.data.lastIndexOf(sig); +}; +/** + * @see DataReader.readData + */ +StringReader.prototype.readData = function(size) { + this.checkOffset(size); + // this will work because the constructor applied the "& 0xff" mask. + var result = this.data.slice(this.index, this.index + size); + this.index += size; + return result; +}; +module.exports = StringReader; + +},{"./dataReader":5,"./utils":21}],16:[function(_dereq_,module,exports){ +'use strict'; + +var utils = _dereq_('./utils'); + +/** + * An object to write any content to a string. + * @constructor + */ +var StringWriter = function() { + this.data = []; +}; +StringWriter.prototype = { + /** + * Append any content to the current string. + * @param {Object} input the content to add. + */ + append: function(input) { + input = utils.transformTo("string", input); + this.data.push(input); + }, + /** + * Finalize the construction an return the result. + * @return {string} the generated string. + */ + finalize: function() { + return this.data.join(""); + } +}; + +module.exports = StringWriter; + +},{"./utils":21}],17:[function(_dereq_,module,exports){ +(function (Buffer){ +'use strict'; +exports.base64 = true; +exports.array = true; +exports.string = true; +exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined"; +// contains true if JSZip can read/generate nodejs Buffer, false otherwise. +// Browserify will provide a Buffer implementation for browsers, which is +// an augmented Uint8Array (i.e., can be used as either Buffer or U8). +exports.nodebuffer = typeof Buffer !== "undefined"; +// contains true if JSZip can read/generate Uint8Array, false otherwise. +exports.uint8array = typeof Uint8Array !== "undefined"; + +if (typeof ArrayBuffer === "undefined") { + exports.blob = false; +} +else { + var buffer = new ArrayBuffer(0); + try { + exports.blob = new Blob([buffer], { + type: "application/zip" + }).size === 0; + } + catch (e) { + try { + var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; + var builder = new Builder(); + builder.append(buffer); + exports.blob = builder.getBlob('application/zip').size === 0; + } + catch (e) { + exports.blob = false; + } + } +} + +}).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined)) +},{}],18:[function(_dereq_,module,exports){ +'use strict'; +var DataReader = _dereq_('./dataReader'); + +function Uint8ArrayReader(data) { + if (data) { + this.data = data; + this.length = this.data.length; + this.index = 0; + } +} +Uint8ArrayReader.prototype = new DataReader(); +/** + * @see DataReader.byteAt + */ +Uint8ArrayReader.prototype.byteAt = function(i) { + return this.data[i]; +}; +/** + * @see DataReader.lastIndexOfSignature + */ +Uint8ArrayReader.prototype.lastIndexOfSignature = function(sig) { + var sig0 = sig.charCodeAt(0), + sig1 = sig.charCodeAt(1), + sig2 = sig.charCodeAt(2), + sig3 = sig.charCodeAt(3); + for (var i = this.length - 4; i >= 0; --i) { + if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) { + return i; + } + } + + return -1; +}; +/** + * @see DataReader.readData + */ +Uint8ArrayReader.prototype.readData = function(size) { + this.checkOffset(size); + if(size === 0) { + // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of []. + return new Uint8Array(0); + } + var result = this.data.subarray(this.index, this.index + size); + this.index += size; + return result; +}; +module.exports = Uint8ArrayReader; + +},{"./dataReader":5}],19:[function(_dereq_,module,exports){ +'use strict'; + +var utils = _dereq_('./utils'); + +/** + * An object to write any content to an Uint8Array. + * @constructor + * @param {number} length The length of the array. + */ +var Uint8ArrayWriter = function(length) { + this.data = new Uint8Array(length); + this.index = 0; +}; +Uint8ArrayWriter.prototype = { + /** + * Append any content to the current array. + * @param {Object} input the content to add. + */ + append: function(input) { + if (input.length !== 0) { + // with an empty Uint8Array, Opera fails with a "Offset larger than array size" + input = utils.transformTo("uint8array", input); + this.data.set(input, this.index); + this.index += input.length; + } + }, + /** + * Finalize the construction an return the result. + * @return {Uint8Array} the generated array. + */ + finalize: function() { + return this.data; + } +}; + +module.exports = Uint8ArrayWriter; + +},{"./utils":21}],20:[function(_dereq_,module,exports){ +'use strict'; + +var utils = _dereq_('./utils'); +var support = _dereq_('./support'); +var nodeBuffer = _dereq_('./nodeBuffer'); + +/** + * The following functions come from pako, from pako/lib/utils/strings + * released under the MIT license, see pako https://github.com/nodeca/pako/ + */ + +// Table with utf8 lengths (calculated by first byte of sequence) +// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS, +// because max possible codepoint is 0x10ffff +var _utf8len = new Array(256); +for (var i=0; i<256; i++) { + _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1); +} +_utf8len[254]=_utf8len[254]=1; // Invalid sequence start + +// convert string to array (typed, when possible) +var string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if (((c & 0xfc00) === 0xd800) && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += (c < 0x80) ? 1 : ((c < 0x800) ? 2 : ((c < 0x10000) ? 3 : 4)); + } + + // allocate buffer + if (support.uint8array) { + buf = new Uint8Array(buf_len); + } else { + buf = new Array(buf_len); + } + + // convert + for (i=0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | ((c >>> 6) & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | ((c >>> 12) & 0x3f); + buf[i++] = 0x80 | ((c >>> 6) & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +var utf8border = function(buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max-1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +// convert array to string +var buf2string = function (buf) { + var str, i, out, c, c_len; + var len = buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len*2); + + for (out=0, i=0; i 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + // shrinkBuf(utf16buf, out) + if (utf16buf.length !== out) { + if(utf16buf.subarray) { + utf16buf = utf16buf.subarray(0, out); + } else { + utf16buf.length = out; + } + } + + // return String.fromCharCode.apply(null, utf16buf); + return utils.applyFromCharCode(utf16buf); +}; + + +// That's all for the pako functions. + + +/** + * Transform a javascript string into an array (typed if possible) of bytes, + * UTF-8 encoded. + * @param {String} str the string to encode + * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string. + */ +exports.utf8encode = function utf8encode(str) { + if (support.nodebuffer) { + return nodeBuffer(str, "utf-8"); + } + + return string2buf(str); +}; + + +/** + * Transform a bytes array (or a representation) representing an UTF-8 encoded + * string into a javascript string. + * @param {Array|Uint8Array|Buffer} buf the data de decode + * @return {String} the decoded string. + */ +exports.utf8decode = function utf8decode(buf) { + if (support.nodebuffer) { + return utils.transformTo("nodebuffer", buf).toString("utf-8"); + } + + buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf); + + // return buf2string(buf); + // Chrome prefers to work with "small" chunks of data + // for the method buf2string. + // Firefox and Chrome has their own shortcut, IE doesn't seem to really care. + var result = [], k = 0, len = buf.length, chunk = 65536; + while (k < len) { + var nextBoundary = utf8border(buf, Math.min(k + chunk, len)); + if (support.uint8array) { + result.push(buf2string(buf.subarray(k, nextBoundary))); + } else { + result.push(buf2string(buf.slice(k, nextBoundary))); + } + k = nextBoundary; + } + return result.join(""); + +}; +// vim: set shiftwidth=4 softtabstop=4: + +},{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(_dereq_,module,exports){ +'use strict'; +var support = _dereq_('./support'); +var compressions = _dereq_('./compressions'); +var nodeBuffer = _dereq_('./nodeBuffer'); +/** + * Convert a string to a "binary string" : a string containing only char codes between 0 and 255. + * @param {string} str the string to transform. + * @return {String} the binary string. + */ +exports.string2binary = function(str) { + var result = ""; + for (var i = 0; i < str.length; i++) { + result += String.fromCharCode(str.charCodeAt(i) & 0xff); + } + return result; +}; +exports.arrayBuffer2Blob = function(buffer) { + exports.checkSupport("blob"); + + try { + // Blob constructor + return new Blob([buffer], { + type: "application/zip" + }); + } + catch (e) { + + try { + // deprecated, browser only, old way + var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; + var builder = new Builder(); + builder.append(buffer); + return builder.getBlob('application/zip'); + } + catch (e) { + + // well, fuck ?! + throw new Error("Bug : can't construct the Blob."); + } + } + + +}; +/** + * The identity function. + * @param {Object} input the input. + * @return {Object} the same input. + */ +function identity(input) { + return input; +} + +/** + * Fill in an array with a string. + * @param {String} str the string to use. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated). + * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array. + */ +function stringToArrayLike(str, array) { + for (var i = 0; i < str.length; ++i) { + array[i] = str.charCodeAt(i) & 0xFF; + } + return array; +} + +/** + * Transform an array-like object to a string. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform. + * @return {String} the result. + */ +function arrayLikeToString(array) { + // Performances notes : + // -------------------- + // String.fromCharCode.apply(null, array) is the fastest, see + // see http://jsperf.com/converting-a-uint8array-to-a-string/2 + // but the stack is limited (and we can get huge arrays !). + // + // result += String.fromCharCode(array[i]); generate too many strings ! + // + // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2 + var chunk = 65536; + var result = [], + len = array.length, + type = exports.getTypeOf(array), + k = 0, + canUseApply = true; + try { + switch(type) { + case "uint8array": + String.fromCharCode.apply(null, new Uint8Array(0)); + break; + case "nodebuffer": + String.fromCharCode.apply(null, nodeBuffer(0)); + break; + } + } catch(e) { + canUseApply = false; + } + + // no apply : slow and painful algorithm + // default browser on android 4.* + if (!canUseApply) { + var resultStr = ""; + for(var i = 0; i < array.length;i++) { + resultStr += String.fromCharCode(array[i]); + } + return resultStr; + } + while (k < len && chunk > 1) { + try { + if (type === "array" || type === "nodebuffer") { + result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len)))); + } + else { + result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len)))); + } + k += chunk; + } + catch (e) { + chunk = Math.floor(chunk / 2); + } + } + return result.join(""); +} + +exports.applyFromCharCode = arrayLikeToString; + + +/** + * Copy the data from an array-like to an other array-like. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array. + * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated. + * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array. + */ +function arrayLikeToArrayLike(arrayFrom, arrayTo) { + for (var i = 0; i < arrayFrom.length; i++) { + arrayTo[i] = arrayFrom[i]; + } + return arrayTo; +} + +// a matrix containing functions to transform everything into everything. +var transform = {}; + +// string to ? +transform["string"] = { + "string": identity, + "array": function(input) { + return stringToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return transform["string"]["uint8array"](input).buffer; + }, + "uint8array": function(input) { + return stringToArrayLike(input, new Uint8Array(input.length)); + }, + "nodebuffer": function(input) { + return stringToArrayLike(input, nodeBuffer(input.length)); + } +}; + +// array to ? +transform["array"] = { + "string": arrayLikeToString, + "array": identity, + "arraybuffer": function(input) { + return (new Uint8Array(input)).buffer; + }, + "uint8array": function(input) { + return new Uint8Array(input); + }, + "nodebuffer": function(input) { + return nodeBuffer(input); + } +}; + +// arraybuffer to ? +transform["arraybuffer"] = { + "string": function(input) { + return arrayLikeToString(new Uint8Array(input)); + }, + "array": function(input) { + return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength)); + }, + "arraybuffer": identity, + "uint8array": function(input) { + return new Uint8Array(input); + }, + "nodebuffer": function(input) { + return nodeBuffer(new Uint8Array(input)); + } +}; + +// uint8array to ? +transform["uint8array"] = { + "string": arrayLikeToString, + "array": function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return input.buffer; + }, + "uint8array": identity, + "nodebuffer": function(input) { + return nodeBuffer(input); + } +}; + +// nodebuffer to ? +transform["nodebuffer"] = { + "string": arrayLikeToString, + "array": function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, + "arraybuffer": function(input) { + return transform["nodebuffer"]["uint8array"](input).buffer; + }, + "uint8array": function(input) { + return arrayLikeToArrayLike(input, new Uint8Array(input.length)); + }, + "nodebuffer": identity +}; + +/** + * Transform an input into any type. + * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer. + * If no output type is specified, the unmodified input will be returned. + * @param {String} outputType the output type. + * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert. + * @throws {Error} an Error if the browser doesn't support the requested output type. + */ +exports.transformTo = function(outputType, input) { + if (!input) { + // undefined, null, etc + // an empty string won't harm. + input = ""; + } + if (!outputType) { + return input; + } + exports.checkSupport(outputType); + var inputType = exports.getTypeOf(input); + var result = transform[inputType][outputType](input); + return result; +}; + +/** + * Return the type of the input. + * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer. + * @param {Object} input the input to identify. + * @return {String} the (lowercase) type of the input. + */ +exports.getTypeOf = function(input) { + if (typeof input === "string") { + return "string"; + } + if (Object.prototype.toString.call(input) === "[object Array]") { + return "array"; + } + if (support.nodebuffer && nodeBuffer.test(input)) { + return "nodebuffer"; + } + if (support.uint8array && input instanceof Uint8Array) { + return "uint8array"; + } + if (support.arraybuffer && input instanceof ArrayBuffer) { + return "arraybuffer"; + } +}; + +/** + * Throw an exception if the type is not supported. + * @param {String} type the type to check. + * @throws {Error} an Error if the browser doesn't support the requested type. + */ +exports.checkSupport = function(type) { + var supported = support[type.toLowerCase()]; + if (!supported) { + throw new Error(type + " is not supported by this browser"); + } +}; +exports.MAX_VALUE_16BITS = 65535; +exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1 + +/** + * Prettify a string read as binary. + * @param {string} str the string to prettify. + * @return {string} a pretty string. + */ +exports.pretty = function(str) { + var res = '', + code, i; + for (i = 0; i < (str || "").length; i++) { + code = str.charCodeAt(i); + res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase(); + } + return res; +}; + +/** + * Find a compression registered in JSZip. + * @param {string} compressionMethod the method magic to find. + * @return {Object|null} the JSZip compression object, null if none found. + */ +exports.findCompression = function(compressionMethod) { + for (var method in compressions) { + if (!compressions.hasOwnProperty(method)) { + continue; + } + if (compressions[method].magic === compressionMethod) { + return compressions[method]; + } + } + return null; +}; +/** +* Cross-window, cross-Node-context regular expression detection +* @param {Object} object Anything +* @return {Boolean} true if the object is a regular expression, +* false otherwise +*/ +exports.isRegExp = function (object) { + return Object.prototype.toString.call(object) === "[object RegExp]"; +}; + + +},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){ +'use strict'; +var StringReader = _dereq_('./stringReader'); +var NodeBufferReader = _dereq_('./nodeBufferReader'); +var Uint8ArrayReader = _dereq_('./uint8ArrayReader'); +var utils = _dereq_('./utils'); +var sig = _dereq_('./signature'); +var ZipEntry = _dereq_('./zipEntry'); +var support = _dereq_('./support'); +var jszipProto = _dereq_('./object'); +// class ZipEntries {{{ +/** + * All the entries in the zip file. + * @constructor + * @param {String|ArrayBuffer|Uint8Array} data the binary stream to load. + * @param {Object} loadOptions Options for loading the stream. + */ +function ZipEntries(data, loadOptions) { + this.files = []; + this.loadOptions = loadOptions; + if (data) { + this.load(data); + } +} +ZipEntries.prototype = { + /** + * Check that the reader is on the speficied signature. + * @param {string} expectedSignature the expected signature. + * @throws {Error} if it is an other signature. + */ + checkSignature: function(expectedSignature) { + var signature = this.reader.readString(4); + if (signature !== expectedSignature) { + throw new Error("Corrupted zip or bug : unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")"); + } + }, + /** + * Read the end of the central directory. + */ + readBlockEndOfCentral: function() { + this.diskNumber = this.reader.readInt(2); + this.diskWithCentralDirStart = this.reader.readInt(2); + this.centralDirRecordsOnThisDisk = this.reader.readInt(2); + this.centralDirRecords = this.reader.readInt(2); + this.centralDirSize = this.reader.readInt(4); + this.centralDirOffset = this.reader.readInt(4); + + this.zipCommentLength = this.reader.readInt(2); + // warning : the encoding depends of the system locale + // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded. + // On a windows machine, this field is encoded with the localized windows code page. + this.zipComment = this.reader.readString(this.zipCommentLength); + // To get consistent behavior with the generation part, we will assume that + // this is utf8 encoded. + this.zipComment = jszipProto.utf8decode(this.zipComment); + }, + /** + * Read the end of the Zip 64 central directory. + * Not merged with the method readEndOfCentral : + * The end of central can coexist with its Zip64 brother, + * I don't want to read the wrong number of bytes ! + */ + readBlockZip64EndOfCentral: function() { + this.zip64EndOfCentralSize = this.reader.readInt(8); + this.versionMadeBy = this.reader.readString(2); + this.versionNeeded = this.reader.readInt(2); + this.diskNumber = this.reader.readInt(4); + this.diskWithCentralDirStart = this.reader.readInt(4); + this.centralDirRecordsOnThisDisk = this.reader.readInt(8); + this.centralDirRecords = this.reader.readInt(8); + this.centralDirSize = this.reader.readInt(8); + this.centralDirOffset = this.reader.readInt(8); + + this.zip64ExtensibleData = {}; + var extraDataSize = this.zip64EndOfCentralSize - 44, + index = 0, + extraFieldId, + extraFieldLength, + extraFieldValue; + while (index < extraDataSize) { + extraFieldId = this.reader.readInt(2); + extraFieldLength = this.reader.readInt(4); + extraFieldValue = this.reader.readString(extraFieldLength); + this.zip64ExtensibleData[extraFieldId] = { + id: extraFieldId, + length: extraFieldLength, + value: extraFieldValue + }; + } + }, + /** + * Read the end of the Zip 64 central directory locator. + */ + readBlockZip64EndOfCentralLocator: function() { + this.diskWithZip64CentralDirStart = this.reader.readInt(4); + this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8); + this.disksCount = this.reader.readInt(4); + if (this.disksCount > 1) { + throw new Error("Multi-volumes zip are not supported"); + } + }, + /** + * Read the local files, based on the offset read in the central part. + */ + readLocalFiles: function() { + var i, file; + for (i = 0; i < this.files.length; i++) { + file = this.files[i]; + this.reader.setIndex(file.localHeaderOffset); + this.checkSignature(sig.LOCAL_FILE_HEADER); + file.readLocalPart(this.reader); + file.handleUTF8(); + } + }, + /** + * Read the central directory. + */ + readCentralDir: function() { + var file; + + this.reader.setIndex(this.centralDirOffset); + while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) { + file = new ZipEntry({ + zip64: this.zip64 + }, this.loadOptions); + file.readCentralPart(this.reader); + this.files.push(file); + } + }, + /** + * Read the end of central directory. + */ + readEndOfCentral: function() { + var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END); + if (offset === -1) { + throw new Error("Corrupted zip : can't find end of central directory"); + } + this.reader.setIndex(offset); + this.checkSignature(sig.CENTRAL_DIRECTORY_END); + this.readBlockEndOfCentral(); + + + /* extract from the zip spec : + 4) If one of the fields in the end of central directory + record is too small to hold required data, the field + should be set to -1 (0xFFFF or 0xFFFFFFFF) and the + ZIP64 format record should be created. + 5) The end of central directory record and the + Zip64 end of central directory locator record must + reside on the same disk when splitting or spanning + an archive. + */ + if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) { + this.zip64 = true; + + /* + Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from + the zip file can fit into a 32bits integer. This cannot be solved : Javascript represents + all numbers as 64-bit double precision IEEE 754 floating point numbers. + So, we have 53bits for integers and bitwise operations treat everything as 32bits. + see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators + and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5 + */ + + // should look for a zip64 EOCD locator + offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + if (offset === -1) { + throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator"); + } + this.reader.setIndex(offset); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + this.readBlockZip64EndOfCentralLocator(); + + // now the zip64 EOCD record + this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); + this.readBlockZip64EndOfCentral(); + } + }, + prepareReader: function(data) { + var type = utils.getTypeOf(data); + if (type === "string" && !support.uint8array) { + this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString); + } + else if (type === "nodebuffer") { + this.reader = new NodeBufferReader(data); + } + else { + this.reader = new Uint8ArrayReader(utils.transformTo("uint8array", data)); + } + }, + /** + * Read a zip file and create ZipEntries. + * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file. + */ + load: function(data) { + this.prepareReader(data); + this.readEndOfCentral(); + this.readCentralDir(); + this.readLocalFiles(); + } +}; +// }}} end of ZipEntries +module.exports = ZipEntries; + +},{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(_dereq_,module,exports){ +'use strict'; +var StringReader = _dereq_('./stringReader'); +var utils = _dereq_('./utils'); +var CompressedObject = _dereq_('./compressedObject'); +var jszipProto = _dereq_('./object'); +// class ZipEntry {{{ +/** + * An entry in the zip file. + * @constructor + * @param {Object} options Options of the current file. + * @param {Object} loadOptions Options for loading the stream. + */ +function ZipEntry(options, loadOptions) { + this.options = options; + this.loadOptions = loadOptions; +} +ZipEntry.prototype = { + /** + * say if the file is encrypted. + * @return {boolean} true if the file is encrypted, false otherwise. + */ + isEncrypted: function() { + // bit 1 is set + return (this.bitFlag & 0x0001) === 0x0001; + }, + /** + * say if the file has utf-8 filename/comment. + * @return {boolean} true if the filename/comment is in utf-8, false otherwise. + */ + useUTF8: function() { + // bit 11 is set + return (this.bitFlag & 0x0800) === 0x0800; + }, + /** + * Prepare the function used to generate the compressed content from this ZipFile. + * @param {DataReader} reader the reader to use. + * @param {number} from the offset from where we should read the data. + * @param {number} length the length of the data to read. + * @return {Function} the callback to get the compressed content (the type depends of the DataReader class). + */ + prepareCompressedContent: function(reader, from, length) { + return function() { + var previousIndex = reader.index; + reader.setIndex(from); + var compressedFileData = reader.readData(length); + reader.setIndex(previousIndex); + + return compressedFileData; + }; + }, + /** + * Prepare the function used to generate the uncompressed content from this ZipFile. + * @param {DataReader} reader the reader to use. + * @param {number} from the offset from where we should read the data. + * @param {number} length the length of the data to read. + * @param {JSZip.compression} compression the compression used on this file. + * @param {number} uncompressedSize the uncompressed size to expect. + * @return {Function} the callback to get the uncompressed content (the type depends of the DataReader class). + */ + prepareContent: function(reader, from, length, compression, uncompressedSize) { + return function() { + + var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent()); + var uncompressedFileData = compression.uncompress(compressedFileData); + + if (uncompressedFileData.length !== uncompressedSize) { + throw new Error("Bug : uncompressed data size mismatch"); + } + + return uncompressedFileData; + }; + }, + /** + * Read the local part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readLocalPart: function(reader) { + var compression, localExtraFieldsLength; + + // we already know everything from the central dir ! + // If the central dir data are false, we are doomed. + // On the bright side, the local part is scary : zip64, data descriptors, both, etc. + // The less data we get here, the more reliable this should be. + // Let's skip the whole header and dash to the data ! + reader.skip(22); + // in some zip created on windows, the filename stored in the central dir contains \ instead of /. + // Strangely, the filename here is OK. + // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes + // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators... + // Search "unzip mismatching "local" filename continuing with "central" filename version" on + // the internet. + // + // I think I see the logic here : the central directory is used to display + // content and the local directory is used to extract the files. Mixing / and \ + // may be used to display \ to windows users and use / when extracting the files. + // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394 + this.fileNameLength = reader.readInt(2); + localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir + this.fileName = reader.readString(this.fileNameLength); + reader.skip(localExtraFieldsLength); + + if (this.compressedSize == -1 || this.uncompressedSize == -1) { + throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize == -1 || uncompressedSize == -1)"); + } + + compression = utils.findCompression(this.compressionMethod); + if (compression === null) { // no compression found + throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")"); + } + this.decompressed = new CompressedObject(); + this.decompressed.compressedSize = this.compressedSize; + this.decompressed.uncompressedSize = this.uncompressedSize; + this.decompressed.crc32 = this.crc32; + this.decompressed.compressionMethod = this.compressionMethod; + this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression); + this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize); + + // we need to compute the crc32... + if (this.loadOptions.checkCRC32) { + this.decompressed = utils.transformTo("string", this.decompressed.getContent()); + if (jszipProto.crc32(this.decompressed) !== this.crc32) { + throw new Error("Corrupted zip : CRC32 mismatch"); + } + } + }, + + /** + * Read the central part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readCentralPart: function(reader) { + this.versionMadeBy = reader.readString(2); + this.versionNeeded = reader.readInt(2); + this.bitFlag = reader.readInt(2); + this.compressionMethod = reader.readString(2); + this.date = reader.readDate(); + this.crc32 = reader.readInt(4); + this.compressedSize = reader.readInt(4); + this.uncompressedSize = reader.readInt(4); + this.fileNameLength = reader.readInt(2); + this.extraFieldsLength = reader.readInt(2); + this.fileCommentLength = reader.readInt(2); + this.diskNumberStart = reader.readInt(2); + this.internalFileAttributes = reader.readInt(2); + this.externalFileAttributes = reader.readInt(4); + this.localHeaderOffset = reader.readInt(4); + + if (this.isEncrypted()) { + throw new Error("Encrypted zip are not supported"); + } + + this.fileName = reader.readString(this.fileNameLength); + this.readExtraFields(reader); + this.parseZIP64ExtraField(reader); + this.fileComment = reader.readString(this.fileCommentLength); + + // warning, this is true only for zip with madeBy == DOS (plateform dependent feature) + this.dir = this.externalFileAttributes & 0x00000010 ? true : false; + }, + /** + * Parse the ZIP64 extra field and merge the info in the current ZipEntry. + * @param {DataReader} reader the reader to use. + */ + parseZIP64ExtraField: function(reader) { + + if (!this.extraFields[0x0001]) { + return; + } + + // should be something, preparing the extra reader + var extraReader = new StringReader(this.extraFields[0x0001].value); + + // I really hope that these 64bits integer can fit in 32 bits integer, because js + // won't let us have more. + if (this.uncompressedSize === utils.MAX_VALUE_32BITS) { + this.uncompressedSize = extraReader.readInt(8); + } + if (this.compressedSize === utils.MAX_VALUE_32BITS) { + this.compressedSize = extraReader.readInt(8); + } + if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) { + this.localHeaderOffset = extraReader.readInt(8); + } + if (this.diskNumberStart === utils.MAX_VALUE_32BITS) { + this.diskNumberStart = extraReader.readInt(4); + } + }, + /** + * Read the central part of a zip file and add the info in this object. + * @param {DataReader} reader the reader to use. + */ + readExtraFields: function(reader) { + var start = reader.index, + extraFieldId, + extraFieldLength, + extraFieldValue; + + this.extraFields = this.extraFields || {}; + + while (reader.index < start + this.extraFieldsLength) { + extraFieldId = reader.readInt(2); + extraFieldLength = reader.readInt(2); + extraFieldValue = reader.readString(extraFieldLength); + + this.extraFields[extraFieldId] = { + id: extraFieldId, + length: extraFieldLength, + value: extraFieldValue + }; + } + }, + /** + * Apply an UTF8 transformation if needed. + */ + handleUTF8: function() { + if (this.useUTF8()) { + this.fileName = jszipProto.utf8decode(this.fileName); + this.fileComment = jszipProto.utf8decode(this.fileComment); + } else { + var upath = this.findExtraFieldUnicodePath(); + if (upath !== null) { + this.fileName = upath; + } + var ucomment = this.findExtraFieldUnicodeComment(); + if (ucomment !== null) { + this.fileComment = ucomment; + } + } + }, + + /** + * Find the unicode path declared in the extra field, if any. + * @return {String} the unicode path, null otherwise. + */ + findExtraFieldUnicodePath: function() { + var upathField = this.extraFields[0x7075]; + if (upathField) { + var extraReader = new StringReader(upathField.value); + + // wrong version + if (extraReader.readInt(1) !== 1) { + return null; + } + + // the crc of the filename changed, this field is out of date. + if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) { + return null; + } + + return jszipProto.utf8decode(extraReader.readString(upathField.length - 5)); + } + return null; + }, + + /** + * Find the unicode comment declared in the extra field, if any. + * @return {String} the unicode comment, null otherwise. + */ + findExtraFieldUnicodeComment: function() { + var ucommentField = this.extraFields[0x6375]; + if (ucommentField) { + var extraReader = new StringReader(ucommentField.value); + + // wrong version + if (extraReader.readInt(1) !== 1) { + return null; + } + + // the crc of the comment changed, this field is out of date. + if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) { + return null; + } + + return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5)); + } + return null; + } +}; +module.exports = ZipEntry; + +},{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(_dereq_,module,exports){ +// Top level file is just a mixin of submodules & constants +'use strict'; + +var assign = _dereq_('./lib/utils/common').assign; + +var deflate = _dereq_('./lib/deflate'); +var inflate = _dereq_('./lib/inflate'); +var constants = _dereq_('./lib/zlib/constants'); + +var pako = {}; + +assign(pako, deflate, inflate, constants); + +module.exports = pako; +},{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(_dereq_,module,exports){ +'use strict'; + + +var zlib_deflate = _dereq_('./zlib/deflate.js'); +var utils = _dereq_('./utils/common'); +var strings = _dereq_('./utils/strings'); +var msg = _dereq_('./zlib/messages'); +var zstream = _dereq_('./zlib/zstream'); + + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + +var Z_NO_FLUSH = 0; +var Z_FINISH = 4; + +var Z_OK = 0; +var Z_STREAM_END = 1; + +var Z_DEFAULT_COMPRESSION = -1; + +var Z_DEFAULT_STRATEGY = 0; + +var Z_DEFLATED = 8; + +/* ===========================================================================*/ + + +/** + * class Deflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[deflate]], + * [[deflateRaw]] and [[gzip]]. + **/ + +/* internal + * Deflate.chunks -> Array + * + * Chunks of output data, if [[Deflate#onData]] not overriden. + **/ + +/** + * Deflate.result -> Uint8Array|Array + * + * Compressed result, generated by default [[Deflate#onData]] + * and [[Deflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Deflate#push]] with `Z_FINISH` / `true` param). + **/ + +/** + * Deflate.err -> Number + * + * Error code after deflate finished. 0 (Z_OK) on success. + * You will not need it in real life, because deflate errors + * are possible only on wrong options or bad `onData` / `onEnd` + * custom handlers. + **/ + +/** + * Deflate.msg -> String + * + * Error message, if [[Deflate.err]] != 0 + **/ + + +/** + * new Deflate(options) + * - options (Object): zlib deflate options. + * + * Creates new deflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `level` + * - `windowBits` + * - `memLevel` + * - `strategy` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw deflate + * - `gzip` (Boolean) - create gzip wrapper + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * - `header` (Object) - custom header for gzip + * - `text` (Boolean) - true if compressed data believed to be text + * - `time` (Number) - modification time, unix timestamp + * - `os` (Number) - operation system code + * - `extra` (Array) - array of bytes with extra data (max 65536) + * - `name` (String) - file name (binary string) + * - `comment` (String) - comment (binary string) + * - `hcrc` (Boolean) - true if header crc should be added + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var deflate = new pako.Deflate({ level: 3}); + * + * deflate.push(chunk1, false); + * deflate.push(chunk2, true); // true -> last chunk + * + * if (deflate.err) { throw new Error(deflate.err); } + * + * console.log(deflate.result); + * ``` + **/ +var Deflate = function(options) { + + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: '' + }, options || {}); + + var opt = this.options; + + if (opt.raw && (opt.windowBits > 0)) { + opt.windowBits = -opt.windowBits; + } + + else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) { + opt.windowBits += 16; + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new zstream(); + this.strm.avail_out = 0; + + var status = zlib_deflate.deflateInit2( + this.strm, + opt.level, + opt.method, + opt.windowBits, + opt.memLevel, + opt.strategy + ); + + if (status !== Z_OK) { + throw new Error(msg[status]); + } + + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } +}; + +/** + * Deflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|String): input data. Strings will be converted to + * utf8 byte sequence. + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with + * new compressed chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That flush internal pending buffers and call + * [[Deflate#onEnd]]. + * + * On fail call [[Deflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * array format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Deflate.prototype.push = function(data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + + if (this.ended) { return false; } + + _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // If we need to compress text, change encoding to utf8. + strm.input = strings.string2buf(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); /* no bad return value */ + + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || (strm.avail_in === 0 && _mode === Z_FINISH)) { + if (this.options.to === 'string') { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + + // Finalize on the last chunk. + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + + return true; +}; + + +/** + * Deflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Deflate.prototype.onData = function(chunk) { + this.chunks.push(chunk); +}; + + +/** + * Deflate#onEnd(status) -> Void + * - status (Number): deflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell deflate that input stream complete + * or error happenned. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Deflate.prototype.onEnd = function(status) { + // On success - join + if (status === Z_OK) { + if (this.options.to === 'string') { + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * deflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * Compress `data` with deflate alrorythm and `options`. + * + * Supported options are: + * + * - level + * - windowBits + * - memLevel + * - strategy + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be "binary string" + * (each char code [0..255]) + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , data = Uint8Array([1,2,3,4,5,6,7,8,9]); + * + * console.log(pako.deflate(data)); + * ``` + **/ +function deflate(input, options) { + var deflator = new Deflate(options); + + deflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (deflator.err) { throw deflator.msg; } + + return deflator.result; +} + + +/** + * deflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); +} + + +/** + * gzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to compress. + * - options (Object): zlib deflate options. + * + * The same as [[deflate]], but create gzip wrapper instead of + * deflate one. + **/ +function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); +} + + +exports.Deflate = Deflate; +exports.deflate = deflate; +exports.deflateRaw = deflateRaw; +exports.gzip = gzip; +},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){ +'use strict'; + + +var zlib_inflate = _dereq_('./zlib/inflate.js'); +var utils = _dereq_('./utils/common'); +var strings = _dereq_('./utils/strings'); +var c = _dereq_('./zlib/constants'); +var msg = _dereq_('./zlib/messages'); +var zstream = _dereq_('./zlib/zstream'); +var gzheader = _dereq_('./zlib/gzheader'); + + +/** + * class Inflate + * + * Generic JS-style wrapper for zlib calls. If you don't need + * streaming behaviour - use more simple functions: [[inflate]] + * and [[inflateRaw]]. + **/ + +/* internal + * inflate.chunks -> Array + * + * Chunks of output data, if [[Inflate#onData]] not overriden. + **/ + +/** + * Inflate.result -> Uint8Array|Array|String + * + * Uncompressed result, generated by default [[Inflate#onData]] + * and [[Inflate#onEnd]] handlers. Filled after you push last chunk + * (call [[Inflate#push]] with `Z_FINISH` / `true` param). + **/ + +/** + * Inflate.err -> Number + * + * Error code after inflate finished. 0 (Z_OK) on success. + * Should be checked if broken data possible. + **/ + +/** + * Inflate.msg -> String + * + * Error message, if [[Inflate.err]] != 0 + **/ + + +/** + * new Inflate(options) + * - options (Object): zlib inflate options. + * + * Creates new inflator instance with specified params. Throws exception + * on bad params. Supported options: + * + * - `windowBits` + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information on these. + * + * Additional options, for internal needs: + * + * - `chunkSize` - size of generated data chunks (16K by default) + * - `raw` (Boolean) - do raw inflate + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * By default, when no options set, autodetect deflate/gzip data format via + * wrapper header. + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9]) + * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]); + * + * var inflate = new pako.Inflate({ level: 3}); + * + * inflate.push(chunk1, false); + * inflate.push(chunk2, true); // true -> last chunk + * + * if (inflate.err) { throw new Error(inflate.err); } + * + * console.log(inflate.result); + * ``` + **/ +var Inflate = function(options) { + + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: '' + }, options || {}); + + var opt = this.options; + + // Force window size for `raw` data, if not set directly, + // because we have no header for autodetect. + if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { opt.windowBits = -15; } + } + + // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate + if ((opt.windowBits >= 0) && (opt.windowBits < 16) && + !(options && options.windowBits)) { + opt.windowBits += 32; + } + + // Gzip header has no info about windows size, we can do autodetect only + // for deflate. So, if window size not set, force it to max when gzip possible + if ((opt.windowBits > 15) && (opt.windowBits < 48)) { + // bit 3 (16) -> gzipped data + // bit 4 (32) -> autodetect gzip/deflate + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + + this.err = 0; // error code, if happens (0 = Z_OK) + this.msg = ''; // error message + this.ended = false; // used to avoid multiple onEnd() calls + this.chunks = []; // chunks of compressed data + + this.strm = new zstream(); + this.strm.avail_out = 0; + + var status = zlib_inflate.inflateInit2( + this.strm, + opt.windowBits + ); + + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + + this.header = new gzheader(); + + zlib_inflate.inflateGetHeader(this.strm, this.header); +}; + +/** + * Inflate#push(data[, mode]) -> Boolean + * - data (Uint8Array|Array|String): input data + * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes. + * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH. + * + * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with + * new output chunks. Returns `true` on success. The last data block must have + * mode Z_FINISH (or `true`). That flush internal pending buffers and call + * [[Inflate#onEnd]]. + * + * On fail call [[Inflate#onEnd]] with error code and return false. + * + * We strongly recommend to use `Uint8Array` on input for best speed (output + * format is detected automatically). Also, don't skip last param and always + * use the same type in your code (boolean or number). That will improve JS speed. + * + * For regular `Array`-s make sure all elements are [0..255]. + * + * ##### Example + * + * ```javascript + * push(chunk, false); // push one of data chunks + * ... + * push(chunk, true); // push last chunk + * ``` + **/ +Inflate.prototype.push = function(data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + var next_out_utf8, tail, utf8str; + + if (this.ended) { return false; } + _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH); + + // Convert data if needed + if (typeof data === 'string') { + // Only binary strings can be decompressed on practice + strm.input = strings.binstring2buf(data); + } else { + strm.input = data; + } + + strm.next_in = 0; + strm.avail_in = strm.input.length; + + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */ + + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && _mode === c.Z_FINISH)) { + + if (this.options.to === 'string') { + + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + + // move tail + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); } + + this.onData(utf8str); + + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + } while ((strm.avail_in > 0) && status !== c.Z_STREAM_END); + + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + // Finalize on the last chunk. + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + + return true; +}; + + +/** + * Inflate#onData(chunk) -> Void + * - chunk (Uint8Array|Array|String): ouput data. Type of array depends + * on js engine support. When string output requested, each chunk + * will be string. + * + * By default, stores data blocks in `chunks[]` property and glue + * those in `onEnd`. Override this handler, if you need another behaviour. + **/ +Inflate.prototype.onData = function(chunk) { + this.chunks.push(chunk); +}; + + +/** + * Inflate#onEnd(status) -> Void + * - status (Number): inflate status. 0 (Z_OK) on success, + * other if not. + * + * Called once after you tell inflate that input stream complete + * or error happenned. By default - join collected chunks, + * free memory and fill `results` / `err` properties. + **/ +Inflate.prototype.onEnd = function(status) { + // On success - join + if (status === c.Z_OK) { + if (this.options.to === 'string') { + // Glue & convert here, until we teach pako to send + // utf8 alligned strings to onData + this.result = this.chunks.join(''); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; +}; + + +/** + * inflate(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Decompress `data` with inflate/ungzip and `options`. Autodetect + * format via wrapper header by default. That's why we don't provide + * separate `ungzip` method. + * + * Supported options are: + * + * - windowBits + * + * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced) + * for more information. + * + * Sugar (options): + * + * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify + * negative windowBits implicitly. + * - `to` (String) - if equal to 'string', then result will be converted + * from utf8 to utf16 (javascript) string. When string output requested, + * chunk length can differ from `chunkSize`, depending on content. + * + * + * ##### Example: + * + * ```javascript + * var pako = require('pako') + * , input = pako.deflate([1,2,3,4,5,6,7,8,9]) + * , output; + * + * try { + * output = pako.inflate(input); + * } catch (err) + * console.log(err); + * } + * ``` + **/ +function inflate(input, options) { + var inflator = new Inflate(options); + + inflator.push(input, true); + + // That will never happens, if you don't cheat with options :) + if (inflator.err) { throw inflator.msg; } + + return inflator.result; +} + + +/** + * inflateRaw(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * The same as [[inflate]], but creates raw data, without wrapper + * (header and adler32 crc). + **/ +function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); +} + + +/** + * ungzip(data[, options]) -> Uint8Array|Array|String + * - data (Uint8Array|Array|String): input data to decompress. + * - options (Object): zlib inflate options. + * + * Just shortcut to [[inflate]], because it autodetects format + * by header.content. Done for convenience. + **/ + + +exports.Inflate = Inflate; +exports.inflate = inflate; +exports.inflateRaw = inflateRaw; +exports.ungzip = inflate; + +},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){ +'use strict'; + + +var TYPED_OK = (typeof Uint8Array !== 'undefined') && + (typeof Uint16Array !== 'undefined') && + (typeof Int32Array !== 'undefined'); + + +exports.assign = function (obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof(source) !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var p in source) { + if (source.hasOwnProperty(p)) { + obj[p] = source[p]; + } + } + } + + return obj; +}; + + +// reduce buffer size, avoiding mem copy +exports.shrinkBuf = function (buf, size) { + if (buf.length === size) { return buf; } + if (buf.subarray) { return buf.subarray(0, size); } + buf.length = size; + return buf; +}; + + +var fnTyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs+len), dest_offs); + return; + } + // Fallback to ordinary array + for(var i=0; i= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1); +} +_utf8len[254]=_utf8len[254]=1; // Invalid sequence start + + +// convert string to array (typed, when possible) +exports.string2buf = function (str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + + // count binary size + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4; + } + + // allocate buffer + buf = new utils.Buf8(buf_len); + + // convert + for (i=0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) { + c2 = str.charCodeAt(m_pos+1); + if ((c2 & 0xfc00) === 0xdc00) { + c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00); + m_pos++; + } + } + if (c < 0x80) { + /* one byte */ + buf[i++] = c; + } else if (c < 0x800) { + /* two bytes */ + buf[i++] = 0xC0 | (c >>> 6); + buf[i++] = 0x80 | (c & 0x3f); + } else if (c < 0x10000) { + /* three bytes */ + buf[i++] = 0xE0 | (c >>> 12); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } else { + /* four bytes */ + buf[i++] = 0xf0 | (c >>> 18); + buf[i++] = 0x80 | (c >>> 12 & 0x3f); + buf[i++] = 0x80 | (c >>> 6 & 0x3f); + buf[i++] = 0x80 | (c & 0x3f); + } + } + + return buf; +}; + +// Helper (used in 2 places) +function buf2binstring(buf, len) { + // use fallback for big arrays to avoid stack overflow + if (len < 65537) { + if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + + var result = ''; + for(var i=0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; +} + + +// Convert byte array to binary string +exports.buf2binstring = function(buf) { + return buf2binstring(buf, buf.length); +}; + + +// Convert binary string (typed, when possible) +exports.binstring2buf = function(str) { + var buf = new utils.Buf8(str.length); + for(var i=0, len=buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; +}; + + +// convert array to string +exports.buf2string = function (buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + + // Reserve max possible length (2 words per char) + // NB: by unknown reasons, Array is significantly faster for + // String.fromCharCode.apply than Uint16Array. + var utf16buf = new Array(len*2); + + for (out=0, i=0; i 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; } + + // apply mask on first byte + c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07; + // join the rest + while (c_len > 1 && i < len) { + c = (c << 6) | (buf[i++] & 0x3f); + c_len--; + } + + // terminated by end of string? + if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; } + + if (c < 0x10000) { + utf16buf[out++] = c; + } else { + c -= 0x10000; + utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff); + utf16buf[out++] = 0xdc00 | (c & 0x3ff); + } + } + + return buf2binstring(utf16buf, out); +}; + + +// Calculate max possible position in utf8 buffer, +// that will not break sequence. If that's not possible +// - (very small limits) return max size as is. +// +// buf[] - utf8 bytes array +// max - length limit (mandatory); +exports.utf8border = function(buf, max) { + var pos; + + max = max || buf.length; + if (max > buf.length) { max = buf.length; } + + // go back from last position, until start of sequence found + pos = max-1; + while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; } + + // Fuckup - very small and broken sequence, + // return max, because we should return something anyway. + if (pos < 0) { return max; } + + // If we came to start of buffer - that means vuffer is too small, + // return max too. + if (pos === 0) { return max; } + + return (pos + _utf8len[buf[pos]] > max) ? pos : max; +}; + +},{"./common":27}],29:[function(_dereq_,module,exports){ +'use strict'; + +// Note: adler32 takes 12% for level 0 and 2% for level 6. +// It doesn't worth to make additional optimizationa as in original. +// Small size is preferable. + +function adler32(adler, buf, len, pos) { + var s1 = (adler & 0xffff) |0 + , s2 = ((adler >>> 16) & 0xffff) |0 + , n = 0; + + while (len !== 0) { + // Set limit ~ twice less than 5552, to keep + // s2 in 31-bits, because we force signed ints. + // in other case %= will fail. + n = len > 2000 ? 2000 : len; + len -= n; + + do { + s1 = (s1 + buf[pos++]) |0; + s2 = (s2 + s1) |0; + } while (--n); + + s1 %= 65521; + s2 %= 65521; + } + + return (s1 | (s2 << 16)) |0; +} + + +module.exports = adler32; +},{}],30:[function(_dereq_,module,exports){ +module.exports = { + + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + + + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type +}; +},{}],31:[function(_dereq_,module,exports){ +'use strict'; + +// Note: we can't get significant speed boost here. +// So write code to minimize size - no pregenerated tables +// and array tools dependencies. + + +// Use ordinary array, since untyped makes no boost here +function makeTable() { + var c, table = []; + + for(var n =0; n < 256; n++){ + c = n; + for(var k =0; k < 8; k++){ + c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); + } + table[n] = c; + } + + return table; +} + +// Create table on load. Just 255 signed longs. Not a problem. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable + , end = pos + len; + + crc = crc ^ (-1); + + for (var i = pos; i < end; i++ ) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; +},{}],32:[function(_dereq_,module,exports){ +'use strict'; + +var utils = _dereq_('../utils/common'); +var trees = _dereq_('./trees'); +var adler32 = _dereq_('./adler32'); +var crc32 = _dereq_('./crc32'); +var msg = _dereq_('./messages'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +var Z_NO_FLUSH = 0; +var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +//var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +//var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +//var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + + +/* compression levels */ +//var Z_NO_COMPRESSION = 0; +//var Z_BEST_SPEED = 1; +//var Z_BEST_COMPRESSION = 9; +var Z_DEFAULT_COMPRESSION = -1; + + +var Z_FILTERED = 1; +var Z_HUFFMAN_ONLY = 2; +var Z_RLE = 3; +var Z_FIXED = 4; +var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +//var Z_BINARY = 0; +//var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + + +/* The deflate compression method */ +var Z_DEFLATED = 8; + +/*============================================================================*/ + + +var MAX_MEM_LEVEL = 9; +/* Maximum value for memLevel in deflateInit2 */ +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_MEM_LEVEL = 8; + + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ +var LITERALS = 256; +/* number of literal bytes 0..255 */ +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ +var D_CODES = 30; +/* number of distance codes */ +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ +var HEAP_SIZE = 2*L_CODES + 1; +/* maximum heap size */ +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + +var PRESET_DICT = 0x20; + +var INIT_STATE = 42; +var EXTRA_STATE = 69; +var NAME_STATE = 73; +var COMMENT_STATE = 91; +var HCRC_STATE = 103; +var BUSY_STATE = 113; +var FINISH_STATE = 666; + +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */ +var BS_BLOCK_DONE = 2; /* block flush performed */ +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */ +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */ + +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default. + +function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; +} + +function rank(f) { + return ((f) << 1) - ((f) > 4 ? 9 : 0); +} + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->output buffer and copying into it. + * (See also read_buf()). + */ +function flush_pending(strm) { + var s = strm.state; + + //_tr_flush_bits(s); + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { return; } + + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } +} + + +function flush_block_only (s, last) { + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); +} + + +function put_byte(s, b) { + s.pending_buf[s.pending++] = b; +} + + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +function putShortMSB(s, b) { +// put_byte(s, (Byte)(b >> 8)); +// put_byte(s, (Byte)(b & 0xff)); + s.pending_buf[s.pending++] = (b >>> 8) & 0xff; + s.pending_buf[s.pending++] = b & 0xff; +} + + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->input buffer and copying from it. + * (See also flush_pending()). + */ +function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + + if (len > size) { len = size; } + if (len === 0) { return 0; } + + strm.avail_in -= len; + + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } + + else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + + strm.next_in += len; + strm.total_in += len; + + return len; +} + + +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; /* max hash chain length */ + var scan = s.strstart; /* current string */ + var match; /* matched string */ + var len; /* length of current match */ + var best_len = s.prev_length; /* best match length so far */ + var nice_match = s.nice_match; /* stop if match long enough */ + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/; + + var _win = s.window; // shortcut + + var wmask = s.w_mask; + var prev = s.prev; + + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if (nice_match > s.lookahead) { nice_match = s.lookahead; } + + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + // Assert(cur_match < s->strstart, "no future"); + match = cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ + + if (_win[match + best_len] !== scan_end || + _win[match + best_len - 1] !== scan_end1 || + _win[match] !== _win[scan] || + _win[++match] !== _win[scan + 1]) { + continue; + } + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2; + match++; + // Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + /*jshint noempty:false*/ + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && + scan < strend); + + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; +} + + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + + do { + more = s.window_size - s.lookahead - s.strstart; + + // JS ints have 32 bit, block below not needed + /* Deal with !@#$% 64K limit: */ + //if (sizeof(int) <= 2) { + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + // more = wsize; + // + // } else if (more == (unsigned)(-1)) { + // /* Very unlikely, but possible on 16 bit machine if + // * strstart == 0 && lookahead == 1 (input done a byte at time) + // */ + // more--; + // } + //} + + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + /* we now have strstart >= MAX_DIST */ + s.block_start -= _w_size; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = (m >= _w_size ? m - _w_size : 0); + } while (--n); + + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = (m >= _w_size ? m - _w_size : 0); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); + + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + //Assert(more >= 2, "more < 2"); + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask; +//#if MIN_MATCH != 3 +// Call update_hash() MIN_MATCH-3 more times +//#endif + while (s.insert) { + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask; + + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + + /* If the WIN_INIT bytes after the end of the current data have never been + * written, then zero those bytes in order to avoid memory check reports of + * the use of uninitialized (or uninitialised as Julian writes) bytes by + * the longest match routines. Update the high water mark for the next + * time through here. WIN_INIT is set to MAX_MATCH since the longest match + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. + */ +// if (s.high_water < s.window_size) { +// var curr = s.strstart + s.lookahead; +// var init = 0; +// +// if (s.high_water < curr) { +// /* Previous high water mark below current data -- zero WIN_INIT +// * bytes or up to end of window, whichever is less. +// */ +// init = s.window_size - curr; +// if (init > WIN_INIT) +// init = WIN_INIT; +// zmemzero(s->window + curr, (unsigned)init); +// s->high_water = curr + init; +// } +// else if (s->high_water < (ulg)curr + WIN_INIT) { +// /* High water mark at or above current data, but below current data +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up +// * to end of window, whichever is less. +// */ +// init = (ulg)curr + WIN_INIT - s->high_water; +// if (init > s->window_size - s->high_water) +// init = s->window_size - s->high_water; +// zmemzero(s->window + s->high_water, (unsigned)init); +// s->high_water += init; +// } +// } +// +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, +// "not enough room for search"); +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +function deflate_stored(s, flush) { + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + var max_block_size = 0xffff; + + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s.lookahead <= 1) { + + //Assert(s->strstart < s->w_size+MAX_DIST(s) || + // s->block_start >= (long)s->w_size, "slide too late"); +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || +// s.block_start >= s.w_size)) { +// throw new Error("slide too late"); +// } + + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + + if (s.lookahead === 0) { + break; + } + /* flush the current block */ + } + //Assert(s->block_start >= 0L, "block gone"); +// if (s.block_start < 0) throw new Error("block gone"); + + s.strstart += s.lookahead; + s.lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + var max_start = s.block_start + max_block_size; + + if (s.strstart === 0 || s.strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + + + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + + s.insert = 0; + + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + + if (s.strstart > s.block_start) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_NEED_MORE; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +function deflate_fast(s, flush) { + var hash_head; /* head of the hash chain */ + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; /* flush the current block */ + } + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + } + if (s.match_length >= MIN_MATCH) { + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only + + /*** _tr_tally_dist(s, s.strstart - s.match_start, + s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { + s.match_length--; /* string at strstart already in table */ + do { + s.strstart++; + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s.match_length !== 0); + s.strstart++; + } else + { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask; + +//#if MIN_MATCH != 3 +// Call UPDATE_HASH() MIN_MATCH-3 more times +//#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s.window[s.strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1); + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +function deflate_slow(s, flush) { + var hash_head; /* head of hash chain */ + var bflush; /* set if current block must be flushed */ + + var max_insert; + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + hash_head = 0/*NIL*/; + if (s.lookahead >= MIN_MATCH) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + + /* Find the longest match, discarding those <= prev_length. + */ + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH-1; + + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && + s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + s.match_length = longest_match(s, hash_head); + /* longest_match() sets match_start */ + + if (s.match_length <= 5 && + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s.match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + //check_match(s, s.strstart-1, s.prev_match, s.prev_length); + + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, + s.prev_length - MIN_MATCH, bflush);***/ + bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH); + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s.lookahead -= s.prev_length-1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + /*** INSERT_STRING(s, s.strstart, hash_head); ***/ + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + /***/ + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH-1; + s.strstart++; + + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + } else if (s.match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]); + + if (bflush) { + /*** FLUSH_BLOCK_ONLY(s, 0) ***/ + flush_block_only(s, false); + /***/ + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + //Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s.match_available) { + //Tracevv((stderr,"%c", s->window[s->strstart-1])); + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]); + + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + + return BS_BLOCK_DONE; +} + + +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +function deflate_rle(s, flush) { + var bflush; /* set if current block must be flushed */ + var prev; /* byte at distance one to match */ + var scan, strend; /* scan goes up to strend for length of run */ + + var _win = s.window; + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest run, plus one for the unrolled loop. + */ + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { break; } /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + /*jshint noempty:false*/ + } while (prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + prev === _win[++scan] && prev === _win[++scan] && + scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (s.match_length >= MIN_MATCH) { + //check_match(s, s.strstart, s.strstart - 1, s.match_length); + + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + /* No match, output a literal byte */ + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + + s.lookahead--; + s.strstart++; + } + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* =========================================================================== + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. + * (It will be regenerated if this run of deflate switches away from Huffman.) + */ +function deflate_huff(s, flush) { + var bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we have a literal to write. */ + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; /* flush the current block */ + } + } + + /* Output a literal byte */ + s.match_length = 0; + //Tracevv((stderr,"%c", s->window[s->strstart])); + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + } + s.insert = 0; + if (flush === Z_FINISH) { + /*** FLUSH_BLOCK(s, 1); ***/ + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + /***/ + return BS_FINISH_DONE; + } + if (s.last_lit) { + /*** FLUSH_BLOCK(s, 0); ***/ + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + /***/ + } + return BS_BLOCK_DONE; +} + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +var Config = function (good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; +}; + +var configuration_table; + +configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), /* 3 */ + + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ +]; + + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +function lm_init(s) { + s.window_size = 2 * s.w_size; + + /*** CLEAR_HASH(s); ***/ + zero(s.head); // Fill with NIL (= 0); + + /* Set the default configuration parameters: + */ + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; +} + + +function DeflateState() { + this.strm = null; /* pointer back to this zlib stream */ + this.status = 0; /* as the name implies */ + this.pending_buf = null; /* output still pending */ + this.pending_buf_size = 0; /* size of pending_buf */ + this.pending_out = 0; /* next pending byte to output to the stream */ + this.pending = 0; /* nb of bytes in the pending buffer */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.gzhead = null; /* gzip header information to write */ + this.gzindex = 0; /* where in extra, name, or comment */ + this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.last_flush = -1; /* value of flush param for previous deflate call */ + + this.w_size = 0; /* LZ77 window size (32K by default) */ + this.w_bits = 0; /* log2(w_size) (8..16) */ + this.w_mask = 0; /* w_size - 1 */ + + this.window = null; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. + */ + + this.window_size = 0; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + this.prev = null; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + this.head = null; /* Heads of the hash chains or NIL. */ + + this.ins_h = 0; /* hash index of string to be inserted */ + this.hash_size = 0; /* number of elements in hash table */ + this.hash_bits = 0; /* log2(hash_size) */ + this.hash_mask = 0; /* hash_size-1 */ + + this.hash_shift = 0; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + this.block_start = 0; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + this.match_length = 0; /* length of best match */ + this.prev_match = 0; /* previous match */ + this.match_available = 0; /* set if previous match exists */ + this.strstart = 0; /* start of string to insert */ + this.match_start = 0; /* start of matching string */ + this.lookahead = 0; /* number of valid bytes ahead in window */ + + this.prev_length = 0; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + this.max_chain_length = 0; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + this.max_lazy_match = 0; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ + // That's alias to max_lazy_match, don't use directly + //this.max_insert_length = 0; + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + this.level = 0; /* compression level (1..9) */ + this.strategy = 0; /* favor or force Huffman coding*/ + + this.good_match = 0; + /* Use a faster search when the previous match is longer than this */ + + this.nice_match = 0; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + + /* Didn't use ct_data typedef below to suppress compiler warning */ + + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + // Use flat array of DOUBLE size, with interleaved fata, + // because JS does not support effective + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2*D_CODES+1) * 2); + this.bl_tree = new utils.Buf16((2*BL_CODES+1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + + this.l_desc = null; /* desc. for literal tree */ + this.d_desc = null; /* desc. for distance tree */ + this.bl_desc = null; /* desc. for bit length tree */ + + //ush bl_count[MAX_BITS+1]; + this.bl_count = new utils.Buf16(MAX_BITS+1); + /* number of codes at each bit length for an optimal tree */ + + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + this.heap = new utils.Buf16(2*L_CODES+1); /* heap used to build the Huffman trees */ + zero(this.heap); + + this.heap_len = 0; /* number of elements in the heap */ + this.heap_max = 0; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + this.depth = new utils.Buf16(2*L_CODES+1); //uch depth[2*L_CODES+1]; + zero(this.depth); + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + this.l_buf = 0; /* buffer index for literals or lengths */ + + this.lit_bufsize = 0; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + this.last_lit = 0; /* running index in l_buf */ + + this.d_buf = 0; + /* Buffer index for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + this.opt_len = 0; /* bit length of current block with optimal trees */ + this.static_len = 0; /* bit length of current block with static trees */ + this.matches = 0; /* number of string matches in current block */ + this.insert = 0; /* bytes at end of window left to insert */ + + + this.bi_buf = 0; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + this.bi_valid = 0; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + + // Used for window memory init. We safely ignore it for JS. That makes + // sense only for pointers and memory check tools. + //this.high_water = 0; + /* High water mark offset in window for initialized bytes -- bytes above + * this are set to zero in order to avoid memory check warnings when + * longest match routines access bytes past the input. This is then + * updated to the new high water mark. + */ +} + + +function deflateResetKeep(strm) { + var s; + + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + + s = strm.state; + s.pending = 0; + s.pending_out = 0; + + if (s.wrap < 0) { + s.wrap = -s.wrap; + /* was made negative by deflate(..., Z_FINISH); */ + } + s.status = (s.wrap ? INIT_STATE : BUSY_STATE); + strm.adler = (s.wrap === 2) ? + 0 // crc32(0, Z_NULL, 0) + : + 1; // adler32(0, Z_NULL, 0) + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; +} + + +function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; +} + + +function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + strm.state.gzhead = head; + return Z_OK; +} + + +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { // === Z_NULL + return Z_STREAM_ERROR; + } + var wrap = 1; + + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } + + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } + + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + + + if (windowBits === 8) { + windowBits = 9; + } + /* until 256-byte window bug fixed */ + + var s = new DeflateState(); + + strm.state = s; + s.strm = strm; + + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + + // Don't need mem init magic for JS. + //s.high_water = 0; /* nothing written to s->window yet */ + + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + s.pending_buf_size = s.lit_bufsize * 4; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + + s.d_buf = s.lit_bufsize >> 1; + s.l_buf = (1 + 2) * s.lit_bufsize; + + s.level = level; + s.strategy = strategy; + s.method = method; + + return deflateReset(strm); +} + +function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); +} + + +function deflate(strm, flush) { + var old_flush, s; + var beg, val; // for gzip header write only + + if (!strm || !strm.state || + flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + + s = strm.state; + + if (!strm.output || + (!strm.input && strm.avail_in !== 0) || + (s.status === FINISH_STATE && flush !== Z_FINISH)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + + s.strm = strm; /* just in case */ + old_flush = s.last_flush; + s.last_flush = flush; + + /* Write the header */ + if (s.status === INIT_STATE) { + + if (s.wrap === 2) { // GZIP header + strm.adler = 0; //crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { // s->gzhead == Z_NULL + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } + else { + put_byte(s, (s.gzhead.text ? 1 : 0) + + (s.gzhead.hcrc ? 2 : 0) + + (!s.gzhead.extra ? 0 : 4) + + (!s.gzhead.name ? 0 : 8) + + (!s.gzhead.comment ? 0 : 16) + ); + put_byte(s, s.gzhead.time & 0xff); + put_byte(s, (s.gzhead.time >> 8) & 0xff); + put_byte(s, (s.gzhead.time >> 16) & 0xff); + put_byte(s, (s.gzhead.time >> 24) & 0xff); + put_byte(s, s.level === 9 ? 2 : + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? + 4 : 0)); + put_byte(s, s.gzhead.os & 0xff); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 0xff); + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } + else // DEFLATE header + { + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + var level_flags = -1; + + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= (level_flags << 6); + if (s.strstart !== 0) { header |= PRESET_DICT; } + header += 31 - (header % 31); + + s.status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + strm.adler = 1; // adler32(0L, Z_NULL, 0); + } + } + +//#ifdef GZIP + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } + else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg){ + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } + else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment/* != Z_NULL*/) { + beg = s.pending; /* start of bytes to update crc */ + //int val; + + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + // JS specific: little magic to add zero terminator to end of string + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } + else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + strm.adler = 0; //crc32(0L, Z_NULL, 0); + s.status = BUSY_STATE; + } + } + else { + s.status = BUSY_STATE; + } + } +//#endif + + /* Flush as much pending output as possible */ + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s.last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && + flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm.avail_in !== 0 || s.lookahead !== 0 || + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : + (s.strategy === Z_RLE ? deflate_rle(s, flush) : + configuration_table[s.level].func(s, flush)); + + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + + trees._tr_stored_block(s, 0, 0, false); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush === Z_FULL_FLUSH) { + /*** CLEAR_HASH(s); ***/ /* forget history */ + zero(s.head); // Fill with NIL (= 0); + + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + //Assert(strm->avail_out > 0, "bug2"); + //if (strm.avail_out <= 0) { throw new Error("bug2");} + + if (flush !== Z_FINISH) { return Z_OK; } + if (s.wrap <= 0) { return Z_STREAM_END; } + + /* Write the trailer */ + if (s.wrap === 2) { + put_byte(s, strm.adler & 0xff); + put_byte(s, (strm.adler >> 8) & 0xff); + put_byte(s, (strm.adler >> 16) & 0xff); + put_byte(s, (strm.adler >> 24) & 0xff); + put_byte(s, strm.total_in & 0xff); + put_byte(s, (strm.total_in >> 8) & 0xff); + put_byte(s, (strm.total_in >> 16) & 0xff); + put_byte(s, (strm.total_in >> 24) & 0xff); + } + else + { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 0xffff); + } + + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s.wrap > 0) { s.wrap = -s.wrap; } + /* write the trailer only once! */ + return s.pending !== 0 ? Z_OK : Z_STREAM_END; +} + +function deflateEnd(strm) { + var status; + + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { + return Z_STREAM_ERROR; + } + + status = strm.state.status; + if (status !== INIT_STATE && + status !== EXTRA_STATE && + status !== NAME_STATE && + status !== COMMENT_STATE && + status !== HCRC_STATE && + status !== BUSY_STATE && + status !== FINISH_STATE + ) { + return err(strm, Z_STREAM_ERROR); + } + + strm.state = null; + + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; +} + +/* ========================================================================= + * Copy the source state to the destination state + */ +//function deflateCopy(dest, source) { +// +//} + +exports.deflateInit = deflateInit; +exports.deflateInit2 = deflateInit2; +exports.deflateReset = deflateReset; +exports.deflateResetKeep = deflateResetKeep; +exports.deflateSetHeader = deflateSetHeader; +exports.deflate = deflate; +exports.deflateEnd = deflateEnd; +exports.deflateInfo = 'pako deflate (from Nodeca project)'; + +/* Not implemented +exports.deflateBound = deflateBound; +exports.deflateCopy = deflateCopy; +exports.deflateSetDictionary = deflateSetDictionary; +exports.deflateParams = deflateParams; +exports.deflatePending = deflatePending; +exports.deflatePrime = deflatePrime; +exports.deflateTune = deflateTune; +*/ +},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(_dereq_,module,exports){ +'use strict'; + + +function GZheader() { + /* true if compressed data believed to be text */ + this.text = 0; + /* modification time */ + this.time = 0; + /* extra flags (not used when writing a gzip file) */ + this.xflags = 0; + /* operating system */ + this.os = 0; + /* pointer to extra field or Z_NULL if none */ + this.extra = null; + /* extra field length (valid if extra != Z_NULL) */ + this.extra_len = 0; // Actually, we don't need it in JS, + // but leave for few code modifications + + // + // Setup limits is not necessary because in js we should not preallocate memory + // for inflate use constant limit in 65536 bytes + // + + /* space at extra (only when reading header) */ + // this.extra_max = 0; + /* pointer to zero-terminated file name or Z_NULL */ + this.name = ''; + /* space at name (only when reading header) */ + // this.name_max = 0; + /* pointer to zero-terminated comment or Z_NULL */ + this.comment = ''; + /* space at comment (only when reading header) */ + // this.comm_max = 0; + /* true if there was or will be a header crc */ + this.hcrc = 0; + /* true when done reading gzip header (not used when writing a gzip file) */ + this.done = false; +} + +module.exports = GZheader; +},{}],34:[function(_dereq_,module,exports){ +'use strict'; + +// See state defs from inflate.js +var BAD = 30; /* got a data error -- remain here until reset */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state.mode === LEN + strm.avail_in >= 6 + strm.avail_out >= 258 + start >= strm.avail_out + state.bits < 8 + + On return, state.mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm.avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm.avail_out >= 258 for each loop to avoid checking for + output space. + */ +module.exports = function inflate_fast(strm, start) { + var state; + var _in; /* local strm.input */ + var last; /* have enough input while in < last */ + var _out; /* local strm.output */ + var beg; /* inflate()'s initial strm.output */ + var end; /* while out < end, enough space available */ +//#ifdef INFLATE_STRICT + var dmax; /* maximum distance from zlib header */ +//#endif + var wsize; /* window size or zero if not using window */ + var whave; /* valid bytes in the window */ + var wnext; /* window write index */ + var window; /* allocated sliding window, if wsize != 0 */ + var hold; /* local strm.hold */ + var bits; /* local strm.bits */ + var lcode; /* local strm.lencode */ + var dcode; /* local strm.distcode */ + var lmask; /* mask for first level of length codes */ + var dmask; /* mask for first level of distance codes */ + var here; /* retrieved table entry */ + var op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + var len; /* match length, unused bytes */ + var dist; /* match distance */ + var from; /* where to copy match from */ + var from_source; + + + var input, output; // JS specific, because we have no pointers + + /* copy state to local variables */ + state = strm.state; + //here = state.here; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); +//#ifdef INFLATE_STRICT + dmax = state.dmax; +//#endif + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + + here = lcode[hold & lmask]; + + dolen: + for (;;) { // Goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + if (op === 0) { /* literal */ + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + output[_out++] = here & 0xffff/*here.val*/; + } + else if (op & 16) { /* length base */ + len = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & ((1 << op) - 1); + hold >>>= op; + bits -= op; + } + //Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + + dodist: + for (;;) { // goto emulation + op = here >>> 24/*here.bits*/; + hold >>>= op; + bits -= op; + op = (here >>> 16) & 0xff/*here.op*/; + + if (op & 16) { /* distance base */ + dist = here & 0xffff/*here.val*/; + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & ((1 << op) - 1); +//#ifdef INFLATE_STRICT + if (dist > dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } +//#endif + hold >>>= op; + bits -= op; + //Tracevv((stderr, "inflate: distance %u\n", dist)); + op = _out - beg; /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break top; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// if (len <= op - whave) { +// do { +// output[_out++] = 0; +// } while (--len); +// continue top; +// } +// len -= op - whave; +// do { +// output[_out++] = 0; +// } while (--op > whave); +// if (op === 0) { +// from = _out - dist; +// do { +// output[_out++] = output[from++]; +// } while (--len); +// continue top; +// } +//#endif + } + from = 0; // window index + from_source = window; + if (wnext === 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + else if (wnext < op) { /* wrap around window */ + from += wsize + wnext - op; + op -= wnext; + if (op < len) { /* some from end of window */ + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = 0; + if (wnext < len) { /* some from start of window */ + op = wnext; + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + } + else { /* contiguous in window */ + from += wnext - op; + if (op < len) { /* some from window */ + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = _out - dist; /* rest from output */ + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } + else { + from = _out - dist; /* copy direct from output */ + do { /* minimum length is three */ + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } + else if ((op & 64) === 0) { /* 2nd level distance code */ + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dodist; + } + else { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } + else if ((op & 64) === 0) { /* 2nd level length code */ + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))]; + continue dolen; + } + else if (op & 32) { /* end-of-block */ + //Tracevv((stderr, "inflate: end of block\n")); + state.mode = TYPE; + break top; + } + else { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break top; + } + + break; // need to emulate goto via "continue" + } + } while (_in < last && _out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + + /* update state and return */ + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)); + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)); + state.hold = hold; + state.bits = bits; + return; +}; + +},{}],35:[function(_dereq_,module,exports){ +'use strict'; + + +var utils = _dereq_('../utils/common'); +var adler32 = _dereq_('./adler32'); +var crc32 = _dereq_('./crc32'); +var inflate_fast = _dereq_('./inffast'); +var inflate_table = _dereq_('./inftrees'); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +/* Allowed flush values; see deflate() and inflate() below for details */ +//var Z_NO_FLUSH = 0; +//var Z_PARTIAL_FLUSH = 1; +//var Z_SYNC_FLUSH = 2; +//var Z_FULL_FLUSH = 3; +var Z_FINISH = 4; +var Z_BLOCK = 5; +var Z_TREES = 6; + + +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ +var Z_OK = 0; +var Z_STREAM_END = 1; +var Z_NEED_DICT = 2; +//var Z_ERRNO = -1; +var Z_STREAM_ERROR = -2; +var Z_DATA_ERROR = -3; +var Z_MEM_ERROR = -4; +var Z_BUF_ERROR = -5; +//var Z_VERSION_ERROR = -6; + +/* The deflate compression method */ +var Z_DEFLATED = 8; + + +/* STATES ====================================================================*/ +/* ===========================================================================*/ + + +var HEAD = 1; /* i: waiting for magic header */ +var FLAGS = 2; /* i: waiting for method and flags (gzip) */ +var TIME = 3; /* i: waiting for modification time (gzip) */ +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */ +var EXLEN = 5; /* i: waiting for extra length (gzip) */ +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */ +var NAME = 7; /* i: waiting for end of file name (gzip) */ +var COMMENT = 8; /* i: waiting for end of comment (gzip) */ +var HCRC = 9; /* i: waiting for header crc (gzip) */ +var DICTID = 10; /* i: waiting for dictionary check value */ +var DICT = 11; /* waiting for inflateSetDictionary() call */ +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */ +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ +var STORED = 14; /* i: waiting for stored size (length and complement) */ +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */ +var COPY = 16; /* i/o: waiting for input or output to copy stored block */ +var TABLE = 17; /* i: waiting for dynamic block table lengths */ +var LENLENS = 18; /* i: waiting for code length code lengths */ +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */ +var LEN_ = 20; /* i: same as LEN below, but only first time in */ +var LEN = 21; /* i: waiting for length/lit/eob code */ +var LENEXT = 22; /* i: waiting for length extra bits */ +var DIST = 23; /* i: waiting for distance code */ +var DISTEXT = 24; /* i: waiting for distance extra bits */ +var MATCH = 25; /* o: waiting for output space to copy string */ +var LIT = 26; /* o: waiting for output space to write literal */ +var CHECK = 27; /* i: waiting for 32-bit check value */ +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ +var DONE = 29; /* finished check, done -- remain here until reset */ +var BAD = 30; /* got a data error -- remain here until reset */ +var MEM = 31; /* got an inflate() memory error -- remain here until reset */ +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */ + +/* ===========================================================================*/ + + + +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var MAX_WBITS = 15; +/* 32K LZ77 window */ +var DEF_WBITS = MAX_WBITS; + + +function ZSWAP32(q) { + return (((q >>> 24) & 0xff) + + ((q >>> 8) & 0xff00) + + ((q & 0xff00) << 8) + + ((q & 0xff) << 24)); +} + + +function InflateState() { + this.mode = 0; /* current inflate mode */ + this.last = false; /* true if processing last block */ + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ + this.havedict = false; /* true if dictionary provided */ + this.flags = 0; /* gzip header method and flags (0 if zlib) */ + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */ + this.check = 0; /* protected copy of check value */ + this.total = 0; /* protected copy of output count */ + // TODO: may be {} + this.head = null; /* where to save gzip header information */ + + /* sliding window */ + this.wbits = 0; /* log base 2 of requested window size */ + this.wsize = 0; /* window size or zero if not using window */ + this.whave = 0; /* valid bytes in the window */ + this.wnext = 0; /* window write index */ + this.window = null; /* allocated sliding window, if needed */ + + /* bit accumulator */ + this.hold = 0; /* input bit accumulator */ + this.bits = 0; /* number of bits in "in" */ + + /* for string and stored block copying */ + this.length = 0; /* literal or length of data to copy */ + this.offset = 0; /* distance back to copy string from */ + + /* for table and code decoding */ + this.extra = 0; /* extra bits needed */ + + /* fixed and dynamic code tables */ + this.lencode = null; /* starting table for length/literal codes */ + this.distcode = null; /* starting table for distance codes */ + this.lenbits = 0; /* index bits for lencode */ + this.distbits = 0; /* index bits for distcode */ + + /* dynamic table building */ + this.ncode = 0; /* number of code length code lengths */ + this.nlen = 0; /* number of length code lengths */ + this.ndist = 0; /* number of distance code lengths */ + this.have = 0; /* number of code lengths in lens[] */ + this.next = null; /* next available space in codes[] */ + + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */ + this.work = new utils.Buf16(288); /* work area for code table building */ + + /* + because we don't have pointers in js, we use lencode and distcode directly + as buffers so we don't need codes + */ + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */ + this.distdyn = null; /* dynamic table for distance codes (JS specific) */ + this.sane = 0; /* if false, allow invalid distance too far */ + this.back = 0; /* bits back of last unprocessed length/lit */ + this.was = 0; /* initial length of match */ +} + +function inflateResetKeep(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ''; /*Z_NULL*/ + if (state.wrap) { /* to support ill-conceived Java test suite */ + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null/*Z_NULL*/; + state.hold = 0; + state.bits = 0; + //state.lencode = state.distcode = state.next = state.codes; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + + state.sane = 1; + state.back = -1; + //Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +function inflateReset(strm) { + var state; + + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + +} + +function inflateReset2(strm, windowBits) { + var wrap; + var state; + + /* get the state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + + /* extract wrap request from windowBits parameter */ + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } + else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + + /* set number of window bits, free window if different */ + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + + /* update state and reset the rest of it */ + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); +} + +function inflateInit2(strm, windowBits) { + var ret; + var state; + + if (!strm) { return Z_STREAM_ERROR; } + //strm.msg = Z_NULL; /* in case we return an error */ + + state = new InflateState(); + + //if (state === Z_NULL) return Z_MEM_ERROR; + //Tracev((stderr, "inflate: allocated\n")); + strm.state = state; + state.window = null/*Z_NULL*/; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null/*Z_NULL*/; + } + return ret; +} + +function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); +} + + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +var virgin = true; + +var lenfix, distfix; // We have no pointers in JS, so keep tables separate + +function fixedtables(state) { + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + var sym; + + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + + /* literal/length table */ + sym = 0; + while (sym < 144) { state.lens[sym++] = 8; } + while (sym < 256) { state.lens[sym++] = 9; } + while (sym < 280) { state.lens[sym++] = 7; } + while (sym < 288) { state.lens[sym++] = 8; } + + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9}); + + /* distance table */ + sym = 0; + while (sym < 32) { state.lens[sym++] = 5; } + + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5}); + + /* do this just once */ + virgin = false; + } + + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; +} + + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + + /* if it hasn't been done already, allocate space for the window */ + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + + state.window = new utils.Buf8(state.wsize); + } + + /* copy state->wsize or less output bytes into the circular window */ + if (copy >= state.wsize) { + utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } + else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + //zmemcpy(state->window + state->wnext, end - copy, dist); + utils.arraySet(state.window,src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + //zmemcpy(state->window, end - copy, copy); + utils.arraySet(state.window,src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } + else { + state.wnext += dist; + if (state.wnext === state.wsize) { state.wnext = 0; } + if (state.whave < state.wsize) { state.whave += dist; } + } + } + return 0; +} + +function inflate(strm, flush) { + var state; + var input, output; // input/output buffers + var next; /* next input INDEX */ + var put; /* next output INDEX */ + var have, left; /* available input and output */ + var hold; /* bit buffer */ + var bits; /* bits in bit buffer */ + var _in, _out; /* save starting available input and output */ + var copy; /* number of stored or match bytes to copy */ + var from; /* where to copy match bytes from */ + var from_source; + var here = 0; /* current decoding table entry */ + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific) + //var last; /* parent table entry */ + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific) + var len; /* length to copy for repeats, bits to drop */ + var ret; /* return code */ + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */ + var opts; + + var n; // temporary var for NEED_BITS + + var order = /* permutation of code lengths */ + [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + + + if (!strm || !strm.state || !strm.output || + (!strm.input && strm.avail_in !== 0)) { + return Z_STREAM_ERROR; + } + + state = strm.state; + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ + + + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + _in = have; + _out = left; + ret = Z_OK; + + inf_leave: // goto emulation + for (;;) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + //=== NEEDBITS(16); + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ + state.check = 0/*crc32(0L, Z_NULL, 0)*/; + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = FLAGS; + break; + } + state.flags = 0; /* expect zlib header */ + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { + strm.msg = 'incorrect header check'; + state.mode = BAD; + break; + } + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// + len = (hold & 0x0f)/*BITS(4)*/ + 8; + if (state.wbits === 0) { + state.wbits = len; + } + else if (len > state.wbits) { + strm.msg = 'invalid window size'; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + //Tracev((stderr, "inflate: zlib header ok\n")); + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = hold & 0x200 ? DICTID : TYPE; + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + break; + case FLAGS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.flags = hold; + if ((state.flags & 0xff) !== Z_DEFLATED) { + strm.msg = 'unknown compression method'; + state.mode = BAD; + break; + } + if (state.flags & 0xe000) { + strm.msg = 'unknown header flags set'; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = ((hold >> 8) & 1); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = TIME; + /* falls through */ + case TIME: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.time = hold; + } + if (state.flags & 0x0200) { + //=== CRC4(state.check, hold) + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + hbuf[2] = (hold >>> 16) & 0xff; + hbuf[3] = (hold >>> 24) & 0xff; + state.check = crc32(state.check, hbuf, 4, 0); + //=== + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = OS; + /* falls through */ + case OS: + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (state.head) { + state.head.xflags = (hold & 0xff); + state.head.os = (hold >> 8); + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = EXLEN; + /* falls through */ + case EXLEN: + if (state.flags & 0x0400) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 0x0200) { + //=== CRC2(state.check, hold); + hbuf[0] = hold & 0xff; + hbuf[1] = (hold >>> 8) & 0xff; + state.check = crc32(state.check, hbuf, 2, 0); + //===// + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + else if (state.head) { + state.head.extra = null/*Z_NULL*/; + } + state.mode = EXTRA; + /* falls through */ + case EXTRA: + if (state.flags & 0x0400) { + copy = state.length; + if (copy > have) { copy = have; } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + // Use untyped array for more conveniend processing later + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + //zmemcpy(state.head.extra + len, next, + // len + copy > state.head.extra_max ? + // state.head.extra_max - len : copy); + } + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { break inf_leave; } + } + state.length = 0; + state.mode = NAME; + /* falls through */ + case NAME: + if (state.flags & 0x0800) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + // TODO: 2 or 1 bytes? + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.name_max*/)) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + /* falls through */ + case COMMENT: + if (state.flags & 0x1000) { + if (have === 0) { break inf_leave; } + copy = 0; + do { + len = input[next + copy++]; + /* use constant limit because in js we should not preallocate memory */ + if (state.head && len && + (state.length < 65536 /*state.head.comm_max*/)) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 0x0200) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { break inf_leave; } + } + else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + /* falls through */ + case HCRC: + if (state.flags & 0x0200) { + //=== NEEDBITS(16); */ + while (bits < 16) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.check & 0xffff)) { + strm.msg = 'header crc mismatch'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + } + if (state.head) { + state.head.hcrc = ((state.flags >> 9) & 1); + state.head.done = true; + } + strm.adler = state.check = 0 /*crc32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + break; + case DICTID: + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + strm.adler = state.check = ZSWAP32(hold); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = DICT; + /* falls through */ + case DICT: + if (state.havedict === 0) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + return Z_NEED_DICT; + } + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; + state.mode = TYPE; + /* falls through */ + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } + /* falls through */ + case TYPEDO: + if (state.last) { + //--- BYTEBITS() ---// + hold >>>= bits & 7; + bits -= bits & 7; + //---// + state.mode = CHECK; + break; + } + //=== NEEDBITS(3); */ + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.last = (hold & 0x01)/*BITS(1)*/; + //--- DROPBITS(1) ---// + hold >>>= 1; + bits -= 1; + //---// + + switch ((hold & 0x03)/*BITS(2)*/) { + case 0: /* stored block */ + //Tracev((stderr, "inflate: stored block%s\n", + // state.last ? " (last)" : "")); + state.mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + //Tracev((stderr, "inflate: fixed codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = LEN_; /* decode codes */ + if (flush === Z_TREES) { + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break inf_leave; + } + break; + case 2: /* dynamic block */ + //Tracev((stderr, "inflate: dynamic codes block%s\n", + // state.last ? " (last)" : "")); + state.mode = TABLE; + break; + case 3: + strm.msg = 'invalid block type'; + state.mode = BAD; + } + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + break; + case STORED: + //--- BYTEBITS() ---// /* go to byte boundary */ + hold >>>= bits & 7; + bits -= bits & 7; + //---// + //=== NEEDBITS(32); */ + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { + strm.msg = 'invalid stored block lengths'; + state.mode = BAD; + break; + } + state.length = hold & 0xffff; + //Tracev((stderr, "inflate: stored length %u\n", + // state.length)); + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + state.mode = COPY_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case COPY_: + state.mode = COPY; + /* falls through */ + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { copy = have; } + if (copy > left) { copy = left; } + if (copy === 0) { break inf_leave; } + //--- zmemcpy(put, next, copy); --- + utils.arraySet(output, input, next, copy, put); + //---// + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + //Tracev((stderr, "inflate: stored end\n")); + state.mode = TYPE; + break; + case TABLE: + //=== NEEDBITS(14); */ + while (bits < 14) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1; + //--- DROPBITS(5) ---// + hold >>>= 5; + bits -= 5; + //---// + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4; + //--- DROPBITS(4) ---// + hold >>>= 4; + bits -= 4; + //---// +//#ifndef PKZIP_BUG_WORKAROUND + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = 'too many length or distance symbols'; + state.mode = BAD; + break; + } +//#endif + //Tracev((stderr, "inflate: table sizes ok\n")); + state.have = 0; + state.mode = LENLENS; + /* falls through */ + case LENLENS: + while (state.have < state.ncode) { + //=== NEEDBITS(3); + while (bits < 3) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + // We have separate tables & no pointers. 2 commented lines below not needed. + //state.next = state.codes; + //state.lencode = state.next; + // Switch to use dynamic table + state.lencode = state.lendyn; + state.lenbits = 7; + + opts = {bits: state.lenbits}; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + + if (ret) { + strm.msg = 'invalid code lengths set'; + state.mode = BAD; + break; + } + //Tracev((stderr, "inflate: code lengths ok\n")); + state.have = 0; + state.mode = CODELENS; + /* falls through */ + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_val < 16) { + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.lens[state.have++] = here_val; + } + else { + if (here_val === 16) { + //=== NEEDBITS(here.bits + 2); + n = here_bits + 2; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + if (state.have === 0) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 0x03);//BITS(2); + //--- DROPBITS(2) ---// + hold >>>= 2; + bits -= 2; + //---// + } + else if (here_val === 17) { + //=== NEEDBITS(here.bits + 3); + n = here_bits + 3; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 3 + (hold & 0x07);//BITS(3); + //--- DROPBITS(3) ---// + hold >>>= 3; + bits -= 3; + //---// + } + else { + //=== NEEDBITS(here.bits + 7); + n = here_bits + 7; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + len = 0; + copy = 11 + (hold & 0x7f);//BITS(7); + //--- DROPBITS(7) ---// + hold >>>= 7; + bits -= 7; + //---// + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = 'invalid bit length repeat'; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + + /* handle error breaks in while */ + if (state.mode === BAD) { break; } + + /* check for end-of-block code (better have one) */ + if (state.lens[256] === 0) { + strm.msg = 'invalid code -- missing end-of-block'; + state.mode = BAD; + break; + } + + /* build code tables -- note: do not change the lenbits or distbits + values here (9 and 6) without reading the comments in inftrees.h + concerning the ENOUGH constants, which depend on those values */ + state.lenbits = 9; + + opts = {bits: state.lenbits}; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.lenbits = opts.bits; + // state.lencode = state.next; + + if (ret) { + strm.msg = 'invalid literal/lengths set'; + state.mode = BAD; + break; + } + + state.distbits = 6; + //state.distcode.copy(state.codes); + // Switch to use dynamic table + state.distcode = state.distdyn; + opts = {bits: state.distbits}; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + // We have separate tables & no pointers. 2 commented lines below not needed. + // state.next_index = opts.table_index; + state.distbits = opts.bits; + // state.distcode = state.next; + + if (ret) { + strm.msg = 'invalid distances set'; + state.mode = BAD; + break; + } + //Tracev((stderr, 'inflate: codes ok\n')); + state.mode = LEN_; + if (flush === Z_TREES) { break inf_leave; } + /* falls through */ + case LEN_: + state.mode = LEN; + /* falls through */ + case LEN: + if (have >= 6 && left >= 258) { + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + inflate_fast(strm, _out); + //--- LOAD() --- + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + //--- + + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & ((1 << state.lenbits) -1)]; /*BITS(state.lenbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if (here_bits <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if (here_op && (here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + + ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? + // "inflate: literal '%c'\n" : + // "inflate: literal 0x%02x\n", here.val)); + state.mode = LIT; + break; + } + if (here_op & 32) { + //Tracevv((stderr, "inflate: end of block\n")); + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = 'invalid literal/length code'; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + /* falls through */ + case LENEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.length += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } + //Tracevv((stderr, "inflate: length %u\n", state.length)); + state.was = state.length; + state.mode = DIST; + /* falls through */ + case DIST: + for (;;) { + here = state.distcode[hold & ((1 << state.distbits) -1)];/*BITS(state.distbits)*/ + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + if ((here_op & 0xf0) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + + ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)]; + here_bits = here >>> 24; + here_op = (here >>> 16) & 0xff; + here_val = here & 0xffff; + + if ((last_bits + here_bits) <= bits) { break; } + //--- PULLBYTE() ---// + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + //---// + } + //--- DROPBITS(last.bits) ---// + hold >>>= last_bits; + bits -= last_bits; + //---// + state.back += last_bits; + } + //--- DROPBITS(here.bits) ---// + hold >>>= here_bits; + bits -= here_bits; + //---// + state.back += here_bits; + if (here_op & 64) { + strm.msg = 'invalid distance code'; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = (here_op) & 15; + state.mode = DISTEXT; + /* falls through */ + case DISTEXT: + if (state.extra) { + //=== NEEDBITS(state.extra); + n = state.extra; + while (bits < n) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + state.offset += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/; + //--- DROPBITS(state.extra) ---// + hold >>>= state.extra; + bits -= state.extra; + //---// + state.back += state.extra; + } +//#ifdef INFLATE_STRICT + if (state.offset > state.dmax) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +//#endif + //Tracevv((stderr, "inflate: distance %u\n", state.offset)); + state.mode = MATCH; + /* falls through */ + case MATCH: + if (left === 0) { break inf_leave; } + copy = _out - left; + if (state.offset > copy) { /* copy from window */ + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = 'invalid distance too far back'; + state.mode = BAD; + break; + } +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR +// Trace((stderr, "inflate.c too far\n")); +// copy -= state.whave; +// if (copy > state.length) { copy = state.length; } +// if (copy > left) { copy = left; } +// left -= copy; +// state.length -= copy; +// do { +// output[put++] = 0; +// } while (--copy); +// if (state.length === 0) { state.mode = LEN; } +// break; +//#endif + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } + else { + from = state.wnext - copy; + } + if (copy > state.length) { copy = state.length; } + from_source = state.window; + } + else { /* copy from output */ + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { copy = left; } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { state.mode = LEN; } + break; + case LIT: + if (left === 0) { break inf_leave; } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + // Use '|' insdead of '+' to make sure that result is signed + hold |= input[next++] << bits; + bits += 8; + } + //===// + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = + /*UPDATE(state.check, put - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)); + + } + _out = left; + // NB: crc32 stored as signed 32-bit int, ZSWAP32 returns signed too + if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) { + strm.msg = 'incorrect data check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: check matches trailer\n")); + } + state.mode = LENGTH; + /* falls through */ + case LENGTH: + if (state.wrap && state.flags) { + //=== NEEDBITS(32); + while (bits < 32) { + if (have === 0) { break inf_leave; } + have--; + hold += input[next++] << bits; + bits += 8; + } + //===// + if (hold !== (state.total & 0xffffffff)) { + strm.msg = 'incorrect length check'; + state.mode = BAD; + break; + } + //=== INITBITS(); + hold = 0; + bits = 0; + //===// + //Tracev((stderr, "inflate: length matches trailer\n")); + } + state.mode = DONE; + /* falls through */ + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + /* falls through */ + default: + return Z_STREAM_ERROR; + } + } + + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + + //--- RESTORE() --- + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + //--- + + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH))) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + + (state.mode === TYPE ? 128 : 0) + + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; +} + +function inflateEnd(strm) { + + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) { + return Z_STREAM_ERROR; + } + + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; +} + +function inflateGetHeader(strm, head) { + var state; + + /* check state */ + if (!strm || !strm.state) { return Z_STREAM_ERROR; } + state = strm.state; + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; } + + /* save header structure */ + state.head = head; + head.done = false; + return Z_OK; +} + + +exports.inflateReset = inflateReset; +exports.inflateReset2 = inflateReset2; +exports.inflateResetKeep = inflateResetKeep; +exports.inflateInit = inflateInit; +exports.inflateInit2 = inflateInit2; +exports.inflate = inflate; +exports.inflateEnd = inflateEnd; +exports.inflateGetHeader = inflateGetHeader; +exports.inflateInfo = 'pako inflate (from Nodeca project)'; + +/* Not implemented +exports.inflateCopy = inflateCopy; +exports.inflateGetDictionary = inflateGetDictionary; +exports.inflateMark = inflateMark; +exports.inflatePrime = inflatePrime; +exports.inflateSetDictionary = inflateSetDictionary; +exports.inflateSync = inflateSync; +exports.inflateSyncPoint = inflateSyncPoint; +exports.inflateUndermine = inflateUndermine; +*/ +},{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(_dereq_,module,exports){ +'use strict'; + + +var utils = _dereq_('../utils/common'); + +var MAXBITS = 15; +var ENOUGH_LENS = 852; +var ENOUGH_DISTS = 592; +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); + +var CODES = 0; +var LENS = 1; +var DISTS = 2; + +var lbase = [ /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +]; + +var lext = [ /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 +]; + +var dbase = [ /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0 +]; + +var dext = [ /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64 +]; + +module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) +{ + var bits = opts.bits; + //here = opts.here; /* table entry for duplication */ + + var len = 0; /* a code's length in bits */ + var sym = 0; /* index of code symbols */ + var min = 0, max = 0; /* minimum and maximum code lengths */ + var root = 0; /* number of index bits for root table */ + var curr = 0; /* number of index bits for current table */ + var drop = 0; /* code bits to drop for sub-table */ + var left = 0; /* number of prefix codes available */ + var used = 0; /* code entries in table used */ + var huff = 0; /* Huffman code */ + var incr; /* for incrementing code, index */ + var fill; /* index for replicating entries */ + var low; /* low bits for current root entry */ + var mask; /* mask for low root bits */ + var next; /* next available space in table */ + var base = null; /* base value table to use */ + var base_index = 0; +// var shoextra; /* extra bits table to use */ + var end; /* use base and extra for symbol > end */ + var count = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* number of codes of each length */ + var offs = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* offsets in table for each length */ + var extra = null; + var extra_index = 0; + + var here_bits, here_op, here_val; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + + /* bound code lengths, force root to be within code lengths */ + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { break; } + } + if (root > max) { + root = max; + } + if (max === 0) { /* no symbols to code at all */ + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ + //table.bits[opts.table_index] = 1; //here.bits = (var char)1; + //table.val[opts.table_index++] = 0; //here.val = (var short)0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + + //table.op[opts.table_index] = 64; + //table.bits[opts.table_index] = 1; + //table.val[opts.table_index++] = 0; + table[table_index++] = (1 << 24) | (64 << 16) | 0; + + opts.bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { break; } + } + if (root < min) { + root = min; + } + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } /* over-subscribed */ + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; /* incomplete set */ + } + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked for LENS and DIST tables against + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in + the initial root table size constants. See the comments in inftrees.h + for more information. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + // poor man optimization - use if-else instead of switch, + // to avoid deopts in old v8 + if (type === CODES) { + base = extra = work; /* dummy value--not used */ + end = 19; + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + } else { /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize opts for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = table_index; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = -1; /* trigger new sub-table when len > root */ + used = 1 << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + var i=0; + /* process all codes and make table entries */ + for (;;) { + i++; + /* create table entry */ + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } + else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } + else { + here_op = 32 + 64; /* end of block */ + here_val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1 << (len - drop); + fill = 1 << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0; + } while (fill !== 0); + + /* backwards increment the len-bit code huff */ + incr = 1 << (len - 1); + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + + /* go to next symbol, update count, len */ + sym++; + if (--count[len] === 0) { + if (len === max) { break; } + len = lens[lens_index + work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) !== low) { + /* if first time, transition to sub-tables */ + if (drop === 0) { + drop = root; + } + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { break; } + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1 << curr; + if ((type === LENS && used > ENOUGH_LENS) || + (type === DISTS && used > ENOUGH_DISTS)) { + return 1; + } + + /* point entry in root table to sub-table */ + low = huff & mask; + /*table.op[low] = curr; + table.bits[low] = root; + table.val[low] = next - opts.table_index;*/ + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0; + } + } + + /* fill in remaining table entry if code is incomplete (guaranteed to have + at most one remaining entry, since if the code is incomplete, the + maximum code length that was allowed to get this far is one bit) */ + if (huff !== 0) { + //table.op[next + huff] = 64; /* invalid code marker */ + //table.bits[next + huff] = len - drop; + //table.val[next + huff] = 0; + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0; + } + + /* set return parameters */ + //opts.table_index += used; + opts.bits = root; + return 0; +}; + +},{"../utils/common":27}],37:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = { + '2': 'need dictionary', /* Z_NEED_DICT 2 */ + '1': 'stream end', /* Z_STREAM_END 1 */ + '0': '', /* Z_OK 0 */ + '-1': 'file error', /* Z_ERRNO (-1) */ + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ + '-3': 'data error', /* Z_DATA_ERROR (-3) */ + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ +}; +},{}],38:[function(_dereq_,module,exports){ +'use strict'; + + +var utils = _dereq_('../utils/common'); + +/* Public constants ==========================================================*/ +/* ===========================================================================*/ + + +//var Z_FILTERED = 1; +//var Z_HUFFMAN_ONLY = 2; +//var Z_RLE = 3; +var Z_FIXED = 4; +//var Z_DEFAULT_STRATEGY = 0; + +/* Possible values of the data_type field (though see inflate()) */ +var Z_BINARY = 0; +var Z_TEXT = 1; +//var Z_ASCII = 1; // = Z_TEXT +var Z_UNKNOWN = 2; + +/*============================================================================*/ + + +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } } + +// From zutil.h + +var STORED_BLOCK = 0; +var STATIC_TREES = 1; +var DYN_TREES = 2; +/* The three kinds of block type */ + +var MIN_MATCH = 3; +var MAX_MATCH = 258; +/* The minimum and maximum match lengths */ + +// From deflate.h +/* =========================================================================== + * Internal compression state. + */ + +var LENGTH_CODES = 29; +/* number of length codes, not counting the special END_BLOCK code */ + +var LITERALS = 256; +/* number of literal bytes 0..255 */ + +var L_CODES = LITERALS + 1 + LENGTH_CODES; +/* number of Literal or Length codes, including the END_BLOCK code */ + +var D_CODES = 30; +/* number of distance codes */ + +var BL_CODES = 19; +/* number of codes used to transfer the bit lengths */ + +var HEAP_SIZE = 2*L_CODES + 1; +/* maximum heap size */ + +var MAX_BITS = 15; +/* All codes must not exceed MAX_BITS bits */ + +var Buf_size = 16; +/* size of bit buffer in bi_buf */ + + +/* =========================================================================== + * Constants + */ + +var MAX_BL_BITS = 7; +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +var END_BLOCK = 256; +/* end of block literal code */ + +var REP_3_6 = 16; +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +var REPZ_3_10 = 17; +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +var REPZ_11_138 = 18; +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +var extra_lbits = /* extra bits for each length code */ + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]; + +var extra_dbits = /* extra bits for each distance code */ + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]; + +var extra_blbits = /* extra bits for each bit length code */ + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]; + +var bl_order = + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +// We pre-fill arrays with 0 to avoid uninitialized gaps + +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */ + +// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1 +var static_ltree = new Array((L_CODES+2) * 2); +zero(static_ltree); +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +var static_dtree = new Array(D_CODES * 2); +zero(static_dtree); +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +var _dist_code = new Array(DIST_CODE_LEN); +zero(_dist_code); +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +var _length_code = new Array(MAX_MATCH-MIN_MATCH+1); +zero(_length_code); +/* length code for each normalized match length (0 == MIN_MATCH) */ + +var base_length = new Array(LENGTH_CODES); +zero(base_length); +/* First normalized length for each code (0 = MIN_MATCH) */ + +var base_dist = new Array(D_CODES); +zero(base_dist); +/* First normalized distance for each code (0 = distance of 1) */ + + +var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) { + + this.static_tree = static_tree; /* static tree or NULL */ + this.extra_bits = extra_bits; /* extra bits for each code or NULL */ + this.extra_base = extra_base; /* base index for extra_bits */ + this.elems = elems; /* max number of elements in the tree */ + this.max_length = max_length; /* max bit length for the codes */ + + // show if `static_tree` has data or dummy - needed for monomorphic objects + this.has_stree = static_tree && static_tree.length; +}; + + +var static_l_desc; +var static_d_desc; +var static_bl_desc; + + +var TreeDesc = function(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; /* the dynamic tree */ + this.max_code = 0; /* largest code with non zero frequency */ + this.stat_desc = stat_desc; /* the corresponding static tree */ +}; + + + +function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; +} + + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +function put_short (s, w) { +// put_byte(s, (uch)((w) & 0xff)); +// put_byte(s, (uch)((ush)(w) >> 8)); + s.pending_buf[s.pending++] = (w) & 0xff; + s.pending_buf[s.pending++] = (w >>> 8) & 0xff; +} + + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +function send_bits(s, value, length) { + if (s.bi_valid > (Buf_size - length)) { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + put_short(s, s.bi_buf); + s.bi_buf = value >> (Buf_size - s.bi_valid); + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= (value << s.bi_valid) & 0xffff; + s.bi_valid += length; + } +} + + +function send_code(s, c, tree) { + send_bits(s, tree[c*2]/*.Code*/, tree[c*2 + 1]/*.Len*/); +} + + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; +} + + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 0xff; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } +} + + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +function gen_bitlen(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; /* heap index */ + var n, m; /* iterate over the tree elements */ + var bits; /* bit length */ + var xbits; /* extra bits */ + var f; /* frequency */ + var overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */ + + for (h = s.heap_max+1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n*2 + 1]/*.Len*/ = bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) { continue; } /* not a leaf node */ + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n-base]; + } + f = tree[n * 2]/*.Freq*/; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits); + } + } + if (overflow === 0) { return; } + + // Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length-1; + while (s.bl_count[bits] === 0) { bits--; } + s.bl_count[bits]--; /* move one leaf down the tree */ + s.bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s.bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { continue; } + if (tree[m*2 + 1]/*.Len*/ !== bits) { + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/; + tree[m*2 + 1]/*.Len*/ = bits; + } + n--; + } + } +} + + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +function gen_codes(tree, max_code, bl_count) +// ct_data *tree; /* the tree to decorate */ +// int max_code; /* largest code with non zero frequency */ +// ushf *bl_count; /* number of codes at each bit length */ +{ + var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */ + var code = 0; /* running code value */ + var bits; /* bit index */ + var n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits-1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES-1; code++) { + base_length[code] = length; + for (n = 0; n < (1< dist code (0..29) */ + dist = 0; + for (code = 0 ; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ + for ( ; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + _dist_code[256 + dist++] = code; + } + } + //Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + + n = 0; + while (n <= 143) { + static_ltree[n*2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n*2 + 1]/*.Len*/ = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n*2 + 1]/*.Len*/ = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n*2 + 1]/*.Len*/ = 8; + n++; + bl_count[8]++; + } + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes(static_ltree, L_CODES+1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n*2 + 1]/*.Len*/ = 5; + static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5); + } + + // Now data ready and we can init static trees + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + + //static_init_done = true; +} + + +/* =========================================================================== + * Initialize a new block. + */ +function init_block(s) { + var n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; } + + s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; +} + + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +function bi_windup(s) +{ + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + //put_byte(s, (Byte)s->bi_buf); + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +function copy_block(s, buf, len, header) +//DeflateState *s; +//charf *buf; /* the input data */ +//unsigned len; /* its length */ +//int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + + if (header) { + put_short(s, len); + put_short(s, ~len); + } +// while (len--) { +// put_byte(s, *buf++); +// } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +function smaller(tree, n, m, depth) { + var _n2 = n*2; + var _m2 = m*2; + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ || + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m])); +} + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +function pqdownheap(s, tree, k) +// deflate_state *s; +// ct_data *tree; /* the tree to restore */ +// int k; /* node to move down */ +{ + var v = s.heap[k]; + var j = k << 1; /* left son of k */ + while (j <= s.heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s.heap_len && + smaller(tree, s.heap[j+1], s.heap[j], s.depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s.heap[j], s.depth)) { break; } + + /* Exchange v with the smallest son */ + s.heap[k] = s.heap[j]; + k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s.heap[k] = v; +} + + +// inlined manually +// var SMALLEST = 1; + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +function compress_block(s, ltree, dtree) +// deflate_state *s; +// const ct_data *ltree; /* literal tree */ +// const ct_data *dtree; /* distance tree */ +{ + var dist; /* distance of matched string */ + var lc; /* match length or unmatched char (if dist == 0) */ + var lx = 0; /* running index in l_buf */ + var code; /* the code to send */ + var extra; /* number of extra bits to send */ + + if (s.last_lit !== 0) { + do { + dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]); + lc = s.pending_buf[s.l_buf + lx]; + lx++; + + if (dist === 0) { + send_code(s, lc, ltree); /* send a literal byte */ + //Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + //Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + // "pendingBuf overflow"); + + } while (lx < s.last_lit); + } + + send_code(s, END_BLOCK, ltree); +} + + +/* =========================================================================== + * Construct one Huffman tree and assigns the code bit strings and lengths. + * Update the total bit length for the current block. + * IN assertion: the field freq is set for all tree elements. + * OUT assertions: the fields len and code are set to the optimal bit length + * and corresponding code. The length opt_len is updated; static_len is + * also updated if stree is not null. The field max_code is set. + */ +function build_tree(s, desc) +// deflate_state *s; +// tree_desc *desc; /* the tree descriptor */ +{ + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; /* iterate over heap elements */ + var max_code = -1; /* largest code with non zero frequency */ + var node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n * 2]/*.Freq*/ !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + + } else { + tree[n*2 + 1]/*.Len*/ = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0); + tree[node * 2]/*.Freq*/ = 1; + s.depth[node] = 0; + s.opt_len--; + + if (has_stree) { + s.static_len -= stree[node*2 + 1]/*.Len*/; + } + /* node is 0 or 1 so it does not have extra bits */ + } + desc.max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); } + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + //pqremove(s, tree, n); /* n = node of least frequency */ + /*** pqremove ***/ + n = s.heap[1/*SMALLEST*/]; + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1/*SMALLEST*/); + /***/ + + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */ + + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */ + s.heap[--s.heap_max] = m; + + /* Create a new node father of n and m */ + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node; + + /* and insert the new node in the heap */ + s.heap[1/*SMALLEST*/] = node++; + pqdownheap(s, tree, 1/*SMALLEST*/); + + } while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes(tree, max_code, s.bl_count); +} + + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +function scan_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n+1)*2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + s.bl_tree[curlen * 2]/*.Freq*/ += count; + + } else if (curlen !== 0) { + + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; } + s.bl_tree[REP_3_6*2]/*.Freq*/++; + + } else if (count <= 10) { + s.bl_tree[REPZ_3_10*2]/*.Freq*/++; + + } else { + s.bl_tree[REPZ_11_138*2]/*.Freq*/++; + } + + count = 0; + prevlen = curlen; + + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +function send_tree(s, tree, max_code) +// deflate_state *s; +// ct_data *tree; /* the tree to be scanned */ +// int max_code; /* and its largest code of non zero frequency */ +{ + var n; /* iterates over all tree elements */ + var prevlen = -1; /* last emitted length */ + var curlen; /* length of current code */ + + var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */ + + var count = 0; /* repeat count of the current code */ + var max_count = 7; /* max repeat count */ + var min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n+1)*2 + 1]/*.Len*/; + + if (++count < max_count && curlen === nextlen) { + continue; + + } else if (count < min_count) { + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0); + + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + //Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count-3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count-3, 3); + + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count-11, 7); + } + + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + + } else { + max_count = 7; + min_count = 4; + } + } +} + + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +function build_bl_tree(s) { + var max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, s.bl_desc); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) { + break; + } + } + /* Update opt_len to include the bit length tree and counts */ + s.opt_len += 3*(max_blindex+1) + 5+5+4; + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + // s->opt_len, s->static_len)); + + return max_blindex; +} + + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +function send_all_trees(s, lcodes, dcodes, blcodes) +// deflate_state *s; +// int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + var rank; /* index in bl_order */ + + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + // "too many codes"); + //Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes-1, 5); + send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + //Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3); + } + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */ + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */ + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + + +/* =========================================================================== + * Check if the data type is TEXT or BINARY, using the following algorithm: + * - TEXT if the two conditions below are satisfied: + * a) There are no non-portable control characters belonging to the + * "black list" (0..6, 14..25, 28..31). + * b) There is at least one printable character belonging to the + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). + * - BINARY otherwise. + * - The following partially-portable control characters form a + * "gray list" that is ignored in this detection algorithm: + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). + * IN assertion: the fields Freq of dyn_ltree are set. + */ +function detect_data_type(s) { + /* black_mask is the bit mask of black-listed bytes + * set bits 0..6, 14..25, and 28..31 + * 0xf3ffc07f = binary 11110011111111111100000001111111 + */ + var black_mask = 0xf3ffc07f; + var n; + + /* Check for non-textual ("black-listed") bytes. */ + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if ((black_mask & 1) && (s.dyn_ltree[n*2]/*.Freq*/ !== 0)) { + return Z_BINARY; + } + } + + /* Check for textual ("white-listed") bytes. */ + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 || + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { + return Z_TEXT; + } + } + + /* There are no "black-listed" or "white-listed" bytes: + * this stream either is empty or has tolerated ("gray-listed") bytes only. + */ + return Z_BINARY; +} + + +var static_init_done = false; + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +function _tr_init(s) +{ + + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + + s.bi_buf = 0; + s.bi_valid = 0; + + /* Initialize the first block of the first file: */ + init_block(s); +} + + +/* =========================================================================== + * Send a stored block + */ +function _tr_stored_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */ + copy_block(s, buf, stored_len, true); /* with header */ +} + + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + */ +function _tr_align(s) { + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); +} + + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +function _tr_flush_block(s, buf, stored_len, last) +//DeflateState *s; +//charf *buf; /* input block, or NULL if too old */ +//ulg stored_len; /* length of input block */ +//int last; /* one if this is the last block for a file */ +{ + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + var max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s.level > 0) { + + /* Check if the file is binary or text */ + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + + /* Construct the literal and distance trees */ + build_tree(s, s.l_desc); + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + + build_tree(s, s.d_desc); + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + // s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s.opt_len+3+7) >>> 3; + static_lenb = (s.static_len+3+7) >>> 3; + + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + // s->last_lit)); + + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; } + + } else { + // Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + + if ((stored_len+4 <= opt_lenb) && (buf !== -1)) { + /* 4: two words for the lengths */ + + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, last); + + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + + send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + + } else { + send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (last) { + bi_windup(s); + } + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + // s->compressed_len-7*last)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +function _tr_tally(s, dist, lc) +// deflate_state *s; +// unsigned dist; /* distance of matched string */ +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + //var out_length, in_length, dcode; + + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff; + + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff; + s.last_lit++; + + if (dist === 0) { + /* lc is the unmatched char */ + s.dyn_ltree[lc*2]/*.Freq*/++; + } else { + s.matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + //Assert((ush)dist < (ush)MAX_DIST(s) && + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++; + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; + } + +// (!) This block is disabled in zlib defailts, +// don't enable it for binary compatibility + +//#ifdef TRUNCATE_BLOCK +// /* Try to guess if it is profitable to stop the current block here */ +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { +// /* Compute an upper bound for the compressed length */ +// out_length = s.last_lit*8; +// in_length = s.strstart - s.block_start; +// +// for (dcode = 0; dcode < D_CODES; dcode++) { +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); +// } +// out_length >>>= 3; +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", +// // s->last_lit, in_length, out_length, +// // 100L - out_length*100L/in_length)); +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { +// return true; +// } +// } +//#endif + + return (s.last_lit === s.lit_bufsize-1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +exports._tr_init = _tr_init; +exports._tr_stored_block = _tr_stored_block; +exports._tr_flush_block = _tr_flush_block; +exports._tr_tally = _tr_tally; +exports._tr_align = _tr_align; +},{"../utils/common":27}],39:[function(_dereq_,module,exports){ +'use strict'; + + +function ZStream() { + /* next input byte */ + this.input = null; // JS specific, because we have no pointers + this.next_in = 0; + /* number of bytes available at input */ + this.avail_in = 0; + /* total number of input bytes read so far */ + this.total_in = 0; + /* next output byte should be put there */ + this.output = null; // JS specific, because we have no pointers + this.next_out = 0; + /* remaining free space at output */ + this.avail_out = 0; + /* total number of bytes output so far */ + this.total_out = 0; + /* last error message, NULL if no error */ + this.msg = ''/*Z_NULL*/; + /* not visible by applications */ + this.state = null; + /* best guess about the data type: binary or text */ + this.data_type = 2/*Z_UNKNOWN*/; + /* adler32 value of the uncompressed data */ + this.adler = 0; +} + +module.exports = ZStream; +},{}]},{},[9]) +(9) +})); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(122).Buffer, __webpack_require__(27))) + +/***/ }), +/* 372 */ +/***/ (function(module, exports) { + +/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */ +module.exports = __webpack_amd_options__; + +/* WEBPACK VAR INJECTION */}.call(exports, {})) + +/***/ }), +/* 373 */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), +/* 374 */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), +/* 375 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"header-f"},[_c('div',{staticClass:"container d-flex justify-content-between py-1"},[_c('div',{staticClass:"d-flex"},[_c('span',{staticClass:"text-white mr-3 my-auto mr-md-4"},[_vm._v("Nombre de Usuario")]),_vm._v(" "),_c('div',[_c('b-dropdown',{staticClass:"m-2",attrs:{"id":"dropdown-left","text":"Añadir","variant":"info"}},[_c('b-dropdown-item',[_c('router-link',{staticClass:"text-decoration-none text-body",attrs:{"to":"#"}},[_vm._v(" Computadora ")])],1),_vm._v(" "),_c('b-dropdown-item',[_c('router-link',{staticClass:"text-decoration-none text-body",attrs:{"to":"#"}},[_vm._v(" Impresora ")])],1)],1)],1)]),_vm._v(" "),_vm._m(0)])])} -var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"my-auto"},[_c('a',{attrs:{"href":"#"}},[_c('span',{staticClass:"badge badge-danger py-2 px-3",staticStyle:{"font-size":"14px"}},[_vm._v("Cerrar sesión")])])])}] +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-modal',{ref:"",attrs:{"id":"session","hide-footer":"","hide-header":""}},[_c('div',{staticClass:"d-block text-center"},[_c('h3',[_vm._v("La sesión ha caducado")])]),_vm._v(" "),_c('b-button',{staticClass:"mt-3",attrs:{"variant":"primary","block":""},on:{"click":function($event){return _vm.$router.replace('/login')}}},[_vm._v("¡Llévame al login!")])],1),_vm._v(" "),_c('div',{staticClass:"container mt-5"},[_vm._m(0),_vm._v(" "),_c('button',{staticClass:"btn btn-info mt-4",on:{"click":function($event){return _vm.changeView()}}},[(_vm.pcView)?_c('span',[_vm._v("Ver impresoras")]):_c('span',[_vm._v("Ver computadoras")])]),_vm._v(" "),_c('div',{staticClass:"row m-0 mt-3 mb-4"},[_c('div',{staticClass:"row"},[_c('div',{staticClass:"col"},[_c('input',{staticClass:"form-control input-login-form shadow-none",attrs:{"type":"text","id":"Inventario","placeholder":"Número de inventario"},on:{"keyup":function($event){return _vm.extraeInventario()}}})]),_vm._v(" "),_c('div',{staticClass:"col"},[_c('select',{staticClass:"form-control select-login-form shadow-none",attrs:{"name":"tipo","id":"tipo"},on:{"change":function($event){return _vm.buscaValor()}}},[_c('option',{attrs:{"value":"Todos","selected":""}},[_vm._v("Todos")]),_vm._v(" "),_vm._l((_vm.tipo),function(opcion){return (_vm.pcView)?_c('option',{domProps:{"value":opcion.activoFijo}},[_vm._v(_vm._s(opcion.activoFijo))]):_vm._l((_vm.tipoPrinters),function(opcion){return _c('option',{domProps:{"value":opcion.tipo}},[_vm._v(_vm._s(opcion.tipo))])})})],2)])])]),_vm._v(" "),(_vm.pcView)?_c('div',{staticClass:"table-responsive table-fixed text-nowrap justify-content-md-center",staticStyle:{"max-height":"350px"}},[_c('table',{class:['table', 'table-sm', 'text-center', { 'table-hover': _vm.admin(), 't-hov': _vm.admin() }],staticStyle:{"font-size":"14px"}},[_c('thead',{staticClass:"thead-light text-uppercase"},[_c('tr',_vm._l((_vm.pcHeads),function(pcHead){return _c('th',{key:pcHead,staticClass:"sticky-top"},[_vm._v(_vm._s(pcHead))])}),0)]),_vm._v(" "),_vm._l((_vm.respuesta),function(item){return _c('tbody',{staticClass:"overflow-auto thov"},[((_vm.seleccionado == item.activoFijo || _vm.seleccionado == 'Todos') + && item.noInventario.indexOf(_vm.miNoInventario) != -1)?_c('tr',{on:{"click":function($event){return _vm.watchRow()}}},[_c('td',[_vm._v(_vm._s(item.noInventario))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.activoFijo))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.modelo))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.marca))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.noSerie))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.procesador))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.vProcesador))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.hdd))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.memoriasz))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.memoria))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.vMemoria))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.graficos))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.osname))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.noResguardo))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.uResponsable))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.nombreResponsable))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.ubicacion))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.uso))])]):_vm._e()])})],2),_vm._v(" "),_c('br'),_vm._v(" "),_c('div',{staticClass:"text-center"},[(_vm.loading)?_c('b-spinner',{attrs:{"variant":"primary","label":"Spinning"}}):_vm._e()],1)]):_c('div',{staticClass:"table-responsive table-fixed text-nowrap justify-content-md-center",attrs:{"id":"myTableStyle"}},[_c('table',{class:['table', 'table-sm', 'text-center', { 't-hov': _vm.admin(), 'table-hover': _vm.admin()}]},[_c('thead',{staticClass:"thead-light text-uppercase"},[_c('tr',_vm._l((_vm.printerHeads),function(printerHead){return _c('th',{key:printerHead,staticClass:"sticky-top"},[_vm._v(_vm._s(printerHead))])}),0)]),_vm._v(" "),_vm._l((_vm.respuesta),function(item){return _c('tbody',[((_vm.seleccionado == item.tipo || _vm.seleccionado == 'Todos') + && item.noInventario.indexOf(_vm.miNoInventario) != -1)?_c('tr',{on:{"click":function($event){return _vm.watchRow()}}},[_c('td',{staticClass:"text-primary"},[_vm._v(_vm._s(item.noInventario))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.tipo))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.modelo))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.marca))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.noSerie))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.descripcion))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.noResguardo))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.uResponsable))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.nombreResponsable))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.ubicacion))]),_vm._v(" "),_c('td',[_vm._v(_vm._s(item.uso))])]):_vm._e()])})],2),_vm._v(" "),_c('br'),_vm._v(" "),_c('div',{staticClass:"text-center"},[(_vm.loading)?_c('b-spinner',{attrs:{"variant":"primary","label":"Spinning"}}):_vm._e()],1)]),_vm._v(" "),_c('button',{staticClass:"btn btn-lg btn-success mt-3",on:{"click":function($event){return _vm.onDescarga(_vm.respuesta)}}},[_vm._v("Descargar\n ")])]),_vm._v(" "),_vm._m(1)],1)} +var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"justify-content-center d-flex"},[_c('h1',{staticClass:"justify-content-center"},[_vm._v("Sistema de censo")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"container-fluid px-0",staticStyle:{"margin-top":"200px","left":"0px","position":"absolute"}},[_c('footer',{staticClass:"text-center",staticStyle:{"left":"0px"},attrs:{"id":"footer"}},[_c('div',{staticClass:"separador"}),_vm._v(" "),_c('div',{staticClass:"contenedor-footer p-3"},[_c('div',{staticClass:"text-white mt-3",staticStyle:{"font-size":"11px"}},[_c('p',[_vm._v("\n Hecho en México, todos los derechos reservados 2020.\n "),_c('br'),_vm._v("\n Esta página puede ser reproducida con fines no\n lucrativos, siempre y cuando no se mutile, se cite\n la fuente\n "),_c('br'),_vm._v("\n completa y su dirección electrónica. De otra forma,\n requiere permiso previo por escrito de la\n institución.\n ")])])])])])}] var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); /***/ }), -/* 330 */ +/* 376 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_AddEquip_vue__ = __webpack_require__(283); +/* unused harmony namespace reexport */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_961d1776_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_AddEquip_vue__ = __webpack_require__(379); +function injectStyle (ssrContext) { + __webpack_require__(377) +} +var normalizeComponent = __webpack_require__(28) +/* script */ + + +/* template */ + +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-961d1776" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_AddEquip_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_961d1776_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_AddEquip_vue__["a" /* default */], + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/App.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/components/Header.vue","import { deepFreeze } from './object'; // --- General BootstrapVue configuration ---\n// NOTES\n//\n// The global config SHALL NOT be used to set defaults for Boolean props, as the props\n// would loose their semantic meaning, and force people writing 3rd party components to\n// explicitly set a true or false value using the v-bind syntax on boolean props\n//\n// Supported config values (depending on the prop's supported type(s)):\n// `String`, `Array`, `Object`, `null` or `undefined`\n// BREAKPOINT DEFINITIONS\n//\n// Some components (`` and ``) generate props based on breakpoints,\n// and this occurs when the component is first loaded (evaluated), which may happen\n// before the config is created/modified\n//\n// To get around this we make these components' props async (lazy evaluation)\n// The component definition is only called/executed when the first access to the\n// component is used (and cached on subsequent uses)\n// PROP DEFAULTS\n//\n// For default values on props, we use the default value factory function approach so\n// that the default values are pulled in at each component instantiation\n//\n// props: {\n// variant: {\n// type: String,\n// default: () => getConfigComponent('BAlert', 'variant')\n// }\n// }\n//\n// We also provide a cached getter for breakpoints, which are \"frozen\" on first access\n// prettier-ignore\n\nexport default deepFreeze({\n // Breakpoints\n breakpoints: ['xs', 'sm', 'md', 'lg', 'xl'],\n // Form controls\n formControls: {\n size: undefined\n },\n // Component specific defaults are keyed by the component\n // name (PascalCase) and prop name (camelCase)\n BAlert: {\n dismissLabel: 'Close',\n variant: 'info'\n },\n BAvatar: {\n variant: 'secondary',\n badgeVariant: 'primary'\n },\n BBadge: {\n variant: 'secondary'\n },\n BButton: {\n size: undefined,\n variant: 'secondary'\n },\n BButtonClose: {\n content: '×',\n // `textVariant` is `null` to inherit the current text color\n textVariant: undefined,\n ariaLabel: 'Close'\n },\n BCalendar: {\n // BFormDate will choose these first if not provided in BFormDate section\n labelPrevDecade: 'Previous decade',\n labelPrevYear: 'Previous year',\n labelPrevMonth: 'Previous month',\n labelCurrentMonth: 'Current month',\n labelNextMonth: 'Next month',\n labelNextYear: 'Next year',\n labelNextDecade: 'Next decade',\n labelToday: 'Today',\n labelSelected: 'Selected date',\n labelNoDateSelected: 'No date selected',\n labelCalendar: 'Calendar',\n labelNav: 'Calendar navigation',\n labelHelp: 'Use cursor keys to navigate calendar dates'\n },\n BCardSubTitle: {\n // `` and `` also inherit this prop\n subTitleTextVariant: 'muted'\n },\n BCarousel: {\n labelPrev: 'Previous Slide',\n labelNext: 'Next Slide',\n labelGotoSlide: 'Goto Slide',\n labelIndicators: 'Select a slide to display'\n },\n BDropdown: {\n toggleText: 'Toggle Dropdown',\n size: undefined,\n variant: 'secondary',\n splitVariant: undefined\n },\n BFormDatepicker: {\n // BFormDatepicker will choose from BCalendar first if not provided here\n labelPrevDecade: undefined,\n labelPrevYear: undefined,\n labelPrevMonth: undefined,\n labelCurrentMonth: undefined,\n labelNextMonth: undefined,\n labelNextYear: undefined,\n labelNextDecade: undefined,\n labelToday: undefined,\n labelSelected: undefined,\n labelNoDateSelected: undefined,\n labelCalendar: undefined,\n labelNav: undefined,\n labelHelp: undefined,\n // These props are specific to BFormDatepicker\n labelTodayButton: 'Select today',\n labelResetButton: 'Reset',\n labelCloseButton: 'Close'\n },\n BFormFile: {\n browseText: 'Browse',\n // Chrome default file prompt\n placeholder: 'No file chosen',\n dropPlaceholder: 'Drop files here'\n },\n BFormRating: {\n variant: null,\n color: null\n },\n BFormTag: {\n removeLabel: 'Remove tag',\n variant: 'secondary'\n },\n BFormTags: {\n addButtonText: 'Add',\n addButtonVariant: 'outline-secondary',\n duplicateTagText: 'Duplicate tag(s)',\n invalidTagText: 'Invalid tag(s)',\n placeholder: 'Add tag...',\n tagRemoveLabel: 'Remove tag',\n tagRemovedLabel: 'Tag removed',\n tagVariant: 'secondary'\n },\n BFormText: {\n textVariant: 'muted'\n },\n BFormTimepicker: {\n // Fallback to BTime\n labelNoTimeSelected: undefined,\n labelSelected: undefined,\n labelHours: undefined,\n labelMinutes: undefined,\n labelSeconds: undefined,\n labelAmpm: undefined,\n labelAm: undefined,\n labelPm: undefined,\n // Fallback to BTime then BFormSpinbutton\n labelDecrement: undefined,\n labelIncrement: undefined,\n // These props are specific to BFormTimepicker\n labelNowButton: 'Select now',\n labelResetButton: 'Reset',\n labelCloseButton: 'Close'\n },\n BFormSpinbutton: {\n labelDecrement: 'Decrement',\n labelIncrement: 'Increment'\n },\n BImg: {\n blankColor: 'transparent'\n },\n BImgLazy: {\n blankColor: 'transparent'\n },\n BInputGroup: {\n size: undefined\n },\n BJumbotron: {\n bgVariant: undefined,\n borderVariant: undefined,\n textVariant: undefined\n },\n BLink: {\n routerComponentName: undefined\n },\n BListGroupItem: {\n variant: undefined\n },\n BModal: {\n titleTag: 'h5',\n size: 'md',\n headerBgVariant: undefined,\n headerBorderVariant: undefined,\n headerTextVariant: undefined,\n headerCloseVariant: undefined,\n bodyBgVariant: undefined,\n bodyTextVariant: undefined,\n footerBgVariant: undefined,\n footerBorderVariant: undefined,\n footerTextVariant: undefined,\n cancelTitle: 'Cancel',\n cancelVariant: 'secondary',\n okTitle: 'OK',\n okVariant: 'primary',\n headerCloseContent: '×',\n headerCloseLabel: 'Close'\n },\n BNavbar: {\n variant: null\n },\n BNavbarToggle: {\n label: 'Toggle navigation'\n },\n BPagination: {\n size: undefined\n },\n BPaginationNav: {\n size: undefined\n },\n BPopover: {\n boundary: 'scrollParent',\n boundaryPadding: 5,\n customClass: undefined,\n delay: 50,\n variant: undefined\n },\n BProgress: {\n variant: undefined\n },\n BProgressBar: {\n variant: undefined\n },\n BSpinner: {\n variant: undefined\n },\n BSidebar: {\n bgVariant: 'light',\n textVariant: 'dark',\n shadow: false,\n width: undefined,\n tag: 'div',\n backdropVariant: 'dark'\n },\n BTable: {\n selectedVariant: 'active',\n headVariant: undefined,\n footVariant: undefined\n },\n BTime: {\n labelNoTimeSelected: 'No time selected',\n labelSelected: 'Selected time',\n labelHours: 'Hours',\n labelMinutes: 'Minutes',\n labelSeconds: 'Seconds',\n labelAmpm: 'AM/PM',\n // It would be nice to be able to get these from Intl.DateTimeFormat somehow\n labelAm: 'AM',\n labelPm: 'PM',\n // The following inherit from BFormSpinbutton if not provided\n labelIncrement: undefined,\n labelDecrement: undefined\n },\n BToast: {\n toaster: 'b-toaster-top-right',\n autoHideDelay: 5000,\n variant: undefined,\n toastClass: undefined,\n headerClass: undefined,\n bodyClass: undefined\n },\n BToaster: {\n ariaLive: undefined,\n ariaAtomic: undefined,\n role: undefined\n },\n BTooltip: {\n boundary: 'scrollParent',\n boundaryPadding: 5,\n customClass: undefined,\n delay: 50,\n variant: undefined\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/utils/config-defaults.js\n// module id = 119\n// module chunks = 0","import { BAlert } from './alert';\nimport { pluginFactory } from '../../utils/plugins';\nvar AlertPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BAlert: BAlert\n }\n});\nexport { AlertPlugin, BAlert };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/alert/index.js\n// module id = 120\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { getComponentConfig } from '../../utils/config';\nimport { requestAF } from '../../utils/dom';\nimport { isBoolean } from '../../utils/inspect';\nimport { toInteger } from '../../utils/number';\nimport BVTransition from '../../utils/bv-transition';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BButtonClose } from '../button/button-close';\nvar NAME = 'BAlert'; // Convert `show` value to a number\n\nvar parseCountDown = function parseCountDown(show) {\n if (show === '' || isBoolean(show)) {\n return 0;\n }\n\n show = toInteger(show, 0);\n return show > 0 ? show : 0;\n}; // Convert `show` value to a boolean\n\n\nvar parseShow = function parseShow(show) {\n if (show === '' || show === true) {\n return true;\n }\n\n if (toInteger(show, 0) < 1) {\n // Boolean will always return false for the above comparison\n return false;\n }\n\n return !!show;\n}; // Is a value number like (i.e. a number or a number as string)\n\n\nvar isNumericLike = function isNumericLike(value) {\n return !isNaN(toInteger(value));\n}; // @vue/component\n\n\nexport var BAlert = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [normalizeSlotMixin],\n model: {\n prop: 'show',\n event: 'input'\n },\n props: {\n variant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'variant');\n }\n },\n dismissible: {\n type: Boolean,\n default: false\n },\n dismissLabel: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'dismissLabel');\n }\n },\n show: {\n type: [Boolean, Number, String],\n default: false\n },\n fade: {\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n return {\n countDown: 0,\n countDownTimeout: null,\n // If initially shown, we need to set these for SSR\n localShow: parseShow(this.show)\n };\n },\n watch: {\n show: function show(newVal) {\n this.countDown = parseCountDown(newVal);\n this.localShow = parseShow(newVal);\n },\n countDown: function countDown(newVal) {\n var _this = this;\n\n this.clearCountDownInterval();\n\n if (isNumericLike(this.show)) {\n // Ignore if this.show transitions to a boolean value.\n this.$emit('dismiss-count-down', newVal);\n\n if (this.show !== newVal) {\n // Update the v-model if needed\n this.$emit('input', newVal);\n }\n\n if (newVal > 0) {\n this.localShow = true;\n this.countDownTimeout = setTimeout(function () {\n _this.countDown--;\n }, 1000);\n } else {\n // Slightly delay the hide to allow any UI updates\n this.$nextTick(function () {\n requestAF(function () {\n _this.localShow = false;\n });\n });\n }\n }\n },\n localShow: function localShow(newVal) {\n if (!newVal && (this.dismissible || isNumericLike(this.show))) {\n // Only emit dismissed events for dismissible or auto dismissing alerts\n this.$emit('dismissed');\n }\n\n if (!isNumericLike(this.show) && this.show !== newVal) {\n // Only emit booleans if we weren't passed a number via `this.show`\n this.$emit('input', newVal);\n }\n }\n },\n created: function created() {\n this.countDown = parseCountDown(this.show);\n this.localShow = parseShow(this.show);\n },\n mounted: function mounted() {\n this.countDown = parseCountDown(this.show);\n this.localShow = parseShow(this.show);\n },\n beforeDestroy: function beforeDestroy() {\n this.clearCountDownInterval();\n },\n methods: {\n dismiss: function dismiss() {\n this.clearCountDownInterval();\n this.countDown = 0;\n this.localShow = false;\n },\n clearCountDownInterval: function clearCountDownInterval() {\n if (this.countDownTimeout) {\n clearTimeout(this.countDownTimeout);\n this.countDownTimeout = null;\n }\n }\n },\n render: function render(h) {\n var $alert; // undefined\n\n if (this.localShow) {\n var $dismissBtn = h();\n\n if (this.dismissible) {\n // Add dismiss button\n $dismissBtn = h(BButtonClose, {\n attrs: {\n 'aria-label': this.dismissLabel\n },\n on: {\n click: this.dismiss\n }\n }, [this.normalizeSlot('dismiss')]);\n }\n\n $alert = h('div', {\n key: this._uid,\n staticClass: 'alert',\n class: _defineProperty({\n 'alert-dismissible': this.dismissible\n }, \"alert-\".concat(this.variant), this.variant),\n attrs: {\n role: 'alert',\n 'aria-live': 'polite',\n 'aria-atomic': true\n }\n }, [$dismissBtn, this.normalizeSlot('default')]);\n $alert = [$alert];\n }\n\n return h(BVTransition, {\n props: {\n noFade: !this.fade\n }\n }, $alert);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/alert/alert.js\n// module id = 121\n// module chunks = 0","import { BAspect } from './aspect';\nimport { pluginFactory } from '../../utils/plugins';\nvar AspectPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BAspect: BAspect\n }\n});\nexport { AspectPlugin, BAspect };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/aspect/index.js\n// module id = 122\n// module chunks = 0","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; 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\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport Vue from '../../utils/vue';\nimport { mathAbs } from '../../utils/math';\nimport { toFloat } from '../../utils/number';\nimport normalizeSlotMixin from '../../mixins/normalize-slot'; // --- Constants ---\n\nvar NAME = 'BAspect';\nvar CLASS_NAME = 'b-aspect';\nvar RX_ASPECT = /^\\d+(\\.\\d*)?[/:]\\d+(\\.\\d*)?$/;\nvar RX_SEPARATOR = /[/:]/; // --- Main Component ---\n\nexport var BAspect = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [normalizeSlotMixin],\n props: {\n aspect: {\n // Accepts a number (i.e. `16 / 9`, `1`, `4 / 3`)\n // Or a string (i.e. '16/9', '16:9', '4:3' '1:1')\n type: [Number, String],\n default: '1:1'\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n computed: {\n padding: function padding() {\n var aspect = this.aspect;\n var ratio = 1;\n\n if (RX_ASPECT.test(aspect)) {\n // Width and/or Height can be a decimal value below `1`, so\n // we only fallback to `1` if the value is `0` or `NaN`\n var _aspect$split$map = aspect.split(RX_SEPARATOR).map(function (v) {\n return toFloat(v) || 1;\n }),\n _aspect$split$map2 = _slicedToArray(_aspect$split$map, 2),\n width = _aspect$split$map2[0],\n height = _aspect$split$map2[1];\n\n ratio = width / height;\n } else {\n ratio = toFloat(aspect) || 1;\n }\n\n return \"\".concat(100 / mathAbs(ratio), \"%\");\n }\n },\n render: function render(h) {\n var $sizer = h('div', {\n staticClass: \"\".concat(CLASS_NAME, \"-sizer flex-grow-1\"),\n style: {\n paddingBottom: this.padding,\n height: 0\n }\n });\n var $content = h('div', {\n staticClass: \"\".concat(CLASS_NAME, \"-content flex-grow-1 w-100 mw-100\"),\n style: {\n marginLeft: '-100%'\n }\n }, [this.normalizeSlot('default')]);\n return h(this.tag, {\n staticClass: \"\".concat(CLASS_NAME, \" d-flex\")\n }, [$sizer, $content]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/aspect/aspect.js\n// module id = 123\n// module chunks = 0","import { BAvatar } from './avatar';\nimport { BAvatarGroup } from './avatar-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar AvatarPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BAvatar: BAvatar,\n BAvatarGroup: BAvatarGroup\n }\n});\nexport { AvatarPlugin, BAvatar, BAvatarGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/avatar/index.js\n// module id = 124\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { hasOwnProperty } from './object';\nexport var makePropWatcher = function makePropWatcher(propName) {\n return {\n handler: function handler(newVal, oldVal) {\n for (var key in oldVal) {\n if (!hasOwnProperty(newVal, key)) {\n this.$delete(this.$data[propName], key);\n }\n }\n\n for (var _key in newVal) {\n this.$set(this.$data[propName], _key, newVal[_key]);\n }\n }\n };\n};\nexport var makePropCacheMixin = function makePropCacheMixin(propName, proxyPropName) {\n return {\n data: function data() {\n return _defineProperty({}, proxyPropName, {});\n },\n watch: _defineProperty({}, propName, makePropWatcher(proxyPropName)),\n created: function created() {\n this[proxyPropName] = _objectSpread({}, this[propName]);\n }\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/utils/cache.js\n// module id = 125\n// module chunks = 0","import Vue from '../../utils/vue';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { mathMax, mathMin } from '../../utils/math';\nimport { toFloat } from '../../utils/number';\nimport { computeSize } from './avatar'; // --- Constants ---\n\nvar NAME = 'BAvatarGroup'; // --- Main component ---\n// @vue/component\n\nexport var BAvatarGroup = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [normalizeSlotMixin],\n provide: function provide() {\n return {\n bvAvatarGroup: this\n };\n },\n props: {\n variant: {\n // Child avatars will prefer this variant over their own\n type: String,\n default: null\n },\n size: {\n // Child avatars will always use this over their own size\n type: String,\n default: null\n },\n overlap: {\n type: [Number, String],\n default: 0.3\n },\n square: {\n // Child avatars will prefer this prop (if set) over their own\n type: Boolean,\n default: false\n },\n rounded: {\n // Child avatars will prefer this prop (if set) over their own\n type: [Boolean, String],\n default: false\n },\n tag: {\n type: String,\n default: 'div'\n }\n },\n computed: {\n computedSize: function computedSize() {\n return computeSize(this.size);\n },\n overlapScale: function overlapScale() {\n return mathMin(mathMax(toFloat(this.overlap, 0), 0), 1) / 2;\n },\n paddingStyle: function paddingStyle() {\n var value = this.computedSize;\n value = value ? \"calc(\".concat(value, \" * \").concat(this.overlapScale, \")\") : null;\n return value ? {\n paddingLeft: value,\n paddingRight: value\n } : {};\n }\n },\n render: function render(h) {\n var $inner = h('div', {\n staticClass: 'b-avatar-group-inner',\n style: this.paddingStyle\n }, [this.normalizeSlot('default')]);\n return h(this.tag, {\n staticClass: 'b-avatar-group',\n attrs: {\n role: 'group'\n }\n }, [$inner]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/avatar/avatar-group.js\n// module id = 126\n// module chunks = 0","import { BBadge } from './badge';\nimport { pluginFactory } from '../../utils/plugins';\nvar BadgePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BBadge: BBadge\n }\n});\nexport { BadgePlugin, BBadge };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/badge/index.js\n// module id = 127\n// module chunks = 0","import { BBreadcrumb } from './breadcrumb';\nimport { BBreadcrumbItem } from './breadcrumb-item';\nimport { BBreadcrumbLink } from './breadcrumb-link';\nimport { pluginFactory } from '../../utils/plugins';\nvar BreadcrumbPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BBreadcrumb: BBreadcrumb,\n BBreadcrumbItem: BBreadcrumbItem,\n BBreadcrumbLink: BBreadcrumbLink\n }\n});\nexport { BreadcrumbPlugin, BBreadcrumb, BBreadcrumbItem, BBreadcrumbLink };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/breadcrumb/index.js\n// module id = 128\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { isArray, isObject } from '../../utils/inspect';\nimport { toString } from '../../utils/string';\nimport { BBreadcrumbItem } from './breadcrumb-item';\nexport var props = {\n items: {\n type: Array,\n default: null\n }\n}; // @vue/component\n\nexport var BBreadcrumb = /*#__PURE__*/Vue.extend({\n name: 'BBreadcrumb',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var childNodes = children; // Build child nodes from items if given.\n\n if (isArray(props.items)) {\n var activeDefined = false;\n childNodes = props.items.map(function (item, idx) {\n if (!isObject(item)) {\n item = {\n text: toString(item)\n };\n } // Copy the value here so we can normalize it.\n\n\n var active = item.active;\n\n if (active) {\n activeDefined = true;\n }\n\n if (!active && !activeDefined) {\n // Auto-detect active by position in list.\n active = idx + 1 === props.items.length;\n }\n\n return h(BBreadcrumbItem, {\n props: _objectSpread(_objectSpread({}, item), {}, {\n active: active\n })\n });\n });\n }\n\n return h('ol', mergeData(data, {\n staticClass: 'breadcrumb'\n }), childNodes);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/breadcrumb/breadcrumb.js\n// module id = 129\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { htmlOrText } from '../../utils/html';\nimport { omit } from '../../utils/object';\nimport { pluckProps } from '../../utils/props';\nimport { BLink, props as BLinkProps } from '../link/link'; // --- Props ---\n\nexport var props = _objectSpread({\n text: {\n type: String,\n default: null\n },\n html: {\n type: String,\n default: null\n },\n ariaCurrent: {\n type: String,\n default: 'location'\n }\n}, omit(BLinkProps, ['event', 'routerTag'])); // --- Main component ---\n// @vue/component\n\nexport var BBreadcrumbLink = /*#__PURE__*/Vue.extend({\n name: 'BBreadcrumbLink',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var suppliedProps = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var active = suppliedProps.active;\n var tag = active ? 'span' : BLink;\n var componentData = {\n attrs: {\n 'aria-current': active ? suppliedProps.ariaCurrent : null\n },\n props: pluckProps(props, suppliedProps)\n };\n\n if (!children) {\n componentData.domProps = htmlOrText(suppliedProps.html, suppliedProps.text);\n }\n\n return h(tag, mergeData(data, componentData), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/breadcrumb/breadcrumb-link.js\n// module id = 130\n// module chunks = 0","import { BButton } from './button';\nimport { BButtonClose } from './button-close';\nimport { pluginFactory } from '../../utils/plugins';\nvar ButtonPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BButton: BButton,\n BBtn: BButton,\n BButtonClose: BButtonClose,\n BBtnClose: BButtonClose\n }\n});\nexport { ButtonPlugin, BButton, BButtonClose };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/button/index.js\n// module id = 131\n// module chunks = 0","import { BButtonGroup } from './button-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar ButtonGroupPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BButtonGroup: BButtonGroup,\n BBtnGroup: BButtonGroup\n }\n});\nexport { ButtonGroupPlugin, BButtonGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/button-group/index.js\n// module id = 132\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { getComponentConfig } from '../../utils/config';\nvar NAME = 'BButtonGroup';\nexport var props = {\n vertical: {\n type: Boolean,\n default: false\n },\n size: {\n type: String,\n default: function _default() {\n return getComponentConfig('BButton', 'size');\n }\n },\n tag: {\n type: String,\n default: 'div'\n },\n ariaRole: {\n type: String,\n default: 'group'\n }\n}; // @vue/component\n\nexport var BButtonGroup = /*#__PURE__*/Vue.extend({\n name: NAME,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n return h(props.tag, mergeData(data, {\n class: _defineProperty({\n 'btn-group': !props.vertical,\n 'btn-group-vertical': props.vertical\n }, \"btn-group-\".concat(props.size), props.size),\n attrs: {\n role: props.ariaRole\n }\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/button-group/button-group.js\n// module id = 133\n// module chunks = 0","import { BButtonToolbar } from './button-toolbar';\nimport { pluginFactory } from '../../utils/plugins';\nvar ButtonToolbarPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BButtonToolbar: BButtonToolbar,\n BBtnToolbar: BButtonToolbar\n }\n});\nexport { ButtonToolbarPlugin, BButtonToolbar };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/button-toolbar/index.js\n// module id = 134\n// module chunks = 0","import Vue from '../../utils/vue';\nimport KeyCodes from '../../utils/key-codes';\nimport { attemptFocus, isVisible, selectAll } from '../../utils/dom';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nvar ITEM_SELECTOR = ['.btn:not(.disabled):not([disabled]):not(.dropdown-item)', '.form-control:not(.disabled):not([disabled])', 'select:not(.disabled):not([disabled])', 'input[type=\"checkbox\"]:not(.disabled)', 'input[type=\"radio\"]:not(.disabled)'].join(','); // @vue/component\n\nexport var BButtonToolbar = /*#__PURE__*/Vue.extend({\n name: 'BButtonToolbar',\n mixins: [normalizeSlotMixin],\n props: {\n justify: {\n type: Boolean,\n default: false\n },\n keyNav: {\n type: Boolean,\n default: false\n }\n },\n mounted: function mounted() {\n if (this.keyNav) {\n // Pre-set the tabindexes if the markup does not include tabindex=\"-1\" on the toolbar items\n this.getItems();\n }\n },\n methods: {\n onFocusin: function onFocusin(evt) {\n if (evt.target === this.$el) {\n evt.preventDefault();\n evt.stopPropagation();\n this.focusFirst(evt);\n }\n },\n stop: function stop(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n },\n onKeydown: function onKeydown(evt) {\n if (!this.keyNav) {\n /* istanbul ignore next: should never happen */\n return;\n }\n\n var key = evt.keyCode;\n var shift = evt.shiftKey;\n\n if (key === KeyCodes.UP || key === KeyCodes.LEFT) {\n this.stop(evt);\n shift ? this.focusFirst(evt) : this.focusPrev(evt);\n } else if (key === KeyCodes.DOWN || key === KeyCodes.RIGHT) {\n this.stop(evt);\n shift ? this.focusLast(evt) : this.focusNext(evt);\n }\n },\n focusFirst: function focusFirst() {\n var items = this.getItems();\n attemptFocus(items[0]);\n },\n focusPrev: function focusPrev(evt) {\n var items = this.getItems();\n var index = items.indexOf(evt.target);\n\n if (index > -1) {\n items = items.slice(0, index).reverse();\n attemptFocus(items[0]);\n }\n },\n focusNext: function focusNext(evt) {\n var items = this.getItems();\n var index = items.indexOf(evt.target);\n\n if (index > -1) {\n items = items.slice(index + 1);\n attemptFocus(items[0]);\n }\n },\n focusLast: function focusLast() {\n var items = this.getItems().reverse();\n attemptFocus(items[0]);\n },\n getItems: function getItems() {\n var items = selectAll(ITEM_SELECTOR, this.$el);\n items.forEach(function (item) {\n // Ensure tabfocus is -1 on any new elements\n item.tabIndex = -1;\n });\n return items.filter(function (el) {\n return isVisible(el);\n });\n }\n },\n render: function render(h) {\n return h('div', {\n staticClass: 'btn-toolbar',\n class: {\n 'justify-content-between': this.justify\n },\n attrs: {\n role: 'toolbar',\n tabindex: this.keyNav ? '0' : null\n },\n on: this.keyNav ? {\n focusin: this.onFocusin,\n keydown: this.onKeydown\n } : {}\n }, [this.normalizeSlot('default')]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/button-toolbar/button-toolbar.js\n// module id = 135\n// module chunks = 0","import { BCalendar } from './calendar';\nimport { pluginFactory } from '../../utils/plugins';\nvar CalendarPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BCalendar: BCalendar\n }\n});\nexport { CalendarPlugin, BCalendar };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/calendar/index.js\n// module id = 136\n// module chunks = 0","import { BCard } from './card';\nimport { BCardHeader } from './card-header';\nimport { BCardBody } from './card-body';\nimport { BCardTitle } from './card-title';\nimport { BCardSubTitle } from './card-sub-title';\nimport { BCardFooter } from './card-footer';\nimport { BCardImg } from './card-img';\nimport { BCardImgLazy } from './card-img-lazy';\nimport { BCardText } from './card-text';\nimport { BCardGroup } from './card-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar CardPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BCard: BCard,\n BCardHeader: BCardHeader,\n BCardBody: BCardBody,\n BCardTitle: BCardTitle,\n BCardSubTitle: BCardSubTitle,\n BCardFooter: BCardFooter,\n BCardImg: BCardImg,\n BCardImgLazy: BCardImgLazy,\n BCardText: BCardText,\n BCardGroup: BCardGroup\n }\n});\nexport { CardPlugin, BCard, BCardHeader, BCardBody, BCardTitle, BCardSubTitle, BCardFooter, BCardImg, BCardImgLazy, BCardText, BCardGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/card/index.js\n// module id = 137\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { htmlOrText } from '../../utils/html';\nimport { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot';\nimport { copyProps, pluckProps, prefixPropName, unprefixPropName } from '../../utils/props';\nimport cardMixin from '../../mixins/card';\nimport { BCardBody, props as bodyProps } from './card-body';\nimport { BCardHeader, props as headerProps } from './card-header';\nimport { BCardFooter, props as footerProps } from './card-footer';\nimport { BCardImg, props as imgProps } from './card-img';\nvar cardImgProps = copyProps(imgProps, prefixPropName.bind(null, 'img'));\ncardImgProps.imgSrc.required = false;\nexport var props = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bodyProps), headerProps), footerProps), cardImgProps), copyProps(cardMixin.props)), {}, {\n align: {\n type: String // default: null\n\n },\n noBody: {\n type: Boolean,\n default: false\n }\n}); // @vue/component\n\nexport var BCard = /*#__PURE__*/Vue.extend({\n name: 'BCard',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var imgLeft = props.imgLeft,\n imgRight = props.imgRight,\n imgStart = props.imgStart,\n imgEnd = props.imgEnd,\n header = props.header,\n headerHtml = props.headerHtml,\n footer = props.footer,\n footerHtml = props.footerHtml,\n align = props.align,\n textVariant = props.textVariant,\n bgVariant = props.bgVariant,\n borderVariant = props.borderVariant;\n var $scopedSlots = scopedSlots || {};\n var $slots = slots();\n var slotScope = {};\n var $imgFirst = h();\n var $imgLast = h();\n\n if (props.imgSrc) {\n var $img = h(BCardImg, {\n props: pluckProps(cardImgProps, props, unprefixPropName.bind(null, 'img'))\n });\n\n if (props.imgBottom) {\n $imgLast = $img;\n } else {\n $imgFirst = $img;\n }\n }\n\n var $header = h();\n var hasHeaderSlot = hasNormalizedSlot('header', $scopedSlots, $slots);\n\n if (hasHeaderSlot || header || headerHtml) {\n $header = h(BCardHeader, {\n props: pluckProps(headerProps, props),\n domProps: hasHeaderSlot ? {} : htmlOrText(headerHtml, header)\n }, normalizeSlot('header', slotScope, $scopedSlots, $slots));\n }\n\n var $content = normalizeSlot('default', slotScope, $scopedSlots, $slots); // Wrap content in when `noBody` prop set\n\n if (!props.noBody) {\n $content = h(BCardBody, {\n props: pluckProps(bodyProps, props)\n }, $content);\n }\n\n var $footer = h();\n var hasFooterSlot = hasNormalizedSlot('footer', $scopedSlots, $slots);\n\n if (hasFooterSlot || footer || footerHtml) {\n $footer = h(BCardFooter, {\n props: pluckProps(footerProps, props),\n domProps: hasHeaderSlot ? {} : htmlOrText(footerHtml, footer)\n }, normalizeSlot('footer', slotScope, $scopedSlots, $slots));\n }\n\n return h(props.tag, mergeData(data, {\n staticClass: 'card',\n class: (_class = {\n 'flex-row': imgLeft || imgStart,\n 'flex-row-reverse': (imgRight || imgEnd) && !(imgLeft || imgStart)\n }, _defineProperty(_class, \"text-\".concat(align), align), _defineProperty(_class, \"bg-\".concat(bgVariant), bgVariant), _defineProperty(_class, \"border-\".concat(borderVariant), borderVariant), _defineProperty(_class, \"text-\".concat(textVariant), textVariant), _class)\n }), [$imgFirst, $header, $content, $footer, $imgLast]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/card/card.js\n// module id = 138\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { omit } from '../../utils/object';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { BImgLazy, props as imgLazyProps } from '../image/img-lazy'; // Copy of `` props, and remove conflicting/non-applicable props\n// The `omit()` util creates a new object, so we can just pass the original props\n\nvar lazyProps = omit(imgLazyProps, ['left', 'right', 'center', 'block', 'rounded', 'thumbnail', 'fluid', 'fluidGrow']);\nexport var props = _objectSpread(_objectSpread({}, lazyProps), {}, {\n top: {\n type: Boolean,\n default: false\n },\n bottom: {\n type: Boolean,\n default: false\n },\n start: {\n type: Boolean,\n default: false\n },\n left: {\n // alias of 'start'\n type: Boolean,\n default: false\n },\n end: {\n type: Boolean,\n default: false\n },\n right: {\n // alias of 'end'\n type: Boolean,\n default: false\n }\n}); // @vue/component\n\nexport var BCardImgLazy = /*#__PURE__*/Vue.extend({\n name: 'BCardImgLazy',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data;\n var baseClass = 'card-img';\n\n if (props.top) {\n baseClass += '-top';\n } else if (props.right || props.end) {\n baseClass += '-right';\n } else if (props.bottom) {\n baseClass += '-bottom';\n } else if (props.left || props.start) {\n baseClass += '-left';\n } // False out the left/center/right props before passing to b-img-lazy\n\n\n var lazyProps = _objectSpread(_objectSpread({}, props), {}, {\n left: false,\n right: false,\n center: false\n });\n\n return h(BImgLazy, mergeData(data, {\n class: [baseClass],\n props: lazyProps\n }));\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/card/card-img-lazy.js\n// module id = 139\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nexport var props = {\n textTag: {\n type: String,\n default: 'p'\n }\n}; // @vue/component\n\nexport var BCardText = /*#__PURE__*/Vue.extend({\n name: 'BCardText',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n return h(props.textTag, mergeData(data, {\n staticClass: 'card-text'\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/card/card-text.js\n// module id = 140\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nexport var props = {\n tag: {\n type: String,\n default: 'div'\n },\n deck: {\n type: Boolean,\n default: false\n },\n columns: {\n type: Boolean,\n default: false\n }\n}; // @vue/component\n\nexport var BCardGroup = /*#__PURE__*/Vue.extend({\n name: 'BCardGroup',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n return h(props.tag, mergeData(data, {\n class: props.deck ? 'card-deck' : props.columns ? 'card-columns' : 'card-group'\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/card/card-group.js\n// module id = 141\n// module chunks = 0","import { BCarousel } from './carousel';\nimport { BCarouselSlide } from './carousel-slide';\nimport { pluginFactory } from '../../utils/plugins';\nvar CarouselPlugin =\n/*#__PURE*/\npluginFactory({\n components: {\n BCarousel: BCarousel,\n BCarouselSlide: BCarouselSlide\n }\n});\nexport { CarouselPlugin, BCarousel, BCarouselSlide };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/carousel/index.js\n// module id = 142\n// module chunks = 0","import Vue from '../../utils/vue';\nimport KeyCodes from '../../utils/key-codes';\nimport noop from '../../utils/noop';\nimport observeDom from '../../utils/observe-dom';\nimport { getComponentConfig } from '../../utils/config';\nimport { addClass, getActiveElement, reflow, removeClass, selectAll, setAttr } from '../../utils/dom';\nimport { isBrowser, hasTouchSupport, hasPointerEventSupport } from '../../utils/env';\nimport { EVENT_OPTIONS_NO_CAPTURE, eventOn, eventOff } from '../../utils/events';\nimport { isUndefined } from '../../utils/inspect';\nimport { mathAbs, mathFloor, mathMax, mathMin } from '../../utils/math';\nimport { toInteger } from '../../utils/number';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nvar NAME = 'BCarousel'; // Slide directional classes\n\nvar DIRECTION = {\n next: {\n dirClass: 'carousel-item-left',\n overlayClass: 'carousel-item-next'\n },\n prev: {\n dirClass: 'carousel-item-right',\n overlayClass: 'carousel-item-prev'\n }\n}; // Fallback Transition duration (with a little buffer) in ms\n\nvar TRANS_DURATION = 600 + 50; // Time for mouse compat events to fire after touch\n\nvar TOUCH_EVENT_COMPAT_WAIT = 500; // Number of pixels to consider touch move a swipe\n\nvar SWIPE_THRESHOLD = 40; // PointerEvent pointer types\n\nvar PointerType = {\n TOUCH: 'touch',\n PEN: 'pen'\n}; // Transition Event names\n\nvar TransitionEndEvents = {\n WebkitTransition: 'webkitTransitionEnd',\n MozTransition: 'transitionend',\n OTransition: 'otransitionend oTransitionEnd',\n transition: 'transitionend'\n}; // Return the browser specific transitionEnd event name\n\nvar getTransitionEndEvent = function getTransitionEndEvent(el) {\n for (var name in TransitionEndEvents) {\n if (!isUndefined(el.style[name])) {\n return TransitionEndEvents[name];\n }\n } // Fallback\n\n /* istanbul ignore next */\n\n\n return null;\n}; // @vue/component\n\n\nexport var BCarousel = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [idMixin, normalizeSlotMixin],\n provide: function provide() {\n return {\n bvCarousel: this\n };\n },\n model: {\n prop: 'value',\n event: 'input'\n },\n props: {\n labelPrev: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelPrev');\n }\n },\n labelNext: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelNext');\n }\n },\n labelGotoSlide: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelGotoSlide');\n }\n },\n labelIndicators: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelIndicators');\n }\n },\n interval: {\n type: Number,\n default: 5000\n },\n indicators: {\n type: Boolean,\n default: false\n },\n controls: {\n type: Boolean,\n default: false\n },\n noAnimation: {\n // Disable slide/fade animation\n type: Boolean,\n default: false\n },\n fade: {\n // Enable cross-fade animation instead of slide animation\n type: Boolean,\n default: false\n },\n noWrap: {\n // Disable wrapping/looping when start/end is reached\n type: Boolean,\n default: false\n },\n noTouch: {\n // Sniffed by carousel-slide\n type: Boolean,\n default: false\n },\n noHoverPause: {\n // Disable pause on hover\n type: Boolean,\n default: false\n },\n imgWidth: {\n // Sniffed by carousel-slide\n type: [Number, String] // default: undefined\n\n },\n imgHeight: {\n // Sniffed by carousel-slide\n type: [Number, String] // default: undefined\n\n },\n background: {\n type: String // default: undefined\n\n },\n value: {\n type: Number,\n default: 0\n }\n },\n data: function data() {\n return {\n index: this.value || 0,\n isSliding: false,\n transitionEndEvent: null,\n slides: [],\n direction: null,\n isPaused: !(toInteger(this.interval, 0) > 0),\n // Touch event handling values\n touchStartX: 0,\n touchDeltaX: 0\n };\n },\n computed: {\n numSlides: function numSlides() {\n return this.slides.length;\n }\n },\n watch: {\n value: function value(newVal, oldVal) {\n if (newVal !== oldVal) {\n this.setSlide(toInteger(newVal, 0));\n }\n },\n interval: function interval(newVal, oldVal) {\n if (newVal === oldVal) {\n /* istanbul ignore next */\n return;\n }\n\n if (!newVal) {\n // Pausing slide show\n this.pause(false);\n } else {\n // Restarting or Changing interval\n this.pause(true);\n this.start(false);\n }\n },\n isPaused: function isPaused(newVal, oldVal) {\n if (newVal !== oldVal) {\n this.$emit(newVal ? 'paused' : 'unpaused');\n }\n },\n index: function index(to, from) {\n if (to === from || this.isSliding) {\n /* istanbul ignore next */\n return;\n }\n\n this.doSlide(to, from);\n }\n },\n created: function created() {\n // Create private non-reactive props\n this.$_interval = null;\n this.$_animationTimeout = null;\n this.$_touchTimeout = null;\n this.$_observer = null; // Set initial paused state\n\n this.isPaused = !(toInteger(this.interval, 0) > 0);\n },\n mounted: function mounted() {\n // Cache current browser transitionend event name\n this.transitionEndEvent = getTransitionEndEvent(this.$el) || null; // Get all slides\n\n this.updateSlides(); // Observe child changes so we can update slide list\n\n this.setObserver(true);\n },\n beforeDestroy: function beforeDestroy() {\n this.clearInterval();\n this.clearAnimationTimeout();\n this.clearTouchTimeout();\n this.setObserver(false);\n },\n methods: {\n clearInterval: function (_clearInterval) {\n function clearInterval() {\n return _clearInterval.apply(this, arguments);\n }\n\n clearInterval.toString = function () {\n return _clearInterval.toString();\n };\n\n return clearInterval;\n }(function () {\n clearInterval(this.$_interval);\n this.$_interval = null;\n }),\n clearAnimationTimeout: function clearAnimationTimeout() {\n clearTimeout(this.$_animationTimeout);\n this.$_animationTimeout = null;\n },\n clearTouchTimeout: function clearTouchTimeout() {\n clearTimeout(this.$_touchTimeout);\n this.$_touchTimeout = null;\n },\n setObserver: function setObserver() {\n var on = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.$_observer && this.$_observer.disconnect();\n this.$_observer = null;\n\n if (on) {\n this.$_observer = observeDom(this.$refs.inner, this.updateSlides.bind(this), {\n subtree: false,\n childList: true,\n attributes: true,\n attributeFilter: ['id']\n });\n }\n },\n // Set slide\n setSlide: function setSlide(slide) {\n var _this = this;\n\n var direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n // Don't animate when page is not visible\n\n /* istanbul ignore if: difficult to test */\n if (isBrowser && document.visibilityState && document.hidden) {\n return;\n }\n\n var noWrap = this.noWrap;\n var numSlides = this.numSlides; // Make sure we have an integer (you never know!)\n\n slide = mathFloor(slide); // Don't do anything if nothing to slide to\n\n if (numSlides === 0) {\n return;\n } // Don't change slide while transitioning, wait until transition is done\n\n\n if (this.isSliding) {\n // Schedule slide after sliding complete\n this.$once('sliding-end', function () {\n return _this.setSlide(slide, direction);\n });\n return;\n }\n\n this.direction = direction; // Set new slide index\n // Wrap around if necessary (if no-wrap not enabled)\n\n this.index = slide >= numSlides ? noWrap ? numSlides - 1 : 0 : slide < 0 ? noWrap ? 0 : numSlides - 1 : slide; // Ensure the v-model is synched up if no-wrap is enabled\n // and user tried to slide pass either ends\n\n if (noWrap && this.index !== slide && this.index !== this.value) {\n this.$emit('input', this.index);\n }\n },\n // Previous slide\n prev: function prev() {\n this.setSlide(this.index - 1, 'prev');\n },\n // Next slide\n next: function next() {\n this.setSlide(this.index + 1, 'next');\n },\n // Pause auto rotation\n pause: function pause(evt) {\n if (!evt) {\n this.isPaused = true;\n }\n\n this.clearInterval();\n },\n // Start auto rotate slides\n start: function start(evt) {\n if (!evt) {\n this.isPaused = false;\n }\n /* istanbul ignore next: most likely will never happen, but just in case */\n\n\n this.clearInterval(); // Don't start if no interval, or less than 2 slides\n\n if (this.interval && this.numSlides > 1) {\n this.$_interval = setInterval(this.next, mathMax(1000, this.interval));\n }\n },\n // Restart auto rotate slides when focus/hover leaves the carousel\n\n /* istanbul ignore next */\n restart: function restart()\n /* istanbul ignore next: difficult to test */\n {\n if (!this.$el.contains(getActiveElement())) {\n this.start();\n }\n },\n doSlide: function doSlide(to, from) {\n var _this2 = this;\n\n var isCycling = Boolean(this.interval); // Determine sliding direction\n\n var direction = this.calcDirection(this.direction, from, to);\n var overlayClass = direction.overlayClass;\n var dirClass = direction.dirClass; // Determine current and next slides\n\n var currentSlide = this.slides[from];\n var nextSlide = this.slides[to]; // Don't do anything if there aren't any slides to slide to\n\n if (!currentSlide || !nextSlide) {\n /* istanbul ignore next */\n return;\n } // Start animating\n\n\n this.isSliding = true;\n\n if (isCycling) {\n this.pause(false);\n }\n\n this.$emit('sliding-start', to); // Update v-model\n\n this.$emit('input', this.index);\n\n if (this.noAnimation) {\n addClass(nextSlide, 'active');\n removeClass(currentSlide, 'active');\n this.isSliding = false; // Notify ourselves that we're done sliding (slid)\n\n this.$nextTick(function () {\n return _this2.$emit('sliding-end', to);\n });\n } else {\n addClass(nextSlide, overlayClass); // Trigger a reflow of next slide\n\n reflow(nextSlide);\n addClass(currentSlide, dirClass);\n addClass(nextSlide, dirClass); // Transition End handler\n\n var called = false;\n /* istanbul ignore next: difficult to test */\n\n var onceTransEnd = function onceTransEnd() {\n if (called) {\n return;\n }\n\n called = true;\n /* istanbul ignore if: transition events cant be tested in JSDOM */\n\n if (_this2.transitionEndEvent) {\n var events = _this2.transitionEndEvent.split(/\\s+/);\n\n events.forEach(function (evt) {\n return eventOff(nextSlide, evt, onceTransEnd, EVENT_OPTIONS_NO_CAPTURE);\n });\n }\n\n _this2.clearAnimationTimeout();\n\n removeClass(nextSlide, dirClass);\n removeClass(nextSlide, overlayClass);\n addClass(nextSlide, 'active');\n removeClass(currentSlide, 'active');\n removeClass(currentSlide, dirClass);\n removeClass(currentSlide, overlayClass);\n setAttr(currentSlide, 'aria-current', 'false');\n setAttr(nextSlide, 'aria-current', 'true');\n setAttr(currentSlide, 'aria-hidden', 'true');\n setAttr(nextSlide, 'aria-hidden', 'false');\n _this2.isSliding = false;\n _this2.direction = null; // Notify ourselves that we're done sliding (slid)\n\n _this2.$nextTick(function () {\n return _this2.$emit('sliding-end', to);\n });\n }; // Set up transitionend handler\n\n /* istanbul ignore if: transition events cant be tested in JSDOM */\n\n\n if (this.transitionEndEvent) {\n var events = this.transitionEndEvent.split(/\\s+/);\n events.forEach(function (event) {\n return eventOn(nextSlide, event, onceTransEnd, EVENT_OPTIONS_NO_CAPTURE);\n });\n } // Fallback to setTimeout()\n\n\n this.$_animationTimeout = setTimeout(onceTransEnd, TRANS_DURATION);\n }\n\n if (isCycling) {\n this.start(false);\n }\n },\n // Update slide list\n updateSlides: function updateSlides() {\n this.pause(true); // Get all slides as DOM elements\n\n this.slides = selectAll('.carousel-item', this.$refs.inner);\n var numSlides = this.slides.length; // Keep slide number in range\n\n var index = mathMax(0, mathMin(mathFloor(this.index), numSlides - 1));\n this.slides.forEach(function (slide, idx) {\n var n = idx + 1;\n\n if (idx === index) {\n addClass(slide, 'active');\n setAttr(slide, 'aria-current', 'true');\n } else {\n removeClass(slide, 'active');\n setAttr(slide, 'aria-current', 'false');\n }\n\n setAttr(slide, 'aria-posinset', String(n));\n setAttr(slide, 'aria-setsize', String(numSlides));\n }); // Set slide as active\n\n this.setSlide(index);\n this.start(this.isPaused);\n },\n calcDirection: function calcDirection() {\n var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var curIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var nextIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n if (!direction) {\n return nextIndex > curIndex ? DIRECTION.next : DIRECTION.prev;\n }\n\n return DIRECTION[direction];\n },\n handleClick: function handleClick(evt, fn) {\n var keyCode = evt.keyCode;\n\n if (evt.type === 'click' || keyCode === KeyCodes.SPACE || keyCode === KeyCodes.ENTER) {\n evt.preventDefault();\n evt.stopPropagation();\n fn();\n }\n },\n\n /* istanbul ignore next */\n handleSwipe: function handleSwipe()\n /* istanbul ignore next: JSDOM doesn't support touch events */\n {\n var absDeltaX = mathAbs(this.touchDeltaX);\n\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return;\n }\n\n var direction = absDeltaX / this.touchDeltaX; // Reset touch delta X\n // https://github.com/twbs/bootstrap/pull/28558\n\n this.touchDeltaX = 0;\n\n if (direction > 0) {\n // Swipe left\n this.prev();\n } else if (direction < 0) {\n // Swipe right\n this.next();\n }\n },\n\n /* istanbul ignore next */\n touchStart: function touchStart(evt)\n /* istanbul ignore next: JSDOM doesn't support touch events */\n {\n if (hasPointerEventSupport && PointerType[evt.pointerType.toUpperCase()]) {\n this.touchStartX = evt.clientX;\n } else if (!hasPointerEventSupport) {\n this.touchStartX = evt.touches[0].clientX;\n }\n },\n\n /* istanbul ignore next */\n touchMove: function touchMove(evt)\n /* istanbul ignore next: JSDOM doesn't support touch events */\n {\n // Ensure swiping with one touch and not pinching\n if (evt.touches && evt.touches.length > 1) {\n this.touchDeltaX = 0;\n } else {\n this.touchDeltaX = evt.touches[0].clientX - this.touchStartX;\n }\n },\n\n /* istanbul ignore next */\n touchEnd: function touchEnd(evt)\n /* istanbul ignore next: JSDOM doesn't support touch events */\n {\n if (hasPointerEventSupport && PointerType[evt.pointerType.toUpperCase()]) {\n this.touchDeltaX = evt.clientX - this.touchStartX;\n }\n\n this.handleSwipe(); // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause(false);\n this.clearTouchTimeout();\n this.$_touchTimeout = setTimeout(this.start, TOUCH_EVENT_COMPAT_WAIT + mathMax(1000, this.interval));\n }\n },\n render: function render(h) {\n var _this3 = this;\n\n // Wrapper for slides\n var inner = h('div', {\n ref: 'inner',\n class: ['carousel-inner'],\n attrs: {\n id: this.safeId('__BV_inner_'),\n role: 'list'\n }\n }, [this.normalizeSlot('default')]); // Prev and next controls\n\n var controls = h();\n\n if (this.controls) {\n var prevHandler = function prevHandler(evt) {\n /* istanbul ignore next */\n if (!_this3.isSliding) {\n _this3.handleClick(evt, _this3.prev);\n } else {\n evt.preventDefault();\n }\n };\n\n var nextHandler = function nextHandler(evt) {\n /* istanbul ignore next */\n if (!_this3.isSliding) {\n _this3.handleClick(evt, _this3.next);\n } else {\n evt.preventDefault();\n }\n };\n\n controls = [h('a', {\n class: ['carousel-control-prev'],\n attrs: {\n href: '#',\n role: 'button',\n 'aria-controls': this.safeId('__BV_inner_'),\n 'aria-disabled': this.isSliding ? 'true' : null\n },\n on: {\n click: prevHandler,\n keydown: prevHandler\n }\n }, [h('span', {\n class: ['carousel-control-prev-icon'],\n attrs: {\n 'aria-hidden': 'true'\n }\n }), h('span', {\n class: ['sr-only']\n }, [this.labelPrev])]), h('a', {\n class: ['carousel-control-next'],\n attrs: {\n href: '#',\n role: 'button',\n 'aria-controls': this.safeId('__BV_inner_'),\n 'aria-disabled': this.isSliding ? 'true' : null\n },\n on: {\n click: nextHandler,\n keydown: nextHandler\n }\n }, [h('span', {\n class: ['carousel-control-next-icon'],\n attrs: {\n 'aria-hidden': 'true'\n }\n }), h('span', {\n class: ['sr-only']\n }, [this.labelNext])])];\n } // Indicators\n\n\n var indicators = h('ol', {\n class: ['carousel-indicators'],\n directives: [{\n name: 'show',\n rawName: 'v-show',\n value: this.indicators,\n expression: 'indicators'\n }],\n attrs: {\n id: this.safeId('__BV_indicators_'),\n 'aria-hidden': this.indicators ? 'false' : 'true',\n 'aria-label': this.labelIndicators,\n 'aria-owns': this.safeId('__BV_inner_')\n }\n }, this.slides.map(function (slide, n) {\n return h('li', {\n key: \"slide_\".concat(n),\n class: {\n active: n === _this3.index\n },\n attrs: {\n role: 'button',\n id: _this3.safeId(\"__BV_indicator_\".concat(n + 1, \"_\")),\n tabindex: _this3.indicators ? '0' : '-1',\n 'aria-current': n === _this3.index ? 'true' : 'false',\n 'aria-label': \"\".concat(_this3.labelGotoSlide, \" \").concat(n + 1),\n 'aria-describedby': _this3.slides[n].id || null,\n 'aria-controls': _this3.safeId('__BV_inner_')\n },\n on: {\n click: function click(evt) {\n _this3.handleClick(evt, function () {\n _this3.setSlide(n);\n });\n },\n keydown: function keydown(evt) {\n _this3.handleClick(evt, function () {\n _this3.setSlide(n);\n });\n }\n }\n });\n }));\n var on = {\n mouseenter: this.noHoverPause ? noop : this.pause,\n mouseleave: this.noHoverPause ? noop : this.restart,\n focusin: this.pause,\n focusout: this.restart,\n keydown: function keydown(evt) {\n if (/input|textarea/i.test(evt.target.tagName)) {\n /* istanbul ignore next */\n return;\n }\n\n var keyCode = evt.keyCode;\n\n if (keyCode === KeyCodes.LEFT || keyCode === KeyCodes.RIGHT) {\n evt.preventDefault();\n evt.stopPropagation();\n\n _this3[keyCode === KeyCodes.LEFT ? 'prev' : 'next']();\n }\n }\n }; // Touch support event handlers for environment\n\n if (!this.noTouch && hasTouchSupport) {\n // Attach appropriate listeners (prepend event name with '&' for passive mode)\n\n /* istanbul ignore next: JSDOM doesn't support touch events */\n if (hasPointerEventSupport) {\n on['&pointerdown'] = this.touchStart;\n on['&pointerup'] = this.touchEnd;\n } else {\n on['&touchstart'] = this.touchStart;\n on['&touchmove'] = this.touchMove;\n on['&touchend'] = this.touchEnd;\n }\n } // Return the carousel\n\n\n return h('div', {\n staticClass: 'carousel',\n class: {\n slide: !this.noAnimation,\n 'carousel-fade': !this.noAnimation && this.fade,\n 'pointer-event': !this.noTouch && hasTouchSupport && hasPointerEventSupport\n },\n style: {\n background: this.background\n },\n attrs: {\n role: 'region',\n id: this.safeId(),\n 'aria-busy': this.isSliding ? 'true' : 'false'\n },\n on: on\n }, [inner, controls, indicators]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/carousel/carousel.js\n// module id = 143\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { hasTouchSupport } from '../../utils/env';\nimport { htmlOrText } from '../../utils/html';\nimport { pluckProps, unprefixPropName } from '../../utils/props';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BImg } from '../image/img'; // --- Props ---\n\nvar imgProps = {\n imgSrc: {\n type: String // default: undefined\n\n },\n imgAlt: {\n type: String // default: undefined\n\n },\n imgWidth: {\n type: [Number, String] // default: undefined\n\n },\n imgHeight: {\n type: [Number, String] // default: undefined\n\n },\n imgBlank: {\n type: Boolean,\n default: false\n },\n imgBlankColor: {\n type: String,\n default: 'transparent'\n }\n};\nexport var props = _objectSpread(_objectSpread({}, imgProps), {}, {\n contentVisibleUp: {\n type: String\n },\n contentTag: {\n type: String,\n default: 'div'\n },\n caption: {\n type: String\n },\n captionHtml: {\n type: String\n },\n captionTag: {\n type: String,\n default: 'h3'\n },\n text: {\n type: String\n },\n textHtml: {\n type: String\n },\n textTag: {\n type: String,\n default: 'p'\n },\n background: {\n type: String\n }\n}); // --- Main component ---\n// @vue/component\n\nexport var BCarouselSlide = /*#__PURE__*/Vue.extend({\n name: 'BCarouselSlide',\n mixins: [idMixin, normalizeSlotMixin],\n inject: {\n bvCarousel: {\n default: function _default() {\n return {\n // Explicitly disable touch if not a child of carousel\n noTouch: true\n };\n }\n }\n },\n props: props,\n computed: {\n contentClasses: function contentClasses() {\n return [this.contentVisibleUp ? 'd-none' : '', this.contentVisibleUp ? \"d-\".concat(this.contentVisibleUp, \"-block\") : ''];\n },\n computedWidth: function computedWidth() {\n // Use local width, or try parent width\n return this.imgWidth || this.bvCarousel.imgWidth || null;\n },\n computedHeight: function computedHeight() {\n // Use local height, or try parent height\n return this.imgHeight || this.bvCarousel.imgHeight || null;\n }\n },\n render: function render(h) {\n var $img = this.normalizeSlot('img');\n\n if (!$img && (this.imgSrc || this.imgBlank)) {\n var on = {}; // Touch support event handler\n\n /* istanbul ignore if: difficult to test in JSDOM */\n\n if (!this.bvCarousel.noTouch && hasTouchSupport) {\n on.dragstart = function (evt) {\n evt.preventDefault();\n };\n }\n\n $img = h(BImg, {\n props: _objectSpread(_objectSpread({}, pluckProps(imgProps, this.$props, unprefixPropName.bind(null, 'img'))), {}, {\n width: this.computedWidth,\n height: this.computedHeight,\n fluidGrow: true,\n block: true\n }),\n on: on\n });\n }\n\n var $contentChildren = [// Caption\n this.caption || this.captionHtml ? h(this.captionTag, {\n domProps: htmlOrText(this.captionHtml, this.caption)\n }) : false, // Text\n this.text || this.textHtml ? h(this.textTag, {\n domProps: htmlOrText(this.textHtml, this.text)\n }) : false, // Children\n this.normalizeSlot('default') || false];\n var $content = h();\n\n if ($contentChildren.some(Boolean)) {\n $content = h(this.contentTag, {\n staticClass: 'carousel-caption',\n class: this.contentClasses\n }, $contentChildren.map(function ($child) {\n return $child || h();\n }));\n }\n\n return h('div', {\n staticClass: 'carousel-item',\n style: {\n background: this.background || this.bvCarousel.background || null\n },\n attrs: {\n id: this.safeId(),\n role: 'listitem'\n }\n }, [$img, $content]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/carousel/carousel-slide.js\n// module id = 144\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { BVCollapse } from '../../utils/bv-collapse';\nimport { addClass, hasClass, removeClass, closest, matches, getCS } from '../../utils/dom';\nimport { isBrowser } from '../../utils/env';\nimport { EVENT_OPTIONS_NO_CAPTURE, eventOnOff } from '../../utils/events';\nimport idMixin from '../../mixins/id';\nimport listenOnRootMixin from '../../mixins/listen-on-root';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { EVENT_TOGGLE, EVENT_STATE, EVENT_STATE_REQUEST, EVENT_STATE_SYNC } from '../../directives/toggle/toggle'; // --- Constants ---\n// Accordion event name we emit on `$root`\n\nvar EVENT_ACCORDION = 'bv::collapse::accordion'; // --- Main component ---\n// @vue/component\n\nexport var BCollapse = /*#__PURE__*/Vue.extend({\n name: 'BCollapse',\n mixins: [idMixin, listenOnRootMixin, normalizeSlotMixin],\n model: {\n prop: 'visible',\n event: 'input'\n },\n props: {\n isNav: {\n type: Boolean,\n default: false\n },\n accordion: {\n type: String // default: null\n\n },\n visible: {\n type: Boolean,\n default: false\n },\n tag: {\n type: String,\n default: 'div'\n },\n appear: {\n // If `true` (and `visible` is `true` on mount), animate initially visible\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n return {\n show: this.visible,\n transitioning: false\n };\n },\n computed: {\n classObject: function classObject() {\n return {\n 'navbar-collapse': this.isNav,\n collapse: !this.transitioning,\n show: this.show && !this.transitioning\n };\n }\n },\n watch: {\n visible: function visible(newVal) {\n if (newVal !== this.show) {\n this.show = newVal;\n }\n },\n show: function show(newVal, oldVal) {\n if (newVal !== oldVal) {\n this.emitState();\n }\n }\n },\n created: function created() {\n this.show = this.visible;\n },\n mounted: function mounted() {\n var _this = this;\n\n this.show = this.visible; // Listen for toggle events to open/close us\n\n this.listenOnRoot(EVENT_TOGGLE, this.handleToggleEvt); // Listen to other collapses for accordion events\n\n this.listenOnRoot(EVENT_ACCORDION, this.handleAccordionEvt);\n\n if (this.isNav) {\n // Set up handlers\n this.setWindowEvents(true);\n this.handleResize();\n }\n\n this.$nextTick(function () {\n _this.emitState();\n }); // Listen for \"Sync state\" requests from `v-b-toggle`\n\n this.listenOnRoot(EVENT_STATE_REQUEST, function (id) {\n if (id === _this.safeId()) {\n _this.$nextTick(_this.emitSync);\n }\n });\n },\n updated: function updated() {\n // Emit a private event every time this component updates to ensure\n // the toggle button is in sync with the collapse's state\n // It is emitted regardless if the visible state changes\n this.emitSync();\n },\n\n /* istanbul ignore next */\n deactivated: function deactivated()\n /* istanbul ignore next */\n {\n if (this.isNav) {\n this.setWindowEvents(false);\n }\n },\n\n /* istanbul ignore next */\n activated: function activated()\n /* istanbul ignore next */\n {\n if (this.isNav) {\n this.setWindowEvents(true);\n }\n\n this.emitSync();\n },\n beforeDestroy: function beforeDestroy() {\n // Trigger state emit if needed\n this.show = false;\n\n if (this.isNav && isBrowser) {\n this.setWindowEvents(false);\n }\n },\n methods: {\n setWindowEvents: function setWindowEvents(on) {\n eventOnOff(on, window, 'resize', this.handleResize, EVENT_OPTIONS_NO_CAPTURE);\n eventOnOff(on, window, 'orientationchange', this.handleResize, EVENT_OPTIONS_NO_CAPTURE);\n },\n toggle: function toggle() {\n this.show = !this.show;\n },\n onEnter: function onEnter() {\n this.transitioning = true; // This should be moved out so we can add cancellable events\n\n this.$emit('show');\n },\n onAfterEnter: function onAfterEnter() {\n this.transitioning = false;\n this.$emit('shown');\n },\n onLeave: function onLeave() {\n this.transitioning = true; // This should be moved out so we can add cancellable events\n\n this.$emit('hide');\n },\n onAfterLeave: function onAfterLeave() {\n this.transitioning = false;\n this.$emit('hidden');\n },\n emitState: function emitState() {\n this.$emit('input', this.show); // Let `v-b-toggle` know the state of this collapse\n\n this.emitOnRoot(EVENT_STATE, this.safeId(), this.show);\n\n if (this.accordion && this.show) {\n // Tell the other collapses in this accordion to close\n this.emitOnRoot(EVENT_ACCORDION, this.safeId(), this.accordion);\n }\n },\n emitSync: function emitSync() {\n // Emit a private event every time this component updates to ensure\n // the toggle button is in sync with the collapse's state\n // It is emitted regardless if the visible state changes\n this.emitOnRoot(EVENT_STATE_SYNC, this.safeId(), this.show);\n },\n checkDisplayBlock: function checkDisplayBlock() {\n // Check to see if the collapse has `display: block !important` set\n // We can't set `display: none` directly on `this.$el`, as it would\n // trigger a new transition to start (or cancel a current one)\n var restore = hasClass(this.$el, 'show');\n removeClass(this.$el, 'show');\n var isBlock = getCS(this.$el).display === 'block';\n\n if (restore) {\n addClass(this.$el, 'show');\n }\n\n return isBlock;\n },\n clickHandler: function clickHandler(evt) {\n // If we are in a nav/navbar, close the collapse when non-disabled link clicked\n var el = evt.target;\n\n if (!this.isNav || !el || getCS(this.$el).display !== 'block') {\n /* istanbul ignore next: can't test getComputedStyle in JSDOM */\n return;\n }\n\n if (matches(el, '.nav-link,.dropdown-item') || closest('.nav-link,.dropdown-item', el)) {\n if (!this.checkDisplayBlock()) {\n // Only close the collapse if it is not forced to be `display: block !important`\n this.show = false;\n }\n }\n },\n handleToggleEvt: function handleToggleEvt(target) {\n if (target !== this.safeId()) {\n return;\n }\n\n this.toggle();\n },\n handleAccordionEvt: function handleAccordionEvt(openedId, accordion) {\n if (!this.accordion || accordion !== this.accordion) {\n return;\n }\n\n if (openedId === this.safeId()) {\n // Open this collapse if not shown\n if (!this.show) {\n this.toggle();\n }\n } else {\n // Close this collapse if shown\n if (this.show) {\n this.toggle();\n }\n }\n },\n handleResize: function handleResize() {\n // Handler for orientation/resize to set collapsed state in nav/navbar\n this.show = getCS(this.$el).display === 'block';\n }\n },\n render: function render(h) {\n var _this2 = this;\n\n var scope = {\n visible: this.show,\n close: function close() {\n return _this2.show = false;\n }\n };\n var content = h(this.tag, {\n class: this.classObject,\n directives: [{\n name: 'show',\n value: this.show\n }],\n attrs: {\n id: this.safeId()\n },\n on: {\n click: this.clickHandler\n }\n }, [this.normalizeSlot('default', scope)]);\n return h(BVCollapse, {\n props: {\n appear: this.appear\n },\n on: {\n enter: this.onEnter,\n afterEnter: this.onAfterEnter,\n leave: this.onLeave,\n afterLeave: this.onAfterLeave\n }\n }, [content]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/collapse/collapse.js\n// module id = 145\n// module chunks = 0","/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.16.1\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n\nvar timeoutDuration = function () {\n var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}();\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var window = element.ownerDocument.defaultView;\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\n/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nfunction getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);\n}\n\nfunction getWindowSizes(document) {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n var width = sizes.width || element.clientWidth || result.width;\n var height = sizes.height || element.clientHeight || result.height;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop);\n var marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n var parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(popper.ownerDocument),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n var isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0;\n boundaries.top += isPaddingNumber ? padding : padding.top || 0;\n boundaries.right -= isPaddingNumber ? padding : padding.right || 0;\n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var window = element.ownerDocument.defaultView;\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nfunction getRoundedOffsets(data, shouldRound) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var round = Math.round,\n floor = Math.floor;\n\n var noRound = function noRound(v) {\n return v;\n };\n\n var referenceWidth = round(reference.width);\n var popperWidth = round(popper.width);\n\n var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n var isVariation = data.placement.indexOf('-') !== -1;\n var sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;\n var verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right)\n };\n}\n\nvar isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.
\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n // flips variation if popper content overflows boundaries\n var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);\n\n var flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.
\n * These can be overridden using the `options` argument of Popper.js.
\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\nexport default Popper;\n//# sourceMappingURL=popper.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/popper.js/dist/esm/popper.js\n// module id = 146\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { requestAF } from '../../utils/dom';\nimport { omit } from '../../utils/object';\nimport attrsMixin from '../../mixins/attrs';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BLink, props as BLinkProps } from '../link/link';\nexport var props = omit(BLinkProps, ['event', 'routerTag']); // @vue/component\n\nexport var BDropdownItem = /*#__PURE__*/Vue.extend({\n name: 'BDropdownItem',\n mixins: [attrsMixin, normalizeSlotMixin],\n inheritAttrs: false,\n inject: {\n bvDropdown: {\n default: null\n }\n },\n props: _objectSpread(_objectSpread({}, props), {}, {\n linkClass: {\n type: [String, Array, Object],\n default: null\n },\n variant: {\n type: String,\n default: null\n }\n }),\n computed: {\n computedAttrs: function computedAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n role: 'menuitem'\n });\n }\n },\n methods: {\n closeDropdown: function closeDropdown() {\n var _this = this;\n\n // Close on next animation frame to allow time to process\n requestAF(function () {\n if (_this.bvDropdown) {\n _this.bvDropdown.hide(true);\n }\n });\n },\n onClick: function onClick(evt) {\n this.$emit('click', evt);\n this.closeDropdown();\n }\n },\n render: function render(h) {\n return h('li', {\n attrs: {\n role: 'presentation'\n }\n }, [h(BLink, {\n props: this.$props,\n staticClass: 'dropdown-item',\n class: [this.linkClass, _defineProperty({}, \"text-\".concat(this.variant), this.variant && !(this.active || this.disabled))],\n attrs: this.computedAttrs,\n on: {\n click: this.onClick\n },\n ref: 'item'\n }, this.normalizeSlot('default'))]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-item.js\n// module id = 147\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport attrsMixin from '../../mixins/attrs';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nexport var props = {\n active: {\n type: Boolean,\n default: false\n },\n activeClass: {\n type: String,\n default: 'active'\n },\n buttonClass: {\n type: [String, Array, Object] // default: null\n\n },\n disabled: {\n type: Boolean,\n default: false\n },\n variant: {\n type: String // default: null\n\n }\n}; // @vue/component\n\nexport var BDropdownItemButton = /*#__PURE__*/Vue.extend({\n name: 'BDropdownItemButton',\n mixins: [attrsMixin, normalizeSlotMixin],\n inheritAttrs: false,\n inject: {\n bvDropdown: {\n default: null\n }\n },\n props: props,\n computed: {\n computedAttrs: function computedAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n role: 'menuitem',\n type: 'button',\n disabled: this.disabled\n });\n }\n },\n methods: {\n closeDropdown: function closeDropdown() {\n if (this.bvDropdown) {\n this.bvDropdown.hide(true);\n }\n },\n onClick: function onClick(evt) {\n this.$emit('click', evt);\n this.closeDropdown();\n }\n },\n render: function render(h) {\n var _ref;\n\n return h('li', {\n attrs: {\n role: 'presentation'\n }\n }, [h('button', {\n staticClass: 'dropdown-item',\n class: [this.buttonClass, (_ref = {}, _defineProperty(_ref, this.activeClass, this.active), _defineProperty(_ref, \"text-\".concat(this.variant), this.variant && !(this.active || this.disabled)), _ref)],\n attrs: this.computedAttrs,\n on: {\n click: this.onClick\n },\n ref: 'button'\n }, this.normalizeSlot('default'))]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-item-button.js\n// module id = 148\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nexport var props = {\n id: {\n type: String // default: null\n\n },\n tag: {\n type: String,\n default: 'header'\n },\n variant: {\n type: String // default: null\n\n }\n}; // @vue/component\n\nexport var BDropdownHeader = /*#__PURE__*/Vue.extend({\n name: 'BDropdownHeader',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var $attrs = data.attrs || {};\n data.attrs = {};\n return h('li', mergeData(data, {\n attrs: {\n role: 'presentation'\n }\n }), [h(props.tag, {\n staticClass: 'dropdown-header',\n class: _defineProperty({}, \"text-\".concat(props.variant), props.variant),\n attrs: _objectSpread(_objectSpread({}, $attrs), {}, {\n id: props.id || null,\n role: 'heading'\n }),\n ref: 'header'\n }, children)]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-header.js\n// module id = 149\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nexport var props = {\n tag: {\n type: String,\n default: 'hr'\n }\n}; // @vue/component\n\nexport var BDropdownDivider = /*#__PURE__*/Vue.extend({\n name: 'BDropdownDivider',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data;\n var $attrs = data.attrs || {};\n data.attrs = {};\n return h('li', mergeData(data, {\n attrs: {\n role: 'presentation'\n }\n }), [h(props.tag, {\n staticClass: 'dropdown-divider',\n attrs: _objectSpread(_objectSpread({}, $attrs), {}, {\n role: 'separator',\n 'aria-orientation': 'horizontal'\n }),\n ref: 'divider'\n })]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-divider.js\n// module id = 150\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { BForm, props as formProps } from '../form/form'; // @vue/component\n\nexport var BDropdownForm = /*#__PURE__*/Vue.extend({\n name: 'BDropdownForm',\n functional: true,\n props: _objectSpread(_objectSpread({}, formProps), {}, {\n disabled: {\n type: Boolean,\n default: false\n },\n formClass: {\n type: [String, Object, Array] // default: null\n\n }\n }),\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var $attrs = data.attrs || {};\n var $listeners = data.on || {};\n data.attrs = {};\n data.on = {};\n return h('li', mergeData(data, {\n attrs: {\n role: 'presentation'\n }\n }), [h(BForm, {\n ref: 'form',\n staticClass: 'b-dropdown-form',\n class: [props.formClass, {\n disabled: props.disabled\n }],\n props: props,\n attrs: _objectSpread(_objectSpread({}, $attrs), {}, {\n disabled: props.disabled,\n // Tab index of -1 for keyboard navigation\n tabindex: props.disabled ? null : '-1'\n }),\n on: $listeners\n }, children)]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-form.js\n// module id = 151\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge'; // @vue/component\n\nexport var BDropdownText = /*#__PURE__*/Vue.extend({\n name: 'BDropdownText',\n functional: true,\n props: {\n tag: {\n type: String,\n default: 'p'\n },\n variant: {\n type: String // default: null\n\n }\n },\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var $attrs = data.attrs || {};\n data.attrs = {};\n return h('li', mergeData(data, {\n attrs: {\n role: 'presentation'\n }\n }), [h(props.tag, {\n staticClass: 'b-dropdown-text',\n class: _defineProperty({}, \"text-\".concat(props.variant), props.variant),\n props: props,\n attrs: $attrs,\n ref: 'text'\n }, children)]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-text.js\n// module id = 152\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot';\nimport identity from '../../utils/identity';\nexport var props = {\n id: {\n type: String // default: null\n\n },\n header: {\n type: String // default: null\n\n },\n headerTag: {\n type: String,\n default: 'header'\n },\n headerVariant: {\n type: String // default: null\n\n },\n headerClasses: {\n type: [String, Array, Object] // default: null\n\n },\n ariaDescribedby: {\n type: String // default: null\n\n }\n}; // @vue/component\n\nexport var BDropdownGroup = /*#__PURE__*/Vue.extend({\n name: 'BDropdownGroup',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var $slots = slots();\n var $scopedSlots = scopedSlots || {};\n var $attrs = data.attrs || {};\n data.attrs = {};\n var header;\n var headerId = null;\n\n if (hasNormalizedSlot('header', $scopedSlots, $slots) || props.header) {\n headerId = props.id ? \"_bv_\".concat(props.id, \"_group_dd_header\") : null;\n header = h(props.headerTag, {\n staticClass: 'dropdown-header',\n class: [props.headerClasses, _defineProperty({}, \"text-\".concat(props.variant), props.variant)],\n attrs: {\n id: headerId,\n role: 'heading'\n }\n }, normalizeSlot('header', {}, $scopedSlots, $slots) || props.header);\n }\n\n var adb = [headerId, props.ariaDescribedBy].filter(identity).join(' ').trim();\n return h('li', mergeData(data, {\n attrs: {\n role: 'presentation'\n }\n }), [header || h(), h('ul', {\n staticClass: 'list-unstyled',\n attrs: _objectSpread(_objectSpread({}, $attrs), {}, {\n id: props.id || null,\n role: 'group',\n 'aria-describedby': adb || null\n })\n }, normalizeSlot('default', {}, $scopedSlots, $slots))]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/dropdown/dropdown-group.js\n// module id = 153\n// module chunks = 0","import { BEmbed } from './embed';\nimport { pluginFactory } from '../../utils/plugins';\nvar EmbedPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BEmbed: BEmbed\n }\n});\nexport { EmbedPlugin, BEmbed };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/embed/index.js\n// module id = 154\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { arrayIncludes } from '../../utils/array';\nexport var props = {\n type: {\n type: String,\n default: 'iframe',\n validator: function validator(str) {\n return arrayIncludes(['iframe', 'embed', 'video', 'object', 'img', 'b-img', 'b-img-lazy'], str);\n }\n },\n tag: {\n type: String,\n default: 'div'\n },\n aspect: {\n type: String,\n default: '16by9'\n }\n}; // @vue/component\n\nexport var BEmbed = /*#__PURE__*/Vue.extend({\n name: 'BEmbed',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n return h(props.tag, {\n ref: data.ref,\n staticClass: 'embed-responsive',\n class: _defineProperty({}, \"embed-responsive-\".concat(props.aspect), props.aspect)\n }, [h(props.type, mergeData(data, {\n ref: '',\n staticClass: 'embed-responsive-item'\n }), children)]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/embed/embed.js\n// module id = 155\n// module chunks = 0","import { BForm } from './form';\nimport { BFormDatalist } from './form-datalist';\nimport { BFormText } from './form-text';\nimport { BFormInvalidFeedback } from './form-invalid-feedback';\nimport { BFormValidFeedback } from './form-valid-feedback';\nimport { BFormRow } from '../layout/form-row';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BForm: BForm,\n BFormDatalist: BFormDatalist,\n BDatalist: BFormDatalist,\n BFormText: BFormText,\n BFormInvalidFeedback: BFormInvalidFeedback,\n BFormFeedback: BFormInvalidFeedback,\n BFormValidFeedback: BFormValidFeedback,\n // Added here for convenience\n BFormRow: BFormRow\n }\n}); // BFormRow is not exported here as a named export, as it is exported by Layout\n\nexport { FormPlugin, BForm, BFormDatalist, BFormText, BFormInvalidFeedback, BFormValidFeedback };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form/index.js\n// module id = 156\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { htmlOrText } from '../../utils/html';\nimport formOptionsMixin from '../../mixins/form-options';\nimport normalizeSlotMixin from '../../mixins/normalize-slot'; // @vue/component\n\nexport var BFormDatalist = /*#__PURE__*/Vue.extend({\n name: 'BFormDatalist',\n mixins: [formOptionsMixin, normalizeSlotMixin],\n props: {\n id: {\n type: String,\n required: true\n }\n },\n render: function render(h) {\n var $options = this.formOptions.map(function (option, index) {\n var value = option.value,\n text = option.text,\n html = option.html,\n disabled = option.disabled;\n return h('option', {\n attrs: {\n value: value,\n disabled: disabled\n },\n domProps: htmlOrText(html, text),\n key: \"option_\".concat(index)\n });\n });\n return h('datalist', {\n attrs: {\n id: this.id\n }\n }, [$options, this.normalizeSlot('default')]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form/form-datalist.js\n// module id = 157\n// module chunks = 0","import { BFormCheckbox } from './form-checkbox';\nimport { BFormCheckboxGroup } from './form-checkbox-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormCheckboxPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormCheckbox: BFormCheckbox,\n BCheckbox: BFormCheckbox,\n BCheck: BFormCheckbox,\n BFormCheckboxGroup: BFormCheckboxGroup,\n BCheckboxGroup: BFormCheckboxGroup,\n BCheckGroup: BFormCheckboxGroup\n }\n});\nexport { FormCheckboxPlugin, BFormCheckbox, BFormCheckboxGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-checkbox/index.js\n// module id = 158\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { attemptBlur, attemptFocus } from '../utils/dom';\nimport attrsMixin from './attrs';\nimport normalizeSlotMixin from './normalize-slot'; // @vue/component\n\nexport default {\n mixins: [attrsMixin, normalizeSlotMixin],\n inheritAttrs: false,\n model: {\n prop: 'checked',\n event: 'input'\n },\n props: {\n value: {// Value when checked\n // type: Object,\n // default: undefined\n },\n checked: {// This is the v-model\n // type: Object,\n // default: undefined\n },\n inline: {\n type: Boolean,\n default: false\n },\n plain: {\n type: Boolean,\n default: false\n },\n button: {\n // Only applicable in standalone mode (non group)\n type: Boolean,\n default: false\n },\n buttonVariant: {\n // Only applicable when rendered with button style\n type: String // default: null\n\n },\n ariaLabel: {\n // Placed on the input if present.\n type: String // default: null\n\n },\n ariaLabelledby: {\n // Placed on the input if present.\n type: String // default: null\n\n }\n },\n data: function data() {\n return {\n localChecked: this.isGroup ? this.bvGroup.checked : this.checked,\n hasFocus: false\n };\n },\n computed: {\n computedLocalChecked: {\n get: function get() {\n return this.isGroup ? this.bvGroup.localChecked : this.localChecked;\n },\n set: function set(val) {\n if (this.isGroup) {\n this.bvGroup.localChecked = val;\n } else {\n this.localChecked = val;\n }\n }\n },\n isGroup: function isGroup() {\n // Is this check/radio a child of check-group or radio-group?\n return Boolean(this.bvGroup);\n },\n isBtnMode: function isBtnMode() {\n // Support button style in single input mode\n return this.isGroup ? this.bvGroup.buttons : this.button;\n },\n isPlain: function isPlain() {\n return this.isBtnMode ? false : this.isGroup ? this.bvGroup.plain : this.plain;\n },\n isCustom: function isCustom() {\n return this.isBtnMode ? false : !this.isPlain;\n },\n isSwitch: function isSwitch() {\n // Custom switch styling (checkboxes only)\n return this.isBtnMode || this.isRadio || this.isPlain ? false : this.isGroup ? this.bvGroup.switches : this.switch;\n },\n isInline: function isInline() {\n return this.isGroup ? this.bvGroup.inline : this.inline;\n },\n isDisabled: function isDisabled() {\n // Child can be disabled while parent isn't, but is always disabled if group is\n return this.isGroup ? this.bvGroup.disabled || this.disabled : this.disabled;\n },\n isRequired: function isRequired() {\n // Required only works when a name is provided for the input(s)\n // Child can only be required when parent is\n // Groups will always have a name (either user supplied or auto generated)\n return this.getName && (this.isGroup ? this.bvGroup.required : this.required);\n },\n getName: function getName() {\n // Group name preferred over local name\n return (this.isGroup ? this.bvGroup.groupName : this.name) || null;\n },\n getForm: function getForm() {\n return (this.isGroup ? this.bvGroup.form : this.form) || null;\n },\n getSize: function getSize() {\n return (this.isGroup ? this.bvGroup.size : this.size) || '';\n },\n getState: function getState() {\n return this.isGroup ? this.bvGroup.computedState : this.computedState;\n },\n getButtonVariant: function getButtonVariant() {\n // Local variant preferred over group variant\n if (this.buttonVariant) {\n return this.buttonVariant;\n } else if (this.isGroup && this.bvGroup.buttonVariant) {\n return this.bvGroup.buttonVariant;\n } // default variant\n\n\n return 'secondary';\n },\n buttonClasses: function buttonClasses() {\n var _ref;\n\n // Same for radio & check\n return ['btn', \"btn-\".concat(this.getButtonVariant), (_ref = {}, _defineProperty(_ref, \"btn-\".concat(this.getSize), this.getSize), _defineProperty(_ref, \"disabled\", this.isDisabled), _defineProperty(_ref, \"active\", this.isChecked), _defineProperty(_ref, \"focus\", this.hasFocus), _ref)];\n },\n computedAttrs: function computedAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n id: this.safeId(),\n type: this.isRadio ? 'radio' : 'checkbox',\n name: this.getName,\n form: this.getForm,\n disabled: this.isDisabled,\n required: this.isRequired,\n autocomplete: 'off',\n 'aria-required': this.isRequired || null,\n 'aria-label': this.ariaLabel || null,\n 'aria-labelledby': this.ariaLabelledby || null\n });\n }\n },\n watch: {\n checked: function checked(newVal) {\n this.computedLocalChecked = newVal;\n }\n },\n methods: {\n handleFocus: function handleFocus(evt) {\n // When in buttons mode, we need to add 'focus' class to label when input focused\n // As it is the hidden input which has actual focus\n if (evt.target) {\n if (evt.type === 'focus') {\n this.hasFocus = true;\n } else if (evt.type === 'blur') {\n this.hasFocus = false;\n }\n }\n },\n // Convenience methods for focusing the input\n focus: function focus() {\n if (!this.isDisabled) {\n attemptFocus(this.$refs.input);\n }\n },\n blur: function blur() {\n if (!this.isDisabled) {\n attemptBlur(this.$refs.input);\n }\n }\n },\n render: function render(h) {\n var defaultSlot = this.normalizeSlot('default'); // Generate the input element\n\n var on = {\n change: this.handleChange\n };\n\n if (this.isBtnMode) {\n // Handlers for focus styling when in button mode\n on.focus = on.blur = this.handleFocus;\n }\n\n var input = h('input', {\n ref: 'input',\n key: 'input',\n on: on,\n class: {\n 'form-check-input': this.isPlain,\n 'custom-control-input': this.isCustom,\n 'is-valid': this.getState === true && !this.isBtnMode,\n 'is-invalid': this.getState === false && !this.isBtnMode,\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/2911\n 'position-static': this.isPlain && !defaultSlot\n },\n directives: [{\n name: 'model',\n rawName: 'v-model',\n value: this.computedLocalChecked,\n expression: 'computedLocalChecked'\n }],\n attrs: this.computedAttrs,\n domProps: {\n value: this.value,\n checked: this.isChecked\n }\n });\n\n if (this.isBtnMode) {\n // Button mode\n var button = h('label', {\n class: this.buttonClasses\n }, [input, defaultSlot]);\n\n if (!this.isGroup) {\n // Standalone button mode, so wrap in 'btn-group-toggle'\n // and flag it as inline-block to mimic regular buttons\n button = h('div', {\n class: ['btn-group-toggle', 'd-inline-block']\n }, [button]);\n }\n\n return button;\n } else {\n // Not button mode\n var label = h(); // If no label content in plain mode we dont render the label\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/2911\n\n if (!(this.isPlain && !defaultSlot)) {\n label = h('label', {\n class: {\n 'form-check-label': this.isPlain,\n 'custom-control-label': this.isCustom\n },\n attrs: {\n for: this.safeId()\n }\n }, defaultSlot);\n } // Wrap it in a div\n\n\n return h('div', {\n class: _defineProperty({\n 'form-check': this.isPlain,\n 'form-check-inline': this.isPlain && this.isInline,\n 'custom-control': this.isCustom,\n 'custom-control-inline': this.isCustom && this.isInline,\n 'custom-checkbox': this.isCustom && this.isCheck && !this.isSwitch,\n 'custom-switch': this.isSwitch,\n 'custom-radio': this.isCustom && this.isRadio\n }, \"b-custom-control-\".concat(this.getSize), Boolean(this.getSize && !this.isBtnMode))\n }, [input, label]);\n }\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/mixins/form-radio-check.js\n// module id = 159\n// module chunks = 0","import Vue from '../../utils/vue';\nimport idMixin from '../../mixins/id';\nimport formMixin from '../../mixins/form';\nimport formOptionsMixin from '../../mixins/form-options';\nimport formRadioCheckGroupMixin from '../../mixins/form-radio-check-group';\nimport formSizeMixin from '../../mixins/form-size';\nimport formStateMixin from '../../mixins/form-state';\nexport var props = {\n switches: {\n // Custom switch styling\n type: Boolean,\n default: false\n },\n checked: {\n type: Array,\n default: null\n }\n}; // @vue/component\n\nexport var BFormCheckboxGroup = /*#__PURE__*/Vue.extend({\n name: 'BFormCheckboxGroup',\n mixins: [idMixin, formMixin, formRadioCheckGroupMixin, // Includes render function\n formOptionsMixin, formSizeMixin, formStateMixin],\n provide: function provide() {\n return {\n bvCheckGroup: this\n };\n },\n props: props,\n data: function data() {\n return {\n localChecked: this.checked || []\n };\n },\n computed: {\n isRadioGroup: function isRadioGroup() {\n return false;\n }\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-checkbox/form-checkbox-group.js\n// module id = 160\n// module chunks = 0","import { htmlOrText } from '../utils/html';\nimport looseEqual from '../utils/loose-equal';\nimport normalizeSlotMixin from './normalize-slot';\nimport { BFormCheckbox } from '../components/form-checkbox/form-checkbox';\nimport { BFormRadio } from '../components/form-radio/form-radio'; // @vue/component\n\nexport default {\n mixins: [normalizeSlotMixin],\n model: {\n prop: 'checked',\n event: 'input'\n },\n props: {\n validated: {\n type: Boolean,\n default: false\n },\n ariaInvalid: {\n type: [Boolean, String],\n default: false\n },\n stacked: {\n type: Boolean,\n default: false\n },\n plain: {\n type: Boolean,\n default: false\n },\n buttons: {\n // Render as button style\n type: Boolean,\n default: false\n },\n buttonVariant: {\n // Only applicable when rendered with button style\n type: String,\n default: 'secondary'\n }\n },\n computed: {\n inline: function inline() {\n return !this.stacked;\n },\n groupName: function groupName() {\n // Checks/Radios tied to the same model must have the same name,\n // especially for ARIA accessibility.\n return this.name || this.safeId();\n },\n groupClasses: function groupClasses() {\n if (this.buttons) {\n return ['btn-group-toggle', this.inline ? 'btn-group' : 'btn-group-vertical', this.size ? \"btn-group-\".concat(this.size) : '', this.validated ? \"was-validated\" : ''];\n }\n\n return [this.validated ? \"was-validated\" : ''];\n },\n computedAriaInvalid: function computedAriaInvalid() {\n var ariaInvalid = this.ariaInvalid;\n\n if (ariaInvalid === true || ariaInvalid === 'true' || ariaInvalid === '') {\n return 'true';\n }\n\n return this.computedState === false ? 'true' : null;\n }\n },\n watch: {\n checked: function checked(newVal) {\n this.localChecked = newVal;\n },\n localChecked: function localChecked(newVal, oldVal) {\n if (!looseEqual(newVal, oldVal)) {\n this.$emit('input', newVal);\n }\n }\n },\n render: function render(h) {\n var _this = this;\n\n var $inputs = this.formOptions.map(function (option, index) {\n var key = \"BV_option_\".concat(index);\n return h(_this.isRadioGroup ? BFormRadio : BFormCheckbox, {\n props: {\n id: _this.safeId(key),\n value: option.value,\n // Individual radios or checks can be disabled in a group\n disabled: option.disabled || false // We don't need to include these, since the input's will know they are inside here\n // name: this.groupName,\n // form: this.form || null,\n // required: Boolean(this.name && this.required)\n\n },\n key: key\n }, [h('span', {\n domProps: htmlOrText(option.html, option.text)\n })]);\n });\n return h('div', {\n class: [this.groupClasses, 'bv-no-focus-ring'],\n attrs: {\n id: this.safeId(),\n role: this.isRadioGroup ? 'radiogroup' : 'group',\n // Add `tabindex=\"-1\"` to allow group to be focused if needed by screen readers\n tabindex: '-1',\n 'aria-required': this.required ? 'true' : null,\n 'aria-invalid': this.computedAriaInvalid\n }\n }, [this.normalizeSlot('first'), $inputs, this.normalizeSlot('default')]);\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/mixins/form-radio-check-group.js\n// module id = 161\n// module chunks = 0","import { BFormDatepicker } from './form-datepicker';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormDatepickerPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormDatepicker: BFormDatepicker,\n BDatepicker: BFormDatepicker\n }\n});\nexport { FormDatepickerPlugin, BFormDatepicker };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-datepicker/index.js\n// module id = 162\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { arrayIncludes } from '../../utils/array';\nimport { BVFormBtnLabelControl, dropdownProps } from '../../utils/bv-form-btn-label-control';\nimport { getComponentConfig } from '../../utils/config';\nimport { createDate, constrainDate, formatYMD, parseYMD } from '../../utils/date';\nimport { attemptBlur, attemptFocus } from '../../utils/dom';\nimport { isUndefinedOrNull } from '../../utils/inspect';\nimport { pick } from '../../utils/object';\nimport idMixin from '../../mixins/id';\nimport { BButton } from '../button/button';\nimport { BCalendar, STR_LONG, STR_NARROW, STR_NUMERIC, STR_SHORT } from '../calendar/calendar';\nimport { BIconCalendar, BIconCalendarFill } from '../../icons/icons';\nvar NAME = 'BFormDatepicker'; // Fallback to BCalendar prop if no value found\n\nvar getConfigFallback = function getConfigFallback(prop) {\n return getComponentConfig(NAME, prop) || getComponentConfig('BCalendar', prop);\n}; // We create our props as a mixin so that we can control\n// where they appear in the props listing reference section\n\n\nvar propsMixin = {\n props: _objectSpread({\n value: {\n type: [String, Date],\n default: null\n },\n valueAsDate: {\n type: Boolean,\n default: false\n },\n resetValue: {\n type: [String, Date] // default: null\n\n },\n initialDate: {\n // This specifies the calendar year/month/day that will be shown when\n // first opening the datepicker if no v-model value is provided\n // Default is the current date (or `min`/`max`)\n // Passed directly to \n type: [String, Date] // default: null\n\n },\n placeholder: {\n type: String // Defaults to `labelNoDateSelected` from calendar context\n // default: null\n\n },\n size: {\n type: String // default: null\n\n },\n min: {\n type: [String, Date] // default: null\n\n },\n max: {\n type: [String, Date] // default: null\n\n },\n disabled: {\n type: Boolean,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n required: {\n // If true adds the `aria-required` attribute\n type: Boolean,\n default: false\n },\n name: {\n type: String // default: null\n\n },\n form: {\n type: String // default: null\n\n },\n state: {\n // Tri-state prop: `true`, `false` or `null`\n type: Boolean,\n default: null\n },\n dateDisabledFn: {\n type: Function // default: null\n\n },\n noCloseOnSelect: {\n type: Boolean,\n default: false\n },\n hideHeader: {\n type: Boolean,\n default: false\n },\n showDecadeNav: {\n // When `true` enables the decade navigation buttons\n type: Boolean,\n default: false\n },\n locale: {\n type: [String, Array] // default: null\n\n },\n startWeekday: {\n // `0` (Sunday), `1` (Monday), ... `6` (Saturday)\n // Day of week to start calendar on\n type: [Number, String],\n default: 0\n },\n direction: {\n type: String // default: null\n\n },\n buttonOnly: {\n type: Boolean,\n default: false\n },\n buttonVariant: {\n // Applicable in button only mode\n type: String,\n default: 'secondary'\n },\n calendarWidth: {\n // Width of the calendar dropdown\n type: String,\n default: '270px'\n },\n selectedVariant: {\n // Variant color to use for the selected date\n type: String,\n default: 'primary'\n },\n todayVariant: {\n // Variant color to use for today's date (defaults to `variant`)\n type: String // default: null\n\n },\n noHighlightToday: {\n // Disable highlighting today's date\n type: Boolean,\n default: false\n },\n todayButton: {\n type: Boolean,\n default: false\n },\n labelTodayButton: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelTodayButton');\n }\n },\n todayButtonVariant: {\n type: String,\n default: 'outline-primary'\n },\n resetButton: {\n type: Boolean,\n default: false\n },\n labelResetButton: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelResetButton');\n }\n },\n resetButtonVariant: {\n type: String,\n default: 'outline-danger'\n },\n closeButton: {\n type: Boolean,\n default: false\n },\n labelCloseButton: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelCloseButton');\n }\n },\n closeButtonVariant: {\n type: String,\n default: 'outline-secondary'\n },\n dateInfoFn: {\n // Passed through to b-calendar\n type: Function // default: undefined\n\n },\n // Labels for buttons and keyboard shortcuts\n // These pick BCalendar global config if no BFormDate global config\n labelPrevDecade: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelPrevDecade');\n }\n },\n labelPrevYear: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelPrevYear');\n }\n },\n labelPrevMonth: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelPrevMonth');\n }\n },\n labelCurrentMonth: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelCurrentMonth');\n }\n },\n labelNextMonth: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelNextMonth');\n }\n },\n labelNextYear: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelNextYear');\n }\n },\n labelNextDecade: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelNextDecade');\n }\n },\n labelToday: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelToday');\n }\n },\n labelSelected: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelSelected');\n }\n },\n labelNoDateSelected: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelNoDateSelected');\n }\n },\n labelCalendar: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelCalendar');\n }\n },\n labelNav: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelNav');\n }\n },\n labelHelp: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelHelp');\n }\n },\n dateFormatOptions: {\n // `Intl.DateTimeFormat` object\n // Note: This value is *not* to be placed in the global config\n type: Object,\n default: function _default() {\n return {\n year: STR_NUMERIC,\n month: STR_LONG,\n day: STR_NUMERIC,\n weekday: STR_LONG\n };\n }\n },\n weekdayHeaderFormat: {\n // Format of the weekday names at the top of the calendar\n // Note: This value is *not* to be placed in the global config\n type: String,\n // `short` is typically a 3 letter abbreviation,\n // `narrow` is typically a single letter\n // `long` is the full week day name\n // Although some locales may override this (i.e `ar`, etc)\n default: STR_SHORT,\n validator: function validator(value) {\n return arrayIncludes([STR_LONG, STR_SHORT, STR_NARROW], value);\n }\n },\n // Dark mode\n dark: {\n type: Boolean,\n default: false\n },\n // extra dropdown stuff\n menuClass: {\n type: [String, Array, Object] // default: null\n\n }\n }, dropdownProps)\n}; // --- BFormDate component ---\n// @vue/component\n\nexport var BFormDatepicker = /*#__PURE__*/Vue.extend({\n name: NAME,\n // The mixins order determines the order of appearance in the props reference section\n mixins: [idMixin, propsMixin],\n model: {\n prop: 'value',\n event: 'input'\n },\n data: function data() {\n return {\n // We always use `YYYY-MM-DD` value internally\n localYMD: formatYMD(this.value) || '',\n // If the popup is open\n isVisible: false,\n // Context data from BCalendar\n localLocale: null,\n isRTL: false,\n formattedValue: '',\n activeYMD: ''\n };\n },\n computed: {\n calendarYM: function calendarYM() {\n // Returns the calendar year/month\n // Returns the `YYYY-MM` portion of the active calendar date\n return this.activeYMD.slice(0, -3);\n },\n calendarProps: function calendarProps() {\n // Use self for better minification, as `this` won't\n // minimize and we reference it many times below\n var self = this;\n return {\n hidden: !self.isVisible,\n value: self.localYMD,\n min: self.min,\n max: self.max,\n initialDate: self.initialDate,\n readonly: self.readonly,\n disabled: self.disabled,\n locale: self.locale,\n startWeekday: self.startWeekday,\n direction: self.direction,\n width: self.calendarWidth,\n dateDisabledFn: self.dateDisabledFn,\n selectedVariant: self.selectedVariant,\n todayVariant: self.todayVariant,\n dateInfoFn: self.dateInfoFn,\n hideHeader: self.hideHeader,\n showDecadeNav: self.showDecadeNav,\n noHighlightToday: self.noHighlightToday,\n labelPrevDecade: self.labelPrevDecade,\n labelPrevYear: self.labelPrevYear,\n labelPrevMonth: self.labelPrevMonth,\n labelCurrentMonth: self.labelCurrentMonth,\n labelNextMonth: self.labelNextMonth,\n labelNextYear: self.labelNextYear,\n labelNextDecade: self.labelNextDecade,\n labelToday: self.labelToday,\n labelSelected: self.labelSelected,\n labelNoDateSelected: self.labelNoDateSelected,\n labelCalendar: self.labelCalendar,\n labelNav: self.labelNav,\n labelHelp: self.labelHelp,\n dateFormatOptions: self.dateFormatOptions,\n weekdayHeaderFormat: self.weekdayHeaderFormat\n };\n },\n computedLang: function computedLang() {\n return (this.localLocale || '').replace(/-u-.*$/i, '') || null;\n },\n computedResetValue: function computedResetValue() {\n return formatYMD(constrainDate(this.resetValue)) || '';\n }\n },\n watch: {\n value: function value(newVal) {\n this.localYMD = formatYMD(newVal) || '';\n },\n localYMD: function localYMD(newVal) {\n // We only update the v-model when the datepicker is open\n if (this.isVisible) {\n this.$emit('input', this.valueAsDate ? parseYMD(newVal) || null : newVal || '');\n }\n },\n calendarYM: function calendarYM(newVal, oldVal)\n /* istanbul ignore next */\n {\n // Displayed calendar month has changed\n // So possibly the calendar height has changed...\n // We need to update popper computed position\n if (newVal !== oldVal && oldVal) {\n try {\n this.$refs.control.updatePopper();\n } catch (_unused) {}\n }\n }\n },\n methods: {\n // Public methods\n focus: function focus() {\n if (!this.disabled) {\n attemptFocus(this.$refs.control);\n }\n },\n blur: function blur() {\n if (!this.disabled) {\n attemptBlur(this.$refs.control);\n }\n },\n // Private methods\n setAndClose: function setAndClose(ymd) {\n var _this = this;\n\n this.localYMD = ymd; // Close calendar popup, unless `noCloseOnSelect`\n\n if (!this.noCloseOnSelect) {\n this.$nextTick(function () {\n _this.$refs.control.hide(true);\n });\n }\n },\n onSelected: function onSelected(ymd) {\n var _this2 = this;\n\n this.$nextTick(function () {\n _this2.setAndClose(ymd);\n });\n },\n onInput: function onInput(ymd) {\n if (this.localYMD !== ymd) {\n this.localYMD = ymd;\n }\n },\n onContext: function onContext(ctx) {\n var activeYMD = ctx.activeYMD,\n isRTL = ctx.isRTL,\n locale = ctx.locale,\n selectedYMD = ctx.selectedYMD,\n selectedFormatted = ctx.selectedFormatted;\n this.isRTL = isRTL;\n this.localLocale = locale;\n this.formattedValue = selectedFormatted;\n this.localYMD = selectedYMD;\n this.activeYMD = activeYMD; // Re-emit the context event\n\n this.$emit('context', ctx);\n },\n onTodayButton: function onTodayButton() {\n // Set to today (or min/max if today is out of range)\n this.setAndClose(formatYMD(constrainDate(createDate(), this.min, this.max)));\n },\n onResetButton: function onResetButton() {\n this.setAndClose(this.computedResetValue);\n },\n onCloseButton: function onCloseButton() {\n this.$refs.control.hide(true);\n },\n // Menu handlers\n onShow: function onShow() {\n this.isVisible = true;\n },\n onShown: function onShown() {\n var _this3 = this;\n\n this.$nextTick(function () {\n attemptFocus(_this3.$refs.calendar);\n\n _this3.$emit('shown');\n });\n },\n onHidden: function onHidden() {\n this.isVisible = false;\n this.$emit('hidden');\n },\n // Render helpers\n defaultButtonFn: function defaultButtonFn(_ref) {\n var isHovered = _ref.isHovered,\n hasFocus = _ref.hasFocus;\n return this.$createElement(isHovered || hasFocus ? BIconCalendarFill : BIconCalendar, {\n attrs: {\n 'aria-hidden': 'true'\n }\n });\n }\n },\n render: function render(h) {\n var $scopedSlots = this.$scopedSlots;\n var localYMD = this.localYMD;\n var disabled = this.disabled;\n var readonly = this.readonly;\n var placeholder = isUndefinedOrNull(this.placeholder) ? this.labelNoDateSelected : this.placeholder; // Optional footer buttons\n\n var $footer = [];\n\n if (this.todayButton) {\n var label = this.labelTodayButton;\n $footer.push(h(BButton, {\n props: {\n size: 'sm',\n disabled: disabled || readonly,\n variant: this.todayButtonVariant\n },\n attrs: {\n 'aria-label': label || null\n },\n on: {\n click: this.onTodayButton\n }\n }, label));\n }\n\n if (this.resetButton) {\n var _label = this.labelResetButton;\n $footer.push(h(BButton, {\n props: {\n size: 'sm',\n disabled: disabled || readonly,\n variant: this.resetButtonVariant\n },\n attrs: {\n 'aria-label': _label || null\n },\n on: {\n click: this.onResetButton\n }\n }, _label));\n }\n\n if (this.closeButton) {\n var _label2 = this.labelCloseButton;\n $footer.push(h(BButton, {\n props: {\n size: 'sm',\n disabled: disabled,\n variant: this.closeButtonVariant\n },\n attrs: {\n 'aria-label': _label2 || null\n },\n on: {\n click: this.onCloseButton\n }\n }, _label2));\n }\n\n if ($footer.length > 0) {\n $footer = [h('div', {\n staticClass: 'b-form-date-controls d-flex flex-wrap',\n class: {\n 'justify-content-between': $footer.length > 1,\n 'justify-content-end': $footer.length < 2\n }\n }, $footer)];\n }\n\n var $calendar = h(BCalendar, {\n key: 'calendar',\n ref: 'calendar',\n staticClass: 'b-form-date-calendar w-100',\n props: this.calendarProps,\n on: {\n selected: this.onSelected,\n input: this.onInput,\n context: this.onContext\n },\n scopedSlots: pick($scopedSlots, ['nav-prev-decade', 'nav-prev-year', 'nav-prev-month', 'nav-this-month', 'nav-next-month', 'nav-next-year', 'nav-next-decade'])\n }, $footer);\n return h(BVFormBtnLabelControl, {\n ref: 'control',\n staticClass: 'b-form-datepicker',\n props: _objectSpread(_objectSpread({}, this.$props), {}, {\n // Overridden / computed props\n id: this.safeId(),\n rtl: this.isRTL,\n lang: this.computedLang,\n value: localYMD || '',\n formattedValue: localYMD ? this.formattedValue : '',\n placeholder: placeholder || '',\n menuClass: [{\n 'bg-dark': !!this.dark,\n 'text-light': !!this.dark\n }, this.menuClass]\n }),\n on: {\n show: this.onShow,\n shown: this.onShown,\n hidden: this.onHidden\n },\n scopedSlots: {\n 'button-content': $scopedSlots['button-content'] || this.defaultButtonFn\n }\n }, [$calendar]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-datepicker/form-datepicker.js\n// module id = 163\n// module chunks = 0","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; }\n\n//\n// Private component used by `b-form-datepicker` and `b-form-timepicker`\n//\nimport Vue from './vue';\nimport { attemptBlur, attemptFocus } from './dom';\nimport { toString } from './string';\nimport dropdownMixin, { commonProps } from '../mixins/dropdown';\nimport idMixin from '../mixins/id';\nimport normalizeSlotMixin from '../mixins/normalize-slot';\nimport { VBHover } from '../directives/hover/hover';\nimport { BIconChevronDown } from '../icons/icons'; // Re-export common dropdown props used for convenience\n\nexport var dropdownProps = commonProps; // @vue/component\n\nexport var BVFormBtnLabelControl = /*#__PURE__*/Vue.extend({\n name: 'BVFormBtnLabelControl',\n directives: {\n BHover: VBHover\n },\n mixins: [idMixin, normalizeSlotMixin, dropdownMixin],\n props: {\n value: {\n // This is the value placed on the hidden input\n type: String,\n default: ''\n },\n formattedValue: {\n // This is the value shown in the label\n // Defaults back to `value`\n type: String // default: null\n\n },\n placeholder: {\n // This is the value placed on the hidden input when no value selected\n type: String // default: null\n\n },\n labelSelected: {\n // Value placed in sr-only span inside label when value is present\n type: String // default: null\n\n },\n state: {\n // Tri-state prop: `true`, `false`, or `null`\n type: Boolean,\n // We must explicitly default to `null` here otherwise\n // Vue coerces `undefined` into Boolean `false`\n default: null\n },\n size: {\n type: String // default: null\n\n },\n name: {\n type: String // default: null\n\n },\n form: {\n type: String // default: null\n\n },\n disabled: {\n type: Boolean,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n required: {\n type: Boolean,\n default: false\n },\n lang: {\n type: String // default: null\n\n },\n rtl: {\n // Tri-state prop: `true`, `false` or `null`\n type: Boolean,\n // We must explicitly default to `null` here otherwise\n // Vue coerces `undefined` into Boolean `false`\n default: null\n },\n buttonOnly: {\n // When true, renders a btn-group wrapper and visually hides the label\n type: Boolean,\n default: false\n },\n buttonVariant: {\n // Applicable in button mode only\n type: String,\n default: 'secondary'\n },\n menuClass: {\n // Extra classes to apply to the `dropdown-menu` div\n type: [String, Array, Object] // default: null\n\n }\n },\n data: function data() {\n return {\n isHovered: false,\n hasFocus: false\n };\n },\n computed: {\n idButton: function idButton() {\n return this.safeId();\n },\n idLabel: function idLabel() {\n return this.safeId('_value_');\n },\n idMenu: function idMenu() {\n return this.safeId('_dialog_');\n },\n idWrapper: function idWrapper() {\n return this.safeId('_outer_');\n },\n computedDir: function computedDir() {\n return this.rtl === true ? 'rtl' : this.rtl === false ? 'ltr' : null;\n }\n },\n methods: {\n focus: function focus() {\n if (!this.disabled) {\n attemptFocus(this.$refs.toggle);\n }\n },\n blur: function blur() {\n if (!this.disabled) {\n attemptBlur(this.$refs.toggle);\n }\n },\n setFocus: function setFocus(evt) {\n this.hasFocus = evt.type === 'focus';\n },\n handleHover: function handleHover(hovered) {\n this.isHovered = hovered;\n },\n\n /* istanbul ignore next */\n stopEvent: function stopEvent(evt)\n /* istanbul ignore next */\n {\n evt.stopPropagation();\n }\n },\n render: function render(h) {\n var _class, _class2, _ref;\n\n var idButton = this.idButton;\n var idLabel = this.idLabel;\n var idMenu = this.idMenu;\n var idWrapper = this.idWrapper;\n var disabled = this.disabled;\n var readonly = this.readonly;\n var required = this.required;\n var isHovered = this.isHovered;\n var hasFocus = this.hasFocus;\n var state = this.state;\n var visible = this.visible;\n var size = this.size;\n var value = toString(this.value) || '';\n var labelSelected = this.labelSelected;\n var buttonOnly = !!this.buttonOnly;\n var buttonVariant = this.buttonVariant;\n var btnScope = {\n isHovered: isHovered,\n hasFocus: hasFocus,\n state: state,\n opened: visible\n };\n var $button = h('button', {\n ref: 'toggle',\n staticClass: 'btn',\n class: (_class = {}, _defineProperty(_class, \"btn-\".concat(buttonVariant), buttonOnly), _defineProperty(_class, \"btn-\".concat(size), !!size), _defineProperty(_class, 'h-auto', !buttonOnly), _defineProperty(_class, 'dropdown-toggle', buttonOnly), _defineProperty(_class, 'dropdown-toggle-no-caret', buttonOnly), _class),\n attrs: {\n id: idButton,\n type: 'button',\n disabled: disabled,\n 'aria-haspopup': 'dialog',\n 'aria-expanded': visible ? 'true' : 'false',\n 'aria-invalid': state === false || required && !value ? 'true' : null,\n 'aria-required': required ? 'true' : null\n },\n directives: [{\n name: 'b-hover',\n value: this.handleHover\n }],\n on: {\n mousedown: this.onMousedown,\n click: this.toggle,\n keydown: this.toggle,\n // Handle ENTER, SPACE and DOWN\n '!focus': this.setFocus,\n '!blur': this.setFocus\n }\n }, [this.hasNormalizedSlot('button-content') ? this.normalizeSlot('button-content', btnScope) :\n /* istanbul ignore next */\n h(BIconChevronDown, {\n props: {\n scale: 1.25\n }\n })]); // Hidden input\n\n var $hidden = h();\n\n if (this.name && !disabled) {\n $hidden = h('input', {\n attrs: {\n type: 'hidden',\n name: this.name || null,\n form: this.form || null,\n value: value\n }\n });\n } // Dropdown content\n\n\n var $menu = h('div', {\n ref: 'menu',\n staticClass: 'dropdown-menu',\n class: [this.menuClass, {\n show: visible,\n 'dropdown-menu-right': this.right\n }],\n attrs: {\n id: idMenu,\n role: 'dialog',\n tabindex: '-1',\n 'aria-modal': 'false',\n 'aria-labelledby': idLabel\n },\n on: {\n keydown: this.onKeydown // Handle ESC\n\n }\n }, [this.normalizeSlot('default', {\n opened: visible\n })]); // Value label\n\n var $label = h('label', {\n staticClass: 'form-control text-break text-wrap bg-transparent h-auto',\n class: (_class2 = {\n // Hidden in button only mode\n 'sr-only': buttonOnly,\n // Mute the text if showing the placeholder\n 'text-muted': !value\n }, _defineProperty(_class2, \"form-control-\".concat(size), !!size), _defineProperty(_class2, 'is-invalid', state === false), _defineProperty(_class2, 'is-valid', state === true), _class2),\n attrs: {\n id: idLabel,\n for: idButton,\n 'aria-invalid': state === false || required && !value ? 'true' : null,\n 'aria-required': required ? 'true' : null\n },\n directives: [{\n name: 'b-hover',\n value: this.handleHover\n }],\n on: {\n // Disable bubbling of the click event to\n // prevent menu from closing and re-opening\n '!click': this.stopEvent\n }\n }, [value ? this.formattedValue || value : this.placeholder || '', // Add the selected label for screen readers when a value is provided\n value && labelSelected ? h('bdi', {\n staticClass: 'sr-only'\n }, labelSelected) : '']); // Return the custom form control wrapper\n\n return h('div', {\n staticClass: 'b-form-btn-label-control dropdown',\n class: [this.directionClass, (_ref = {\n 'btn-group': buttonOnly,\n 'form-control': !buttonOnly\n }, _defineProperty(_ref, \"form-control-\".concat(size), !!size && !buttonOnly), _defineProperty(_ref, 'd-flex', !buttonOnly), _defineProperty(_ref, 'h-auto', !buttonOnly), _defineProperty(_ref, 'align-items-stretch', !buttonOnly), _defineProperty(_ref, \"focus\", hasFocus && !buttonOnly), _defineProperty(_ref, \"show\", visible), _defineProperty(_ref, 'is-valid', state === true), _defineProperty(_ref, 'is-invalid', state === false), _ref)],\n attrs: {\n id: idWrapper,\n role: buttonOnly ? null : 'group',\n lang: this.lang || null,\n dir: this.computedDir,\n 'aria-disabled': disabled,\n 'aria-readonly': readonly && !disabled,\n 'aria-labelledby': idLabel,\n 'aria-invalid': state === false || required && !value ? 'true' : null,\n 'aria-required': required ? 'true' : null\n }\n }, [$button, $hidden, $menu, $label]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/utils/bv-form-btn-label-control.js\n// module id = 164\n// module chunks = 0","import { BFormFile } from './form-file';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormFilePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormFile: BFormFile,\n BFile: BFormFile\n }\n});\nexport { FormFilePlugin, BFormFile };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-file/index.js\n// module id = 165\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport identity from '../../utils/identity';\nimport { from as arrayFrom, isArray, concat } from '../../utils/array';\nimport { getComponentConfig } from '../../utils/config';\nimport { isFile, isFunction, isUndefinedOrNull } from '../../utils/inspect';\nimport { File } from '../../utils/safe-types';\nimport { toString } from '../../utils/string';\nimport { warn } from '../../utils/warn';\nimport attrsMixin from '../../mixins/attrs';\nimport formCustomMixin from '../../mixins/form-custom';\nimport formMixin from '../../mixins/form';\nimport formStateMixin from '../../mixins/form-state';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot'; // --- Constants ---\n\nvar NAME = 'BFormFile';\nvar VALUE_EMPTY_DEPRECATED_MSG = 'Setting \"value\"/\"v-model\" to an empty string for reset is deprecated. Set to \"null\" instead.'; // --- Helper methods ---\n\nvar isValidValue = function isValidValue(value) {\n return isFile(value) || isArray(value) && value.every(function (v) {\n return isValidValue(v);\n });\n}; // @vue/component\n\n\nexport var BFormFile = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [attrsMixin, idMixin, formMixin, formStateMixin, formCustomMixin, normalizeSlotMixin],\n inheritAttrs: false,\n model: {\n prop: 'value',\n event: 'input'\n },\n props: {\n size: {\n type: String,\n default: function _default() {\n return getComponentConfig('BFormControl', 'size');\n }\n },\n value: {\n type: [File, Array],\n default: null,\n validator: function validator(value) {\n /* istanbul ignore next */\n if (value === '') {\n warn(VALUE_EMPTY_DEPRECATED_MSG, NAME);\n return true;\n }\n\n return isUndefinedOrNull(value) || isValidValue(value);\n }\n },\n accept: {\n type: String,\n default: ''\n },\n // Instruct input to capture from camera\n capture: {\n type: Boolean,\n default: false\n },\n placeholder: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'placeholder');\n }\n },\n browseText: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'browseText');\n }\n },\n dropPlaceholder: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'dropPlaceholder');\n }\n },\n multiple: {\n type: Boolean,\n default: false\n },\n directory: {\n type: Boolean,\n default: false\n },\n noTraverse: {\n type: Boolean,\n default: false\n },\n noDrop: {\n type: Boolean,\n default: false\n },\n fileNameFormatter: {\n type: Function,\n default: null\n }\n },\n data: function data() {\n return {\n selectedFile: null,\n dragging: false,\n hasFocus: false\n };\n },\n computed: {\n selectLabel: function selectLabel() {\n // Draging active\n if (this.dragging && this.dropPlaceholder) {\n return this.dropPlaceholder;\n } // No file chosen\n\n\n if (!this.selectedFile || this.selectedFile.length === 0) {\n return this.placeholder;\n } // Convert selectedFile to an array (if not already one)\n\n\n var files = concat(this.selectedFile).filter(identity);\n\n if (this.hasNormalizedSlot('file-name')) {\n // There is a slot for formatting the files/names\n return [this.normalizeSlot('file-name', {\n files: files,\n names: files.map(function (f) {\n return f.name;\n })\n })];\n } else {\n // Use the user supplied formatter, or the built in one.\n return isFunction(this.fileNameFormatter) ? toString(this.fileNameFormatter(files)) : files.map(function (file) {\n return file.name;\n }).join(', ');\n }\n },\n computedAttrs: function computedAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n type: 'file',\n id: this.safeId(),\n name: this.name,\n disabled: this.disabled,\n required: this.required,\n form: this.form || null,\n capture: this.capture || null,\n accept: this.accept || null,\n multiple: this.multiple,\n webkitdirectory: this.directory,\n 'aria-required': this.required ? 'true' : null\n });\n }\n },\n watch: {\n selectedFile: function selectedFile(newVal, oldVal) {\n // The following test is needed when the file input is \"reset\" or the\n // exact same file(s) are selected to prevent an infinite loop.\n // When in `multiple` mode we need to check for two empty arrays or\n // two arrays with identical files\n if (newVal === oldVal || isArray(newVal) && isArray(oldVal) && newVal.length === oldVal.length && newVal.every(function (v, i) {\n return v === oldVal[i];\n })) {\n return;\n }\n\n if (!newVal && this.multiple) {\n this.$emit('input', []);\n } else {\n this.$emit('input', newVal);\n }\n },\n value: function value(newVal) {\n if (!newVal || isArray(newVal) && newVal.length === 0) {\n this.reset();\n }\n }\n },\n methods: {\n focusHandler: function focusHandler(evt) {\n // Bootstrap v4 doesn't have focus styling for custom file input\n // Firefox has a '[type=file]:focus ~ sibling' selector issue,\n // so we add a 'focus' class to get around these bugs\n if (this.plain || evt.type === 'focusout') {\n this.hasFocus = false;\n } else {\n // Add focus styling for custom file input\n this.hasFocus = true;\n }\n },\n reset: function reset() {\n // IE 11 doesn't support setting `$input.value` to `''` or `null`\n // So we use this little extra hack to reset the value, just in case\n // This also appears to work on modern browsers as well\n // Wrapped in try in case IE 11 or mobile Safari crap out\n try {\n var $input = this.$refs.input;\n $input.value = '';\n $input.type = '';\n $input.type = 'file';\n } catch (e) {}\n\n this.selectedFile = this.multiple ? [] : null;\n },\n onFileChange: function onFileChange(evt) {\n var _this = this;\n\n // Always emit original event\n this.$emit('change', evt); // Check if special `items` prop is available on event (drop mode)\n // Can be disabled by setting no-traverse\n\n var items = evt.dataTransfer && evt.dataTransfer.items;\n /* istanbul ignore next: not supported in JSDOM */\n\n if (items && !this.noTraverse) {\n var queue = [];\n\n for (var i = 0; i < items.length; i++) {\n var item = items[i].webkitGetAsEntry();\n\n if (item) {\n queue.push(this.traverseFileTree(item));\n }\n }\n\n Promise.all(queue).then(function (filesArr) {\n _this.setFiles(arrayFrom(filesArr));\n });\n return;\n } // Normal handling\n\n\n this.setFiles(evt.target.files || evt.dataTransfer.files);\n },\n setFiles: function setFiles() {\n var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if (!files) {\n /* istanbul ignore next: this will probably not happen */\n this.selectedFile = null;\n } else if (this.multiple) {\n // Convert files to array\n var filesArray = [];\n\n for (var i = 0; i < files.length; i++) {\n filesArray.push(files[i]);\n } // Return file(s) as array\n\n\n this.selectedFile = filesArray;\n } else {\n // Return single file object\n this.selectedFile = files[0] || null;\n }\n },\n onReset: function onReset() {\n // Triggered when the parent form (if any) is reset\n this.selectedFile = this.multiple ? [] : null;\n },\n onDragover: function onDragover(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n\n if (this.noDrop || !this.custom) {\n return;\n }\n\n this.dragging = true;\n\n try {\n evt.dataTransfer.dropEffect = 'copy';\n } catch (_unused) {}\n },\n onDragleave: function onDragleave(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n this.dragging = false;\n },\n onDrop: function onDrop(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n\n if (this.noDrop) {\n return;\n }\n\n this.dragging = false;\n\n if (evt.dataTransfer.files && evt.dataTransfer.files.length > 0) {\n this.onFileChange(evt);\n }\n },\n\n /* istanbul ignore next: not supported in JSDOM */\n traverseFileTree: function traverseFileTree(item, path)\n /* istanbul ignore next */\n {\n var _this2 = this;\n\n // Based on https://stackoverflow.com/questions/3590058\n return new Promise(function (resolve) {\n path = path || '';\n\n if (item.isFile) {\n // Get file\n item.file(function (file) {\n file.$path = path; // Inject $path to file obj\n\n resolve(file);\n });\n } else if (item.isDirectory) {\n // Get folder contents\n item.createReader().readEntries(function (entries) {\n var queue = [];\n\n for (var i = 0; i < entries.length; i++) {\n queue.push(_this2.traverseFileTree(entries[i], path + item.name + '/'));\n }\n\n Promise.all(queue).then(function (filesArr) {\n resolve(arrayFrom(filesArr));\n });\n });\n }\n });\n }\n },\n render: function render(h) {\n // Form Input\n var input = h('input', {\n ref: 'input',\n class: [{\n 'form-control-file': this.plain,\n 'custom-file-input': this.custom,\n focus: this.custom && this.hasFocus\n }, this.stateClass],\n attrs: this.computedAttrs,\n on: {\n change: this.onFileChange,\n focusin: this.focusHandler,\n focusout: this.focusHandler,\n reset: this.onReset\n }\n });\n\n if (this.plain) {\n return input;\n } // Overlay Labels\n\n\n var label = h('label', {\n staticClass: 'custom-file-label',\n class: [this.dragging ? 'dragging' : null],\n attrs: {\n for: this.safeId(),\n 'data-browse': this.browseText || null\n }\n }, this.selectLabel); // Return rendered custom file input\n\n return h('div', {\n staticClass: 'custom-file b-form-file',\n class: [this.stateClass, _defineProperty({}, \"b-custom-control-\".concat(this.size), this.size)],\n attrs: {\n id: this.safeId('_BV_file_outer_')\n },\n on: {\n dragover: this.onDragover,\n dragleave: this.onDragleave,\n drop: this.onDrop\n }\n }, [input, label]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-file/form-file.js\n// module id = 166\n// module chunks = 0","// @vue/component\nexport default {\n props: {\n plain: {\n type: Boolean,\n default: false\n }\n },\n computed: {\n custom: function custom() {\n return !this.plain;\n }\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/mixins/form-custom.js\n// module id = 167\n// module chunks = 0","import { BFormGroup } from './form-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormGroupPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormGroup: BFormGroup,\n BFormFieldset: BFormGroup\n }\n});\nexport { FormGroupPlugin, BFormGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-group/index.js\n// module id = 168\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport cssEscape from '../../utils/css-escape';\nimport memoize from '../../utils/memoize';\nimport { arrayIncludes } from '../../utils/array';\nimport { getBreakpointsUpCached } from '../../utils/config';\nimport { select, selectAll, isVisible, setAttr, removeAttr, getAttr, attemptFocus } from '../../utils/dom';\nimport { isBrowser } from '../../utils/env';\nimport { isBoolean } from '../../utils/inspect';\nimport { toInteger } from '../../utils/number';\nimport { keys, create } from '../../utils/object';\nimport { upperFirst } from '../../utils/string';\nimport formStateMixin from '../../mixins/form-state';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BCol } from '../layout/col';\nimport { BFormRow } from '../layout/form-row';\nimport { BFormText } from '../form/form-text';\nimport { BFormInvalidFeedback } from '../form/form-invalid-feedback';\nimport { BFormValidFeedback } from '../form/form-valid-feedback'; // --- Constants ---\n// Component name\n\nvar NAME = 'BFormGroup'; // Selector for finding first input in the form-group\n\nvar SELECTOR = 'input:not([disabled]),textarea:not([disabled]),select:not([disabled])'; // --- Render methods ---\n\nvar renderInvalidFeedback = function renderInvalidFeedback(h, ctx) {\n var content = ctx.normalizeSlot('invalid-feedback') || ctx.invalidFeedback;\n var invalidFeedback = h();\n\n if (content) {\n invalidFeedback = h(BFormInvalidFeedback, {\n props: {\n id: ctx.invalidFeedbackId,\n // If state is explicitly false, always show the feedback\n state: ctx.computedState,\n tooltip: ctx.tooltip,\n ariaLive: ctx.feedbackAriaLive,\n role: ctx.feedbackAriaLive ? 'alert' : null\n },\n attrs: {\n tabindex: content ? '-1' : null\n }\n }, [content]);\n }\n\n return invalidFeedback;\n};\n\nvar renderValidFeedback = function renderValidFeedback(h, ctx) {\n var content = ctx.normalizeSlot('valid-feedback') || ctx.validFeedback;\n var validFeedback = h();\n\n if (content) {\n validFeedback = h(BFormValidFeedback, {\n props: {\n id: ctx.validFeedbackId,\n // If state is explicitly true, always show the feedback\n state: ctx.computedState,\n tooltip: ctx.tooltip,\n ariaLive: ctx.feedbackAriaLive,\n role: ctx.feedbackAriaLive ? 'alert' : null\n },\n attrs: {\n tabindex: content ? '-1' : null\n }\n }, [content]);\n }\n\n return validFeedback;\n};\n\nvar renderHelpText = function renderHelpText(h, ctx) {\n // Form help text (description)\n var content = ctx.normalizeSlot('description') || ctx.description;\n var description = h();\n\n if (content) {\n description = h(BFormText, {\n attrs: {\n id: ctx.descriptionId,\n tabindex: content ? '-1' : null\n }\n }, [content]);\n }\n\n return description;\n};\n\nvar renderLabel = function renderLabel(h, ctx) {\n // Render label/legend inside b-col if necessary\n var content = ctx.normalizeSlot('label') || ctx.label;\n var labelFor = ctx.labelFor;\n var isLegend = !labelFor;\n var isHorizontal = ctx.isHorizontal;\n var labelTag = isLegend ? 'legend' : 'label';\n\n if (!content && !isHorizontal) {\n return h();\n } else if (ctx.labelSrOnly) {\n var label = h();\n\n if (content) {\n label = h(labelTag, {\n class: 'sr-only',\n attrs: {\n id: ctx.labelId,\n for: labelFor || null\n }\n }, [content]);\n }\n\n return h(isHorizontal ? BCol : 'div', {\n props: isHorizontal ? ctx.labelColProps : {}\n }, [label]);\n } else {\n return h(isHorizontal ? BCol : labelTag, {\n on: isLegend ? {\n click: ctx.legendClick\n } : {},\n props: isHorizontal ? _objectSpread({\n tag: labelTag\n }, ctx.labelColProps) : {},\n attrs: {\n id: ctx.labelId,\n for: labelFor || null,\n // We add a tab index to legend so that screen readers\n // will properly read the aria-labelledby in IE.\n tabindex: isLegend ? '-1' : null\n },\n class: [// Hide the focus ring on the legend\n isLegend ? 'bv-no-focus-ring' : '', // When horizontal or if a legend is rendered, add col-form-label\n // for correct sizing as Bootstrap has inconsistent font styling\n // for legend in non-horizontal form-groups.\n // See: https://github.com/twbs/bootstrap/issues/27805\n isHorizontal || isLegend ? 'col-form-label' : '', // Emulate label padding top of 0 on legend when not horizontal\n !isHorizontal && isLegend ? 'pt-0' : '', // If not horizontal and not a legend, we add d-block to label\n // so that label-align works\n !isHorizontal && !isLegend ? 'd-block' : '', ctx.labelSize ? \"col-form-label-\".concat(ctx.labelSize) : '', ctx.labelAlignClasses, ctx.labelClass]\n }, [content]);\n }\n}; // -- BFormGroup Prop factory -- used for lazy generation of props\n// Memoize this function to return cached values to\n// save time in computed functions\n\n\nvar makePropName = memoize(function () {\n var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var prefix = arguments.length > 1 ? arguments[1] : undefined;\n return \"\".concat(prefix).concat(upperFirst(breakpoint));\n}); // BFormGroup prop generator for lazy generation of props\n\nvar generateProps = function generateProps() {\n var BREAKPOINTS = getBreakpointsUpCached(); // Generate the labelCol breakpoint props\n\n var bpLabelColProps = BREAKPOINTS.reduce(function (props, breakpoint) {\n // i.e. label-cols, label-cols-sm, label-cols-md, ...\n props[makePropName(breakpoint, 'labelCols')] = {\n type: [Number, String, Boolean],\n default: breakpoint ? false : null\n };\n return props;\n }, create(null)); // Generate the labelAlign breakpoint props\n\n var bpLabelAlignProps = BREAKPOINTS.reduce(function (props, breakpoint) {\n // label-align, label-align-sm, label-align-md, ...\n props[makePropName(breakpoint, 'labelAlign')] = {\n type: String // left, right, center\n // default: null\n\n };\n return props;\n }, create(null));\n return _objectSpread(_objectSpread(_objectSpread({\n label: {\n type: String // default: null\n\n },\n labelFor: {\n type: String // default: null\n\n },\n labelSize: {\n type: String // default: null\n\n },\n labelSrOnly: {\n type: Boolean,\n default: false\n }\n }, bpLabelColProps), bpLabelAlignProps), {}, {\n labelClass: {\n type: [String, Array, Object] // default: null\n\n },\n description: {\n type: String // default: null\n\n },\n invalidFeedback: {\n type: String // default: null\n\n },\n validFeedback: {\n type: String // default: null\n\n },\n tooltip: {\n // Enable tooltip style feedback\n type: Boolean,\n default: false\n },\n feedbackAriaLive: {\n type: String,\n default: 'assertive'\n },\n validated: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n }\n });\n}; // We do not use Vue.extend here as that would evaluate the props\n// immediately, which we do not want to happen\n// @vue/component\n\n\nexport var BFormGroup = {\n name: NAME,\n mixins: [idMixin, formStateMixin, normalizeSlotMixin],\n\n get props() {\n // Allow props to be lazy evaled on first access and\n // then they become a non-getter afterwards.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#Smart_self-overwriting_lazy_getters\n delete this.props; // eslint-disable-next-line no-return-assign\n\n return this.props = generateProps();\n },\n\n computed: {\n labelColProps: function labelColProps() {\n var _this = this;\n\n var props = {};\n getBreakpointsUpCached().forEach(function (breakpoint) {\n // Grab the value if the label column breakpoint prop\n var propVal = _this[makePropName(breakpoint, 'labelCols')]; // Handle case where the prop's value is an empty string,\n // which represents true\n\n\n propVal = propVal === '' ? true : propVal || false;\n\n if (!isBoolean(propVal) && propVal !== 'auto') {\n // Convert to column size to number\n propVal = toInteger(propVal, 0); // Ensure column size is greater than 0\n\n propVal = propVal > 0 ? propVal : false;\n }\n\n if (propVal) {\n // Add the prop to the list of props to give to b-col\n // If breakpoint is '' (labelCols=true), then we use the\n // col prop to make equal width at xs\n var bColPropName = breakpoint || (isBoolean(propVal) ? 'col' : 'cols'); // Add it to the props\n\n props[bColPropName] = propVal;\n }\n });\n return props;\n },\n labelAlignClasses: function labelAlignClasses() {\n var _this2 = this;\n\n var classes = [];\n getBreakpointsUpCached().forEach(function (breakpoint) {\n // Assemble the label column breakpoint align classes\n var propVal = _this2[makePropName(breakpoint, 'labelAlign')] || null;\n\n if (propVal) {\n var className = breakpoint ? \"text-\".concat(breakpoint, \"-\").concat(propVal) : \"text-\".concat(propVal);\n classes.push(className);\n }\n });\n return classes;\n },\n isHorizontal: function isHorizontal() {\n // Determine if the resultant form-group will be rendered\n // horizontal (meaning it has label-col breakpoints)\n return keys(this.labelColProps).length > 0;\n },\n labelId: function labelId() {\n return this.hasNormalizedSlot('label') || this.label ? this.safeId('_BV_label_') : null;\n },\n descriptionId: function descriptionId() {\n return this.hasNormalizedSlot('description') || this.description ? this.safeId('_BV_description_') : null;\n },\n hasInvalidFeedback: function hasInvalidFeedback() {\n // Used for computing aria-describedby\n return this.computedState === false && (this.hasNormalizedSlot('invalid-feedback') || this.invalidFeedback);\n },\n invalidFeedbackId: function invalidFeedbackId() {\n return this.hasInvalidFeedback ? this.safeId('_BV_feedback_invalid_') : null;\n },\n hasValidFeedback: function hasValidFeedback() {\n // Used for computing aria-describedby\n return this.computedState === true && (this.hasNormalizedSlot('valid-feedback') || this.validFeedback);\n },\n validFeedbackId: function validFeedbackId() {\n return this.hasValidFeedback ? this.safeId('_BV_feedback_valid_') : null;\n },\n describedByIds: function describedByIds() {\n // Screen readers will read out any content linked to by aria-describedby\n // even if the content is hidden with `display: none;`, hence we only include\n // feedback IDs if the form-group's state is explicitly valid or invalid.\n return [this.descriptionId, this.invalidFeedbackId, this.validFeedbackId].filter(Boolean).join(' ') || null;\n }\n },\n watch: {\n describedByIds: function describedByIds(add, remove) {\n if (add !== remove) {\n this.setInputDescribedBy(add, remove);\n }\n }\n },\n mounted: function mounted() {\n var _this3 = this;\n\n this.$nextTick(function () {\n // Set the aria-describedby IDs on the input specified by label-for\n // We do this in a nextTick to ensure the children have finished rendering\n _this3.setInputDescribedBy(_this3.describedByIds);\n });\n },\n methods: {\n legendClick: function legendClick(evt) {\n if (this.labelFor) {\n // Don't do anything if labelFor is set\n\n /* istanbul ignore next: clicking a label will focus the input, so no need to test */\n return;\n }\n\n var tagName = evt.target ? evt.target.tagName : '';\n\n if (/^(input|select|textarea|label|button|a)$/i.test(tagName)) {\n // If clicked an interactive element inside legend,\n // we just let the default happen\n\n /* istanbul ignore next */\n return;\n }\n\n var inputs = selectAll(SELECTOR, this.$refs.content).filter(isVisible); // If only a single input, focus it, emulating label behaviour\n\n if (inputs && inputs.length === 1) {\n attemptFocus(inputs[0]);\n }\n },\n setInputDescribedBy: function setInputDescribedBy(add, remove) {\n // Sets the `aria-describedby` attribute on the input if label-for is set.\n // Optionally accepts a string of IDs to remove as the second parameter.\n // Preserves any aria-describedby value(s) user may have on input.\n if (this.labelFor && isBrowser) {\n // We need to escape `labelFor` since it can be user-provided\n var input = select(\"#\".concat(cssEscape(this.labelFor)), this.$refs.content);\n\n if (input) {\n var adb = 'aria-describedby';\n var ids = (getAttr(input, adb) || '').split(/\\s+/);\n add = (add || '').split(/\\s+/);\n remove = (remove || '').split(/\\s+/); // Update ID list, preserving any original IDs\n // and ensuring the ID's are unique\n\n ids = ids.filter(function (id) {\n return !arrayIncludes(remove, id);\n }).concat(add).filter(Boolean);\n ids = keys(ids.reduce(function (memo, id) {\n return _objectSpread(_objectSpread({}, memo), {}, _defineProperty({}, id, true));\n }, {})).join(' ').trim();\n\n if (ids) {\n setAttr(input, adb, ids);\n } else {\n // No IDs, so remove the attribute\n removeAttr(input, adb);\n }\n }\n }\n }\n },\n render: function render(h) {\n var isFieldset = !this.labelFor;\n var isHorizontal = this.isHorizontal; // Generate the label\n\n var label = renderLabel(h, this); // Generate the content\n\n var content = h(isHorizontal ? BCol : 'div', {\n ref: 'content',\n // Hide focus ring\n staticClass: 'bv-no-focus-ring',\n attrs: {\n tabindex: isFieldset ? '-1' : null,\n role: isFieldset ? 'group' : null\n }\n }, [this.normalizeSlot('default') || h(), renderInvalidFeedback(h, this), renderValidFeedback(h, this), renderHelpText(h, this)]); // Create the form-group\n\n var data = {\n staticClass: 'form-group',\n class: [this.validated ? 'was-validated' : null, this.stateClass],\n attrs: {\n id: this.safeId(),\n disabled: isFieldset ? this.disabled : null,\n role: isFieldset ? null : 'group',\n 'aria-invalid': this.computedState === false ? 'true' : null,\n // Only apply aria-labelledby if we are a horizontal fieldset\n // as the legend is no longer a direct child of fieldset\n 'aria-labelledby': isFieldset && isHorizontal ? this.labelId : null,\n // Only apply aria-describedby IDs if we are a fieldset\n // as the input will have the IDs when not a fieldset\n 'aria-describedby': isFieldset ? this.describedByIds : null\n }\n }; // Return it wrapped in a form-group\n // Note: Fieldsets do not support adding `row` or `form-row` directly\n // to them due to browser specific render issues, so we move the `form-row`\n // to an inner wrapper div when horizontal and using a fieldset\n\n return h(isFieldset ? 'fieldset' : isHorizontal ? BFormRow : 'div', data, isHorizontal && isFieldset ? [h(BFormRow, [label, content])] : [label, content]);\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-group/form-group.js\n// module id = 169\n// module chunks = 0","import { toString } from './string';\n\nvar escapeChar = function escapeChar(value) {\n return '\\\\' + value;\n}; // The `cssEscape()` util is based on this `CSS.escape()` polyfill:\n// https://github.com/mathiasbynens/CSS.escape\n\n\nvar cssEscape = function cssEscape(value) {\n value = toString(value);\n var length = value.length;\n var firstCharCode = value.charCodeAt(0);\n return value.split('').reduce(function (result, char, index) {\n var charCode = value.charCodeAt(index); // If the character is NULL (U+0000), use (U+FFFD) as replacement\n\n if (charCode === 0x0000) {\n return result + \"\\uFFFD\";\n } // If the character ...\n\n\n if ( // ... is U+007F OR\n charCode === 0x007f || // ... is in the range [\\1-\\1F] (U+0001 to U+001F) OR ...\n charCode >= 0x0001 && charCode <= 0x001f || // ... is the first character and is in the range [0-9] (U+0030 to U+0039) OR ...\n index === 0 && charCode >= 0x0030 && charCode <= 0x0039 || // ... is the second character and is in the range [0-9] (U+0030 to U+0039)\n // and the first character is a `-` (U+002D) ...\n index === 1 && charCode >= 0x0030 && charCode <= 0x0039 && firstCharCode === 0x002d) {\n // ... https://drafts.csswg.org/cssom/#escape-a-character-as-code-point\n return result + escapeChar(\"\".concat(charCode.toString(16), \" \"));\n } // If the character ...\n\n\n if ( // ... is the first character AND ...\n index === 0 && // ... is a `-` (U+002D) AND ...\n charCode === 0x002d && // ... there is no second character ...\n length === 1) {\n // ... use the escaped character\n return result + escapeChar(char);\n } // If the character ...\n\n\n if ( // ... is greater than or equal to U+0080 OR ...\n charCode >= 0x0080 || // ... is `-` (U+002D) OR ...\n charCode === 0x002d || // ... is `_` (U+005F) OR ...\n charCode === 0x005f || // ... is in the range [0-9] (U+0030 to U+0039) OR ...\n charCode >= 0x0030 && charCode <= 0x0039 || // ... is in the range [A-Z] (U+0041 to U+005A) OR ...\n charCode >= 0x0041 && charCode <= 0x005a || // ... is in the range [a-z] (U+0061 to U+007A) ...\n charCode >= 0x0061 && charCode <= 0x007a) {\n // ... use the character itself\n return result + char;\n } // Otherwise use the escaped character\n // See: https://drafts.csswg.org/cssom/#escape-a-character\n\n\n return result + escapeChar(char);\n }, '');\n};\n\nexport default cssEscape;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/utils/css-escape.js\n// module id = 170\n// module chunks = 0","import { BFormInput } from './form-input';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormInputPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormInput: BFormInput,\n BInput: BFormInput\n }\n});\nexport { FormInputPlugin, BFormInput };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-input/index.js\n// module id = 171\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { arrayIncludes } from '../../utils/array';\nimport { attemptBlur } from '../../utils/dom';\nimport { eventOn, eventOff, eventOnOff } from '../../utils/events';\nimport formMixin from '../../mixins/form';\nimport formSelectionMixin from '../../mixins/form-selection';\nimport formSizeMixin from '../../mixins/form-size';\nimport formStateMixin from '../../mixins/form-state';\nimport formTextMixin from '../../mixins/form-text';\nimport formValidityMixin from '../../mixins/form-validity';\nimport idMixin from '../../mixins/id';\nimport listenersMixin from '../../mixins/listeners'; // Valid supported input types\n\nvar TYPES = ['text', 'password', 'email', 'number', 'url', 'tel', 'search', 'range', 'color', 'date', 'time', 'datetime', 'datetime-local', 'month', 'week']; // @vue/component\n\nexport var BFormInput = /*#__PURE__*/Vue.extend({\n name: 'BFormInput',\n // Mixin order is important!\n mixins: [listenersMixin, idMixin, formMixin, formSizeMixin, formStateMixin, formTextMixin, formSelectionMixin, formValidityMixin],\n props: {\n // `value` prop is defined in form-text mixin\n type: {\n type: String,\n default: 'text',\n validator: function validator(type) {\n return arrayIncludes(TYPES, type);\n }\n },\n noWheel: {\n // Disable mousewheel to prevent wheel from\n // changing values (i.e. number/date)\n type: Boolean,\n default: false\n },\n min: {\n type: [String, Number] // default: null\n\n },\n max: {\n type: [String, Number] // default: null\n\n },\n step: {\n type: [String, Number] // default: null\n\n },\n list: {\n type: String // default: null\n\n }\n },\n computed: {\n localType: function localType() {\n // We only allow certain types\n return arrayIncludes(TYPES, this.type) ? this.type : 'text';\n },\n computedAttrs: function computedAttrs() {\n var type = this.localType,\n disabled = this.disabled,\n placeholder = this.placeholder,\n required = this.required,\n min = this.min,\n max = this.max,\n step = this.step;\n return {\n id: this.safeId(),\n name: this.name || null,\n form: this.form || null,\n type: type,\n disabled: disabled,\n placeholder: placeholder,\n required: required,\n autocomplete: this.autocomplete || null,\n readonly: this.readonly || this.plaintext,\n min: min,\n max: max,\n step: step,\n list: type !== 'password' ? this.list : null,\n 'aria-required': required ? 'true' : null,\n 'aria-invalid': this.computedAriaInvalid\n };\n },\n computedListeners: function computedListeners() {\n return _objectSpread(_objectSpread({}, this.bvListeners), {}, {\n input: this.onInput,\n change: this.onChange,\n blur: this.onBlur\n });\n }\n },\n watch: {\n noWheel: function noWheel(newVal) {\n this.setWheelStopper(newVal);\n }\n },\n mounted: function mounted() {\n this.setWheelStopper(this.noWheel);\n },\n\n /* istanbul ignore next */\n deactivated: function deactivated() {\n // Turn off listeners when keep-alive component deactivated\n\n /* istanbul ignore next */\n this.setWheelStopper(false);\n },\n\n /* istanbul ignore next */\n activated: function activated() {\n // Turn on listeners (if no-wheel) when keep-alive component activated\n\n /* istanbul ignore next */\n this.setWheelStopper(this.noWheel);\n },\n beforeDestroy: function beforeDestroy() {\n /* istanbul ignore next */\n this.setWheelStopper(false);\n },\n methods: {\n setWheelStopper: function setWheelStopper(on) {\n var input = this.$el; // We use native events, so that we don't interfere with propagation\n\n eventOnOff(on, input, 'focus', this.onWheelFocus);\n eventOnOff(on, input, 'blur', this.onWheelBlur);\n\n if (!on) {\n eventOff(document, 'wheel', this.stopWheel);\n }\n },\n onWheelFocus: function onWheelFocus() {\n eventOn(document, 'wheel', this.stopWheel);\n },\n onWheelBlur: function onWheelBlur() {\n eventOff(document, 'wheel', this.stopWheel);\n },\n stopWheel: function stopWheel(evt) {\n evt.preventDefault();\n attemptBlur(this.$el);\n }\n },\n render: function render(h) {\n return h('input', {\n ref: 'input',\n class: this.computedClass,\n attrs: this.computedAttrs,\n domProps: {\n value: this.localValue\n },\n on: this.computedListeners\n });\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-input/form-input.js\n// module id = 172\n// module chunks = 0","// @vue/component\nexport default {\n computed: {\n selectionStart: {\n // Expose selectionStart for formatters, etc\n cache: false,\n\n /* istanbul ignore next */\n get: function get() {\n return this.$refs.input.selectionStart;\n },\n\n /* istanbul ignore next */\n set: function set(val) {\n this.$refs.input.selectionStart = val;\n }\n },\n selectionEnd: {\n // Expose selectionEnd for formatters, etc\n cache: false,\n\n /* istanbul ignore next */\n get: function get() {\n return this.$refs.input.selectionEnd;\n },\n\n /* istanbul ignore next */\n set: function set(val) {\n this.$refs.input.selectionEnd = val;\n }\n },\n selectionDirection: {\n // Expose selectionDirection for formatters, etc\n cache: false,\n\n /* istanbul ignore next */\n get: function get() {\n return this.$refs.input.selectionDirection;\n },\n\n /* istanbul ignore next */\n set: function set(val) {\n this.$refs.input.selectionDirection = val;\n }\n }\n },\n methods: {\n /* istanbul ignore next */\n select: function select() {\n var _this$$refs$input;\n\n // For external handler that may want a select() method\n (_this$$refs$input = this.$refs.input).select.apply(_this$$refs$input, arguments);\n },\n\n /* istanbul ignore next */\n setSelectionRange: function setSelectionRange() {\n var _this$$refs$input2;\n\n // For external handler that may want a setSelectionRange(a,b,c) method\n (_this$$refs$input2 = this.$refs.input).setSelectionRange.apply(_this$$refs$input2, arguments);\n },\n\n /* istanbul ignore next */\n setRangeText: function setRangeText() {\n var _this$$refs$input3;\n\n // For external handler that may want a setRangeText(a,b,c) method\n (_this$$refs$input3 = this.$refs.input).setRangeText.apply(_this$$refs$input3, arguments);\n }\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/mixins/form-selection.js\n// module id = 173\n// module chunks = 0","import { attemptBlur, attemptFocus } from '../utils/dom';\nimport { isFunction } from '../utils/inspect';\nimport { mathMax } from '../utils/math';\nimport { toInteger, toFloat } from '../utils/number';\nimport { toString } from '../utils/string'; // @vue/component\n\nexport default {\n model: {\n prop: 'value',\n event: 'update'\n },\n props: {\n value: {\n type: [String, Number],\n default: ''\n },\n ariaInvalid: {\n type: [Boolean, String],\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n plaintext: {\n type: Boolean,\n default: false\n },\n autocomplete: {\n type: String // default: null\n\n },\n placeholder: {\n type: String // default: null\n\n },\n formatter: {\n type: Function // default: null\n\n },\n lazyFormatter: {\n type: Boolean,\n default: false\n },\n trim: {\n type: Boolean,\n default: false\n },\n number: {\n type: Boolean,\n default: false\n },\n lazy: {\n // Only update the `v-model` on blur/change events\n type: Boolean,\n default: false\n },\n debounce: {\n // Debounce timeout (in ms). Not applicable with `lazy` prop\n type: [Number, String],\n default: 0\n }\n },\n data: function data() {\n return {\n localValue: toString(this.value),\n vModelValue: this.value\n };\n },\n computed: {\n computedClass: function computedClass() {\n return [{\n // Range input needs class `custom-range`\n 'custom-range': this.type === 'range',\n // `plaintext` not supported by `type=\"range\"` or `type=\"color\"`\n 'form-control-plaintext': this.plaintext && this.type !== 'range' && this.type !== 'color',\n // `form-control` not used by `type=\"range\"` or `plaintext`\n // Always used by `type=\"color\"`\n 'form-control': !this.plaintext && this.type !== 'range' || this.type === 'color'\n }, this.sizeFormClass, this.stateClass];\n },\n computedAriaInvalid: function computedAriaInvalid() {\n if (!this.ariaInvalid || this.ariaInvalid === 'false') {\n // `this.ariaInvalid` is `null` or `false` or 'false'\n return this.computedState === false ? 'true' : null;\n }\n\n if (this.ariaInvalid === true) {\n // User wants explicit `:aria-invalid=\"true\"`\n return 'true';\n } // Most likely a string value (which could be the string 'true')\n\n\n return this.ariaInvalid;\n },\n computedDebounce: function computedDebounce() {\n // Ensure we have a positive number equal to or greater than 0\n return mathMax(toInteger(this.debounce, 0), 0);\n },\n hasFormatter: function hasFormatter() {\n return isFunction(this.formatter);\n }\n },\n watch: {\n value: function value(newVal) {\n var stringifyValue = toString(newVal);\n\n if (stringifyValue !== this.localValue && newVal !== this.vModelValue) {\n // Clear any pending debounce timeout, as we are overwriting the user input\n this.clearDebounce(); // Update the local values\n\n this.localValue = stringifyValue;\n this.vModelValue = newVal;\n }\n }\n },\n created: function created() {\n // Create private non-reactive props\n this.$_inputDebounceTimer = null;\n },\n mounted: function mounted() {\n // Set up destroy handler\n this.$on('hook:beforeDestroy', this.clearDebounce); // Preset the internal state\n\n var value = this.value;\n var stringifyValue = toString(value);\n /* istanbul ignore next */\n\n if (stringifyValue !== this.localValue && value !== this.vModelValue) {\n this.localValue = stringifyValue;\n this.vModelValue = value;\n }\n },\n methods: {\n clearDebounce: function clearDebounce() {\n clearTimeout(this.$_inputDebounceTimer);\n this.$_inputDebounceTimer = null;\n },\n formatValue: function formatValue(value, evt) {\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n value = toString(value);\n\n if (this.hasFormatter && (!this.lazyFormatter || force)) {\n value = this.formatter(value, evt);\n }\n\n return value;\n },\n modifyValue: function modifyValue(value) {\n // Emulate `.trim` modifier behaviour\n if (this.trim) {\n value = value.trim();\n } // Emulate `.number` modifier behaviour\n\n\n if (this.number) {\n value = toFloat(value, value);\n }\n\n return value;\n },\n updateValue: function updateValue(value) {\n var _this = this;\n\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var lazy = this.lazy;\n\n if (lazy && !force) {\n return;\n }\n\n value = this.modifyValue(value);\n\n if (value !== this.vModelValue) {\n this.clearDebounce();\n\n var doUpdate = function doUpdate() {\n _this.vModelValue = value;\n\n _this.$emit('update', value);\n };\n\n var debounce = this.computedDebounce; // Only debounce the value update when a value greater than `0`\n // is set and we are not in lazy mode or this is a forced update\n\n if (debounce > 0 && !lazy && !force) {\n this.$_inputDebounceTimer = setTimeout(doUpdate, debounce);\n } else {\n // Immediately update the v-model\n doUpdate();\n }\n } else if (this.hasFormatter) {\n // When the `vModelValue` hasn't changed but the actual input value\n // is out of sync, make sure to change it to the given one\n // Usually caused by browser autocomplete and how it triggers the\n // change or input event, or depending on the formatter function\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/2657\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/3498\n\n /* istanbul ignore next: hard to test */\n var $input = this.$refs.input;\n /* istanbul ignore if: hard to test out of sync value */\n\n if ($input && value !== $input.value) {\n $input.value = value;\n }\n }\n },\n onInput: function onInput(evt) {\n // `evt.target.composing` is set by Vue\n // https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/directives/model.js\n // TODO: Is this needed now with the latest Vue?\n\n /* istanbul ignore if: hard to test composition events */\n if (evt.target.composing) {\n return;\n }\n\n var value = evt.target.value;\n var formattedValue = this.formatValue(value, evt); // Exit when the `formatter` function strictly returned `false`\n // or prevented the input event\n\n /* istanbul ignore next */\n\n if (formattedValue === false || evt.defaultPrevented) {\n evt.preventDefault();\n return;\n }\n\n this.localValue = formattedValue;\n this.updateValue(formattedValue);\n this.$emit('input', formattedValue);\n },\n onChange: function onChange(evt) {\n var value = evt.target.value;\n var formattedValue = this.formatValue(value, evt); // Exit when the `formatter` function strictly returned `false`\n // or prevented the input event\n\n /* istanbul ignore next */\n\n if (formattedValue === false || evt.defaultPrevented) {\n evt.preventDefault();\n return;\n }\n\n this.localValue = formattedValue;\n this.updateValue(formattedValue, true);\n this.$emit('change', formattedValue);\n },\n onBlur: function onBlur(evt) {\n // Apply the `localValue` on blur to prevent cursor jumps\n // on mobile browsers (e.g. caused by autocomplete)\n var value = evt.target.value;\n var formattedValue = this.formatValue(value, evt, true);\n\n if (formattedValue !== false) {\n // We need to use the modified value here to apply the\n // `.trim` and `.number` modifiers properly\n this.localValue = toString(this.modifyValue(formattedValue)); // We pass the formatted value here since the `updateValue` method\n // handles the modifiers itself\n\n this.updateValue(formattedValue, true);\n } // Emit native blur event\n\n\n this.$emit('blur', evt);\n },\n focus: function focus() {\n // For external handler that may want a focus method\n if (!this.disabled) {\n attemptFocus(this.$el);\n }\n },\n blur: function blur() {\n // For external handler that may want a blur method\n if (!this.disabled) {\n attemptBlur(this.$el);\n }\n }\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/mixins/form-text.js\n// module id = 174\n// module chunks = 0","// @vue/component\nexport default {\n computed: {\n validity: {\n // Expose validity property\n cache: false,\n\n /* istanbul ignore next */\n get: function get() {\n return this.$refs.input.validity;\n }\n },\n validationMessage: {\n // Expose validationMessage property\n cache: false,\n\n /* istanbul ignore next */\n get: function get() {\n return this.$refs.input.validationMessage;\n }\n },\n willValidate: {\n // Expose willValidate property\n cache: false,\n\n /* istanbul ignore next */\n get: function get() {\n return this.$refs.input.willValidate;\n }\n }\n },\n methods: {\n /* istanbul ignore next */\n setCustomValidity: function setCustomValidity() {\n var _this$$refs$input;\n\n // For external handler that may want a setCustomValidity(...) method\n return (_this$$refs$input = this.$refs.input).setCustomValidity.apply(_this$$refs$input, arguments);\n },\n\n /* istanbul ignore next */\n checkValidity: function checkValidity() {\n var _this$$refs$input2;\n\n // For external handler that may want a checkValidity(...) method\n return (_this$$refs$input2 = this.$refs.input).checkValidity.apply(_this$$refs$input2, arguments);\n },\n\n /* istanbul ignore next */\n reportValidity: function reportValidity() {\n var _this$$refs$input3;\n\n // For external handler that may want a reportValidity(...) method\n return (_this$$refs$input3 = this.$refs.input).reportValidity.apply(_this$$refs$input3, arguments);\n }\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/mixins/form-validity.js\n// module id = 175\n// module chunks = 0","import { BFormRadio } from './form-radio';\nimport { BFormRadioGroup } from './form-radio-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormRadioPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormRadio: BFormRadio,\n BRadio: BFormRadio,\n BFormRadioGroup: BFormRadioGroup,\n BRadioGroup: BFormRadioGroup\n }\n});\nexport { FormRadioPlugin, BFormRadio, BFormRadioGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-radio/index.js\n// module id = 176\n// module chunks = 0","import Vue from '../../utils/vue';\nimport idMixin from '../../mixins/id';\nimport formMixin from '../../mixins/form';\nimport formOptionsMixin from '../../mixins/form-options';\nimport formRadioCheckGroupMixin from '../../mixins/form-radio-check-group';\nimport formSizeMixin from '../../mixins/form-size';\nimport formStateMixin from '../../mixins/form-state';\nexport var props = {\n checked: {\n // type: [String, Number, Boolean, Object],\n default: null\n }\n}; // @vue/component\n\nexport var BFormRadioGroup = /*#__PURE__*/Vue.extend({\n name: 'BFormRadioGroup',\n mixins: [idMixin, formMixin, formRadioCheckGroupMixin, // Includes render function\n formOptionsMixin, formSizeMixin, formStateMixin],\n provide: function provide() {\n return {\n bvRadioGroup: this\n };\n },\n props: props,\n data: function data() {\n return {\n localChecked: this.checked\n };\n },\n computed: {\n isRadioGroup: function isRadioGroup() {\n return true;\n }\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-radio/form-radio-group.js\n// module id = 177\n// module chunks = 0","import { BFormRating } from './form-rating';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormRatingPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormRating: BFormRating,\n BRating: BFormRating\n }\n});\nexport { FormRatingPlugin, BFormRating };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-rating/index.js\n// module id = 178\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { arrayIncludes, concat } from '../../utils/array';\nimport { getComponentConfig } from '../../utils/config';\nimport { attemptBlur, attemptFocus } from '../../utils/dom';\nimport { isNull } from '../../utils/inspect';\nimport { isLocaleRTL } from '../../utils/locale';\nimport { mathMax, mathMin } from '../../utils/math';\nimport { toInteger, toFloat } from '../../utils/number';\nimport { toString } from '../../utils/string';\nimport identity from '../../utils/identity';\nimport KeyCodes from '../../utils/key-codes';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BIcon } from '../../icons/icon';\nimport { BIconStar, BIconStarHalf, BIconStarFill, BIconX } from '../../icons/icons'; // --- Constants ---\n\nvar NAME = 'BFormRating';\nvar MIN_STARS = 3;\nvar DEFAULT_STARS = 5;\nvar LEFT = KeyCodes.LEFT,\n RIGHT = KeyCodes.RIGHT,\n UP = KeyCodes.UP,\n DOWN = KeyCodes.DOWN; // --- Private helper component ---\n// @vue/component\n\nvar BVFormRatingStar = Vue.extend({\n name: 'BVFormRatingStar',\n mixins: [normalizeSlotMixin],\n props: {\n rating: {\n type: Number,\n default: 0\n },\n star: {\n type: Number,\n default: 0\n },\n focused: {\n // If parent is focused\n type: Boolean,\n default: false\n },\n variant: {\n type: String // default: null\n\n },\n disabled: {\n type: Boolean,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n hasClear: {\n type: Boolean,\n default: false\n }\n },\n methods: {\n onClick: function onClick(evt) {\n if (!this.disabled && !this.readonly) {\n evt.preventDefault();\n this.$emit('selected', this.star);\n }\n }\n },\n render: function render(h) {\n var rating = this.rating,\n star = this.star,\n focused = this.focused,\n hasClear = this.hasClear,\n variant = this.variant,\n disabled = this.disabled,\n readonly = this.readonly;\n var minStar = hasClear ? 0 : 1;\n var type = rating >= star ? 'full' : rating >= star - 0.5 ? 'half' : 'empty';\n var slotScope = {\n variant: variant,\n disabled: disabled,\n readonly: readonly\n };\n return h('span', {\n staticClass: 'b-rating-star',\n class: {\n // When not hovered, we use this class to focus the current (or first) star\n focused: focused && rating === star || !toInteger(rating) && star === minStar,\n // We add type classes to we can handle RTL styling\n 'b-rating-star-empty': type === 'empty',\n 'b-rating-star-half': type === 'half',\n 'b-rating-star-full': type === 'full'\n },\n attrs: {\n tabindex: !disabled && !readonly ? '-1' : null\n },\n on: {\n click: this.onClick\n }\n }, [h('span', {\n staticClass: 'b-rating-icon'\n }, [this.normalizeSlot(type, slotScope)])]);\n }\n}); // --- Utility methods ---\n\nvar computeStars = function computeStars(stars) {\n return mathMax(MIN_STARS, toInteger(stars, DEFAULT_STARS));\n};\n\nvar clampValue = function clampValue(value, min, max) {\n return mathMax(mathMin(value, max), min);\n}; // --- BFormRating ---\n// @vue/component\n\n\nexport var BFormRating = /*#__PURE__*/Vue.extend({\n name: NAME,\n components: {\n BIconStar: BIconStar,\n BIconStarHalf: BIconStarHalf,\n BIconStarFill: BIconStarFill,\n BIconX: BIconX\n },\n mixins: [idMixin],\n model: {\n prop: 'value',\n event: 'change'\n },\n props: {\n value: {\n type: [Number, String],\n default: null\n },\n stars: {\n type: [Number, String],\n default: DEFAULT_STARS,\n validator: function validator(val) {\n return toInteger(val) >= MIN_STARS;\n }\n },\n variant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'variant');\n }\n },\n color: {\n // CSS color string (overrides variant)\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'color');\n }\n },\n showValue: {\n type: Boolean,\n default: false\n },\n showValueMax: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n size: {\n type: String // default: null\n\n },\n name: {\n type: String // default: null\n\n },\n form: {\n type: String // default: null\n\n },\n noBorder: {\n type: Boolean,\n default: false\n },\n inline: {\n type: Boolean,\n default: false\n },\n precision: {\n type: [Number, String],\n default: null\n },\n iconEmpty: {\n type: String,\n default: 'star'\n },\n iconHalf: {\n type: String,\n default: 'star-half'\n },\n iconFull: {\n type: String,\n default: 'star-fill'\n },\n iconClear: {\n type: String,\n default: 'x'\n },\n locale: {\n // Locale for the formatted value (if shown)\n // Defaults to the browser locale. Falls back to `en`\n type: [String, Array] // default: undefined\n\n },\n showClear: {\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n var value = toFloat(this.value, null);\n var stars = computeStars(this.stars);\n return {\n localValue: isNull(value) ? null : clampValue(value, 0, stars),\n hasFocus: false\n };\n },\n computed: {\n computedStars: function computedStars() {\n return computeStars(this.stars);\n },\n computedRating: function computedRating() {\n var value = toFloat(this.localValue, 0);\n var precision = toInteger(this.precision, 3); // We clamp the value between `0` and stars\n\n return clampValue(toFloat(value.toFixed(precision)), 0, this.computedStars);\n },\n computedLocale: function computedLocale() {\n var locales = concat(this.locale).filter(identity);\n var nf = new Intl.NumberFormat(locales);\n return nf.resolvedOptions().locale;\n },\n isInteractive: function isInteractive() {\n return !this.disabled && !this.readonly;\n },\n isRTL: function isRTL() {\n return isLocaleRTL(this.computedLocale);\n },\n formattedRating: function formattedRating() {\n var precision = toInteger(this.precision);\n var showValueMax = this.showValueMax;\n var locale = this.computedLocale;\n var formatOptions = {\n notation: 'standard',\n minimumFractionDigits: isNaN(precision) ? 0 : precision,\n maximumFractionDigits: isNaN(precision) ? 3 : precision\n };\n var stars = this.computedStars.toLocaleString(locale);\n var value = this.localValue;\n value = isNull(value) ? showValueMax ? '-' : '' : value.toLocaleString(locale, formatOptions);\n return showValueMax ? \"\".concat(value, \"/\").concat(stars) : value;\n }\n },\n watch: {\n value: function value(newVal, oldVal) {\n if (newVal !== oldVal) {\n var value = toFloat(newVal, null);\n this.localValue = isNull(value) ? null : clampValue(value, 0, this.computedStars);\n }\n },\n localValue: function localValue(newVal, oldVal) {\n if (newVal !== oldVal && newVal !== (this.value || 0)) {\n this.$emit('change', newVal || null);\n }\n },\n disabled: function disabled(newVal) {\n if (newVal) {\n this.hasFocus = false;\n this.blur();\n }\n }\n },\n methods: {\n // --- Public methods ---\n focus: function focus() {\n if (!this.disabled) {\n attemptFocus(this.$el);\n }\n },\n blur: function blur() {\n if (!this.disabled) {\n attemptBlur(this.$el);\n }\n },\n // --- Private methods ---\n onKeydown: function onKeydown(evt) {\n var keyCode = evt.keyCode;\n\n if (this.isInteractive && arrayIncludes([LEFT, DOWN, RIGHT, UP], keyCode)) {\n evt.preventDefault();\n var value = toInteger(this.localValue, 0);\n var min = this.showClear ? 0 : 1;\n var stars = this.computedStars; // In RTL mode, LEFT/RIGHT are swapped\n\n var amountRtl = this.isRTL ? -1 : 1;\n\n if (keyCode === LEFT) {\n this.localValue = clampValue(value - amountRtl, min, stars) || null;\n } else if (keyCode === RIGHT) {\n this.localValue = clampValue(value + amountRtl, min, stars);\n } else if (keyCode === DOWN) {\n this.localValue = clampValue(value - 1, min, stars) || null;\n } else if (keyCode === UP) {\n this.localValue = clampValue(value + 1, min, stars);\n }\n }\n },\n onSelected: function onSelected(value) {\n if (this.isInteractive) {\n this.localValue = value;\n }\n },\n onFocus: function onFocus(evt) {\n this.hasFocus = !this.isInteractive ? false : evt.type === 'focus';\n },\n // --- Render methods ---\n renderIcon: function renderIcon(icon) {\n return this.$createElement(BIcon, {\n props: {\n icon: icon,\n variant: this.disabled || this.color ? null : this.variant || null\n }\n });\n },\n iconEmptyFn: function iconEmptyFn() {\n return this.renderIcon(this.iconEmpty);\n },\n iconHalfFn: function iconHalfFn() {\n return this.renderIcon(this.iconHalf);\n },\n iconFullFn: function iconFullFn() {\n return this.renderIcon(this.iconFull);\n },\n iconClearFn: function iconClearFn() {\n return this.$createElement(BIcon, {\n props: {\n icon: this.iconClear\n }\n });\n }\n },\n render: function render(h) {\n var _this = this,\n _class;\n\n var disabled = this.disabled,\n readonly = this.readonly,\n size = this.size,\n name = this.name,\n form = this.form,\n inline = this.inline,\n variant = this.variant,\n color = this.color,\n noBorder = this.noBorder,\n hasFocus = this.hasFocus,\n computedRating = this.computedRating,\n computedStars = this.computedStars,\n formattedRating = this.formattedRating,\n showClear = this.showClear,\n isRTL = this.isRTL,\n isInteractive = this.isInteractive,\n $scopedSlots = this.$scopedSlots;\n var $content = [];\n\n if (showClear && !disabled && !readonly) {\n var $icon = h('span', {\n staticClass: 'b-rating-icon'\n }, [($scopedSlots['icon-clear'] || this.iconClearFn)()]);\n $content.push(h('span', {\n staticClass: 'b-rating-star b-rating-star-clear flex-grow-1',\n class: {\n focused: hasFocus && computedRating === 0\n },\n attrs: {\n tabindex: isInteractive ? '-1' : null\n },\n on: {\n click: function click() {\n return _this.onSelected(null);\n }\n },\n key: 'clear'\n }, [$icon]));\n }\n\n for (var index = 0; index < computedStars; index++) {\n var value = index + 1;\n $content.push(h(BVFormRatingStar, {\n staticClass: 'flex-grow-1',\n style: color && !disabled ? {\n color: color\n } : {},\n props: {\n rating: computedRating,\n star: value,\n variant: disabled ? null : variant || null,\n disabled: disabled,\n readonly: readonly,\n focused: hasFocus,\n hasClear: showClear\n },\n on: {\n selected: this.onSelected\n },\n scopedSlots: {\n empty: $scopedSlots['icon-empty'] || this.iconEmptyFn,\n half: $scopedSlots['icon-half'] || this.iconHalfFn,\n full: $scopedSlots['icon-full'] || this.iconFullFn\n },\n key: index\n }));\n }\n\n if (name) {\n $content.push(h('input', {\n attrs: {\n type: 'hidden',\n value: isNull(this.localValue) ? '' : computedRating,\n name: name,\n form: form || null\n },\n key: 'hidden'\n }));\n }\n\n if (this.showValue) {\n $content.push(h('b', {\n staticClass: 'b-rating-value flex-grow-1',\n attrs: {\n 'aria-hidden': 'true'\n },\n key: 'value'\n }, toString(formattedRating)));\n }\n\n return h('output', {\n staticClass: 'b-rating form-control align-items-center',\n class: (_class = {}, _defineProperty(_class, \"form-control-\".concat(size), !!size), _defineProperty(_class, 'd-inline-flex', inline), _defineProperty(_class, 'd-flex', !inline), _defineProperty(_class, 'border-0', noBorder), _defineProperty(_class, \"disabled\", disabled), _defineProperty(_class, \"readonly\", !disabled && readonly), _class),\n attrs: {\n id: this.safeId(),\n dir: isRTL ? 'rtl' : 'ltr',\n tabindex: disabled ? null : '0',\n disabled: disabled,\n role: 'slider',\n 'aria-disabled': disabled ? 'true' : null,\n 'aria-readonly': !disabled && readonly ? 'true' : null,\n 'aria-live': 'off',\n 'aria-valuemin': showClear ? '0' : '1',\n 'aria-valuemax': toString(computedStars),\n 'aria-valuenow': computedRating ? toString(computedRating) : null\n },\n on: {\n keydown: this.onKeydown,\n focus: this.onFocus,\n blur: this.onFocus\n }\n }, $content);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-rating/form-rating.js\n// module id = 179\n// module chunks = 0","import { BFormSelect } from './form-select';\nimport { BFormSelectOption } from './form-select-option';\nimport { BFormSelectOptionGroup } from './form-select-option-group';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormSelectPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormSelect: BFormSelect,\n BFormSelectOption: BFormSelectOption,\n BFormSelectOptionGroup: BFormSelectOptionGroup,\n BSelect: BFormSelect,\n BSelectOption: BFormSelectOption,\n BSelectOptionGroup: BFormSelectOptionGroup\n }\n});\nexport { FormSelectPlugin, BFormSelect, BFormSelectOption, BFormSelectOptionGroup };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-select/index.js\n// module id = 180\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { from as arrayFrom, isArray } from '../../utils/array';\nimport { attemptBlur, attemptFocus } from '../../utils/dom';\nimport { htmlOrText } from '../../utils/html';\nimport formCustomMixin from '../../mixins/form-custom';\nimport formMixin from '../../mixins/form';\nimport formSizeMixin from '../../mixins/form-size';\nimport formStateMixin from '../../mixins/form-state';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport optionsMixin from './helpers/mixin-options';\nimport { BFormSelectOption } from './form-select-option';\nimport { BFormSelectOptionGroup } from './form-select-option-group'; // @vue/component\n\nexport var BFormSelect = /*#__PURE__*/Vue.extend({\n name: 'BFormSelect',\n mixins: [idMixin, normalizeSlotMixin, formMixin, formSizeMixin, formStateMixin, formCustomMixin, optionsMixin],\n model: {\n prop: 'value',\n event: 'input'\n },\n props: {\n value: {// type: [Object, Array, String, Number, Boolean],\n // default: undefined\n },\n multiple: {\n type: Boolean,\n default: false\n },\n selectSize: {\n // Browsers default size to 0, which shows 4 rows in most browsers in multiple mode\n // Size of 1 can bork out Firefox\n type: Number,\n default: 0\n },\n ariaInvalid: {\n type: [Boolean, String],\n default: false\n }\n },\n data: function data() {\n return {\n localValue: this.value\n };\n },\n computed: {\n computedSelectSize: function computedSelectSize() {\n // Custom selects with a size of zero causes the arrows to be hidden,\n // so dont render the size attribute in this case\n return !this.plain && this.selectSize === 0 ? null : this.selectSize;\n },\n inputClass: function inputClass() {\n return [this.plain ? 'form-control' : 'custom-select', this.size && this.plain ? \"form-control-\".concat(this.size) : null, this.size && !this.plain ? \"custom-select-\".concat(this.size) : null, this.stateClass];\n },\n computedAriaInvalid: function computedAriaInvalid() {\n if (this.ariaInvalid === true || this.ariaInvalid === 'true') {\n return 'true';\n }\n\n return this.stateClass === 'is-invalid' ? 'true' : null;\n }\n },\n watch: {\n value: function value(newVal) {\n this.localValue = newVal;\n },\n localValue: function localValue() {\n this.$emit('input', this.localValue);\n }\n },\n methods: {\n focus: function focus() {\n attemptFocus(this.$refs.input);\n },\n blur: function blur() {\n attemptBlur(this.$refs.input);\n },\n onChange: function onChange(evt) {\n var _this = this;\n\n var target = evt.target;\n var selectedVal = arrayFrom(target.options).filter(function (o) {\n return o.selected;\n }).map(function (o) {\n return '_value' in o ? o._value : o.value;\n });\n this.localValue = target.multiple ? selectedVal : selectedVal[0];\n this.$nextTick(function () {\n _this.$emit('change', _this.localValue);\n });\n }\n },\n render: function render(h) {\n var name = this.name,\n disabled = this.disabled,\n required = this.required,\n size = this.computedSelectSize,\n value = this.localValue;\n var $options = this.formOptions.map(function (option, index) {\n var value = option.value,\n label = option.label,\n options = option.options,\n disabled = option.disabled;\n var key = \"option_\".concat(index);\n return isArray(options) ? h(BFormSelectOptionGroup, {\n props: {\n label: label,\n options: options\n },\n key: key\n }) : h(BFormSelectOption, {\n props: {\n value: value,\n disabled: disabled\n },\n domProps: htmlOrText(option.html, option.text),\n key: key\n });\n });\n return h('select', {\n class: this.inputClass,\n attrs: {\n id: this.safeId(),\n name: name,\n form: this.form || null,\n multiple: this.multiple || null,\n size: size,\n disabled: disabled,\n required: required,\n 'aria-required': required ? 'true' : null,\n 'aria-invalid': this.computedAriaInvalid\n },\n on: {\n change: this.onChange\n },\n directives: [{\n name: 'model',\n value: value\n }],\n ref: 'input'\n }, [this.normalizeSlot('first'), $options, this.normalizeSlot('default')]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-select/form-select.js\n// module id = 181\n// module chunks = 0","import { BFormSpinbutton } from './form-spinbutton';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormSpinbuttonPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormSpinbutton: BFormSpinbutton,\n BSpinbutton: BFormSpinbutton\n }\n});\nexport { FormSpinbuttonPlugin, BFormSpinbutton };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-spinbutton/index.js\n// module id = 182\n// module chunks = 0","import { BFormTags } from './form-tags';\nimport { BFormTag } from './form-tag';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormTagsPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormTags: BFormTags,\n BTags: BFormTags,\n BFormTag: BFormTag,\n BTag: BFormTag\n }\n});\nexport { FormTagsPlugin, BFormTags, BFormTag };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-tags/index.js\n// module id = 183\n// module chunks = 0","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\n// Tagged input form control\n// Based loosely on https://adamwathan.me/renderless-components-in-vuejs/\nimport Vue from '../../utils/vue';\nimport KeyCodes from '../../utils/key-codes';\nimport cssEscape from '../../utils/css-escape';\nimport identity from '../../utils/identity';\nimport looseEqual from '../../utils/loose-equal';\nimport { arrayIncludes, concat } from '../../utils/array';\nimport { getComponentConfig } from '../../utils/config';\nimport { attemptBlur, attemptFocus, closest, isActiveElement, matches, requestAF, select } from '../../utils/dom';\nimport { isEvent, isFunction, isString } from '../../utils/inspect';\nimport { escapeRegExp, toString, trim, trimLeft } from '../../utils/string';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BButton } from '../button/button';\nimport { BFormInvalidFeedback } from '../form/form-invalid-feedback';\nimport { BFormText } from '../form/form-text';\nimport { BFormTag } from './form-tag'; // --- Constants ---\n\nvar NAME = 'BFormTags'; // Supported input types (for built in input)\n\nvar TYPES = ['text', 'email', 'tel', 'url', 'number']; // Pre-compiled regular expressions for performance reasons\n\nvar RX_SPACES = /[\\s\\uFEFF\\xA0]+/g; // KeyCode constants\n\nvar ENTER = KeyCodes.ENTER,\n BACKSPACE = KeyCodes.BACKSPACE,\n DELETE = KeyCodes.DELETE; // --- Utility methods ---\n// Escape special chars in string and replace\n// contiguous spaces with a whitespace match\n\nvar escapeRegExpChars = function escapeRegExpChars(str) {\n return escapeRegExp(str).replace(RX_SPACES, '\\\\s');\n}; // Remove leading/trailing spaces from array of tags and remove duplicates\n\n\nvar cleanTags = function cleanTags(tags) {\n return concat(tags).map(function (tag) {\n return trim(toString(tag));\n }).filter(function (tag, index, arr) {\n return tag.length > 0 && arr.indexOf(tag) === index;\n });\n}; // Processes an input/change event, normalizing string or event argument\n\n\nvar processEventValue = function processEventValue(evt) {\n return isString(evt) ? evt : isEvent(evt) ? evt.target.value || '' : '';\n}; // Returns a fresh empty `tagsState` object\n\n\nvar cleanTagsState = function cleanTagsState() {\n return {\n all: [],\n valid: [],\n invalid: [],\n duplicate: []\n };\n}; // @vue/component\n\n\nexport var BFormTags = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [idMixin, normalizeSlotMixin],\n model: {\n // Even though this is the default that Vue assumes, we need\n // to add it for the docs to reflect that this is the model\n prop: 'value',\n event: 'input'\n },\n props: {\n inputId: {\n type: String // default: null\n\n },\n placeholder: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'placeholder');\n }\n },\n disabled: {\n type: Boolean,\n default: false\n },\n name: {\n type: String // default: null\n\n },\n form: {\n type: String // default: null\n\n },\n autofocus: {\n type: Boolean,\n default: false\n },\n state: {\n // Tri-state: `true`, `false`, `null`\n type: Boolean,\n default: null\n },\n size: {\n type: String // default: null\n\n },\n inputType: {\n type: String,\n default: 'text',\n validator: function validator(type) {\n return arrayIncludes(TYPES, type);\n }\n },\n inputClass: {\n type: [String, Array, Object] // default: null\n\n },\n inputAttrs: {\n // Additional attributes to add to the input element\n type: Object,\n default: function _default() {\n return {};\n }\n },\n addButtonText: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'addButtonText');\n }\n },\n addButtonVariant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'addButtonVariant');\n }\n },\n tagVariant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'tagVariant');\n }\n },\n tagClass: {\n type: [String, Array, Object] // default: null\n\n },\n tagPills: {\n type: Boolean,\n default: false\n },\n tagRemoveLabel: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'tagRemoveLabel');\n }\n },\n tagRemovedLabel: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'tagRemovedLabel');\n }\n },\n tagValidator: {\n type: Function // default: null\n\n },\n duplicateTagText: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'duplicateTagText');\n }\n },\n invalidTagText: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'invalidTagText');\n }\n },\n separator: {\n // Character (or characters) that trigger adding tags\n type: [String, Array] // default: null\n\n },\n removeOnDelete: {\n // Enable deleting last tag in list when BACKSPACE is\n // pressed and input is empty\n type: Boolean,\n default: false\n },\n addOnChange: {\n // Enable change event triggering tag addition\n // Handy if using ` elements\n this.newTag = '';\n } else {\n var invalidAndDuplicates = [].concat(_toConsumableArray(parsed.invalid), _toConsumableArray(parsed.duplicate));\n this.newTag = parsed.all.filter(function (tag) {\n return arrayIncludes(invalidAndDuplicates, tag);\n }).join(this.computedJoiner).concat(invalidAndDuplicates.length > 0 ? this.computedJoiner.charAt(0) : '');\n }\n }\n\n if (parsed.valid.length > 0) {\n // We add the new tags in one atomic operation\n // to trigger reactivity once (instead of once per tag)\n // We do this after we update the new tag input value\n // `concat()` can be faster than array spread, when both args are arrays\n this.tags = concat(this.tags, parsed.valid);\n }\n\n this.tagsState = parsed; // Attempt to re-focus the input (specifically for when using the Add\n // button, as the button disappears after successfully adding a tag\n\n this.focus();\n },\n removeTag: function removeTag(tag) {\n var _this2 = this;\n\n /* istanbul ignore next */\n if (this.disabled) {\n return;\n } // TODO:\n // Add `onRemoveTag(tag)` user method, which if returns `false`\n // will prevent the tag from being removed (i.e. confirmation)\n // Or emit cancelable `BvEvent`\n\n\n this.tags = this.tags.filter(function (t) {\n return t !== tag;\n }); // Return focus to the input (if possible)\n\n this.$nextTick(function () {\n _this2.focus();\n });\n },\n // --- Input element event handlers ---\n onInputInput: function onInputInput(evt) {\n /* istanbul ignore next: hard to test composition events */\n if (this.disabled || isEvent(evt) && evt.target.composing) {\n // `evt.target.composing` is set by Vue (`v-model` directive)\n // https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/directives/model.js\n return;\n }\n\n var newTag = processEventValue(evt);\n var separatorRe = this.computedSeparatorRegExp;\n\n if (this.newTag !== newTag) {\n this.newTag = newTag;\n } // We ignore leading whitespace for the following\n\n\n newTag = trimLeft(newTag);\n\n if (separatorRe && separatorRe.test(newTag.slice(-1))) {\n // A trailing separator character was entered, so add the tag(s)\n // Note: More than one tag on input event is possible via copy/paste\n this.addTag();\n } else {\n // Validate (parse tags) on input event\n this.tagsState = newTag === '' ? cleanTagsState() : this.parseTags(newTag);\n }\n },\n onInputChange: function onInputChange(evt) {\n // Change is triggered on `` blur, or ` v-bind:inputAttrs\n inputAttrs: this.computedInputAttrs,\n // v-on:inputHandlers\n inputHandlers: this.computedInputHandlers,\n // :id=\"inputId\"\n inputId: this.computedInputId,\n // Invalid/Duplicate state information\n invalidTags: this.invalidTags.slice(),\n isInvalid: this.hasInvalidTags,\n duplicateTags: this.duplicateTags.slice(),\n isDuplicate: this.hasDuplicateTags,\n // If the 'Add' button should be disabled\n disableAddButton: this.disableAddButton,\n // Pass-though values\n state: this.state,\n separator: this.separator,\n disabled: this.disabled,\n size: this.size,\n placeholder: this.placeholder,\n inputClass: this.inputClass,\n tagRemoveLabel: this.tagRemoveLabel,\n tagVariant: this.tagVariant,\n tagPills: this.tagPills,\n tagClass: this.tagClass,\n addButtonText: this.addButtonText,\n addButtonVariant: this.addButtonVariant,\n invalidTagText: this.invalidTagText,\n duplicateTagText: this.duplicateTagText\n }; // Generate the user interface\n\n var $content = this.normalizeSlot('default', scope) || this.defaultRender(scope); // Generate the `aria-live` region for the current value(s)\n\n var $output = h('output', {\n staticClass: 'sr-only',\n attrs: {\n id: this.safeId('_selected-tags_'),\n role: 'status',\n for: this.computedInputId,\n 'aria-live': this.hasFocus ? 'polite' : 'off',\n 'aria-atomic': 'true',\n 'aria-relevant': 'additions text'\n }\n }, this.tags.join(', ')); // Removed tag live region\n\n var $removed = h('div', {\n staticClass: 'sr-only',\n attrs: {\n id: this.safeId('_removed-tags_'),\n role: 'status',\n 'aria-live': this.hasFocus ? 'assertive' : 'off',\n 'aria-atomic': 'true'\n }\n }, this.removedTags.length > 0 ? \"(\".concat(this.tagRemovedLabel, \") \").concat(this.removedTags.join(', ')) : ''); // Add hidden inputs for form submission\n\n var $hidden = h();\n\n if (this.name && !this.disabled) {\n // We add hidden inputs for each tag if a name is provided\n // for native submission of forms\n $hidden = this.tags.map(function (tag) {\n return h('input', {\n key: tag,\n attrs: {\n type: 'hidden',\n value: tag,\n name: _this6.name,\n form: _this6.form || null\n }\n });\n });\n } // Return the rendered output\n\n\n return h('div', {\n staticClass: 'b-form-tags form-control h-auto',\n class: _defineProperty({\n focus: this.hasFocus && !this.noOuterFocus && !this.disabled,\n disabled: this.disabled,\n 'is-valid': this.state === true,\n 'is-invalid': this.state === false\n }, \"form-control-\".concat(this.size), this.size),\n attrs: {\n id: this.safeId(),\n role: 'group',\n tabindex: this.disabled || this.noOuterFocus ? null : '-1',\n 'aria-describedby': this.safeId('_selected_')\n },\n on: {\n click: this.onClick,\n focusin: this.onFocusin,\n focusout: this.onFocusout\n }\n }, [$output, $removed, $content, $hidden]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-tags/form-tags.js\n// module id = 184\n// module chunks = 0","import { BFormTextarea } from './form-textarea';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormTextareaPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormTextarea: BFormTextarea,\n BTextarea: BFormTextarea\n }\n});\nexport { FormTextareaPlugin, BFormTextarea };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-textarea/index.js\n// module id = 185\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { getCS, isVisible, requestAF } from '../../utils/dom';\nimport { isNull } from '../../utils/inspect';\nimport { mathCeil, mathMax, mathMin } from '../../utils/math';\nimport { toInteger, toFloat } from '../../utils/number';\nimport formMixin from '../../mixins/form';\nimport formSelectionMixin from '../../mixins/form-selection';\nimport formSizeMixin from '../../mixins/form-size';\nimport formStateMixin from '../../mixins/form-state';\nimport formTextMixin from '../../mixins/form-text';\nimport formValidityMixin from '../../mixins/form-validity';\nimport idMixin from '../../mixins/id';\nimport listenOnRootMixin from '../../mixins/listen-on-root';\nimport listenersMixin from '../../mixins/listeners';\nimport { VBVisible } from '../../directives/visible/visible'; // @vue/component\n\nexport var BFormTextarea = /*#__PURE__*/Vue.extend({\n name: 'BFormTextarea',\n directives: {\n 'b-visible': VBVisible\n },\n // Mixin order is important!\n mixins: [listenersMixin, idMixin, listenOnRootMixin, formMixin, formSizeMixin, formStateMixin, formTextMixin, formSelectionMixin, formValidityMixin],\n props: {\n rows: {\n type: [Number, String],\n default: 2\n },\n maxRows: {\n type: [Number, String] // default: null\n\n },\n wrap: {\n // 'soft', 'hard' or 'off'. Browser default is 'soft'\n type: String,\n default: 'soft'\n },\n noResize: {\n // Disable the resize handle of textarea\n type: Boolean,\n default: false\n },\n noAutoShrink: {\n // When in auto resize mode, disable shrinking to content height\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n return {\n heightInPx: null\n };\n },\n computed: {\n computedStyle: function computedStyle() {\n var styles = {\n // Setting `noResize` to true will disable the ability for the user to\n // manually resize the textarea. We also disable when in auto height mode\n resize: !this.computedRows || this.noResize ? 'none' : null\n };\n\n if (!this.computedRows) {\n // Conditionally set the computed CSS height when auto rows/height is enabled\n // We avoid setting the style to `null`, which can override user manual resize handle\n styles.height = this.heightInPx; // We always add a vertical scrollbar to the textarea when auto-height is\n // enabled so that the computed height calculation returns a stable value\n\n styles.overflowY = 'scroll';\n }\n\n return styles;\n },\n computedMinRows: function computedMinRows() {\n // Ensure rows is at least 2 and positive (2 is the native textarea value)\n // A value of 1 can cause issues in some browsers, and most browsers\n // only support 2 as the smallest value\n return mathMax(toInteger(this.rows, 2), 2);\n },\n computedMaxRows: function computedMaxRows() {\n return mathMax(this.computedMinRows, toInteger(this.maxRows, 0));\n },\n computedRows: function computedRows() {\n // This is used to set the attribute 'rows' on the textarea\n // If auto-height is enabled, then we return `null` as we use CSS to control height\n return this.computedMinRows === this.computedMaxRows ? this.computedMinRows : null;\n },\n computedAttrs: function computedAttrs() {\n var disabled = this.disabled,\n required = this.required;\n return {\n id: this.safeId(),\n name: this.name || null,\n form: this.form || null,\n disabled: disabled,\n placeholder: this.placeholder || null,\n required: required,\n autocomplete: this.autocomplete || null,\n readonly: this.readonly || this.plaintext,\n rows: this.computedRows,\n wrap: this.wrap || null,\n 'aria-required': this.required ? 'true' : null,\n 'aria-invalid': this.computedAriaInvalid\n };\n },\n computedListeners: function computedListeners() {\n return _objectSpread(_objectSpread({}, this.bvListeners), {}, {\n input: this.onInput,\n change: this.onChange,\n blur: this.onBlur\n });\n }\n },\n watch: {\n localValue: function localValue() {\n this.setHeight();\n }\n },\n mounted: function mounted() {\n this.setHeight();\n },\n methods: {\n // Called by intersection observer directive\n visibleCallback: function visibleCallback(visible)\n /* istanbul ignore next */\n {\n if (visible) {\n // We use a `$nextTick()` here just to make sure any\n // transitions or portalling have completed\n this.$nextTick(this.setHeight);\n }\n },\n setHeight: function setHeight() {\n var _this = this;\n\n this.$nextTick(function () {\n requestAF(function () {\n _this.heightInPx = _this.computeHeight();\n });\n });\n },\n computeHeight: function computeHeight()\n /* istanbul ignore next: can't test getComputedStyle in JSDOM */\n {\n if (this.$isServer || !isNull(this.computedRows)) {\n return null;\n }\n\n var el = this.$el; // Element must be visible (not hidden) and in document\n // Must be checked after above checks\n\n if (!isVisible(el)) {\n return null;\n } // Get current computed styles\n\n\n var computedStyle = getCS(el); // Height of one line of text in px\n\n var lineHeight = toFloat(computedStyle.lineHeight, 1); // Calculate height of border and padding\n\n var border = toFloat(computedStyle.borderTopWidth, 0) + toFloat(computedStyle.borderBottomWidth, 0);\n var padding = toFloat(computedStyle.paddingTop, 0) + toFloat(computedStyle.paddingBottom, 0); // Calculate offset\n\n var offset = border + padding; // Minimum height for min rows (which must be 2 rows or greater for cross-browser support)\n\n var minHeight = lineHeight * this.computedMinRows + offset; // Get the current style height (with `px` units)\n\n var oldHeight = el.style.height || computedStyle.height; // Probe scrollHeight by temporarily changing the height to `auto`\n\n el.style.height = 'auto';\n var scrollHeight = el.scrollHeight; // Place the original old height back on the element, just in case `computedProp`\n // returns the same value as before\n\n el.style.height = oldHeight; // Calculate content height in 'rows' (scrollHeight includes padding but not border)\n\n var contentRows = mathMax((scrollHeight - padding) / lineHeight, 2); // Calculate number of rows to display (limited within min/max rows)\n\n var rows = mathMin(mathMax(contentRows, this.computedMinRows), this.computedMaxRows); // Calculate the required height of the textarea including border and padding (in pixels)\n\n var height = mathMax(mathCeil(rows * lineHeight + offset), minHeight); // Computed height remains the larger of `oldHeight` and new `height`,\n // when height is in `sticky` mode (prop `no-auto-shrink` is true)\n\n if (this.noAutoShrink && toFloat(oldHeight, 0) > height) {\n return oldHeight;\n } // Return the new computed CSS height in px units\n\n\n return \"\".concat(height, \"px\");\n }\n },\n render: function render(h) {\n return h('textarea', {\n ref: 'input',\n class: this.computedClass,\n style: this.computedStyle,\n directives: [{\n name: 'b-visible',\n value: this.visibleCallback,\n // If textarea is within 640px of viewport, consider it visible\n modifiers: {\n '640': true\n }\n }],\n attrs: this.computedAttrs,\n domProps: {\n value: this.localValue\n },\n on: this.computedListeners\n });\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-textarea/form-textarea.js\n// module id = 186\n// module chunks = 0","import { BFormTimepicker } from './form-timepicker';\nimport { pluginFactory } from '../../utils/plugins';\nvar FormTimepickerPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BFormTimepicker: BFormTimepicker,\n BTimepicker: BFormTimepicker\n }\n});\nexport { FormTimepickerPlugin, BFormTimepicker };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-timepicker/index.js\n// module id = 187\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { BVFormBtnLabelControl, dropdownProps } from '../../utils/bv-form-btn-label-control';\nimport { getComponentConfig } from '../../utils/config';\nimport { attemptBlur, attemptFocus } from '../../utils/dom';\nimport { isUndefinedOrNull } from '../../utils/inspect';\nimport idMixin from '../../mixins/id';\nimport { BButton } from '../button/button';\nimport { BTime } from '../time/time';\nimport { BIconClock, BIconClockFill } from '../../icons/icons';\nvar NAME = 'BFormTimepicker'; // Fallback to BTime/BFormSpinbutton prop if no value found\n\nvar getConfigFallback = function getConfigFallback(prop) {\n return getComponentConfig(NAME, prop) || getComponentConfig('BTime', prop) || getComponentConfig('BFormSpinbutton', prop);\n}; // We create our props as a mixin so that we can control\n// where they appear in the props listing reference section\n\n\nvar propsMixin = {\n props: _objectSpread({\n value: {\n type: String,\n default: ''\n },\n resetValue: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String // Defaults to `labelNoTime` from BTime context\n // default: null\n\n },\n size: {\n type: String // default: null\n\n },\n disabled: {\n type: Boolean,\n default: false\n },\n readonly: {\n type: Boolean,\n default: false\n },\n required: {\n // If true adds the `aria-required` attribute\n type: Boolean,\n default: false\n },\n name: {\n type: String // default: null\n\n },\n form: {\n type: String // default: null\n\n },\n state: {\n // Tri-state prop: `true`, `false` or `null`\n type: Boolean,\n default: null\n },\n hour12: {\n // Tri-state prop: `true` => 12 hour, `false` => 24 hour, `null` => auto\n type: Boolean,\n default: null\n },\n locale: {\n type: [String, Array] // default: null\n\n },\n showSeconds: {\n type: Boolean,\n default: false\n },\n hideHeader: {\n type: Boolean,\n default: false\n },\n secondsStep: {\n type: [Number, String],\n default: 1\n },\n minutesStep: {\n type: [Number, String],\n default: 1\n },\n buttonOnly: {\n type: Boolean,\n default: false\n },\n buttonVariant: {\n // Applicable in button only mode\n type: String,\n default: 'secondary'\n },\n nowButton: {\n type: Boolean,\n default: false\n },\n labelNowButton: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelNowButton');\n }\n },\n nowButtonVariant: {\n type: String,\n default: 'outline-primary'\n },\n resetButton: {\n type: Boolean,\n default: false\n },\n labelResetButton: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelResetButton');\n }\n },\n resetButtonVariant: {\n type: String,\n default: 'outline-danger'\n },\n noCloseButton: {\n type: Boolean,\n default: false\n },\n labelCloseButton: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'labelCloseButton');\n }\n },\n closeButtonVariant: {\n type: String,\n default: 'outline-secondary'\n },\n // Labels\n // These fallback to BTime values\n labelSelected: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelSelected');\n }\n },\n labelNoTimeSelected: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelNoTimeSelected');\n }\n },\n labelHours: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelHours');\n }\n },\n labelMinutes: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelMinutes');\n }\n },\n labelSeconds: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelSeconds');\n }\n },\n labelAmpm: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelAmpm');\n }\n },\n labelAm: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelAm');\n }\n },\n labelPm: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelPm');\n }\n },\n // These pick BTime or BFormSpinbutton global config if no BFormTimepicker global config\n labelIncrement: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelIncrement');\n }\n },\n labelDecrement: {\n type: String,\n default: function _default() {\n return getConfigFallback('labelDecrement');\n }\n },\n // extra dropdown stuff\n menuClass: {\n type: [String, Array, Object] // default: null\n\n }\n }, dropdownProps)\n}; // --- BFormDate component ---\n// @vue/component\n\nexport var BFormTimepicker = /*#__PURE__*/Vue.extend({\n name: NAME,\n // The mixins order determines the order of appearance in the props reference section\n mixins: [idMixin, propsMixin],\n model: {\n prop: 'value',\n event: 'input'\n },\n data: function data() {\n return {\n // We always use `HH:mm:ss` value internally\n localHMS: this.value || '',\n // Context data from BTime\n localLocale: null,\n isRTL: false,\n formattedValue: '',\n // If the menu is opened\n isVisible: false\n };\n },\n computed: {\n computedLang: function computedLang() {\n return (this.localLocale || '').replace(/-u-.*$/i, '') || null;\n },\n timeProps: function timeProps() {\n // Props we pass to BTime\n // Use self for better minification, as `this` won't\n // minimize and we reference it many times below\n var self = this;\n return {\n hidden: !self.isVisible,\n value: self.localHMS,\n // Passthrough props\n readonly: self.readonly,\n disabled: self.disabled,\n locale: self.locale,\n hour12: self.hour12,\n hideHeader: self.hideHeader,\n showSeconds: self.showSeconds,\n secondsStep: self.secondsStep,\n minutesStep: self.minutesStep,\n labelNoTimeSelected: self.labelNoTimeSelected,\n labelSelected: self.labelSelected,\n labelHours: self.labelHours,\n labelMinutes: self.labelMinutes,\n labelSeconds: self.labelSeconds,\n labelAmpm: self.labelAmpm,\n labelAm: self.labelAm,\n labelPm: self.labelPm,\n labelIncrement: self.labelIncrement,\n labelDecrement: self.labelDecrement\n };\n }\n },\n watch: {\n value: function value(newVal) {\n this.localHMS = newVal || '';\n },\n localHMS: function localHMS(newVal) {\n // We only update the v-model value when the timepicker\n // is open, to prevent cursor jumps when bound to a\n // text input in button only mode\n if (this.isVisible) {\n this.$emit('input', newVal || '');\n }\n }\n },\n methods: {\n // Public methods\n focus: function focus() {\n if (!this.disabled) {\n attemptFocus(this.$refs.control);\n }\n },\n blur: function blur() {\n if (!this.disabled) {\n attemptBlur(this.$refs.control);\n }\n },\n // Private methods\n setAndClose: function setAndClose(value) {\n var _this = this;\n\n this.localHMS = value;\n this.$nextTick(function () {\n _this.$refs.control.hide(true);\n });\n },\n onInput: function onInput(hms) {\n if (this.localHMS !== hms) {\n this.localHMS = hms;\n }\n },\n onContext: function onContext(ctx) {\n var isRTL = ctx.isRTL,\n locale = ctx.locale,\n value = ctx.value,\n formatted = ctx.formatted;\n this.isRTL = isRTL;\n this.localLocale = locale;\n this.formattedValue = formatted;\n this.localHMS = value || ''; // Re-emit the context event\n\n this.$emit('context', ctx);\n },\n onNowButton: function onNowButton() {\n var now = new Date();\n var hours = now.getHours();\n var minutes = now.getMinutes();\n var seconds = this.showSeconds ? now.getSeconds() : 0;\n var value = [hours, minutes, seconds].map(function (v) {\n return \"00\".concat(v || '').slice(-2);\n }).join(':');\n this.setAndClose(value);\n },\n onResetButton: function onResetButton() {\n this.setAndClose(this.resetValue);\n },\n onCloseButton: function onCloseButton() {\n this.$refs.control.hide(true);\n },\n onShow: function onShow() {\n this.isVisible = true;\n },\n onShown: function onShown() {\n var _this2 = this;\n\n this.$nextTick(function () {\n attemptFocus(_this2.$refs.time);\n\n _this2.$emit('shown');\n });\n },\n onHidden: function onHidden() {\n this.isVisible = false;\n this.$emit('hidden');\n },\n // Render function helpers\n defaultButtonFn: function defaultButtonFn(_ref) {\n var isHovered = _ref.isHovered,\n hasFocus = _ref.hasFocus;\n return this.$createElement(isHovered || hasFocus ? BIconClockFill : BIconClock, {\n attrs: {\n 'aria-hidden': 'true'\n }\n });\n }\n },\n render: function render(h) {\n var localHMS = this.localHMS,\n disabled = this.disabled,\n readonly = this.readonly;\n var placeholder = isUndefinedOrNull(this.placeholder) ? this.labelNoTimeSelected : this.placeholder; // Footer buttons\n\n var $footer = [];\n\n if (this.nowButton) {\n var label = this.labelNowButton;\n $footer.push(h(BButton, {\n key: 'now-btn',\n props: {\n size: 'sm',\n disabled: disabled || readonly,\n variant: this.nowButtonVariant\n },\n attrs: {\n 'aria-label': label || null\n },\n on: {\n click: this.onNowButton\n }\n }, label));\n }\n\n if (this.resetButton) {\n if ($footer.length > 0) {\n // Add a \"spacer\" between buttons (' ')\n $footer.push(h('span', \"\\xA0\"));\n }\n\n var _label = this.labelResetButton;\n $footer.push(h(BButton, {\n key: 'reset-btn',\n props: {\n size: 'sm',\n disabled: disabled || readonly,\n variant: this.resetButtonVariant\n },\n attrs: {\n 'aria-label': _label || null\n },\n on: {\n click: this.onResetButton\n }\n }, _label));\n }\n\n if (!this.noCloseButton) {\n if ($footer.length > 0) {\n // Add a \"spacer\" between buttons (' ')\n $footer.push(h('span', \"\\xA0\"));\n }\n\n var _label2 = this.labelCloseButton;\n $footer.push(h(BButton, {\n key: 'close-btn',\n props: {\n size: 'sm',\n disabled: disabled,\n variant: this.closeButtonVariant\n },\n attrs: {\n 'aria-label': _label2 || null\n },\n on: {\n click: this.onCloseButton\n }\n }, _label2));\n }\n\n if ($footer.length > 0) {\n $footer = [h('div', {\n staticClass: 'b-form-date-controls d-flex flex-wrap',\n class: {\n 'justify-content-between': $footer.length > 1,\n 'justify-content-end': $footer.length < 2\n }\n }, $footer)];\n }\n\n var $time = h(BTime, {\n ref: 'time',\n staticClass: 'b-form-time-control',\n props: this.timeProps,\n on: {\n input: this.onInput,\n context: this.onContext\n }\n }, $footer);\n return h(BVFormBtnLabelControl, {\n ref: 'control',\n staticClass: 'b-form-timepicker',\n props: _objectSpread(_objectSpread({}, this.$props), {}, {\n // Overridden / computed props\n id: this.safeId(),\n rtl: this.isRTL,\n lang: this.computedLang,\n value: localHMS || '',\n formattedValue: localHMS ? this.formattedValue : '',\n placeholder: placeholder || ''\n }),\n on: {\n show: this.onShow,\n shown: this.onShown,\n hidden: this.onHidden\n },\n scopedSlots: {\n 'button-content': this.$scopedSlots['button-content'] || this.defaultButtonFn\n }\n }, [$time]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/form-timepicker/form-timepicker.js\n// module id = 188\n// module chunks = 0","import { BImg } from './img';\nimport { BImgLazy } from './img-lazy';\nimport { pluginFactory } from '../../utils/plugins';\nvar ImagePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BImg: BImg,\n BImgLazy: BImgLazy\n }\n});\nexport { ImagePlugin, BImg, BImgLazy };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/image/index.js\n// module id = 189\n// module chunks = 0","import { BInputGroup } from './input-group';\nimport { BInputGroupAddon } from './input-group-addon';\nimport { BInputGroupPrepend } from './input-group-prepend';\nimport { BInputGroupAppend } from './input-group-append';\nimport { BInputGroupText } from './input-group-text';\nimport { pluginFactory } from '../../utils/plugins';\nvar InputGroupPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BInputGroup: BInputGroup,\n BInputGroupAddon: BInputGroupAddon,\n BInputGroupPrepend: BInputGroupPrepend,\n BInputGroupAppend: BInputGroupAppend,\n BInputGroupText: BInputGroupText\n }\n});\nexport { InputGroupPlugin, BInputGroup, BInputGroupAddon, BInputGroupPrepend, BInputGroupAppend, BInputGroupText };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/input-group/index.js\n// module id = 190\n// module chunks = 0","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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { getComponentConfig } from '../../utils/config';\nimport { htmlOrText } from '../../utils/html';\nimport { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot';\nimport { BInputGroupAppend } from './input-group-append';\nimport { BInputGroupPrepend } from './input-group-prepend';\nimport { BInputGroupText } from './input-group-text'; // --- Constants ---\n\nvar NAME = 'BInputGroup'; // --- Props ---\n\nexport var props = {\n id: {\n type: String\n },\n size: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'size');\n }\n },\n prepend: {\n type: String\n },\n prependHtml: {\n type: String\n },\n append: {\n type: String\n },\n appendHtml: {\n type: String\n },\n tag: {\n type: String,\n default: 'div'\n }\n}; // --- Main component ---\n// @vue/component\n\nexport var BInputGroup = /*#__PURE__*/Vue.extend({\n name: NAME,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var prepend = props.prepend,\n prependHtml = props.prependHtml,\n append = props.append,\n appendHtml = props.appendHtml,\n size = props.size;\n var $scopedSlots = scopedSlots || {};\n var $slots = slots();\n var slotScope = {};\n var $prepend = h();\n var hasPrependSlot = hasNormalizedSlot('prepend', $scopedSlots, $slots);\n\n if (hasPrependSlot || prepend || prependHtml) {\n $prepend = h(BInputGroupPrepend, [hasPrependSlot ? normalizeSlot('prepend', slotScope, $scopedSlots, $slots) : h(BInputGroupText, {\n domProps: htmlOrText(prependHtml, prepend)\n })]);\n }\n\n var $append = h();\n var hasAppendSlot = hasNormalizedSlot('append', $scopedSlots, $slots);\n\n if (hasAppendSlot || append || appendHtml) {\n $append = h(BInputGroupAppend, [hasAppendSlot ? normalizeSlot('append', slotScope, $scopedSlots, $slots) : h(BInputGroupText, {\n domProps: htmlOrText(appendHtml, append)\n })]);\n }\n\n return h(props.tag, mergeData(data, {\n staticClass: 'input-group',\n class: _defineProperty({}, \"input-group-\".concat(size), size),\n attrs: {\n id: props.id || null,\n role: 'group'\n }\n }), [$prepend, normalizeSlot('default', slotScope, $scopedSlots, $slots), $append]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/input-group/input-group.js\n// module id = 191\n// module chunks = 0","import { BJumbotron } from './jumbotron';\nimport { pluginFactory } from '../../utils/plugins';\nvar JumbotronPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BJumbotron: BJumbotron\n }\n});\nexport { JumbotronPlugin, BJumbotron };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/jumbotron/index.js\n// module id = 192\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { getComponentConfig } from '../../utils/config';\nimport { htmlOrText } from '../../utils/html';\nimport { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot';\nimport { BContainer } from '../layout/container'; // --- Constants ---\n\nvar NAME = 'BJumbotron'; // --- Props ---\n\nexport var props = {\n fluid: {\n type: Boolean,\n default: false\n },\n containerFluid: {\n type: [Boolean, String],\n default: false\n },\n header: {\n type: String // default: null\n\n },\n headerHtml: {\n type: String // default: null\n\n },\n headerTag: {\n type: String,\n default: 'h1'\n },\n headerLevel: {\n type: [Number, String],\n default: '3'\n },\n lead: {\n type: String // default: null\n\n },\n leadHtml: {\n type: String // default: null\n\n },\n leadTag: {\n type: String,\n default: 'p'\n },\n tag: {\n type: String,\n default: 'div'\n },\n bgVariant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'bgVariant');\n }\n },\n borderVariant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'borderVariant');\n }\n },\n textVariant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'textVariant');\n }\n }\n}; // --- Main component ---\n// @vue/component\n\nexport var BJumbotron = /*#__PURE__*/Vue.extend({\n name: NAME,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class2;\n\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var header = props.header,\n headerHtml = props.headerHtml,\n lead = props.lead,\n leadHtml = props.leadHtml,\n textVariant = props.textVariant,\n bgVariant = props.bgVariant,\n borderVariant = props.borderVariant;\n var $scopedSlots = scopedSlots || {};\n var $slots = slots();\n var slotScope = {};\n var $header = h();\n var hasHeaderSlot = hasNormalizedSlot('header', $scopedSlots, $slots);\n\n if (hasHeaderSlot || header || headerHtml) {\n var headerLevel = props.headerLevel;\n $header = h(props.headerTag, {\n class: _defineProperty({}, \"display-\".concat(headerLevel), headerLevel),\n domProps: hasHeaderSlot ? {} : htmlOrText(headerHtml, header)\n }, normalizeSlot('header', slotScope, $scopedSlots, $slots));\n }\n\n var $lead = h();\n var hasLeadSlot = hasNormalizedSlot('lead', $scopedSlots, $slots);\n\n if (hasLeadSlot || lead || leadHtml) {\n $lead = h(props.leadTag, {\n staticClass: 'lead',\n domProps: hasLeadSlot ? {} : htmlOrText(leadHtml, lead)\n }, normalizeSlot('lead', slotScope, $scopedSlots, $slots));\n }\n\n var $children = [$header, $lead, normalizeSlot('default', slotScope, $scopedSlots, $slots)]; // If fluid, wrap content in a container\n\n if (props.fluid) {\n $children = [h(BContainer, {\n props: {\n fluid: props.containerFluid\n }\n }, $children)];\n }\n\n return h(props.tag, mergeData(data, {\n staticClass: 'jumbotron',\n class: (_class2 = {\n 'jumbotron-fluid': props.fluid\n }, _defineProperty(_class2, \"text-\".concat(textVariant), textVariant), _defineProperty(_class2, \"bg-\".concat(bgVariant), bgVariant), _defineProperty(_class2, \"border-\".concat(borderVariant), borderVariant), _defineProperty(_class2, \"border\", borderVariant), _class2)\n }), $children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/jumbotron/jumbotron.js\n// module id = 193\n// module chunks = 0","import { BContainer } from './container';\nimport { BRow } from './row';\nimport { BCol } from './col';\nimport { BFormRow } from './form-row';\nimport { pluginFactory } from '../../utils/plugins';\nvar LayoutPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BContainer: BContainer,\n BRow: BRow,\n BCol: BCol,\n BFormRow: BFormRow\n }\n});\nexport { LayoutPlugin, BContainer, BRow, BCol, BFormRow };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/layout/index.js\n// module id = 194\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport identity from '../../utils/identity';\nimport memoize from '../../utils/memoize';\nimport { arrayIncludes, concat } from '../../utils/array';\nimport { getBreakpointsUpCached } from '../../utils/config';\nimport { create, keys } from '../../utils/object';\nimport { suffixPropName } from '../../utils/props';\nimport { lowerCase, toString, trim } from '../../utils/string';\nvar COMMON_ALIGNMENT = ['start', 'end', 'center']; // Generates a prop object with a type of `[String, Number]`\n\nvar strNum = function strNum() {\n return {\n type: [String, Number],\n default: null\n };\n}; // Compute a `row-cols-{breakpoint}-{cols}` class name\n// Memoized function for better performance on generating class names\n\n\nvar computeRowColsClass = memoize(function (breakpoint, cols) {\n cols = trim(toString(cols));\n return cols ? lowerCase(['row-cols', breakpoint, cols].filter(identity).join('-')) : null;\n}); // Get the breakpoint name from the `rowCols` prop name\n// Memoized function for better performance on extracting breakpoint names\n\nvar computeRowColsBreakpoint = memoize(function (prop) {\n return lowerCase(prop.replace('cols', ''));\n}); // Cached copy of the `row-cols` breakpoint prop names\n// Will be populated when the props are generated\n\nvar rowColsPropList = []; // Lazy evaled props factory for (called only once,\n// the first time the component is used)\n\nvar generateProps = function generateProps() {\n // Grab the breakpoints from the cached config (including the '' (xs) breakpoint)\n var breakpoints = getBreakpointsUpCached(); // Supports classes like: `row-cols-2`, `row-cols-md-4`, `row-cols-xl-6`\n\n var rowColsProps = breakpoints.reduce(function (props, breakpoint) {\n props[suffixPropName(breakpoint, 'cols')] = strNum();\n return props;\n }, create(null)); // Cache the row-cols prop names\n\n rowColsPropList = keys(rowColsProps); // Return the generated props\n\n return _objectSpread({\n tag: {\n type: String,\n default: 'div'\n },\n noGutters: {\n type: Boolean,\n default: false\n },\n alignV: {\n type: String,\n default: null,\n validator: function validator(str) {\n return arrayIncludes(concat(COMMON_ALIGNMENT, 'baseline', 'stretch'), str);\n }\n },\n alignH: {\n type: String,\n default: null,\n validator: function validator(str) {\n return arrayIncludes(concat(COMMON_ALIGNMENT, 'between', 'around'), str);\n }\n },\n alignContent: {\n type: String,\n default: null,\n validator: function validator(str) {\n return arrayIncludes(concat(COMMON_ALIGNMENT, 'between', 'around', 'stretch'), str);\n }\n }\n }, rowColsProps);\n}; // We do not use `Vue.extend()` here as that would evaluate the props\n// immediately, which we do not want to happen\n// @vue/component\n\n\nexport var BRow = {\n name: 'BRow',\n functional: true,\n\n get props() {\n // Allow props to be lazy evaled on first access and\n // then they become a non-getter afterwards\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get#Smart_self-overwriting_lazy_getters\n delete this.props;\n this.props = generateProps();\n return this.props;\n },\n\n render: function render(h, _ref) {\n var _classList$push;\n\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var classList = []; // Loop through row-cols breakpoint props and generate the classes\n\n rowColsPropList.forEach(function (prop) {\n var c = computeRowColsClass(computeRowColsBreakpoint(prop), props[prop]); // If a class is returned, push it onto the array\n\n if (c) {\n classList.push(c);\n }\n });\n classList.push((_classList$push = {\n 'no-gutters': props.noGutters\n }, _defineProperty(_classList$push, \"align-items-\".concat(props.alignV), props.alignV), _defineProperty(_classList$push, \"justify-content-\".concat(props.alignH), props.alignH), _defineProperty(_classList$push, \"align-content-\".concat(props.alignContent), props.alignContent), _classList$push));\n return h(props.tag, mergeData(data, {\n staticClass: 'row',\n class: classList\n }), children);\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/layout/row.js\n// module id = 195\n// module chunks = 0","import { BLink } from './link';\nimport { pluginFactory } from '../../utils/plugins';\nvar LinkPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BLink: BLink\n }\n});\nexport { LinkPlugin, BLink };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/link/index.js\n// module id = 196\n// module chunks = 0","import { BListGroup } from './list-group';\nimport { BListGroupItem } from './list-group-item';\nimport { pluginFactory } from '../../utils/plugins';\nvar ListGroupPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BListGroup: BListGroup,\n BListGroupItem: BListGroupItem\n }\n});\nexport { ListGroupPlugin, BListGroup, BListGroupItem };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/list-group/index.js\n// module id = 197\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { isString } from '../../utils/inspect';\nexport var props = {\n tag: {\n type: String,\n default: 'div'\n },\n flush: {\n type: Boolean,\n default: false\n },\n horizontal: {\n type: [Boolean, String],\n default: false\n }\n}; // @vue/component\n\nexport var BListGroup = /*#__PURE__*/Vue.extend({\n name: 'BListGroup',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var horizontal = props.horizontal === '' ? true : props.horizontal;\n horizontal = props.flush ? false : horizontal;\n var componentData = {\n staticClass: 'list-group',\n class: _defineProperty({\n 'list-group-flush': props.flush,\n 'list-group-horizontal': horizontal === true\n }, \"list-group-horizontal-\".concat(horizontal), isString(horizontal))\n };\n return h(props.tag, mergeData(data, componentData), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/list-group/list-group.js\n// module id = 198\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { arrayIncludes } from '../../utils/array';\nimport { getComponentConfig } from '../../utils/config';\nimport { isTag } from '../../utils/dom';\nimport { omit } from '../../utils/object';\nimport { pluckProps } from '../../utils/props';\nimport { isLink } from '../../utils/router';\nimport { BLink, props as BLinkProps } from '../link/link'; // --- Constants ---\n\nvar NAME = 'BListGroupItem';\nvar actionTags = ['a', 'router-link', 'button', 'b-link']; // --- Props ---\n\nvar linkProps = omit(BLinkProps, ['event', 'routerTag']);\ndelete linkProps.href.default;\ndelete linkProps.to.default;\nexport var props = _objectSpread({\n tag: {\n type: String,\n default: 'div'\n },\n action: {\n type: Boolean,\n default: null\n },\n button: {\n type: Boolean,\n default: null\n },\n variant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'variant');\n }\n }\n}, linkProps); // --- Main component ---\n// @vue/component\n\nexport var BListGroupItem = /*#__PURE__*/Vue.extend({\n name: NAME,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var button = props.button,\n variant = props.variant,\n active = props.active,\n disabled = props.disabled;\n var link = isLink(props);\n var tag = button ? 'button' : !link ? props.tag : BLink;\n var action = !!(props.action || link || button || arrayIncludes(actionTags, props.tag));\n var attrs = {};\n var itemProps = {};\n\n if (isTag(tag, 'button')) {\n if (!data.attrs || !data.attrs.type) {\n // Add a type for button is one not provided in passed attributes\n attrs.type = 'button';\n }\n\n if (props.disabled) {\n // Set disabled attribute if button and disabled\n attrs.disabled = true;\n }\n } else {\n itemProps = pluckProps(linkProps, props);\n }\n\n return h(tag, mergeData(data, {\n attrs: attrs,\n props: itemProps,\n staticClass: 'list-group-item',\n class: (_class = {}, _defineProperty(_class, \"list-group-item-\".concat(variant), variant), _defineProperty(_class, 'list-group-item-action', action), _defineProperty(_class, \"active\", active), _defineProperty(_class, \"disabled\", disabled), _class)\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/list-group/list-group-item.js\n// module id = 199\n// module chunks = 0","import { BMedia } from './media';\nimport { BMediaAside } from './media-aside';\nimport { BMediaBody } from './media-body';\nimport { pluginFactory } from '../../utils/plugins';\nvar MediaPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BMedia: BMedia,\n BMediaAside: BMediaAside,\n BMediaBody: BMediaBody\n }\n});\nexport { MediaPlugin, BMedia, BMediaAside, BMediaBody };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/media/index.js\n// module id = 200\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { normalizeSlot } from '../../utils/normalize-slot';\nimport { BMediaBody } from './media-body';\nimport { BMediaAside } from './media-aside';\nexport var props = {\n tag: {\n type: String,\n default: 'div'\n },\n rightAlign: {\n type: Boolean,\n default: false\n },\n verticalAlign: {\n type: String,\n default: 'top'\n },\n noBody: {\n type: Boolean,\n default: false\n }\n}; // @vue/component\n\nexport var BMedia = /*#__PURE__*/Vue.extend({\n name: 'BMedia',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots,\n children = _ref.children;\n var childNodes = props.noBody ? children : [];\n\n if (!props.noBody) {\n var $slots = slots();\n var $scopedSlots = scopedSlots || {};\n var $aside = normalizeSlot('aside', {}, $scopedSlots, $slots);\n var $default = normalizeSlot('default', {}, $scopedSlots, $slots);\n\n if ($aside && !props.rightAlign) {\n childNodes.push(h(BMediaAside, {\n staticClass: 'mr-3',\n props: {\n verticalAlign: props.verticalAlign\n }\n }, $aside));\n }\n\n childNodes.push(h(BMediaBody, $default));\n\n if ($aside && props.rightAlign) {\n childNodes.push(h(BMediaAside, {\n staticClass: 'ml-3',\n props: {\n verticalAlign: props.verticalAlign\n }\n }, $aside));\n }\n }\n\n return h(props.tag, mergeData(data, {\n staticClass: 'media'\n }), childNodes);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/media/media.js\n// module id = 201\n// module chunks = 0","import { BModal } from './modal';\nimport { VBModal } from '../../directives/modal/modal';\nimport { BVModalPlugin } from './helpers/bv-modal';\nimport { pluginFactory } from '../../utils/plugins';\nvar ModalPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BModal: BModal\n },\n directives: {\n VBModal: VBModal\n },\n // $bvModal injection\n plugins: {\n BVModalPlugin: BVModalPlugin\n }\n});\nexport { ModalPlugin, BModal };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/modal/index.js\n// module id = 202\n// module chunks = 0","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// Plugin for adding `$bvModal` property to all Vue instances\nimport { BModal, props as modalProps } from '../modal';\nimport { concat } from '../../../utils/array';\nimport { getComponentConfig } from '../../../utils/config';\nimport { isUndefined, isFunction } from '../../../utils/inspect';\nimport { assign, defineProperties, defineProperty, hasOwnProperty, keys, omit, readonlyDescriptor } from '../../../utils/object';\nimport { pluginFactory } from '../../../utils/plugins';\nimport { warn, warnNotClient, warnNoPromiseSupport } from '../../../utils/warn'; // --- Constants ---\n\nvar PROP_NAME = '$bvModal';\nvar PROP_NAME_PRIV = '_bv__modal'; // Base modal props that are allowed\n// Some may be ignored or overridden on some message boxes\n// Prop ID is allowed, but really only should be used for testing\n// We need to add it in explicitly as it comes from the `idMixin`\n\nvar BASE_PROPS = ['id'].concat(_toConsumableArray(keys(omit(modalProps, ['busy', 'lazy', 'noStacking', \"static\", 'visible'])))); // Fallback event resolver (returns undefined)\n\nvar defaultResolver = function defaultResolver() {}; // Map prop names to modal slot names\n\n\nvar propsToSlots = {\n msgBoxContent: 'default',\n title: 'modal-title',\n okTitle: 'modal-ok',\n cancelTitle: 'modal-cancel'\n}; // --- Utility methods ---\n// Method to filter only recognized props that are not undefined\n\nvar filterOptions = function filterOptions(options) {\n return BASE_PROPS.reduce(function (memo, key) {\n if (!isUndefined(options[key])) {\n memo[key] = options[key];\n }\n\n return memo;\n }, {});\n}; // Method to install `$bvModal` VM injection\n\n\nvar plugin = function plugin(Vue) {\n // Create a private sub-component that extends BModal\n // which self-destructs after hidden\n // @vue/component\n var BMsgBox = Vue.extend({\n name: 'BMsgBox',\n extends: BModal,\n destroyed: function destroyed() {\n // Make sure we not in document any more\n if (this.$el && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n },\n mounted: function mounted() {\n var _this = this;\n\n // Self destruct handler\n var handleDestroy = function handleDestroy() {\n var self = _this;\n\n _this.$nextTick(function () {\n // In a `setTimeout()` to release control back to application\n setTimeout(function () {\n return self.$destroy();\n }, 0);\n });\n }; // Self destruct if parent destroyed\n\n\n this.$parent.$once('hook:destroyed', handleDestroy); // Self destruct after hidden\n\n this.$once('hidden', handleDestroy); // Self destruct on route change\n\n /* istanbul ignore if */\n\n if (this.$router && this.$route) {\n // Destroy ourselves if route changes\n\n /* istanbul ignore next */\n this.$once('hook:beforeDestroy', this.$watch('$router', handleDestroy));\n } // Show the `BMsgBox`\n\n\n this.show();\n }\n }); // Method to generate the on-demand modal message box\n // Returns a promise that resolves to a value returned by the resolve\n\n var asyncMsgBox = function asyncMsgBox($parent, props) {\n var resolver = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultResolver;\n\n if (warnNotClient(PROP_NAME) || warnNoPromiseSupport(PROP_NAME)) {\n /* istanbul ignore next */\n return;\n } // Create an instance of `BMsgBox` component\n\n\n var msgBox = new BMsgBox({\n // We set parent as the local VM so these modals can emit events on\n // the app `$root`, as needed by things like tooltips and popovers\n // And it helps to ensure `BMsgBox` is destroyed when parent is destroyed\n parent: $parent,\n // Preset the prop values\n propsData: _objectSpread(_objectSpread(_objectSpread({}, filterOptions(getComponentConfig('BModal') || {})), {}, {\n // Defaults that user can override\n hideHeaderClose: true,\n hideHeader: !(props.title || props.titleHtml)\n }, omit(props, keys(propsToSlots))), {}, {\n // Props that can't be overridden\n lazy: false,\n busy: false,\n visible: false,\n noStacking: false,\n noEnforceFocus: false\n })\n }); // Convert certain props to scoped slots\n\n keys(propsToSlots).forEach(function (prop) {\n if (!isUndefined(props[prop])) {\n // Can be a string, or array of VNodes.\n // Alternatively, user can use HTML version of prop to pass an HTML string.\n msgBox.$slots[propsToSlots[prop]] = concat(props[prop]);\n }\n }); // Return a promise that resolves when hidden, or rejects on destroyed\n\n return new Promise(function (resolve, reject) {\n var resolved = false;\n msgBox.$once('hook:destroyed', function () {\n if (!resolved) {\n /* istanbul ignore next */\n reject(new Error('BootstrapVue MsgBox destroyed before resolve'));\n }\n });\n msgBox.$on('hide', function (bvModalEvt) {\n if (!bvModalEvt.defaultPrevented) {\n var result = resolver(bvModalEvt); // If resolver didn't cancel hide, we resolve\n\n if (!bvModalEvt.defaultPrevented) {\n resolved = true;\n resolve(result);\n }\n }\n }); // Create a mount point (a DIV) and mount the msgBo which will trigger it to show\n\n var div = document.createElement('div');\n document.body.appendChild(div);\n msgBox.$mount(div);\n });\n }; // Private utility method to open a user defined message box and returns a promise.\n // Not to be used directly by consumers, as this method may change calling syntax\n\n\n var makeMsgBox = function makeMsgBox($parent, content) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var resolver = arguments.length > 3 ? arguments[3] : undefined;\n\n if (!content || warnNoPromiseSupport(PROP_NAME) || warnNotClient(PROP_NAME) || !isFunction(resolver)) {\n /* istanbul ignore next */\n return;\n }\n\n return asyncMsgBox($parent, _objectSpread(_objectSpread({}, filterOptions(options)), {}, {\n msgBoxContent: content\n }), resolver);\n }; // BvModal instance class\n\n\n var BvModal = /*#__PURE__*/function () {\n function BvModal(vm) {\n _classCallCheck(this, BvModal);\n\n // Assign the new properties to this instance\n assign(this, {\n _vm: vm,\n _root: vm.$root\n }); // Set these properties as read-only and non-enumerable\n\n defineProperties(this, {\n _vm: readonlyDescriptor(),\n _root: readonlyDescriptor()\n });\n } // --- Instance methods ---\n // Show modal with the specified ID args are for future use\n\n\n _createClass(BvModal, [{\n key: \"show\",\n value: function show(id) {\n if (id && this._root) {\n var _this$_root;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n (_this$_root = this._root).$emit.apply(_this$_root, ['bv::show::modal', id].concat(args));\n }\n } // Hide modal with the specified ID args are for future use\n\n }, {\n key: \"hide\",\n value: function hide(id) {\n if (id && this._root) {\n var _this$_root2;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (_this$_root2 = this._root).$emit.apply(_this$_root2, ['bv::hide::modal', id].concat(args));\n }\n } // The following methods require Promise support!\n // IE 11 and others do not support Promise natively, so users\n // should have a Polyfill loaded (which they need anyways for IE 11 support)\n // Open a message box with OK button only and returns a promise\n\n }, {\n key: \"msgBoxOk\",\n value: function msgBoxOk(message) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Pick the modal props we support from options\n var props = _objectSpread(_objectSpread({}, options), {}, {\n // Add in overrides and our content prop\n okOnly: true,\n okDisabled: false,\n hideFooter: false,\n msgBoxContent: message\n });\n\n return makeMsgBox(this._vm, message, props, function () {\n // Always resolve to true for OK\n return true;\n });\n } // Open a message box modal with OK and CANCEL buttons\n // and returns a promise\n\n }, {\n key: \"msgBoxConfirm\",\n value: function msgBoxConfirm(message) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Set the modal props we support from options\n var props = _objectSpread(_objectSpread({}, options), {}, {\n // Add in overrides and our content prop\n okOnly: false,\n okDisabled: false,\n cancelDisabled: false,\n hideFooter: false\n });\n\n return makeMsgBox(this._vm, message, props, function (bvModalEvt) {\n var trigger = bvModalEvt.trigger;\n return trigger === 'ok' ? true : trigger === 'cancel' ? false : null;\n });\n }\n }]);\n\n return BvModal;\n }(); // Add our instance mixin\n\n\n Vue.mixin({\n beforeCreate: function beforeCreate() {\n // Because we need access to `$root` for `$emits`, and VM for parenting,\n // we have to create a fresh instance of `BvModal` for each VM\n this[PROP_NAME_PRIV] = new BvModal(this);\n }\n }); // Define our read-only `$bvModal` instance property\n // Placed in an if just in case in HMR mode\n\n if (!hasOwnProperty(Vue.prototype, PROP_NAME)) {\n defineProperty(Vue.prototype, PROP_NAME, {\n get: function get() {\n /* istanbul ignore next */\n if (!this || !this[PROP_NAME_PRIV]) {\n warn(\"\\\"\".concat(PROP_NAME, \"\\\" must be accessed from a Vue instance \\\"this\\\" context.\"), 'BModal');\n }\n\n return this[PROP_NAME_PRIV];\n }\n });\n }\n};\n\nexport var BVModalPlugin = /*#__PURE__*/pluginFactory({\n plugins: {\n plugin: plugin\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/modal/helpers/bv-modal.js\n// module id = 203\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { omit } from '../../utils/object';\nimport { BLink, props as BLinkProps } from '../link/link'; // --- Props ---\n\nexport var props = omit(BLinkProps, ['event', 'routerTag']); // --- Main component ---\n// @vue/component\n\nexport var BNavItem = /*#__PURE__*/Vue.extend({\n name: 'BNavItem',\n functional: true,\n props: _objectSpread(_objectSpread({}, props), {}, {\n linkAttrs: {\n type: Object,\n default: function _default() {}\n },\n linkClasses: {\n type: [String, Object, Array],\n default: null\n }\n }),\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n listeners = _ref.listeners,\n children = _ref.children;\n // We transfer the listeners to the link\n delete data.on;\n return h('li', mergeData(data, {\n staticClass: 'nav-item'\n }), [h(BLink, {\n staticClass: 'nav-link',\n class: props.linkClasses,\n attrs: props.linkAttrs,\n props: props,\n on: listeners\n }, children)]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/nav/nav-item.js\n// module id = 204\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nexport var props = {}; // @vue/component\n\nexport var BNavText = /*#__PURE__*/Vue.extend({\n name: 'BNavText',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var data = _ref.data,\n children = _ref.children;\n return h('li', mergeData(data, {\n staticClass: 'navbar-text'\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/nav/nav-text.js\n// module id = 205\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { mergeData } from 'vue-functional-data-merge';\nimport { omit } from '../../utils/object';\nimport { BForm, props as BFormProps } from '../form/form';\nexport var props = _objectSpread(_objectSpread({}, omit(BFormProps, ['inline'])), {}, {\n formClass: {\n type: [String, Array, Object] // default: null\n\n }\n}); // @vue/component\n\nexport var BNavForm = /*#__PURE__*/Vue.extend({\n name: 'BNavForm',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children,\n _ref$listeners = _ref.listeners,\n listeners = _ref$listeners === void 0 ? {} : _ref$listeners;\n var attrs = data.attrs; // The following data properties are cleared out\n // as they will be passed to BForm directly\n\n data.attrs = {};\n data.on = {};\n var $form = h(BForm, {\n class: props.formClass,\n props: _objectSpread(_objectSpread({}, props), {}, {\n inline: true\n }),\n attrs: attrs,\n on: listeners\n }, children);\n return h('li', mergeData(data, {\n staticClass: 'form-inline'\n }), [$form]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/nav/nav-form.js\n// module id = 206\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { htmlOrText } from '../../utils/html';\nimport { pluckProps } from '../../utils/props';\nimport dropdownMixin from '../../mixins/dropdown';\nimport idMixin from '../../mixins/id';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { props as BDropdownProps } from '../dropdown/dropdown';\nimport { BLink } from '../link/link'; // --- Props ---\n\nexport var props = pluckProps(['text', 'html', 'menuClass', 'toggleClass', 'noCaret', 'role', 'lazy'], BDropdownProps); // --- Main component ---\n// @vue/component\n\nexport var BNavItemDropdown = /*#__PURE__*/Vue.extend({\n name: 'BNavItemDropdown',\n mixins: [idMixin, dropdownMixin, normalizeSlotMixin],\n props: props,\n computed: {\n toggleId: function toggleId() {\n return this.safeId('_BV_toggle_');\n },\n isNav: function isNav() {\n // Signal to dropdown mixin that we are in a navbar\n return true;\n },\n dropdownClasses: function dropdownClasses() {\n return [this.directionClass, {\n show: this.visible\n }];\n },\n menuClasses: function menuClasses() {\n return [this.menuClass, {\n 'dropdown-menu-right': this.right,\n show: this.visible\n }];\n },\n toggleClasses: function toggleClasses() {\n return [this.toggleClass, {\n 'dropdown-toggle-no-caret': this.noCaret\n }];\n }\n },\n render: function render(h) {\n var toggleId = this.toggleId,\n visible = this.visible;\n var $toggle = h(BLink, {\n staticClass: 'nav-link dropdown-toggle',\n class: this.toggleClasses,\n props: {\n href: \"#\".concat(this.id || ''),\n disabled: this.disabled\n },\n attrs: {\n id: toggleId,\n role: 'button',\n 'aria-haspopup': 'true',\n 'aria-expanded': visible ? 'true' : 'false'\n },\n on: {\n mousedown: this.onMousedown,\n click: this.toggle,\n keydown: this.toggle // Handle ENTER, SPACE and DOWN\n\n },\n ref: 'toggle'\n }, [// TODO: The `text` slot is deprecated in favor of the `button-content` slot\n this.normalizeSlot(['button-content', 'text']) || h('span', {\n domProps: htmlOrText(this.html, this.text)\n })]);\n var $menu = h('ul', {\n staticClass: 'dropdown-menu',\n class: this.menuClasses,\n attrs: {\n tabindex: '-1',\n 'aria-labelledby': toggleId\n },\n on: {\n keydown: this.onKeydown // Handle UP, DOWN and ESC\n\n },\n ref: 'menu'\n }, !this.lazy || visible ? this.normalizeSlot('default', {\n hide: this.hide\n }) : [h()]);\n return h('li', {\n staticClass: 'nav-item b-nav-dropdown dropdown',\n class: this.dropdownClasses,\n attrs: {\n id: this.safeId()\n }\n }, [$toggle, $menu]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/nav/nav-item-dropdown.js\n// module id = 207\n// module chunks = 0","import { BNavbar } from './navbar';\nimport { BNavbarNav } from './navbar-nav';\nimport { BNavbarBrand } from './navbar-brand';\nimport { BNavbarToggle } from './navbar-toggle';\nimport { NavPlugin } from '../nav';\nimport { CollapsePlugin } from '../collapse';\nimport { DropdownPlugin } from '../dropdown';\nimport { pluginFactory } from '../../utils/plugins';\nvar NavbarPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BNavbar: BNavbar,\n BNavbarNav: BNavbarNav,\n BNavbarBrand: BNavbarBrand,\n BNavbarToggle: BNavbarToggle,\n BNavToggle: BNavbarToggle\n },\n plugins: {\n NavPlugin: NavPlugin,\n CollapsePlugin: CollapsePlugin,\n DropdownPlugin: DropdownPlugin\n }\n});\nexport { NavbarPlugin, BNavbar, BNavbarNav, BNavbarBrand, BNavbarToggle };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/navbar/index.js\n// module id = 208\n// module chunks = 0","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; }\n\nimport Vue from '../../utils/vue';\nimport { getComponentConfig, getBreakpoints } from '../../utils/config';\nimport { isTag } from '../../utils/dom';\nimport { isString } from '../../utils/inspect';\nimport normalizeSlotMixin from '../../mixins/normalize-slot'; // --- Constants ---\n\nvar NAME = 'BNavbar'; // --- Props ---\n\nexport var props = {\n tag: {\n type: String,\n default: 'nav'\n },\n type: {\n type: String,\n default: 'light'\n },\n variant: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'variant');\n }\n },\n toggleable: {\n type: [Boolean, String],\n default: false\n },\n fixed: {\n type: String\n },\n sticky: {\n type: Boolean,\n default: false\n },\n print: {\n type: Boolean,\n default: false\n }\n}; // --- Main component ---\n// @vue/component\n\nexport var BNavbar = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [normalizeSlotMixin],\n props: props,\n provide: function provide() {\n return {\n bvNavbar: this\n };\n },\n computed: {\n breakpointClass: function breakpointClass() {\n var breakpoint = null;\n var xs = getBreakpoints()[0];\n var toggleable = this.toggleable;\n\n if (toggleable && isString(toggleable) && toggleable !== xs) {\n breakpoint = \"navbar-expand-\".concat(toggleable);\n } else if (toggleable === false) {\n breakpoint = 'navbar-expand';\n }\n\n return breakpoint;\n }\n },\n render: function render(h) {\n var _ref;\n\n return h(this.tag, {\n staticClass: 'navbar',\n class: [(_ref = {\n 'd-print': this.print,\n 'sticky-top': this.sticky\n }, _defineProperty(_ref, \"navbar-\".concat(this.type), this.type), _defineProperty(_ref, \"bg-\".concat(this.variant), this.variant), _defineProperty(_ref, \"fixed-\".concat(this.fixed), this.fixed), _ref), this.breakpointClass],\n attrs: {\n role: isTag(this.tag, 'nav') ? null : 'navigation'\n }\n }, [this.normalizeSlot('default')]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/navbar/navbar.js\n// module id = 209\n// module chunks = 0","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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { pluckProps } from '../../utils/props';\nimport { props as BNavProps } from '../nav/nav'; // -- Constants --\n\nexport var props = pluckProps(['tag', 'fill', 'justified', 'align', 'small'], BNavProps); // -- Utils --\n\nvar computeJustifyContent = function computeJustifyContent(value) {\n // Normalize value\n value = value === 'left' ? 'start' : value === 'right' ? 'end' : value;\n return \"justify-content-\".concat(value);\n}; // @vue/component\n\n\nexport var BNavbarNav = /*#__PURE__*/Vue.extend({\n name: 'BNavbarNav',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n return h(props.tag, mergeData(data, {\n staticClass: 'navbar-nav',\n class: (_class = {\n 'nav-fill': props.fill,\n 'nav-justified': props.justified\n }, _defineProperty(_class, computeJustifyContent(props.align), props.align), _defineProperty(_class, \"small\", props.small), _class)\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/navbar/navbar-nav.js\n// module id = 210\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport { mergeData } from 'vue-functional-data-merge';\nimport Vue from '../../utils/vue';\nimport { omit } from '../../utils/object';\nimport { pluckProps } from '../../utils/props';\nimport { BLink, props as BLinkProps } from '../link/link'; // --- Props ---\n\nvar linkProps = omit(BLinkProps, ['event', 'routerTag']);\nlinkProps.href.default = undefined;\nlinkProps.to.default = undefined;\nexport var props = _objectSpread({\n tag: {\n type: String,\n default: 'div'\n }\n}, linkProps); // --- Main component ---\n// @vue/component\n\nexport var BNavbarBrand = /*#__PURE__*/Vue.extend({\n name: 'BNavbarBrand',\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var isLink = props.to || props.href;\n var tag = isLink ? BLink : props.tag;\n return h(tag, mergeData(data, {\n staticClass: 'navbar-brand',\n props: isLink ? pluckProps(linkProps, props) : {}\n }), children);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/navbar/navbar-brand.js\n// module id = 211\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { getComponentConfig } from '../../utils/config';\nimport listenOnRootMixin from '../../mixins/listen-on-root';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { VBToggle, EVENT_STATE, EVENT_STATE_SYNC } from '../../directives/toggle/toggle'; // --- Constants ---\n\nvar NAME = 'BNavbarToggle';\nvar CLASS_NAME = 'navbar-toggler'; // --- Main component ---\n// @vue/component\n\nexport var BNavbarToggle = /*#__PURE__*/Vue.extend({\n name: NAME,\n directives: {\n BToggle: VBToggle\n },\n mixins: [listenOnRootMixin, normalizeSlotMixin],\n props: {\n label: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'label');\n }\n },\n target: {\n type: String,\n required: true\n },\n disabled: {\n type: Boolean,\n default: false\n }\n },\n data: function data() {\n return {\n toggleState: false\n };\n },\n created: function created() {\n this.listenOnRoot(EVENT_STATE, this.handleStateEvt);\n this.listenOnRoot(EVENT_STATE_SYNC, this.handleStateEvt);\n },\n methods: {\n onClick: function onClick(evt) {\n if (!this.disabled) {\n // Emit courtesy `click` event\n this.$emit('click', evt);\n }\n },\n handleStateEvt: function handleStateEvt(id, state) {\n // We listen for state events so that we can pass the\n // boolean expanded state to the default scoped slot\n if (id === this.target) {\n this.toggleState = state;\n }\n }\n },\n render: function render(h) {\n var disabled = this.disabled;\n return h('button', {\n staticClass: CLASS_NAME,\n class: {\n disabled: disabled\n },\n directives: [{\n name: 'BToggle',\n value: this.target\n }],\n attrs: {\n type: 'button',\n disabled: disabled,\n 'aria-label': this.label\n },\n on: {\n click: this.onClick\n }\n }, [this.normalizeSlot('default', {\n expanded: this.toggleState\n }) || h('span', {\n staticClass: \"\".concat(CLASS_NAME, \"-icon\")\n })]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/navbar/navbar-toggle.js\n// module id = 212\n// module chunks = 0","import { BOverlay } from './overlay';\nimport { pluginFactory } from '../../utils/plugins';\nvar OverlayPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BOverlay: BOverlay\n }\n});\nexport { OverlayPlugin, BOverlay };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/overlay/index.js\n// module id = 213\n// module chunks = 0","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _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; }\n\nimport Vue from '../../utils/vue';\nimport { BVTransition } from '../../utils/bv-transition';\nimport { toFloat } from '../../utils/number';\nimport normalizeSlotMixin from '../../mixins/normalize-slot';\nimport { BSpinner } from '../spinner/spinner';\nvar positionCover = {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n};\nexport var BOverlay = /*#__PURE__*/Vue.extend({\n name: 'BOverlay',\n mixins: [normalizeSlotMixin],\n props: {\n show: {\n type: Boolean,\n default: false\n },\n variant: {\n type: String,\n default: 'light'\n },\n bgColor: {\n // Alternative to variant, allowing a specific\n // CSS color to be applied to the overlay\n type: String // default: null\n\n },\n opacity: {\n type: [Number, String],\n default: 0.85,\n validator: function validator(value) {\n var number = toFloat(value, 0);\n return number >= 0 && number <= 1;\n }\n },\n blur: {\n type: String,\n default: '2px'\n },\n rounded: {\n type: [Boolean, String],\n default: false\n },\n noCenter: {\n type: Boolean,\n default: false\n },\n noFade: {\n type: Boolean,\n default: false\n },\n spinnerType: {\n type: String,\n default: 'border'\n },\n spinnerVariant: {\n type: String // default: null\n\n },\n spinnerSmall: {\n type: Boolean,\n default: false\n },\n overlayTag: {\n type: String,\n default: 'div'\n },\n wrapTag: {\n type: String,\n default: 'div'\n },\n noWrap: {\n // If set, does not render the default slot\n // and switches to absolute positioning\n type: Boolean,\n default: false\n },\n fixed: {\n type: Boolean,\n default: false\n },\n zIndex: {\n type: [Number, String],\n default: 10\n }\n },\n computed: {\n computedRounded: function computedRounded() {\n var rounded = this.rounded;\n return rounded === true || rounded === '' ? 'rounded' : !rounded ? '' : \"rounded-\".concat(rounded);\n },\n computedVariant: function computedVariant() {\n return this.variant && !this.bgColor ? \"bg-\".concat(this.variant) : '';\n },\n overlayScope: function overlayScope() {\n return {\n spinnerType: this.spinnerType || null,\n spinnerVariant: this.spinnerVariant || null,\n spinnerSmall: this.spinnerSmall\n };\n }\n },\n methods: {\n defaultOverlayFn: function defaultOverlayFn(_ref) {\n var spinnerType = _ref.spinnerType,\n spinnerVariant = _ref.spinnerVariant,\n spinnerSmall = _ref.spinnerSmall;\n return this.$createElement(BSpinner, {\n props: {\n type: spinnerType,\n variant: spinnerVariant,\n small: spinnerSmall\n }\n });\n }\n },\n render: function render(h) {\n var _this = this;\n\n var $overlay = h();\n\n if (this.show) {\n var scope = this.overlayScope; // Overlay backdrop\n\n var $background = h('div', {\n staticClass: 'position-absolute',\n class: [this.computedVariant, this.computedRounded],\n style: _objectSpread(_objectSpread({}, positionCover), {}, {\n opacity: this.opacity,\n backgroundColor: this.bgColor || null,\n backdropFilter: this.blur ? \"blur(\".concat(this.blur, \")\") : null\n })\n }); // Overlay content\n\n var $content = h('div', {\n staticClass: 'position-absolute',\n style: this.noCenter ?\n /* istanbul ignore next */\n _objectSpread({}, positionCover) : {\n top: '50%',\n left: '50%',\n transform: 'translateX(-50%) translateY(-50%)'\n }\n }, [this.normalizeSlot('overlay', scope) || this.defaultOverlayFn(scope)]); // Overlay positioning\n\n $overlay = h(this.overlayTag, {\n key: 'overlay',\n staticClass: 'b-overlay',\n class: {\n 'position-absolute': !this.noWrap || this.noWrap && !this.fixed,\n 'position-fixed': this.noWrap && this.fixed\n },\n style: _objectSpread(_objectSpread({}, positionCover), {}, {\n zIndex: this.zIndex || 10\n }),\n on: {\n click: function click(evt) {\n return _this.$emit('click', evt);\n }\n }\n }, [$background, $content]);\n } // Wrap in a fade transition\n\n\n $overlay = h(BVTransition, {\n props: {\n noFade: this.noFade,\n appear: true\n },\n on: {\n 'after-enter': function afterEnter() {\n return _this.$emit('shown');\n },\n 'after-leave': function afterLeave() {\n return _this.$emit('hidden');\n }\n }\n }, [$overlay]);\n\n if (this.noWrap) {\n return $overlay;\n }\n\n return h(this.wrapTag, {\n staticClass: 'b-overlay-wrap position-relative',\n attrs: {\n 'aria-busy': this.show ? 'true' : null\n }\n }, this.noWrap ? [$overlay] : [this.normalizeSlot('default'), $overlay]);\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/overlay/overlay.js\n// module id = 214\n// module chunks = 0","import { BPagination } from './pagination';\nimport { pluginFactory } from '../../utils/plugins';\nvar PaginationPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BPagination: BPagination\n }\n});\nexport { PaginationPlugin, BPagination };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/pagination/index.js\n// module id = 215\n// module chunks = 0","import Vue from '../../utils/vue';\nimport { getComponentConfig } from '../../utils/config';\nimport { attemptFocus, isVisible } from '../../utils/dom';\nimport { isUndefinedOrNull } from '../../utils/inspect';\nimport { mathCeil, mathMax } from '../../utils/math';\nimport { toInteger } from '../../utils/number';\nimport paginationMixin from '../../mixins/pagination'; // --- Constants ---\n\nvar NAME = 'BPagination';\nvar DEFAULT_PER_PAGE = 20;\nvar DEFAULT_TOTAL_ROWS = 0;\nvar props = {\n size: {\n type: String,\n default: function _default() {\n return getComponentConfig(NAME, 'size');\n }\n },\n perPage: {\n type: [Number, String],\n default: DEFAULT_PER_PAGE\n },\n totalRows: {\n type: [Number, String],\n default: DEFAULT_TOTAL_ROWS\n },\n ariaControls: {\n type: String // default: null\n\n }\n}; // --- Helper functions ---\n// Sanitize the provided per page number (converting to a number)\n\nvar sanitizePerPage = function sanitizePerPage(val) {\n return mathMax(toInteger(val) || DEFAULT_PER_PAGE, 1);\n}; // Sanitize the provided total rows number (converting to a number)\n\n\nvar sanitizeTotalRows = function sanitizeTotalRows(val) {\n return mathMax(toInteger(val) || DEFAULT_TOTAL_ROWS, 0);\n}; // The render function is brought in via the `paginationMixin`\n// @vue/component\n\n\nexport var BPagination = /*#__PURE__*/Vue.extend({\n name: NAME,\n mixins: [paginationMixin],\n props: props,\n computed: {\n numberOfPages: function numberOfPages() {\n var result = mathCeil(sanitizeTotalRows(this.totalRows) / sanitizePerPage(this.perPage));\n return result < 1 ? 1 : result;\n },\n pageSizeNumberOfPages: function pageSizeNumberOfPages() {\n // Used for watching changes to `perPage` and `numberOfPages`\n return {\n perPage: sanitizePerPage(this.perPage),\n totalRows: sanitizeTotalRows(this.totalRows),\n numberOfPages: this.numberOfPages\n };\n }\n },\n watch: {\n pageSizeNumberOfPages: function pageSizeNumberOfPages(newVal, oldVal) {\n if (!isUndefinedOrNull(oldVal)) {\n if (newVal.perPage !== oldVal.perPage && newVal.totalRows === oldVal.totalRows) {\n // If the page size changes, reset to page 1\n this.currentPage = 1;\n } else if (newVal.numberOfPages !== oldVal.numberOfPages && this.currentPage > newVal.numberOfPages) {\n // If `numberOfPages` changes and is less than\n // the `currentPage` number, reset to page 1\n this.currentPage = 1;\n }\n }\n\n this.localNumberOfPages = newVal.numberOfPages;\n }\n },\n created: function created() {\n var _this = this;\n\n // Set the initial page count\n this.localNumberOfPages = this.numberOfPages; // Set the initial page value\n\n var currentPage = toInteger(this.value, 0);\n\n if (currentPage > 0) {\n this.currentPage = currentPage;\n } else {\n this.$nextTick(function () {\n // If this value parses to NaN or a value less than 1\n // Trigger an initial emit of 'null' if no page specified\n _this.currentPage = 0;\n });\n }\n },\n mounted: function mounted() {\n // Set the initial page count\n this.localNumberOfPages = this.numberOfPages;\n },\n methods: {\n // These methods are used by the render function\n onClick: function onClick(num, evt) {\n var _this2 = this;\n\n // Handle edge cases where number of pages has changed (i.e. if perPage changes)\n // This should normally not happen, but just in case.\n if (num > this.numberOfPages) {\n /* istanbul ignore next */\n num = this.numberOfPages;\n } else if (num < 1) {\n /* istanbul ignore next */\n num = 1;\n } // Update the v-model\n\n\n this.currentPage = num; // Emit event triggered by user interaction\n\n this.$emit('change', this.currentPage);\n this.$nextTick(function () {\n // Keep the current button focused if possible\n var target = evt.target;\n\n if (isVisible(target) && _this2.$el.contains(target)) {\n attemptFocus(target);\n } else {\n _this2.focusCurrent();\n }\n });\n },\n makePage: function makePage(pageNum) {\n return pageNum;\n },\n\n /* istanbul ignore next */\n linkProps: function linkProps() {\n // No props, since we render a plain button\n\n /* istanbul ignore next */\n return {};\n }\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/bootstrap-vue/esm/components/pagination/pagination.js\n// module id = 216\n// module chunks = 0","import KeyCodes from '../utils/key-codes';\nimport range from '../utils/range';\nimport { attemptFocus, getActiveElement, getAttr, isDisabled, isVisible, selectAll } from '../utils/dom';\nimport { isFunction, isNull } from '../utils/inspect';\nimport { mathFloor, mathMax, mathMin } from '../utils/math';\nimport { toInteger } from '../utils/number';\nimport { toString } from '../utils/string';\nimport { warn } from '../utils/warn';\nimport normalizeSlotMixin from '../mixins/normalize-slot';\nimport { BLink } from '../components/link/link'; // Common props, computed, data, render function, and methods\n// for `` and ``\n// --- Constants ---\n// Threshold of limit size when we start/stop showing ellipsis\n\nvar ELLIPSIS_THRESHOLD = 3; // Default # of buttons limit\n\nvar DEFAULT_LIMIT = 5; // --- Helper methods ---\n// Make an array of N to N+X\n\nvar makePageArray = function makePageArray(startNumber, numberOfPages) {\n return range(numberOfPages).map(function (val, i) {\n return {\n number: startNumber + i,\n classes: null\n };\n });\n}; // Sanitize the provided limit value (converting to a number)\n\n\nvar sanitizeLimit = function sanitizeLimit(val) {\n var limit = toInteger(val) || 1;\n return limit < 1 ? DEFAULT_LIMIT : limit;\n}; // Sanitize the provided current page number (converting to a number)\n\n\nvar sanitizeCurrentPage = function sanitizeCurrentPage(val, numberOfPages) {\n var page = toInteger(val) || 1;\n return page > numberOfPages ? numberOfPages : page < 1 ? 1 : page;\n}; // Links don't normally respond to SPACE, so we add that\n// functionality via this handler\n\n\nvar onSpaceKey = function onSpaceKey(evt) {\n if (evt.keyCode === KeyCodes.SPACE) {\n evt.preventDefault(); // Stop page from scrolling\n\n evt.stopImmediatePropagation();\n evt.stopPropagation(); // Trigger the click event on the link\n\n evt.currentTarget.click();\n return false;\n }\n}; // --- Props ---\n\n\nexport var props = {\n disabled: {\n type: Boolean,\n default: false\n },\n value: {\n type: [Number, String],\n default: null,\n validator: function validator(value)\n /* istanbul ignore next */\n {\n if (!isNull(value) && toInteger(value, 0) < 1) {\n warn('\"v-model\" value must be a number greater than \"0\"', 'BPagination');\n return false;\n }\n\n return true;\n }\n },\n limit: {\n type: [Number, String],\n default: DEFAULT_LIMIT,\n validator: function validator(value)\n /* istanbul ignore next */\n {\n if (toInteger(value, 0) < 1) {\n warn('Prop \"limit\" must be a number greater than \"0\"', 'BPagination');\n return false;\n }\n\n return true;\n }\n },\n align: {\n type: String,\n default: 'left'\n },\n pills: {\n type: Boolean,\n default: false\n },\n hideGotoEndButtons: {\n type: Boolean,\n default: false\n },\n ariaLabel: {\n type: String,\n default: 'Pagination'\n },\n labelFirstPage: {\n type: String,\n default: 'Go to first page'\n },\n firstText: {\n type: String,\n default: \"\\xAB\" // '«'\n\n },\n firstNumber: {\n type: Boolean,\n default: false\n },\n firstClass: {\n type: [String, Array, Object],\n default: null\n },\n labelPrevPage: {\n type: String,\n default: 'Go to previous page'\n },\n prevText: {\n type: String,\n default: \"\\u2039\" // '‹'\n\n },\n prevClass: {\n type: [String, Array, Object],\n default: null\n },\n labelNextPage: {\n type: String,\n default: 'Go to next page'\n },\n nextText: {\n type: String,\n default: \"\\u203A\" // '›'\n\n },\n nextClass: {\n type: [String, Array, Object] // default: null\n\n },\n labelLastPage: {\n type: String,\n default: 'Go to last page'\n },\n lastText: {\n type: String,\n default: \"\\xBB\" // '»'\n\n },\n lastNumber: {\n type: Boolean,\n default: false\n },\n lastClass: {\n type: [String, Array, Object] // default: null\n\n },\n labelPage: {\n type: [String, Function],\n default: 'Go to page'\n },\n pageClass: {\n type: [String, Array, Object] // default: null\n\n },\n hideEllipsis: {\n type: Boolean,\n default: false\n },\n ellipsisText: {\n type: String,\n default: \"\\u2026\" // '…'\n\n },\n ellipsisClass: {\n type: [String, Array, Object] // default: null\n\n }\n}; // @vue/component\n\nexport default {\n mixins: [normalizeSlotMixin],\n model: {\n prop: 'value',\n event: 'input'\n },\n props: props,\n data: function data() {\n // `-1` signifies no page initially selected\n var currentPage = toInteger(this.value, 0);\n currentPage = currentPage > 0 ? currentPage : -1;\n return {\n currentPage: currentPage,\n localNumberOfPages: 1,\n localLimit: DEFAULT_LIMIT\n };\n },\n computed: {\n btnSize: function btnSize() {\n return this.size ? \"pagination-\".concat(this.size) : '';\n },\n alignment: function alignment() {\n var align = this.align;\n\n if (align === 'center') {\n return 'justify-content-center';\n } else if (align === 'end' || align === 'right') {\n return 'justify-content-end';\n } else if (align === 'fill') {\n // The page-items will also have 'flex-fill' added\n // We add text centering to make the button appearance better in fill mode\n return 'text-center';\n }\n\n return '';\n },\n styleClass: function styleClass() {\n return this.pills ? 'b-pagination-pills' : '';\n },\n computedCurrentPage: function computedCurrentPage() {\n return sanitizeCurrentPage(this.currentPage, this.localNumberOfPages);\n },\n paginationParams: function paginationParams() {\n // Determine if we should show the the ellipsis\n var limit = this.localLimit;\n var numberOfPages = this.localNumberOfPages;\n var currentPage = this.computedCurrentPage;\n var hideEllipsis = this.hideEllipsis;\n var firstNumber = this.firstNumber;\n var lastNumber = this.lastNumber;\n var showFirstDots = false;\n var showLastDots = false;\n var numberOfLinks = limit;\n var startNumber = 1;\n\n if (numberOfPages <= limit) {\n // Special case: Less pages available than the limit of displayed pages\n numberOfLinks = numberOfPages;\n } else if (currentPage < limit - 1 && limit > ELLIPSIS_THRESHOLD) {\n if (!hideEllipsis || lastNumber) {\n showLastDots = true;\n numberOfLinks = limit - (firstNumber ? 0 : 1);\n }\n\n numberOfLinks = mathMin(numberOfLinks, limit);\n } else if (numberOfPages - currentPage + 2 < limit && limit > ELLIPSIS_THRESHOLD) {\n if (!hideEllipsis || firstNumber) {\n showFirstDots = true;\n numberOfLinks = limit - (lastNumber ? 0 : 1);\n }\n\n startNumber = numberOfPages - numberOfLinks + 1;\n } else {\n // We are somewhere in the middle of the page list\n if (limit > ELLIPSIS_THRESHOLD) {\n numberOfLinks = limit - 2;\n showFirstDots = !!(!hideEllipsis || firstNumber);\n showLastDots = !!(!hideEllipsis || lastNumber);\n }\n\n startNumber = currentPage - mathFloor(numberOfLinks / 2);\n } // Sanity checks\n\n /* istanbul ignore if */\n\n\n if (startNumber < 1) {\n startNumber = 1;\n showFirstDots = false;\n } else if (startNumber > numberOfPages - numberOfLinks) {\n startNumber = numberOfPages - numberOfLinks + 1;\n showLastDots = false;\n }\n\n if (showFirstDots && firstNumber && startNumber < 4) {\n numberOfLinks = numberOfLinks + 2;\n startNumber = 1;\n showFirstDots = false;\n }\n\n var lastPageNumber = startNumber + numberOfLinks - 1;\n\n if (showLastDots && lastNumber && lastPageNumber > numberOfPages - 3) {\n numberOfLinks = numberOfLinks + (lastPageNumber === numberOfPages - 2 ? 2 : 3);\n showLastDots = false;\n } // Special handling for lower limits (where ellipsis are never shown)\n\n\n if (limit <= ELLIPSIS_THRESHOLD) {\n if (firstNumber && startNumber === 1) {\n numberOfLinks = mathMin(numberOfLinks + 1, numberOfPages, limit + 1);\n } else if (lastNumber && numberOfPages === startNumber + numberOfLinks - 1) {\n startNumber = mathMax(startNumber - 1, 1);\n numberOfLinks = mathMin(numberOfPages - startNumber + 1, numberOfPages, limit + 1);\n }\n }\n\n numberOfLinks = mathMin(numberOfLinks, numberOfPages - startNumber + 1);\n return {\n showFirstDots: showFirstDots,\n showLastDots: showLastDots,\n numberOfLinks: numberOfLinks,\n startNumber: startNumber\n };\n },\n pageList: function pageList() {\n // Generates the pageList array\n var _this$paginationParam = this.paginationParams,\n numberOfLinks = _this$paginationParam.numberOfLinks,\n startNumber = _this$paginationParam.startNumber;\n var currentPage = this.computedCurrentPage; // Generate list of page numbers\n\n var pages = makePageArray(startNumber, numberOfLinks); // We limit to a total of 3 page buttons on XS screens\n // So add classes to page links to hide them for XS breakpoint\n // Note: Ellipsis will also be hidden on XS screens\n // TODO: Make this visual limit configurable based on breakpoint(s)\n\n if (pages.length > 3) {\n var idx = currentPage - startNumber; // THe following is a bootstrap-vue custom utility class\n\n var classes = 'bv-d-xs-down-none';\n\n if (idx === 0) {\n // Keep leftmost 3 buttons visible when current page is first page\n for (var i = 3; i < pages.length; i++) {\n pages[i].classes = classes;\n }\n } else if (idx === pages.length - 1) {\n // Keep rightmost 3 buttons visible when current page is last page\n for (var _i = 0; _i < pages.length - 3; _i++) {\n pages[_i].classes = classes;\n }\n } else {\n // Hide all except current page, current page - 1 and current page + 1\n for (var _i2 = 0; _i2 < idx - 1; _i2++) {\n // hide some left button(s)\n pages[_i2].classes = classes;\n }\n\n for (var _i3 = pages.length - 1; _i3 > idx + 1; _i3--) {\n // hide some right button(s)\n pages[_i3].classes = classes;\n }\n }\n }\n\n return pages;\n }\n },\n watch: {\n value: function value(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.currentPage = sanitizeCurrentPage(newValue, this.localNumberOfPages);\n }\n },\n currentPage: function currentPage(newValue, oldValue) {\n if (newValue !== oldValue) {\n // Emit null if no page selected\n this.$emit('input', newValue > 0 ? newValue : null);\n }\n },\n limit: function limit(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.localLimit = sanitizeLimit(newValue);\n }\n }\n },\n created: function created() {\n var _this = this;\n\n // Set our default values in data\n this.localLimit = sanitizeLimit(this.limit);\n this.$nextTick(function () {\n // Sanity check\n _this.currentPage = _this.currentPage > _this.localNumberOfPages ? _this.localNumberOfPages : _this.currentPage;\n });\n },\n methods: {\n handleKeyNav: function handleKeyNav(evt) {\n var keyCode = evt.keyCode,\n shiftKey = evt.shiftKey;\n /* istanbul ignore if */\n\n if (this.isNav) {\n // We disable left/right keyboard navigation in ``\n return;\n }\n\n if (keyCode === KeyCodes.LEFT || keyCode === KeyCodes.UP) {\n evt.preventDefault();\n shiftKey ? this.focusFirst() : this.focusPrev();\n } else if (keyCode === KeyCodes.RIGHT || keyCode === KeyCodes.DOWN) {\n evt.preventDefault();\n shiftKey ? this.focusLast() : this.focusNext();\n }\n },\n getButtons: function getButtons() {\n // Return only buttons that are visible\n return selectAll('button.page-link, a.page-link', this.$el).filter(function (btn) {\n return isVisible(btn);\n });\n },\n focusCurrent: function focusCurrent() {\n var _this2 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var btn = _this2.getButtons().find(function (el) {\n return toInteger(getAttr(el, 'aria-posinset'), 0) === _this2.computedCurrentPage;\n });\n\n if (!attemptFocus(btn)) {\n // Fallback if current page is not in button list\n _this2.focusFirst();\n }\n });\n },\n focusFirst: function focusFirst() {\n var _this3 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var btn = _this3.getButtons().find(function (el) {\n return !isDisabled(el);\n });\n\n attemptFocus(btn);\n });\n },\n focusLast: function focusLast() {\n var _this4 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var btn = _this4.getButtons().reverse().find(function (el) {\n return !isDisabled(el);\n });\n\n attemptFocus(btn);\n });\n },\n focusPrev: function focusPrev() {\n var _this5 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var buttons = _this5.getButtons();\n\n var index = buttons.indexOf(getActiveElement());\n\n if (index > 0 && !isDisabled(buttons[index - 1])) {\n attemptFocus(buttons[index - 1]);\n }\n });\n },\n focusNext: function focusNext() {\n var _this6 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var buttons = _this6.getButtons();\n\n var index = buttons.indexOf(getActiveElement());\n\n if (index < buttons.length - 1 && !isDisabled(buttons[index + 1])) {\n attemptFocus(buttons[index + 1]);\n }\n });\n }\n },\n render: function render(h) {\n var _this7 = this;\n\n var buttons = [];\n var numberOfPages = this.localNumberOfPages;\n var pageNumbers = this.pageList.map(function (p) {\n return p.number;\n });\n var disabled = this.disabled;\n var _this$paginationParam2 = this.paginationParams,\n showFirstDots = _this$paginationParam2.showFirstDots,\n showLastDots = _this$paginationParam2.showLastDots;\n var currentPage = this.computedCurrentPage;\n var fill = this.align === 'fill'; // Used to control what type of aria attributes are rendered and wrapper\n\n var isNav = this.isNav; // Helper function and flag\n\n var isActivePage = function isActivePage(pageNumber) {\n return pageNumber === currentPage;\n };\n\n var noCurrentPage = this.currentPage < 1; // Factory function for prev/next/first/last buttons\n\n var makeEndBtn = function makeEndBtn(linkTo, ariaLabel, btnSlot, btnText, btnClass, pageTest, key) {\n var isDisabled = disabled || isActivePage(pageTest) || noCurrentPage || linkTo < 1 || linkTo > numberOfPages;\n var pageNumber = linkTo < 1 ? 1 : linkTo > numberOfPages ? numberOfPages : linkTo;\n var scope = {\n disabled: isDisabled,\n page: pageNumber,\n index: pageNumber - 1\n };\n var $btnContent = _this7.normalizeSlot(btnSlot, scope) || toString(btnText) || h();\n var $inner = h(isDisabled ? 'span' : isNav ? BLink : 'button', {\n staticClass: 'page-link',\n class: {\n 'flex-grow-1': !isNav && !isDisabled && fill\n },\n props: isDisabled || !isNav ? {} : _this7.linkProps(linkTo),\n attrs: {\n role: isNav ? null : 'menuitem',\n type: isNav || isDisabled ? null : 'button',\n tabindex: isDisabled || isNav ? null : '-1',\n 'aria-label': ariaLabel,\n 'aria-controls': _this7.ariaControls || null,\n 'aria-disabled': isDisabled ? 'true' : null\n },\n on: isDisabled ? {} : {\n '!click': function click(evt) {\n _this7.onClick(linkTo, evt);\n },\n keydown: onSpaceKey\n }\n }, [$btnContent]);\n return h('li', {\n key: key,\n staticClass: 'page-item',\n class: [{\n disabled: isDisabled,\n 'flex-fill': fill,\n 'd-flex': fill && !isNav && !isDisabled\n }, btnClass],\n attrs: {\n role: isNav ? null : 'presentation',\n 'aria-hidden': isDisabled ? 'true' : null\n }\n }, [$inner]);\n }; // Ellipsis factory\n\n\n var makeEllipsis = function makeEllipsis(isLast) {\n return h('li', {\n key: \"ellipsis-\".concat(isLast ? 'last' : 'first'),\n staticClass: 'page-item',\n class: ['disabled', 'bv-d-xs-down-none', fill ? 'flex-fill' : '', _this7.ellipsisClass],\n attrs: {\n role: 'separator'\n }\n }, [h('span', {\n staticClass: 'page-link'\n }, [_this7.normalizeSlot('ellipsis-text') || toString(_this7.ellipsisText) || h()])]);\n }; // Page button factory\n\n\n var makePageButton = function makePageButton(page, idx) {\n var active = isActivePage(page.number) && !noCurrentPage; // Active page will have tabindex of 0, or if no current page and first page button\n\n var tabIndex = disabled ? null : active || noCurrentPage && idx === 0 ? '0' : '-1';\n var attrs = {\n role: isNav ? null : 'menuitemradio',\n type: isNav || disabled ? null : 'button',\n 'aria-disabled': disabled ? 'true' : null,\n 'aria-controls': _this7.ariaControls || null,\n 'aria-label': isFunction(_this7.labelPage) ?\n /* istanbul ignore next */\n _this7.labelPage(page.number) : \"\".concat(_this7.labelPage, \" \").concat(page.number),\n 'aria-checked': isNav ? null : active ? 'true' : 'false',\n 'aria-current': isNav && active ? 'page' : null,\n 'aria-posinset': page.number,\n 'aria-setsize': numberOfPages,\n // ARIA \"roving tabindex\" method (except in isNav mode)\n tabindex: isNav ? null : tabIndex\n };\n var btnContent = toString(_this7.makePage(page.number));\n var scope = {\n page: page.number,\n index: page.number - 1,\n content: btnContent,\n active: active,\n disabled: disabled\n };\n var $inner = h(disabled ? 'span' : isNav ? BLink : 'button', {\n props: disabled || !isNav ? {} : _this7.linkProps(page.number),\n staticClass: 'page-link',\n class: {\n 'flex-grow-1': !isNav && !disabled && fill\n },\n attrs: attrs,\n on: disabled ? {} : {\n '!click': function click(evt) {\n _this7.onClick(page.number, evt);\n },\n keydown: onSpaceKey\n }\n }, [_this7.normalizeSlot('page', scope) || btnContent]);\n return h('li', {\n key: \"page-\".concat(page.number),\n staticClass: 'page-item',\n class: [{\n disabled: disabled,\n active: active,\n 'flex-fill': fill,\n 'd-flex': fill && !isNav && !disabled\n }, page.classes, _this7.pageClass],\n attrs: {\n role: isNav ? null : 'presentation'\n }\n }, [$inner]);\n }; // Goto first page button\n // Don't render button when `hideGotoEndButtons` or `firstNumber` is set\n\n\n var $firstPageBtn = h();\n\n if (!this.firstNumber && !this.hideGotoEndButtons) {\n $firstPageBtn = makeEndBtn(1, this.labelFirstPage, 'first-text', this.firstText, this.firstClass, 1, 'pagination-goto-first');\n }\n\n buttons.push($firstPageBtn); // Goto previous page button\n\n buttons.push(makeEndBtn(currentPage - 1, this.labelPrevPage, 'prev-text', this.prevText, this.prevClass, 1, 'pagination-goto-prev')); // Show first (1) button?\n\n buttons.push(this.firstNumber && pageNumbers[0] !== 1 ? makePageButton({\n number: 1\n }, 0) : h()); // First ellipsis\n\n buttons.push(showFirstDots ? makeEllipsis(false) : h()); // Individual page links\n\n this.pageList.forEach(function (page, idx) {\n var offset = showFirstDots && _this7.firstNumber && pageNumbers[0] !== 1 ? 1 : 0;\n buttons.push(makePageButton(page, idx + offset));\n }); // Last ellipsis\n\n buttons.push(showLastDots ? makeEllipsis(true) : h()); // Show last page button?\n\n buttons.push(this.lastNumber && pageNumbers[pageNumbers.length - 1] !== numberOfPages ? makePageButton({\n number: numberOfPages\n }, -1) : h()); // Goto next page button\n\n buttons.push(makeEndBtn(currentPage + 1, this.labelNextPage, 'next-text', this.nextText, this.nextClass, numberOfPages, 'pagination-goto-next')); // Goto last page button\n // Don't render button when `hideGotoEndButtons` or `lastNumber` is set\n\n var $lastPageBtn = h();\n\n if (!this.lastNumber && !this.hideGotoEndButtons) {\n $lastPageBtn = makeEndBtn(numberOfPages, this.labelLastPage, 'last-text', this.lastText, this.lastClass, numberOfPages, 'pagination-goto-last');\n }\n\n buttons.push($lastPageBtn); // Assemble the pagination buttons\n\n var $pagination = h('ul', {\n ref: 'ul',\n staticClass: 'pagination',\n class: ['b-pagination', this.btnSize, this.alignment, this.styleClass],\n attrs: {\n role: isNav ? null : 'menubar',\n 'aria-disabled': disabled ? 'true' : 'false',\n 'aria-label': isNav ? null : this.ariaLabel || null\n },\n // We disable keyboard left/right nav when ``\n on: isNav ? {} : {\n keydown: this.handleKeyNav\n }\n }, buttons); // If we are ``, wrap in `