UNPKG

hot-form

Version:

A project developed based on ant-design-vue and vant whitch do some things on create/render/modify and etc. for forms. Also can custom some component on the form items if you want. 一个基于antdv/vant开发的创建表单组件,包含表单渲染、表单编辑页面、以及植入自定义附加内容的组件

1,673 lines (1,598 loc) 7.45 MB
module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "fb15"); /******/ }) /************************************************************************/ /******/ ({ /***/ "00ee": /***/ (function(module, exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__("b622"); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), /***/ "00fd": /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__("9e69"); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } module.exports = getRawTag; /***/ }), /***/ "010e": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Uzbek Latin [uz-latn] //! author : Rasulbek Mirzayev : github.com/Rasulbeeek ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var uzLatn = moment.defineLocale('uz-latn', { months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split( '_' ), monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'), weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split( '_' ), weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'), weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'), longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'D MMMM YYYY, dddd HH:mm', }, calendar: { sameDay: '[Bugun soat] LT [da]', nextDay: '[Ertaga] LT [da]', nextWeek: 'dddd [kuni soat] LT [da]', lastDay: '[Kecha soat] LT [da]', lastWeek: "[O'tgan] dddd [kuni soat] LT [da]", sameElse: 'L', }, relativeTime: { future: 'Yaqin %s ichida', past: 'Bir necha %s oldin', s: 'soniya', ss: '%d soniya', m: 'bir daqiqa', mm: '%d daqiqa', h: 'bir soat', hh: '%d soat', d: 'bir kun', dd: '%d kun', M: 'bir oy', MM: '%d oy', y: 'bir yil', yy: '%d yil', }, week: { dow: 1, // Monday is the first day of the week. doy: 7, // The week that contains Jan 7th is the first week of the year. }, }); return uzLatn; }))); /***/ }), /***/ "02fb": /***/ (function(module, exports, __webpack_require__) { //! moment.js locale configuration //! locale : Malayalam [ml] //! author : Floyd Pink : https://github.com/floydpink ;(function (global, factory) { true ? factory(__webpack_require__("c1df")) : undefined }(this, (function (moment) { 'use strict'; //! moment.js locale configuration var ml = moment.defineLocale('ml', { months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split( '_' ), monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split( '_' ), monthsParseExact: true, weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split( '_' ), weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), longDateFormat: { LT: 'A h:mm -നു', LTS: 'A h:mm:ss -നു', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY, A h:mm -നു', LLLL: 'dddd, D MMMM YYYY, A h:mm -നു', }, calendar: { sameDay: '[ഇന്ന്] LT', nextDay: '[നാളെ] LT', nextWeek: 'dddd, LT', lastDay: '[ഇന്നലെ] LT', lastWeek: '[കഴിഞ്ഞ] dddd, LT', sameElse: 'L', }, relativeTime: { future: '%s കഴിഞ്ഞ്', past: '%s മുൻപ്', s: 'അൽപ നിമിഷങ്ങൾ', ss: '%d സെക്കൻഡ്', m: 'ഒരു മിനിറ്റ്', mm: '%d മിനിറ്റ്', h: 'ഒരു മണിക്കൂർ', hh: '%d മണിക്കൂർ', d: 'ഒരു ദിവസം', dd: '%d ദിവസം', M: 'ഒരു മാസം', MM: '%d മാസം', y: 'ഒരു വർഷം', yy: '%d വർഷം', }, meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, meridiemHour: function (hour, meridiem) { if (hour === 12) { hour = 0; } if ( (meridiem === 'രാത്രി' && hour >= 4) || meridiem === 'ഉച്ച കഴിഞ്ഞ്' || meridiem === 'വൈകുന്നേരം' ) { return hour + 12; } else { return hour; } }, meridiem: function (hour, minute, isLower) { if (hour < 4) { return 'രാത്രി'; } else if (hour < 12) { return 'രാവിലെ'; } else if (hour < 17) { return 'ഉച്ച കഴിഞ്ഞ്'; } else if (hour < 20) { return 'വൈകുന്നേരം'; } else { return 'രാത്രി'; } }, }); return ml; }))); /***/ }), /***/ "030f": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.10.3 (2022-02-09) */ (function () { 'use strict'; var typeOf = function (x) { var t = typeof x; if (x === null) { return 'null'; } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { return 'array'; } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { return 'string'; } else { return t; } }; var isType$1 = function (type) { return function (value) { return typeOf(value) === type; }; }; var isSimpleType = function (type) { return function (value) { return typeof value === type; }; }; var eq$1 = function (t) { return function (a) { return t === a; }; }; var isString = isType$1('string'); var isObject = isType$1('object'); var isArray = isType$1('array'); var isNull = eq$1(null); var isBoolean = isSimpleType('boolean'); var isUndefined = eq$1(undefined); var isNullable = function (a) { return a === null || a === undefined; }; var isNonNullable = function (a) { return !isNullable(a); }; var isFunction = isSimpleType('function'); var isNumber = isSimpleType('number'); var isArrayOf = function (value, pred) { if (isArray(value)) { for (var i = 0, len = value.length; i < len; ++i) { if (!pred(value[i])) { return false; } } return true; } return false; }; var noop = function () { }; var noarg = function (f) { return function () { return f(); }; }; var compose = function (fa, fb) { return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return fa(fb.apply(null, args)); }; }; var compose1 = function (fbc, fab) { return function (a) { return fbc(fab(a)); }; }; var constant$1 = function (value) { return function () { return value; }; }; var identity$1 = function (x) { return x; }; var tripleEquals = function (a, b) { return a === b; }; function curry(fn) { var initialArgs = []; for (var _i = 1; _i < arguments.length; _i++) { initialArgs[_i - 1] = arguments[_i]; } return function () { var restArgs = []; for (var _i = 0; _i < arguments.length; _i++) { restArgs[_i] = arguments[_i]; } var all = initialArgs.concat(restArgs); return fn.apply(null, all); }; } var not = function (f) { return function (t) { return !f(t); }; }; var die = function (msg) { return function () { throw new Error(msg); }; }; var never = constant$1(false); var always = constant$1(true); var global$g = tinymce.util.Tools.resolve('tinymce.ThemeManager'); var __assign = function () { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === 'function') for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } var none = function () { return NONE; }; var NONE = function () { var call = function (thunk) { return thunk(); }; var id = identity$1; var me = { fold: function (n, _s) { return n(); }, isSome: never, isNone: always, getOr: id, getOrThunk: call, getOrDie: function (msg) { throw new Error(msg || 'error: getOrDie called on none.'); }, getOrNull: constant$1(null), getOrUndefined: constant$1(undefined), or: id, orThunk: call, map: none, each: noop, bind: none, exists: never, forall: always, filter: function () { return none(); }, toArray: function () { return []; }, toString: constant$1('none()') }; return me; }(); var some = function (a) { var constant_a = constant$1(a); var self = function () { return me; }; var bind = function (f) { return f(a); }; var me = { fold: function (n, s) { return s(a); }, isSome: always, isNone: never, getOr: constant_a, getOrThunk: constant_a, getOrDie: constant_a, getOrNull: constant_a, getOrUndefined: constant_a, or: self, orThunk: self, map: function (f) { return some(f(a)); }, each: function (f) { f(a); }, bind: bind, exists: bind, forall: bind, filter: function (f) { return f(a) ? me : NONE; }, toArray: function () { return [a]; }, toString: function () { return 'some(' + a + ')'; } }; return me; }; var from$1 = function (value) { return value === null || value === undefined ? NONE : some(value); }; var Optional = { some: some, none: none, from: from$1 }; var nativeSlice = Array.prototype.slice; var nativeIndexOf = Array.prototype.indexOf; var nativePush = Array.prototype.push; var rawIndexOf = function (ts, t) { return nativeIndexOf.call(ts, t); }; var indexOf = function (xs, x) { var r = rawIndexOf(xs, x); return r === -1 ? Optional.none() : Optional.some(r); }; var contains$2 = function (xs, x) { return rawIndexOf(xs, x) > -1; }; var exists = function (xs, pred) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; if (pred(x, i)) { return true; } } return false; }; var range$2 = function (num, f) { var r = []; for (var i = 0; i < num; i++) { r.push(f(i)); } return r; }; var chunk$1 = function (array, size) { var r = []; for (var i = 0; i < array.length; i += size) { var s = nativeSlice.call(array, i, i + size); r.push(s); } return r; }; var map$2 = function (xs, f) { var len = xs.length; var r = new Array(len); for (var i = 0; i < len; i++) { var x = xs[i]; r[i] = f(x, i); } return r; }; var each$1 = function (xs, f) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; f(x, i); } }; var eachr = function (xs, f) { for (var i = xs.length - 1; i >= 0; i--) { var x = xs[i]; f(x, i); } }; var partition$3 = function (xs, pred) { var pass = []; var fail = []; for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; var arr = pred(x, i) ? pass : fail; arr.push(x); } return { pass: pass, fail: fail }; }; var filter$2 = function (xs, pred) { var r = []; for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; if (pred(x, i)) { r.push(x); } } return r; }; var foldr = function (xs, f, acc) { eachr(xs, function (x, i) { acc = f(acc, x, i); }); return acc; }; var foldl = function (xs, f, acc) { each$1(xs, function (x, i) { acc = f(acc, x, i); }); return acc; }; var findUntil = function (xs, pred, until) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; if (pred(x, i)) { return Optional.some(x); } else if (until(x, i)) { break; } } return Optional.none(); }; var find$5 = function (xs, pred) { return findUntil(xs, pred, never); }; var findIndex$1 = function (xs, pred) { for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; if (pred(x, i)) { return Optional.some(i); } } return Optional.none(); }; var flatten = function (xs) { var r = []; for (var i = 0, len = xs.length; i < len; ++i) { if (!isArray(xs[i])) { throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); } nativePush.apply(r, xs[i]); } return r; }; var bind$3 = function (xs, f) { return flatten(map$2(xs, f)); }; var forall = function (xs, pred) { for (var i = 0, len = xs.length; i < len; ++i) { var x = xs[i]; if (pred(x, i) !== true) { return false; } } return true; }; var reverse = function (xs) { var r = nativeSlice.call(xs, 0); r.reverse(); return r; }; var difference = function (a1, a2) { return filter$2(a1, function (x) { return !contains$2(a2, x); }); }; var mapToObject = function (xs, f) { var r = {}; for (var i = 0, len = xs.length; i < len; i++) { var x = xs[i]; r[String(x)] = f(x, i); } return r; }; var pure$2 = function (x) { return [x]; }; var sort = function (xs, comparator) { var copy = nativeSlice.call(xs, 0); copy.sort(comparator); return copy; }; var get$f = function (xs, i) { return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); }; var head = function (xs) { return get$f(xs, 0); }; var last$2 = function (xs) { return get$f(xs, xs.length - 1); }; var from = isFunction(Array.from) ? Array.from : function (x) { return nativeSlice.call(x); }; var findMap = function (arr, f) { for (var i = 0; i < arr.length; i++) { var r = f(arr[i], i); if (r.isSome()) { return r; } } return Optional.none(); }; var keys = Object.keys; var hasOwnProperty = Object.hasOwnProperty; var each = function (obj, f) { var props = keys(obj); for (var k = 0, len = props.length; k < len; k++) { var i = props[k]; var x = obj[i]; f(x, i); } }; var map$1 = function (obj, f) { return tupleMap(obj, function (x, i) { return { k: i, v: f(x, i) }; }); }; var tupleMap = function (obj, f) { var r = {}; each(obj, function (x, i) { var tuple = f(x, i); r[tuple.k] = tuple.v; }); return r; }; var objAcc = function (r) { return function (x, i) { r[i] = x; }; }; var internalFilter = function (obj, pred, onTrue, onFalse) { var r = {}; each(obj, function (x, i) { (pred(x, i) ? onTrue : onFalse)(x, i); }); return r; }; var filter$1 = function (obj, pred) { var t = {}; internalFilter(obj, pred, objAcc(t), noop); return t; }; var mapToArray = function (obj, f) { var r = []; each(obj, function (value, name) { r.push(f(value, name)); }); return r; }; var find$4 = function (obj, pred) { var props = keys(obj); for (var k = 0, len = props.length; k < len; k++) { var i = props[k]; var x = obj[i]; if (pred(x, i, obj)) { return Optional.some(x); } } return Optional.none(); }; var values = function (obj) { return mapToArray(obj, identity$1); }; var get$e = function (obj, key) { return has$2(obj, key) ? Optional.from(obj[key]) : Optional.none(); }; var has$2 = function (obj, key) { return hasOwnProperty.call(obj, key); }; var hasNonNullableKey = function (obj, key) { return has$2(obj, key) && obj[key] !== undefined && obj[key] !== null; }; var is$1 = function (lhs, rhs, comparator) { if (comparator === void 0) { comparator = tripleEquals; } return lhs.exists(function (left) { return comparator(left, rhs); }); }; var equals = function (lhs, rhs, comparator) { if (comparator === void 0) { comparator = tripleEquals; } return lift2(lhs, rhs, comparator).getOr(lhs.isNone() && rhs.isNone()); }; var cat = function (arr) { var r = []; var push = function (x) { r.push(x); }; for (var i = 0; i < arr.length; i++) { arr[i].each(push); } return r; }; var sequence = function (arr) { var r = []; for (var i = 0; i < arr.length; i++) { var x = arr[i]; if (x.isSome()) { r.push(x.getOrDie()); } else { return Optional.none(); } } return Optional.some(r); }; var lift2 = function (oa, ob, f) { return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); }; var lift3 = function (oa, ob, oc, f) { return oa.isSome() && ob.isSome() && oc.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Optional.none(); }; var mapFrom = function (a, f) { return a !== undefined && a !== null ? Optional.some(f(a)) : Optional.none(); }; var someIf = function (b, a) { return b ? Optional.some(a) : Optional.none(); }; var addToEnd = function (str, suffix) { return str + suffix; }; var removeFromStart = function (str, numChars) { return str.substring(numChars); }; var checkRange = function (str, substr, start) { return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; }; var removeLeading = function (str, prefix) { return startsWith(str, prefix) ? removeFromStart(str, prefix.length) : str; }; var ensureTrailing = function (str, suffix) { return endsWith(str, suffix) ? str : addToEnd(str, suffix); }; var contains$1 = function (str, substr) { return str.indexOf(substr) !== -1; }; var startsWith = function (str, prefix) { return checkRange(str, prefix, 0); }; var endsWith = function (str, suffix) { return checkRange(str, suffix, str.length - suffix.length); }; var blank = function (r) { return function (s) { return s.replace(r, ''); }; }; var trim$1 = blank(/^\s+|\s+$/g); var isNotEmpty = function (s) { return s.length > 0; }; var isEmpty = function (s) { return !isNotEmpty(s); }; var isSupported$1 = function (dom) { return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var fromHtml$2 = function (html, scope) { var doc = scope || document; var div = doc.createElement('div'); div.innerHTML = html; if (!div.hasChildNodes() || div.childNodes.length > 1) { console.error('HTML does not have a single root node', html); throw new Error('HTML must have a single root node'); } return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { var doc = scope || document; var node = doc.createElement(tag); return fromDom(node); }; var fromText = function (text, scope) { var doc = scope || document; var node = doc.createTextNode(text); return fromDom(node); }; var fromDom = function (node) { if (node === null || node === undefined) { throw new Error('Node cannot be null or undefined'); } return { dom: node }; }; var fromPoint = function (docElm, x, y) { return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { fromHtml: fromHtml$2, fromTag: fromTag, fromText: fromText, fromDom: fromDom, fromPoint: fromPoint }; typeof window !== 'undefined' ? window : Function('return this;')(); var DOCUMENT = 9; var DOCUMENT_FRAGMENT = 11; var ELEMENT = 1; var TEXT = 3; var name$2 = function (element) { var r = element.dom.nodeName; return r.toLowerCase(); }; var type = function (element) { return element.dom.nodeType; }; var isType = function (t) { return function (element) { return type(element) === t; }; }; var isElement$2 = isType(ELEMENT); var isText$1 = isType(TEXT); var isDocument = isType(DOCUMENT); var isDocumentFragment = isType(DOCUMENT_FRAGMENT); var cached = function (f) { var called = false; var r; return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (!called) { called = true; r = f.apply(null, args); } return r; }; }; var DeviceType = function (os, browser, userAgent, mediaMatch) { var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; var isiPhone = os.isiOS() && !isiPad; var isMobile = os.isiOS() || os.isAndroid(); var isTouch = isMobile || mediaMatch('(pointer:coarse)'); var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); var isPhone = isiPhone || isMobile && !isTablet; var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; var isDesktop = !isPhone && !isTablet && !iOSwebview; return { isiPad: constant$1(isiPad), isiPhone: constant$1(isiPhone), isTablet: constant$1(isTablet), isPhone: constant$1(isPhone), isTouch: constant$1(isTouch), isAndroid: os.isAndroid, isiOS: os.isiOS, isWebView: constant$1(iOSwebview), isDesktop: constant$1(isDesktop) }; }; var firstMatch = function (regexes, s) { for (var i = 0; i < regexes.length; i++) { var x = regexes[i]; if (x.test(s)) { return x; } } return undefined; }; var find$3 = function (regexes, agent) { var r = firstMatch(regexes, agent); if (!r) { return { major: 0, minor: 0 }; } var group = function (i) { return Number(agent.replace(r, '$' + i)); }; return nu$d(group(1), group(2)); }; var detect$4 = function (versionRegexes, agent) { var cleanedAgent = String(agent).toLowerCase(); if (versionRegexes.length === 0) { return unknown$3(); } return find$3(versionRegexes, cleanedAgent); }; var unknown$3 = function () { return nu$d(0, 0); }; var nu$d = function (major, minor) { return { major: major, minor: minor }; }; var Version = { nu: nu$d, detect: detect$4, unknown: unknown$3 }; var detectBrowser$1 = function (browsers, userAgentData) { return findMap(userAgentData.brands, function (uaBrand) { var lcBrand = uaBrand.brand.toLowerCase(); return find$5(browsers, function (browser) { var _a; return lcBrand === ((_a = browser.brand) === null || _a === void 0 ? void 0 : _a.toLowerCase()); }).map(function (info) { return { current: info.name, version: Version.nu(parseInt(uaBrand.version, 10), 0) }; }); }); }; var detect$3 = function (candidates, userAgent) { var agent = String(userAgent).toLowerCase(); return find$5(candidates, function (candidate) { return candidate.search(agent); }); }; var detectBrowser = function (browsers, userAgent) { return detect$3(browsers, userAgent).map(function (browser) { var version = Version.detect(browser.versionRegexes, userAgent); return { current: browser.name, version: version }; }); }; var detectOs = function (oses, userAgent) { return detect$3(oses, userAgent).map(function (os) { var version = Version.detect(os.versionRegexes, userAgent); return { current: os.name, version: version }; }); }; var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; var checkContains = function (target) { return function (uastring) { return contains$1(uastring, target); }; }; var browsers = [ { name: 'Edge', versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], search: function (uastring) { return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); } }, { name: 'Chrome', brand: 'Chromium', versionRegexes: [ /.*?chrome\/([0-9]+)\.([0-9]+).*/, normalVersionRegex ], search: function (uastring) { return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); } }, { name: 'IE', versionRegexes: [ /.*?msie\ ?([0-9]+)\.([0-9]+).*/, /.*?rv:([0-9]+)\.([0-9]+).*/ ], search: function (uastring) { return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); } }, { name: 'Opera', versionRegexes: [ normalVersionRegex, /.*?opera\/([0-9]+)\.([0-9]+).*/ ], search: checkContains('opera') }, { name: 'Firefox', versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], search: checkContains('firefox') }, { name: 'Safari', versionRegexes: [ normalVersionRegex, /.*?cpu os ([0-9]+)_([0-9]+).*/ ], search: function (uastring) { return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); } } ]; var oses = [ { name: 'Windows', search: checkContains('win'), versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] }, { name: 'iOS', search: function (uastring) { return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); }, versionRegexes: [ /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, /.*cpu os ([0-9]+)_([0-9]+).*/, /.*cpu iphone os ([0-9]+)_([0-9]+).*/ ] }, { name: 'Android', search: checkContains('android'), versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] }, { name: 'OSX', search: checkContains('mac os x'), versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] }, { name: 'Linux', search: checkContains('linux'), versionRegexes: [] }, { name: 'Solaris', search: checkContains('sunos'), versionRegexes: [] }, { name: 'FreeBSD', search: checkContains('freebsd'), versionRegexes: [] }, { name: 'ChromeOS', search: checkContains('cros'), versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] } ]; var PlatformInfo = { browsers: constant$1(browsers), oses: constant$1(oses) }; var edge = 'Edge'; var chrome = 'Chrome'; var ie = 'IE'; var opera = 'Opera'; var firefox = 'Firefox'; var safari = 'Safari'; var unknown$2 = function () { return nu$c({ current: undefined, version: Version.unknown() }); }; var nu$c = function (info) { var current = info.current; var version = info.version; var isBrowser = function (name) { return function () { return current === name; }; }; return { current: current, version: version, isEdge: isBrowser(edge), isChrome: isBrowser(chrome), isIE: isBrowser(ie), isOpera: isBrowser(opera), isFirefox: isBrowser(firefox), isSafari: isBrowser(safari) }; }; var Browser = { unknown: unknown$2, nu: nu$c, edge: constant$1(edge), chrome: constant$1(chrome), ie: constant$1(ie), opera: constant$1(opera), firefox: constant$1(firefox), safari: constant$1(safari) }; var windows = 'Windows'; var ios = 'iOS'; var android = 'Android'; var linux = 'Linux'; var osx = 'OSX'; var solaris = 'Solaris'; var freebsd = 'FreeBSD'; var chromeos = 'ChromeOS'; var unknown$1 = function () { return nu$b({ current: undefined, version: Version.unknown() }); }; var nu$b = function (info) { var current = info.current; var version = info.version; var isOS = function (name) { return function () { return current === name; }; }; return { current: current, version: version, isWindows: isOS(windows), isiOS: isOS(ios), isAndroid: isOS(android), isOSX: isOS(osx), isLinux: isOS(linux), isSolaris: isOS(solaris), isFreeBSD: isOS(freebsd), isChromeOS: isOS(chromeos) }; }; var OperatingSystem = { unknown: unknown$1, nu: nu$b, windows: constant$1(windows), ios: constant$1(ios), android: constant$1(android), linux: constant$1(linux), osx: constant$1(osx), solaris: constant$1(solaris), freebsd: constant$1(freebsd), chromeos: constant$1(chromeos) }; var detect$2 = function (userAgent, userAgentDataOpt, mediaMatch) { var browsers = PlatformInfo.browsers(); var oses = PlatformInfo.oses(); var browser = userAgentDataOpt.bind(function (userAgentData) { return detectBrowser$1(browsers, userAgentData); }).orThunk(function () { return detectBrowser(browsers, userAgent); }).fold(Browser.unknown, Browser.nu); var os = detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); var deviceType = DeviceType(os, browser, userAgent, mediaMatch); return { browser: browser, os: os, deviceType: deviceType }; }; var PlatformDetection = { detect: detect$2 }; var mediaMatch = function (query) { return window.matchMedia(query).matches; }; var platform = cached(function () { return PlatformDetection.detect(navigator.userAgent, Optional.from(navigator.userAgentData), mediaMatch); }); var detect$1 = function () { return platform(); }; var compareDocumentPosition = function (a, b, match) { return (a.compareDocumentPosition(b) & match) !== 0; }; var documentPositionContainedBy = function (a, b) { return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); }; var is = function (element, selector) { var dom = element.dom; if (dom.nodeType !== ELEMENT) { return false; } else { var elem = dom; if (elem.matches !== undefined) { return elem.matches(selector); } else if (elem.msMatchesSelector !== undefined) { return elem.msMatchesSelector(selector); } else if (elem.webkitMatchesSelector !== undefined) { return elem.webkitMatchesSelector(selector); } else if (elem.mozMatchesSelector !== undefined) { return elem.mozMatchesSelector(selector); } else { throw new Error('Browser lacks native selectors'); } } }; var bypassSelector = function (dom) { return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; }; var all$3 = function (selector, scope) { var base = scope === undefined ? document : scope.dom; return bypassSelector(base) ? [] : map$2(base.querySelectorAll(selector), SugarElement.fromDom); }; var one = function (selector, scope) { var base = scope === undefined ? document : scope.dom; return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); }; var eq = function (e1, e2) { return e1.dom === e2.dom; }; var regularContains = function (e1, e2) { var d1 = e1.dom; var d2 = e2.dom; return d1 === d2 ? false : d1.contains(d2); }; var ieContains = function (e1, e2) { return documentPositionContainedBy(e1.dom, e2.dom); }; var contains = function (e1, e2) { return detect$1().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); }; var owner$4 = function (element) { return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { return isDocument(dos) ? dos : owner$4(dos); }; var documentElement = function (element) { return SugarElement.fromDom(documentOrOwner(element).dom.documentElement); }; var defaultView = function (element) { return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); }; var parent = function (element) { return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); }; var parentNode = function (element) { return parent(element); }; var offsetParent = function (element) { return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom); }; var nextSibling = function (element) { return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); }; var children = function (element) { return map$2(element.dom.childNodes, SugarElement.fromDom); }; var child$2 = function (element, index) { var cs = element.dom.childNodes; return Optional.from(cs[index]).map(SugarElement.fromDom); }; var firstChild = function (element) { return child$2(element, 0); }; var spot = function (element, offset) { return { element: element, offset: offset }; }; var leaf = function (element, offset) { var cs = children(element); return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset); }; var isShadowRoot = function (dos) { return isDocumentFragment(dos) && isNonNullable(dos.dom.host); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var isSupported = constant$1(supported); var getRootNode = supported ? function (e) { return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getContentContainer = function (dos) { return isShadowRoot(dos) ? dos : SugarElement.fromDom(documentOrOwner(dos).dom.body); }; var isInShadowRoot = function (e) { return getShadowRoot(e).isSome(); }; var getShadowRoot = function (e) { var r = getRootNode(e); return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { return SugarElement.fromDom(e.dom.host); }; var getOriginalEventTarget = function (event) { if (isSupported() && isNonNullable(event.target)) { var el = SugarElement.fromDom(event.target); if (isElement$2(el) && isOpenShadowHost(el)) { if (event.composed && event.composedPath) { var composedPath = event.composedPath(); if (composedPath) { return head(composedPath); } } } } return Optional.from(event.target); }; var isOpenShadowHost = function (element) { return isNonNullable(element.dom.shadowRoot); }; var inBody = function (element) { var dom = isText$1(element) ? element.dom.parentNode : element.dom; if (dom === undefined || dom === null || dom.ownerDocument === null) { return false; } var doc = dom.ownerDocument; return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { return doc.body.contains(dom); }, compose1(inBody, getShadowHost)); }; var body = function () { return getBody(SugarElement.fromDom(document)); }; var getBody = function (doc) { var b = doc.dom.body; if (b === null || b === undefined) { throw new Error('Body is not available yet'); } return SugarElement.fromDom(b); }; var rawSet = function (dom, key, value) { if (isString(value) || isBoolean(value) || isNumber(value)) { dom.setAttribute(key, value + ''); } else { console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); throw new Error('Attribute value was not simple'); } }; var set$8 = function (element, key, value) { rawSet(element.dom, key, value); }; var setAll$1 = function (element, attrs) { var dom = element.dom; each(attrs, function (v, k) { rawSet(dom, k, v); }); }; var get$d = function (element, key) { var v = element.dom.getAttribute(key); return v === null ? undefined : v; }; var getOpt = function (element, key) { return Optional.from(get$d(element, key)); }; var has$1 = function (element, key) { var dom = element.dom; return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; }; var remove$7 = function (element, key) { element.dom.removeAttribute(key); }; var internalSet = function (dom, property, value) { if (!isString(value)) { console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); throw new Error('CSS value must be a string: ' + value); } if (isSupported$1(dom)) { dom.style.setProperty(property, value); } }; var internalRemove = function (dom, property) { if (isSupported$1(dom)) { dom.style.removeProperty(property); } }; var set$7 = function (element, property, value) { var dom = element.dom; internalSet(dom, property, value); }; var setAll = function (element, css) { var dom = element.dom; each(css, function (v, k) { internalSet(dom, k, v); }); }; var setOptions = function (element, css) { var dom = element.dom; each(css, function (v, k) { v.fold(function () { internalRemove(dom, k); }, function (value) { internalSet(dom, k, value); }); }); }; var get$c = function (element, property) { var dom = element.dom; var styles = window.getComputedStyle(dom); var r = styles.getPropertyValue(property); return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; }; var getRaw = function (element, property) { var dom = element.dom; var raw = getUnsafeProperty(dom, property); return Optional.from(raw).filter(function (r) { return r.length > 0; }); }; var getAllRaw = function (element) { var css = {}; var dom = element.dom; if (isSupported$1(dom)) { for (var i = 0; i < dom.style.length; i++) { var ruleName = dom.style.item(i); css[ruleName] = dom.style[ruleName]; } } return css; }; var isValidValue = function (tag, property, value) { var element = SugarElement.fromTag(tag); set$7(element, property, value); var style = getRaw(element, property); return style.isSome(); }; var remove$6 = function (element, property) { var dom = element.dom; internalRemove(dom, property); if (is$1(getOpt(element, 'style').map(trim$1), '')) { remove$7(element, 'style'); } }; var reflow = function (e) { return e.dom.offsetWidth; }; var Dimension = function (name, getOffset) { var set = function (element, h) { if (!isNumber(h) && !h.match(/^[0-9]+$/)) { throw new Error(name + '.set accepts only positive integer values. Value was ' + h); } var dom = element.dom; if (isSupported$1(dom)) { dom.style[name] = h + 'px'; } }; var get = function (element) { var r = getOffset(element); if (r <= 0 || r === null) { var css = get$c(element, name); return parseFloat(css) || 0; } return r; }; var getOuter = get; var aggregate = function (element, properties) { return foldl(properties, function (acc, property) { var val = get$c(element, property); var value = val === undefined ? 0 : parseInt(val, 10); return isNaN(value) ? acc : acc + value; }, 0); }; var max = function (element, value, properties) { var cumulativeInclusions = aggregate(element, properties); var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; return absoluteMax; }; return { set: set, get: get, getOuter: getOuter, aggregate: aggregate, max: max }; }; var api$3 = Dimension('height', function (element) { var dom = element.dom; return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; }); var get$b = function (element) { return api$3.get(element); }; var getOuter$2 = function (element) { return api$3.getOuter(element); }; var setMax$1 = function (element, value) { var inclusions = [ 'margin-top', 'border-top-width', 'padding-top', 'padding-bottom', 'border-bottom-width', 'margin-bottom' ]; var absMax = api$3.max(element, value, inclusions); set$7(element, 'max-height', absMax + 'px'); }; var r$1 = function (left, top) { var translate = function (x, y) { return