diff --git a/dist/jedi.js b/dist/jedi.js index c72c515..84b2f2b 100644 --- a/dist/jedi.js +++ b/dist/jedi.js @@ -1,8315 +1,3257 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["Jedi"] = factory(); - else - root["Jedi"] = factory(); -})(this, () => { -return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/editors/array-nav.js": -/*!**********************************!*\ - !*** ./src/editors/array-nav.js ***! - \**********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ "./src/editors/array.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorArrayNav instance. - * @extends EditorArray - */ -class EditorArrayNav extends _array_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - init () { - super.init() - this.activeTabIndex = 0 - } - - addEventListeners () { - this.control.addBtn.addEventListener('click', () => { - this.activeTabIndex = this.instance.value.length - this.instance.addItem() - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.childrenSlot.innerHTML = '' - - const navCols = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'navCols') - const navStacked = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'navStacked') - const navType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'navType') - - const row = this.theme.getRow() - const cols = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(navCols) ? navCols : 3 - const tabListCol = this.theme.getCol(12, cols) - const tabContentCol = this.theme.getCol(12, (12 - cols)) - const tabContent = this.theme.getTabContent() - const tabList = this.theme.getTabList({ - stacked: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(navStacked) ? navStacked : false, - type: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(navType) ? navType : 'pils' - }) - - this.control.childrenSlot.appendChild(row) - row.appendChild(tabListCol) - row.appendChild(tabContentCol) - tabListCol.appendChild(tabList) - tabContentCol.appendChild(tabContent) - - this.instance.children.forEach((child, index) => { - const deleteBtn = this.theme.getDeleteItemBtn() - const moveUpBtn = this.theme.getMoveUpItemBtn() - const moveDownBtn = this.theme.getMoveDownItemBtn() - - child.ui.control.arrayActions.innerHTML = '' - child.ui.control.arrayActions.appendChild(deleteBtn) - child.ui.control.arrayActions.appendChild(moveUpBtn) - child.ui.control.arrayActions.appendChild(moveDownBtn) - - this.control.childrenSlot.appendChild(child.ui.control.container) - - let childTitle - const schemaOptionItemTemplate = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'itemTemplate') - - if (schemaOptionItemTemplate) { - const template = schemaOptionItemTemplate - const data = { - i0: index, - i1: (index + 1), - value: child.getValue() - } - childTitle = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.compileTemplate)(template, data) - } else { - const schemaTitle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(child.schema) - childTitle = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaTitle) ? schemaTitle + ' ' + (index + 1) : child.getKey() - } - - deleteBtn.addEventListener('click', () => { - this.activeTabIndex = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.clamp)((index - 1), 0, (this.instance.value.length - 1)) - this.instance.deleteItem(index) +function ee() { + const i = []; + return function(t, e) { + if (typeof e != "object" || e === null) + return e; + for (; i.length > 0 && i.at(-1) !== this; ) + i.pop(); + return i.includes(e) ? "[Circular]" : (i.push(e), e); + }; +} +function T(i) { + if (!(typeof i > "u")) + return JSON.parse(JSON.stringify(i, ee())); +} +function se(i) { + return i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +} +function Ft(i, t, e) { + return i.replace(new RegExp(se(t), "g"), e); +} +function S(i) { + return Ft(Ft(i, "#", "root"), "/", "-"); +} +function D(i, t) { + return Object.prototype.hasOwnProperty.call(i, t); +} +function It(i) { + return Object.keys(i).sort().reduce((t, e) => (t[e] = i[e], t), {}); +} +function wt(i, t) { + return m(i) && m(t) && (i = It(i), t = It(t)), JSON.stringify(i) === JSON.stringify(t); +} +function Ot(i, t) { + return !wt(i, t); +} +function Pt(i) { + return i === null; +} +function d(i) { + return typeof i < "u"; +} +function H(i) { + return typeof i > "u"; +} +function A(i) { + return typeof i == "number"; +} +function B(i) { + return A(i) && i === Math.floor(i); +} +function V(i) { + return typeof i == "string"; +} +function O(i) { + return typeof i == "boolean"; +} +function x(i) { + return Array.isArray(i); +} +function m(i) { + return !Pt(i) && !x(i) && typeof i == "object"; +} +function ie(i) { + let t = "any"; + return A(i) ? t = B(i) ? "integer" : "number" : V(i) ? t = "string" : O(i) ? t = "boolean" : x(i) ? t = "array" : Pt(i) ? t = "null" : m(i) && (t = "object"), t; +} +function K(i, ...t) { + if (!t.length) + return i; + const e = t.shift(); + return m(i) && m(e) && Object.keys(e).forEach((s) => { + m(e[s]) ? (i[s] || Object.assign(i, { + [s]: {} + }), K(i[s], e[s])) : Object.assign(i, { + [s]: e[s] + }); + }), K(i, ...t); +} +function $t(i, t) { + return Object.keys(t).forEach(function(e) { + e in i && typeof i[e] == typeof t[e] && (i[e] = t[e]); + }), i; +} +function ne(i, t) { + const e = t.split("."); + let s = i; + for (const n of e) + if (Array.isArray(s) && /^\d+$/.test(n)) { + const r = parseInt(n); + if (r >= 0 && r < s.length) + s = s[r]; + else + return; + } else if (D(s, n)) + s = s[n]; + else + return; + return s; +} +function C(i, t) { + return i.replace(/{{(.*?)}}/g, (e) => { + e = e.replace(/\s/g, ""); + const s = e.split(/{{|}}/)[1]; + return ne(t, s); + }); +} +function re(i, t, e) { + return Math.max(t, Math.min(i, e)); +} +function Kt(i) { + const t = [], e = /* @__PURE__ */ new Set(); + for (const s of i) { + const n = JSON.stringify(s); + e.has(n) || (e.add(n), t.push(s)); + } + return t; +} +function St(i) { + return m(i.additionalProperties) || O(i.additionalProperties) ? i.additionalProperties : void 0; +} +function ae(i) { + return m(i.propertyNames) || O(i.propertyNames) ? i.propertyNames : void 0; +} +function zt(i) { + return x(i.allOf) ? i.allOf : void 0; +} +function $(i) { + return x(i.anyOf) ? i.anyOf : void 0; +} +function oe(i) { + return i.const; +} +function ce(i) { + return m(i.contains) || O(i.contains) ? i.contains : void 0; +} +function le(i) { + return i.default; +} +function Jt(i) { + return m(i.dependentRequired) ? i.dependentRequired : void 0; +} +function de(i) { + return m(i.dependentSchemas) ? i.dependentSchemas : void 0; +} +function j(i) { + return V(i.description) ? i.description : void 0; +} +function At(i) { + return m(i.else) || O(i.else) ? i.else : void 0; +} +function k(i) { + if (x(i.enum) && i.enum.length > 0) + return i.enum; +} +function he(i) { + return A(i.exclusiveMaximum) ? i.exclusiveMaximum : void 0; +} +function ue(i) { + return A(i.exclusiveMinimum) ? i.exclusiveMinimum : void 0; +} +function q(i) { + return V(i.format) ? i.format : void 0; +} +function jt(i) { + if (m(i.if) || O(i.if)) + return i.if; +} +function Gt(i) { + return m(i.items) || O(i.items) ? i.items : void 0; +} +function pe(i) { + return A(i.maximum) ? i.maximum : void 0; +} +function me(i) { + if (B(i.maxContains) && i.maxContains >= 0) + return i.maxContains; +} +function _t(i) { + if (B(i.maxItems) && i.maxItems >= 0) + return i.maxItems; +} +function fe(i) { + if (B(i.maxLength) && i.maxLength >= 0) + return i.maxLength; +} +function ge(i) { + if (B(i.maxProperties)) + return i.maxProperties; +} +function ve(i) { + return A(i.minimum) ? i.minimum : void 0; +} +function be(i) { + if (B(i.minContains) && i.minContains >= 0) + return i.minContains; +} +function Wt(i) { + if (B(i.minItems) && i.minItems >= 0) + return i.minItems; +} +function ye(i) { + if (B(i.minLength) && i.minLength >= 0) + return i.minLength; +} +function Ce(i) { + if (B(i.minProperties) && i.minProperties >= 0) + return i.minProperties; +} +function Ee(i) { + if (A(i.multipleOf) && i.multipleOf >= 0) + return i.multipleOf; +} +function Le(i) { + return m(i.not) || O(i.not) ? i.not : void 0; +} +function f(i, t) { + return i.options && i.options[t] ? i.options[t] : void 0; +} +function xe(i) { + return V(i.pattern) ? i.pattern : void 0; +} +function Tt(i) { + return m(i.patternProperties) ? i.patternProperties : void 0; +} +function kt(i) { + return x(i.prefixItems) ? i.prefixItems : void 0; +} +function Mt(i) { + return m(i.properties) ? i.properties : void 0; +} +function Ut(i) { + return O(i.readOnly) ? i.readOnly : void 0; +} +function Qt(i) { + return x(i.required) ? [...new Set(i.required)] : void 0; +} +function Vt(i) { + return m(i.then) || O(i.then) ? i.then : void 0; +} +function I(i) { + return V(i.title) ? i.title : void 0; +} +function R(i) { + if (V(i.type) || x(i.type)) + return i.type; +} +function z(i) { + return x(i.oneOf) ? i.oneOf : void 0; +} +function Ie(i) { + return O(i.unevaluatedProperties) ? i.unevaluatedProperties : void 0; +} +function we(i) { + return O(i.uniqueItems) ? i.uniqueItems : void 0; +} +function J(i, t, e, s) { + let n = []; + const r = zt(e); + return d(r) && r.forEach((a) => { + const o = new w({ refParser: i.refParser, schema: a, data: t, rootName: s }), c = o.getErrors(); + o.destroy(), n = [...n, ...c], n = Kt(n); + }), n; +} +const v = { + errorAdditionalProperties: 'Has additional property "{{ property }}" but no additional properties are allowed.', + errorAnyOf: "Must validate against at least one of the provided schemas.", + errorConst: "Must have value of: {{ const }}.", + errorContains: "Must contain at least one item matching the provided schema.", + errorDependentRequired: "Must have the required properties: {{ dependentRequired }}.", + errorEnum: "Must be one of the enumerated values: {{ enum }}.", + errorExclusiveMaximum: "Must be less than {{ exclusiveMaximum }}.", + errorExclusiveMinimum: "Must be greater than {{ exclusiveMinimum }}.", + errorFormat: "Must be a valid {{ format }}.", + errorItems: "Must have items that validate against the provided schema.", + errorMaximum: "Must be at most {{ maximum }}.", + errorMaxItems: "Must have at most {{ maxItems }} items.", + errorMaxLength: "Must be at most {{ maxLength }} characters long.", + errorMaxProperties: "Must have at most {{ maxProperties }} properties.", + errorMaxContains: "Must contain at most {{ maxContains }} items matching the provided schema. It currently contains {{ counter }}.", + errorMinContains: "Must contain at least {{ minContains }} items matching the provided schema. It currently contains {{ counter }}.", + errorMinimum: "Must be at least {{ minimum }}.", + errorMinItems: "Must have at least {{ minItems }} items.", + errorMinLength: "Must be at least {{ minLength }} characters long.", + errorMinProperties: "Must have at least {{ minProperties }} properties.", + errorMultipleOf: "Must be multiple of {{ multipleOf }}.", + errorNot: "Must not validate against the provided schema.", + errorOneOf: "Must validate against exactly one of the provided schemas. It currently validates against {{ counter }} of the schemas.", + errorPattern: 'Must match the pattern: "{{ pattern }}".', + errorPrefixItems: "Item {{ index }} fails validation.", + errorPropertyNames: 'Property name "{{ propertyName }}" fails validation.', + errorRequired: "Must have the required properties: {{ required }}.", + errorType: "Must be of type {{ type }}.", + errorUnevaluatedProperties: 'Has invalid unevaluated property "{{ property }}"', + errorUniqueItems: "Must have unique items." +}; +function G(i, t, e, s, n) { + const r = [], a = ye(e); + return V(t) && d(a) && (t = t.replace(/[\uDCA9]/g, ""), t.length < a && r.push({ + messages: [ + C(v.errorMinLength, { + minLength: a }) - - moveUpBtn.addEventListener('click', () => { - const toIndex = index - 1 - this.activeTabIndex = toIndex - this.instance.move(index, toIndex) + ], + path: n, + constrain: "minLength" + })), r; +} +function _(i, t, e, s, n) { + const r = [], a = $(e); + if (d(a)) { + let o = !1; + a.forEach((c) => { + const l = new w({ refParser: i.refParser, schema: c, data: t }), h = l.getErrors(); + l.destroy(), h.length === 0 && (o = !0); + }), o || r.push({ + messages: [ + v.errorAnyOf + ], + path: n, + constrain: "anyOf" + }); + } + return r; +} +function W(i, t, e, s, n) { + const r = [], a = k(e); + return d(a) && !a.some((c) => JSON.stringify(t) === JSON.stringify(c)) && r.push({ + messages: [ + C(v.errorEnum, { + enum: JSON.stringify(a) }) - - moveDownBtn.addEventListener('click', () => { - const toIndex = index + 1 - this.activeTabIndex = toIndex - this.instance.move(index, toIndex) + ], + path: n, + constrain: "enum" + }), r; +} +function Q(i, t, e, s, n) { + const r = [], a = he(e); + return A(t) && d(a) && t >= a && r.push({ + messages: [ + C(v.errorExclusiveMaximum, { + exclusiveMaximum: a }) - - const active = index === this.activeTabIndex - const id = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(child.path) - - const tab = this.theme.getTab({ - title: childTitle, - id: id, - active: active + ], + path: n, + constrain: "exclusiveMaximum" + }), r; +} +function X(i, t, e, s, n) { + const r = [], a = ue(e); + return A(t) && d(a) && t <= a && r.push({ + messages: [ + C(v.errorExclusiveMinimum, { + exclusiveMinimum: a }) - - tab.list.addEventListener('click', () => { - this.activeTabIndex = index + ], + path: n, + constrain: "exclusiveMinimum" + }), r; +} +function Y(i, t, e, s, n) { + const r = [], a = q(e); + let o = i.validateFormat; + if (f(e, "validateFormat") && (o = e.options.validateFormat), d(a) && V(t) && o) { + let c; + a === "email" && (c = new RegExp(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i)), a === "url" && (c = new RegExp(/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu)), a === "uuid" && (c = new RegExp(/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i)), d(c) && !c.test(t) && r.push({ + messages: [ + C(v.errorFormat, { format: a }) + ], + path: n, + constrain: "format" + }); + } + return r; +} +function Z(i, t, e, s, n) { + const r = [], a = Gt(e), o = kt(e); + if (x(t) && d(a)) { + const c = d(o) ? o.length : 0; + a === !1 && t.length > 0 && t.length > c && r.push({ + messages: [v.errorItems], + path: n, + constrain: "items" + }); + } + return r; +} +function tt(i, t, e, s, n) { + const r = [], a = _t(e); + return x(t) && d(a) && t.length > a && r.push({ + messages: [ + C(v.errorMaxItems, { + maxItems: a }) - - this.theme.setTabPaneAttributes(child.ui.control.container, active, id) - tabList.appendChild(tab.list) - tabContent.appendChild(child.ui.control.container) - - if (this.disabled || this.instance.isReadOnly()) { - child.ui.disable() - } else { - child.ui.enable() - } - - if (index === 0) { - moveUpBtn.setAttribute('disabled', '') - } - - if ((this.instance.value.length - 1) === index) { - moveDownBtn.setAttribute('disabled', '') - } - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorArrayNav); - - -/***/ }), - -/***/ "./src/editors/array.js": -/*!******************************!*\ - !*** ./src/editors/array.js ***! - \******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorArray instance. - * @extends Editor - */ -class EditorArray extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getArrayControl({ - title: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.addBtn.addEventListener('click', () => { - this.instance.addItem() - }) - } - - getInvalidFeedback (config) { - return this.theme.getAlert(config) - } - - sanitize (value) { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - return value - } - - return [] - } - - refreshUI () { - this.refreshInteractiveElements() - - const maxItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaMaxItems)(this.instance.schema) - const minItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaMinItems)(this.instance.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(maxItems) && maxItems === this.instance.value.length) { - this.control.addBtn.setAttribute('disabled', '') - } - - this.control.childrenSlot.innerHTML = '' - - this.instance.children.forEach((child) => { - const itemIndex = Number(child.getKey()) - const deleteBtn = this.theme.getDeleteItemBtn() - const moveUpBtn = this.theme.getMoveUpItemBtn() - const moveDownBtn = this.theme.getMoveDownItemBtn() - - child.ui.control.arrayActions.innerHTML = '' - child.ui.control.arrayActions.appendChild(deleteBtn) - child.ui.control.arrayActions.appendChild(moveUpBtn) - child.ui.control.arrayActions.appendChild(moveDownBtn) - - this.control.childrenSlot.appendChild(child.ui.control.container) - - deleteBtn.addEventListener('click', () => { - const itemIndex = Number(child.path.split(this.instance.jedi.pathSeparator).pop()) - this.instance.deleteItem(itemIndex) + ], + path: n, + constrain: "maxItems" + }), r; +} +function et(i, t, e, s, n) { + const r = [], a = fe(e); + return V(t) && d(a) && (t = t.replace(/[\uDCA9]/g, ""), t.length > a && r.push({ + messages: [ + C(v.errorMaxLength, { + maxLength: a }) - - moveUpBtn.addEventListener('click', () => { - const toIndex = itemIndex - 1 - this.instance.move(itemIndex, toIndex) + ], + path: n, + constrain: "maxLength" + })), r; +} +function st(i, t, e, s, n) { + const r = [], a = ge(e); + return m(t) && d(a) && Object.keys(t).length > a && r.push({ + messages: [ + C(v.errorMaxProperties, { + maxProperties: a }) - - moveDownBtn.addEventListener('click', () => { - const toIndex = itemIndex + 1 - this.instance.move(itemIndex, toIndex) + ], + path: n, + constrain: "maxProperties" + }), r; +} +function it(i, t, e, s, n) { + const r = [], a = ve(e); + return A(t) && d(a) && t < a && r.push({ + messages: [ + C(v.errorMinimum, { + minimum: a }) - - if (this.disabled || this.instance.isReadOnly()) { - child.ui.disable() - } else { - child.ui.enable() + ], + path: n, + constrain: "minimum" + }), r; +} +function nt(i, t, e, s, n) { + const r = [], a = Wt(e); + return x(t) && d(a) && t.length < a && r.push({ + messages: [ + C(v.errorMinItems, { + minItems: a + }) + ], + path: n, + constrain: "minItems" + }), r; +} +function rt(i, t, e, s, n) { + const r = [], a = Ce(e); + return m(t) && d(a) && Object.keys(t).length < a && r.push({ + messages: [ + C(v.errorMinProperties, { + minProperties: a + }) + ], + path: n, + constrain: "minProperties" + }), r; +} +function at(i, t, e, s, n) { + const r = [], a = Ee(e); + if (A(t) && d(a)) { + if (t === 0) + return r; + (!(t / a === Math.floor(t / a)) || t.toString().includes("e")) && r.push({ + messages: [ + C(v.errorMultipleOf, { + multipleOf: a + }) + ], + path: n, + constrain: "multipleOf" + }); + } + return r; +} +function ot(i, t, e, s, n) { + const r = [], a = Le(e); + if (d(a)) { + const o = new w({ refParser: i.refParser, schema: a, data: t }), c = o.getErrors(); + o.destroy(), c.length === 0 && r.push({ + messages: [ + C(v.errorNot) + ], + path: n, + constrain: "not" + }); + } + return r; +} +function ct(i, t, e, s, n) { + const r = [], a = z(e); + if (d(a)) { + let o = 0; + a.forEach((c) => { + const l = new w({ refParser: i.refParser, schema: c, data: t }), h = l.getErrors(); + l.destroy(), h.length === 0 && o++; + }), o !== 1 && r.push({ + messages: [ + C(v.errorOneOf, { + counter: o + }) + ], + path: n, + constrain: "oneOf" + }); + } + return r; +} +function lt(i, t, e, s, n) { + const r = [], a = xe(e); + return V(t) && d(a) && !new RegExp(a).test(t) && r.push({ + messages: [ + C(v.errorPattern, { + pattern: a + }) + ], + path: n, + constrain: "pattern" + }), r; +} +function dt(i, t, e, s) { + let n = []; + const r = Tt(e); + return m(t) && d(r) && Object.keys(t).forEach((a) => { + Object.keys(r).forEach((o) => { + if (new RegExp(o).test(a)) { + const l = r[o], h = new w({ + refParser: i.refParser, + schema: l, + data: t[a] + }), u = h.getErrors().map((p) => ({ + messages: p.messages, + path: s + "/" + a, + constrain: "patternProperties" + })); + n = [...n, ...u], h.destroy(); } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(minItems) && this.instance.value.length <= minItems) { - deleteBtn.setAttribute('disabled', '') + }); + }), n; +} +function ht(i, t, e, s, n) { + const r = [], a = Qt(e); + if (m(t) && d(a)) { + const o = [], c = Object.keys(t); + a.forEach((h) => { + c.includes(h) || o.push(h); + }), o.length > 0 && r.push({ + messages: [ + C(v.errorRequired, { + required: o.join(", ") + }) + ], + path: n, + constrain: "required" + }); + } + return r; +} +function ut(i, t, e, s, n) { + const r = [], a = R(e); + if (a === "any") + return r; + if (d(a)) { + const o = { + string: (l) => V(l), + number: (l) => A(l), + integer: (l) => B(l), + boolean: (l) => O(l), + array: (l) => x(l), + object: (l) => m(l), + null: (l) => Pt(l) + }; + let c = !0; + x(a) ? c = a.some((l) => o[l](t)) : c = o[a](t), c || r.push({ + messages: [ + C(v.errorType, { + type: a, + valueType: ie(t) + }) + ], + path: n, + constrain: "type" + }); + } + return r; +} +function pt(i, t, e, s, n) { + const r = [], a = pe(e); + return A(t) && d(a) && t > a && r.push({ + messages: [ + C(v.errorMaximum, { + maximum: a + }) + ], + path: n, + constrain: "maximum" + }), r; +} +function mt(i, t, e, s, n) { + const r = [], a = we(e); + if (x(t) && d(a) && a === !0) { + const o = []; + let c = !1; + for (let h = 0; h < t.length; h++) { + let u = t[h]; + m(u) && (u = It(u)); + const p = JSON.stringify(u); + if (c = o.some((g) => g === p), c) + break; + o.push(p); + } + c && r.push({ + messages: [ + v.errorUniqueItems + ], + path: n, + constrain: "uniqueItems" + }); + } + return r; +} +function ft(i, t, e, s, n) { + let r = []; + const a = St(e), o = Tt(e), c = Mt(e); + if (m(t) && d(a)) { + const l = d(c) ? c : {}, h = a, u = o; + l && Object.keys(t).forEach((p) => { + let g = !1; + if (d(u) && Object.keys(u).forEach((b) => { + g = new RegExp(b).test(p); + }), !g && h === !1 && !D(l, p) && r.push({ + messages: [ + C(v.errorAdditionalProperties, { + property: p + }) + ], + path: n, + constrain: "additionalProperties" + }), !g && m(h) && !D(l, p)) { + const b = new w({ + refParser: i.refParser, + schema: h, + data: t[p] + }), E = b.getErrors().map((y) => ({ + messages: y.messages, + path: p, + constrain: "additionalProperties" + })); + r = [...r, ...E], b.destroy(); } - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorArray); - - -/***/ }), - -/***/ "./src/editors/boolean-enum-radio.js": -/*!*******************************************!*\ - !*** ./src/editors/boolean-enum-radio.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _boolean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./boolean.js */ "./src/editors/boolean.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorBooleanEnumRadio instance. - * @extends EditorBoolean - */ -class EditorBooleanEnumRadio extends _boolean_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getRadiosControl({ - values: ['false', 'true'], - titles: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enumTitles') || ['false', 'true'], - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.radios.forEach((radio) => { - radio.addEventListener('change', () => { - const radioValue = radio.value === 'true' - this.instance.setValue(radioValue) + }); + } + return r; +} +const Se = { + additionalProperties: ft, + allOf: J, + anyOf: _, + enum: W, + exclusiveMaximum: Q, + exclusiveMinimum: X, + format: Y, + items: Z, + maximum: pt, + maxItems: tt, + maxLength: et, + maxProperties: st, + minimum: it, + minItems: nt, + minLength: G, + minProperties: rt, + multipleOf: at, + not: ot, + oneOf: ct, + pattern: lt, + patternProperties: dt, + required: ht, + type: ut, + uniqueItems: mt +}; +function vt(i, t, e, s, n) { + const r = [], a = oe(e); + return d(a) && Ot(t, a) && r.push({ + messages: [ + C(v.errorConst, { + const: JSON.stringify(a) }) - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.radios.forEach((radio) => { - const radioValue = radio.value === 'true' - radio.checked = radioValue === this.instance.getValue() - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorBooleanEnumRadio); - - -/***/ }), - -/***/ "./src/editors/boolean-enum-select.js": -/*!********************************************!*\ - !*** ./src/editors/boolean-enum-select.js ***! - \********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _boolean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./boolean.js */ "./src/editors/boolean.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorBooleanEnumSelect instance. - * @extends EditorBoolean - */ -class EditorBooleanEnumSelect extends _boolean_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getSelectControl({ - values: ['false', 'true'], - titles: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enumTitles') || ['false', 'true'], - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.input.addEventListener('change', () => { - const value = this.control.input.value === 'true' - this.instance.setValue(value) - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.input.value = this.instance.getValue() === true ? 'true' : 'false' - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorBooleanEnumSelect); - - -/***/ }), - -/***/ "./src/editors/boolean.js": -/*!********************************!*\ - !*** ./src/editors/boolean.js ***! - \********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorBoolean instance. - * @extends Editor - */ -class EditorBoolean extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getCheckboxControl({ - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.input.addEventListener('change', () => { - this.instance.setValue(this.control.input.checked) - }) - } - - sanitize (value) { - return Boolean(value) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.input.checked = this.instance.getValue() - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorBoolean); - - -/***/ }), - -/***/ "./src/editors/editor.js": -/*!*******************************!*\ - !*** ./src/editors/editor.js ***! - \*******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../themes/icons/icons.js */ "./src/themes/icons/icons.js"); -/* harmony import */ var _themes_bootstrap3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../themes/bootstrap3.js */ "./src/themes/bootstrap3.js"); -/* harmony import */ var _themes_bootstrap4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../themes/bootstrap4.js */ "./src/themes/bootstrap4.js"); -/* harmony import */ var _themes_bootstrap5_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../themes/bootstrap5.js */ "./src/themes/bootstrap5.js"); -/* harmony import */ var _themes_theme_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../themes/theme.js */ "./src/themes/theme.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - - - -/** - * Represents an Editor instance. - * @extends EventEmitter - */ -class Editor { - constructor (instance) { - /** - * A reference to the Instance being controlled by this editor. - * @type {Instance} - * @private - */ - this.instance = instance - - /** - * Theme instance used to build the Editor user interface. - * @type {Theme} - * @private - */ - this.theme = null - - /** - * The user interface html for this editor - * @type {HTMLElement} - * @private - */ - this.control = null - - /** - * Disabled status for this editor user interface - * @type {boolean} - * @private - */ - this.disabled = false - - /** - * Read only status for this editor user interface - * @type {boolean} - * @private - */ - this.readOnly = this.instance.isReadOnly() - - this.init() - this.build() - this.coerceValue() - this.addEventListeners() - this.setContainerAttributes() - this.refreshUI() - - const alwaysShowErrors = this.instance.jedi.options.showErrors === 'always' || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaOption)(this.instance.schema, 'showErrors') === 'always' - - if (alwaysShowErrors) { - const errors = this.instance.getErrors() - this.showValidationErrors(errors) - } - - this.instance.on('set-value', () => { - this.refreshUI() - const errors = this.instance.getErrors() - this.showValidationErrors(errors) - }) - - this.instance.on('change', () => { - this.refreshUI() - const errors = this.instance.getErrors() - this.showValidationErrors(errors) - }) - } - + ], + path: n, + constrain: "const" + }), r; +} +function bt(i, t, e, s, n) { + const r = [], a = ce(e), o = be(e), c = me(e); + if (x(t) && d(a)) { + let l = 0; + t.forEach((u) => { + const p = new w({ refParser: i.refParser, schema: a, data: u }); + p.getErrors().length === 0 && l++, p.destroy(); + }); + const h = l === 0; + d(o) ? l < o && r.push({ + messages: [ + C(v.errorMinContains, { + counter: l, + minContains: o + }) + ], + path: n, + constrain: "minContains" + }) : h && r.push({ + messages: [v.errorContains], + path: n, + constrain: "contains" + }), d(c) && l > c && r.push({ + messages: [ + C(v.errorMaxContains, { + counter: l, + maxContains: c + }) + ], + path: n, + constrain: "maxContains" + }); + } + return r; +} +function yt(i, t, e, s, n) { + const r = [], a = Jt(e); + if (m(t) && d(a)) { + let o = []; + Object.keys(a).forEach((l) => { + d(t[l]) && (o = a[l].filter((u) => !D(t, u))); + }), o.length > 0 && r.push({ + messages: [ + C(v.errorDependentRequired, { + dependentRequired: o.join(", ") + }) + ], + path: n, + constrain: "dependentRequired" + }); + } + return r; +} +function Ct(i, t, e) { + let s = []; + const n = de(e); + return m(t) && d(n) && Object.keys(n).forEach((r) => { + if (d(t[r])) { + const a = n[r], o = new w({ refParser: i.refParser, schema: a, data: t }), c = o.getErrors(); + o.destroy(), s = [...s, ...c]; + } + }), s; +} +function Et(i, t, e) { + const s = [], n = jt(e), r = Vt(e), a = At(e); + if (d(n)) { + if (H(r) && H(a)) + return s; + const o = new w({ refParser: i.refParser, schema: n, data: t }), c = o.getErrors(); + o.destroy(); + let l = [], h = []; + if (d(r)) { + const u = new w({ refParser: i.refParser, schema: r, data: t }); + l = u.getErrors(), u.destroy(); + } + if (d(a)) { + const u = new w({ refParser: i.refParser, schema: a, data: t }); + h = u.getErrors(), u.destroy(); + } + if (n === !0) + return l; + if (n === !1) + return h; + if (c.length === 0) + return l; + if (c.length > 0) + return h; + } + return s; +} +function Lt(i, t, e, s, n) { + const r = [], a = kt(e); + return x(t) && d(a) && a.forEach((o, c) => { + const l = t[c]; + if (d(l)) { + const h = new w({ refParser: i.refParser, schema: o, data: l }), u = h.getErrors(); + h.destroy(), u.length > 0 && r.push({ + messages: [ + C(v.errorPrefixItems, { + index: c + }) + ], + path: n, + constrain: "prefixItems" + }); + } + }), r; +} +const Oe = { + additionalProperties: ft, + allOf: J, + anyOf: _, + const: vt, + contains: bt, + dependentRequired: yt, + dependentSchemas: Ct, + enum: W, + exclusiveMaximum: Q, + exclusiveMinimum: X, + format: Y, + if: Et, + items: Z, + maximum: pt, + maxItems: tt, + maxLength: et, + maxProperties: st, + minimum: it, + minItems: nt, + minLength: G, + minProperties: rt, + multipleOf: at, + not: ot, + oneOf: ct, + pattern: lt, + patternProperties: dt, + prefixItems: Lt, + required: ht, + type: ut, + uniqueItems: mt +}, Pe = { + additionalProperties: ft, + allOf: J, + anyOf: _, + const: vt, + contains: bt, + dependentRequired: yt, + dependentSchemas: Ct, + enum: W, + exclusiveMaximum: Q, + exclusiveMinimum: X, + format: Y, + if: Et, + items: Z, + maximum: pt, + maxItems: tt, + maxLength: et, + maxProperties: st, + minimum: it, + minItems: nt, + minLength: G, + minProperties: rt, + multipleOf: at, + not: ot, + oneOf: ct, + pattern: lt, + patternProperties: dt, + prefixItems: Lt, + required: ht, + type: ut, + uniqueItems: mt +}; +function Xt(i, t, e, s, n) { + let r = []; + const a = Ie(e), o = Tt(e), c = Mt(e), l = zt(e), h = $(e), u = z(e); + if (m(t) && d(a)) { + let p = d(c) ? c : {}; + const g = a, b = o; + [ + l, + h, + u + ].forEach((y) => { + d(y) && y.forEach((L) => { + d(L.properties) && (p = { ...p, ...L.properties }); + }); + }), p && Object.keys(t).forEach((y) => { + let L = !1; + if (d(b) && Object.keys(b).forEach((N) => { + L = new RegExp(N).test(y); + }), !L && g === !1 && !D(p, y) && r.push({ + messages: [ + C(v.errorUnevaluatedProperties, { + property: y + }) + ], + path: n, + constrain: "unevaluatedProperties" + }), !L && m(g) && !D(p, y)) { + const N = new w({ + refParser: i.refParser, + schema: g, + data: t[y] + }), M = N.getErrors().map((P) => ({ + messages: P.messages, + path: y, + constrain: "unevaluatedProperties" + })); + r = [...r, ...M], N.destroy(); + } + }); + } + return r; +} +const Ae = { + additionalProperties: ft, + allOf: J, + anyOf: _, + const: vt, + contains: bt, + dependentRequired: yt, + dependentSchemas: Ct, + enum: W, + exclusiveMaximum: Q, + exclusiveMinimum: X, + format: Y, + if: Et, + items: Z, + maximum: pt, + maxItems: tt, + maxLength: et, + maxProperties: st, + minimum: it, + minItems: nt, + minLength: G, + minProperties: rt, + multipleOf: at, + not: ot, + oneOf: ct, + pattern: lt, + patternProperties: dt, + prefixItems: Lt, + required: ht, + type: ut, + unevaluatedProperties: Xt, + uniqueItems: mt +}; +function je(i, t, e, s, n) { + const r = [], a = ae(e); + return m(t) && d(a) && Object.keys(t).forEach((o) => { + new w({ + refParser: i.refParser, + schema: a, + data: o + }).getErrors().length > 0 && r.push({ + messages: [ + C(v.errorPropertyNames, { propertyName: o }) + ], + path: n, + constrain: "propertyNames" + }); + }), r; +} +const Ht = { + additionalProperties: ft, + allOf: J, + anyOf: _, + const: vt, + contains: bt, + dependentRequired: yt, + dependentSchemas: Ct, + enum: W, + exclusiveMaximum: Q, + exclusiveMinimum: X, + format: Y, + if: Et, + items: Z, + maximum: pt, + maxItems: tt, + maxLength: et, + maxProperties: st, + minimum: it, + minItems: nt, + minLength: G, + minProperties: rt, + multipleOf: at, + not: ot, + oneOf: ct, + pattern: lt, + patternProperties: dt, + prefixItems: Lt, + propertyNames: je, + required: ht, + type: ut, + unevaluatedProperties: Xt, + uniqueItems: mt +}; +class Te { + constructor(t = {}) { + this.refParser = t.refParser, this.validateFormat = t.validateFormat ? t.validateFormat : !1, this.draft = Ht, this.jsonSchemaDrafts = { + "http://json-schema.org/draft-04/schema#": Se, + "http://json-schema.org/draft-06/schema#": Oe, + "http://json-schema.org/draft-07/schema#": Pe, + "https://json-schema.org/draft/2019-09/schema": Ae, + "https://json-schema.org/draft/2020-12/schema": Ht + }; + } /** - * Initializes the editor - * @private + * Validates a value against it's schema */ - init () { - let icons = null - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isSet)(this.instance.jedi.options.iconLib)) { - switch (this.instance.jedi.options.iconLib) { - case 'glyphicons': - icons = _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__.glyphicons - break - case 'bootstrap-icons': - icons = _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__.bootstrapIcons - break - case 'fontawesome3': - icons = _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__.fontAwesome3 - break - case 'fontawesome4': - icons = _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__.fontAwesome4 - break - case 'fontawesome5': - icons = _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__.fontAwesome5 - break - case 'fontawesome6': - icons = _themes_icons_icons_js__WEBPACK_IMPORTED_MODULE_0__.fontAwesome6 - break + getErrors(t, e, s, n) { + let r = []; + const a = f(e, "messages"), o = T(e); + return O(o) && o === !0 ? r : O(o) && o === !1 ? [{ + messages: d(a) ? a : ["invalid"], + path: n + }] : (Object.keys(this.draft).forEach((c) => { + if (D(o, c)) { + const l = this.draft[c], h = l(this, t, e, s, n); + h && (r = [...r, ...h]); } - } - - switch (this.instance.jedi.options.theme) { - case 'bootstrap3': - this.theme = new _themes_bootstrap3_js__WEBPACK_IMPORTED_MODULE_1__["default"](icons) - break - case 'bootstrap4': - this.theme = new _themes_bootstrap4_js__WEBPACK_IMPORTED_MODULE_2__["default"](icons) - break - case 'bootstrap5': - this.theme = new _themes_bootstrap5_js__WEBPACK_IMPORTED_MODULE_3__["default"](icons) - break - default: - this.theme = new _themes_theme_js__WEBPACK_IMPORTED_MODULE_4__["default"](icons) - } + }), r.length > 0 && a && (r = [ + { + messages: a, + path: n + } + ]), r); + } +} +class Yt { + constructor() { + this.listeners = []; } - /** - * Sets container attributes like data-path and data-type - * @private + * Adds a named event listener + * @public + * @param {string} name - The name of the event + * @param {function} callback - A callback functions that will be executed when this event is emitted */ - setContainerAttributes () { - this.control.container.setAttribute('data-path', this.instance.path) - this.control.container.setAttribute('data-type', (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaType)(this.instance.schema)) + on(t, e) { + this.listeners.push({ name: t, callback: e }); } - /** - * Builds the editor control and appends it to the editor container - * @private + * Triggers the callback function of a named event listener + * @public + * @param {string} name - The name of the event to be emitted + * @param {*} payload - Payload containing data that is passed along with the callback function */ - build () { + emit(t, e = void 0) { + this.listeners.filter((n) => n.name === t).forEach((n) => { + n.callback(e); + }); } - /** - * Updates the value of the instance by making assumptions based on constrains + * Deletes all properties of the class */ - coerceValue () { - const schemaEnum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaEnum)(this.instance.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isSet)(schemaEnum) && !schemaEnum.includes(this.instance.getValue()) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isSet)(schemaEnum[0])) { - this.instance.setValue(schemaEnum[0], false) - } + destroy() { + Object.keys(this).forEach((t) => { + delete this[t]; + }); + } +} +class F extends Yt { + constructor(t) { + super(), this.jedi = t.jedi, this.path = t.path || this.jedi.rootName, this.schema = t.schema, this.value = d(t.value) ? t.value : void 0, this.isActive = !0, this.parent = t.parent || null, this.children = [], this.ui = null, this.init(); } - /** - * Add event listeners to ui elements - * @private + * Initializes and register the instance */ - addEventListeners () { + init() { + this.register(), this.setInitialValue(), this.prepare(), this.setDefaultValue(), this.jedi.options.isEditor && this.setUI(), this.on("change", () => { + this.parent && this.parent.onChildChange(); + }); } - /** - * Shows validation messages in the editor container. - * @private + * Sets the instance ui property. UI can be an editor instance or similar */ - showValidationErrors (errors) { - const neverShowErrors = this.instance.jedi.options.showErrors === 'never' || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaOption)(this.instance.schema, 'showErrors') === 'never' - - if (neverShowErrors) { - return - } - - this.control.messages.innerHTML = '' - - const label = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaTitle)(this.instance.schema) || this.instance.getKey() - - errors.forEach((error) => { - error.messages.forEach((message) => { - const invalidFeedback = this.getInvalidFeedback({ - message: label + ': ' + message - }) - this.control.messages.appendChild(invalidFeedback) - }) - }) + setUI() { } - /** - * Get an error message container - * @private + * Return the last part of the instance path */ - getInvalidFeedback (config) { - return this.theme.getInvalidFeedback(config) + getKey() { + return this.path.split(this.jedi.pathSeparator).pop(); } - /** - * Disables the editor + * Adds a child instance pointer to the instances list */ - disable () { - this.disabled = true - this.refreshUI() + register() { + this.jedi.register(this); } - /** - * Enables the editor + * Deletes a child instance pointer from the instances list */ - enable () { - this.disabled = false - this.refreshUI() + unregister() { + this.jedi.unregister(this); } - /** - * Updates control UI when its state changes - * @private + * Sets the default value of the instance based on it's type */ - refreshUI () { - this.refreshInteractiveElements() - } - - refreshInteractiveElements () { - const interactiveElements = this.control.container.querySelectorAll('button, input, select, textarea') - - interactiveElements.forEach((element) => { - if (this.disabled || this.readOnly) { - element.setAttribute('disabled', '') - } else { - element.removeAttribute('disabled', '') - } - }) + setInitialValue() { + if (H(this.value)) { + let t; + const e = R(this.schema); + e === "boolean" && (t = !1), e === "number" && (t = 0), e === "integer" && (t = 0), e === "string" && (t = ""), e === "array" && (t = []), e === "object" && (t = {}), e === "null" && (t = null), this.value = t; + } + } + setDefaultValue() { + const t = le(this.schema); + d(t) && this.setValue(t, !1); } - /** - * Transforms the input value if necessary before value set - * @private + * Returns the value of the instance */ - sanitize (value) { - return value + getValue() { + return this.value; } - /** - * Destroys the editor - * @private + * Sets the instance value */ - destroy () { - if (this.control.container && this.control.container.parentNode) { - this.control.container.parentNode.removeChild(this.control.container) - } - - Object.keys(this).forEach((key) => { - delete this[key] - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Editor); - - -/***/ }), - -/***/ "./src/editors/multiple.js": -/*!*********************************!*\ - !*** ./src/editors/multiple.js ***! - \*********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorMultiple instance. - * @extends Editor - */ -class EditorMultiple extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getMultipleControl({ - title: 'Options', - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema), - switcherOptionValues: this.instance.switcherOptionValues, - switcherOptionsLabels: this.instance.switcherOptionsLabels - }) - } - - addEventListeners () { - this.control.switcher.input.addEventListener('change', () => { - const index = Number(this.control.switcher.input.value) - this.instance.switchInstance(index) - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.childrenSlot.innerHTML = '' - this.control.childrenSlot.appendChild(this.instance.activeInstance.ui.control.container) - this.control.switcher.input.value = this.instance.index - - if (this.disabled || this.instance.isReadOnly()) { - this.instance.activeInstance.ui.disable() - } else { - this.instance.activeInstance.ui.enable() - } - } - - getInvalidFeedback (config) { - return this.theme.getAlert(config) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorMultiple); - - -/***/ }), - -/***/ "./src/editors/null.js": -/*!*****************************!*\ - !*** ./src/editors/null.js ***! - \*****************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorNull instance. - * @extends Editor - */ -class EditorNull extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getNullControl({ - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaFormat)(this.instance.schema) === 'hidden', - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - sanitize () { - return null - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorNull); - - -/***/ }), - -/***/ "./src/editors/number-enum-radio.js": -/*!******************************************!*\ - !*** ./src/editors/number-enum-radio.js ***! - \******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ "./src/editors/number.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorNumberEnumRadio instance. - * @extends EditorNumber - */ -class EditorNumberEnumRadio extends _number_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getRadiosControl({ - values: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - titles: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enumTitles') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.radios.forEach((radio) => { - radio.addEventListener('change', () => { - const value = this.sanitize(radio.value) - this.instance.setValue(value) - }) - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.radios.forEach((radio) => { - radio.checked = (Number(radio.value) === Number(this.instance.getValue())) - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorNumberEnumRadio); - - -/***/ }), - -/***/ "./src/editors/number-enum-select.js": -/*!*******************************************!*\ - !*** ./src/editors/number-enum-select.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ "./src/editors/number.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorNumberEnumSelect instance. - * @extends EditorNumber - */ -class EditorNumberEnumSelect extends _number_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getSelectControl({ - values: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - titles: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enumTitles') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.input.addEventListener('change', () => { - const value = this.sanitize(this.control.input.value) - this.instance.setValue(value) - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorNumberEnumSelect); - - -/***/ }), - -/***/ "./src/editors/number.js": -/*!*******************************!*\ - !*** ./src/editors/number.js ***! - \*******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorNumber instance. - * @extends Editor - */ -class EditorNumber extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getInputControl({ - type: 'number', - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaFormat)(this.instance.schema) === 'hidden', - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.input.addEventListener('change', () => { - const value = this.sanitize(this.control.input.value) - this.instance.setValue(value) - }) - } - - sanitize (value) { - if ((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaType)(this.instance.schema) === 'integer') { - return Math.floor(Number(value)) - } else { - return Number(value) - } + setValue(t, e = !0) { + this.value = t, this.emit("set-value", t), e && this.emit("change"); } - - refreshUI () { - this.refreshInteractiveElements() - const value = this.instance.getValue() - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isNumber)(value)) { - this.control.input.value = this.instance.getValue() - } + /** + * Fires when a child's instance state changes + */ + onChildChange() { } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorNumber); - - -/***/ }), - -/***/ "./src/editors/object-grid.js": -/*!************************************!*\ - !*** ./src/editors/object-grid.js ***! - \************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./object.js */ "./src/editors/object.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - -/** - * Represents a EditorObjectGrid instance. - * @extends EditorObject - */ -class EditorObjectGrid extends _object_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - refreshEditors () { - while (this.control.childrenSlot.firstChild) { - this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild) - } - - let row = this.theme.getRow() - this.control.childrenSlot.appendChild(row) - - this.instance.children.forEach((child) => { - if (child.isActive) { - const columns = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaOption)(child.schema, 'columns') || 12 - const offset = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaOption)(child.schema, 'offset') || 0 - const col = this.theme.getCol(12, columns, offset) - - if ((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaOption)(child.schema, 'newRow') === true) { - row = this.theme.getRow() - this.control.childrenSlot.appendChild(row) - } - - row.appendChild(col) - col.appendChild(child.ui.control.container) - - if (this.disabled || this.instance.isReadOnly()) { - child.ui.disable() - } else { - child.ui.enable() - } - } - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorObjectGrid); - - -/***/ }), - -/***/ "./src/editors/object-nav.js": -/*!***********************************!*\ - !*** ./src/editors/object-nav.js ***! - \***********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./object.js */ "./src/editors/object.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorObjectNav instance. - * @extends EditorObject - */ -class EditorObjectNav extends _object_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - init () { - super.init() - this.activeTabIndex = 0 - } - - refreshEditors () { - while (this.control.childrenSlot.firstChild) { - this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild) - } - - const controlCols = this.instance.schema['x-control-cols'] - const controlStacked = this.instance.schema['x-control-stacked'] - const controlVariant = this.instance.schema['x-control-variant'] - - const row = this.theme.getRow() - const cols = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(controlCols) ? controlCols : 3 - const tabListCol = this.theme.getCol(12, cols) - const tabContentCol = this.theme.getCol(12, (12 - cols)) - const tabContent = this.theme.getTabContent() - const tabList = this.theme.getTabList({ - stacked: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(controlStacked) ? controlStacked : false, - type: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(controlVariant) ? controlVariant : 'pils' - }) - - this.control.childrenSlot.appendChild(row) - row.appendChild(tabListCol) - row.appendChild(tabContentCol) - tabListCol.appendChild(tabList) - tabContentCol.appendChild(tabContent) - - this.instance.children.forEach((child, index) => { - if (child.isActive) { - const active = index === this.activeTabIndex - const id = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(child.path) - const schemaTitle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(child.schema) - - const tab = this.theme.getTab({ - title: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaTitle) ? schemaTitle : child.getKey(), - id: id, - active: active - }) - - tab.list.addEventListener('click', () => { - this.activeTabIndex = index - }) - - this.theme.setTabPaneAttributes(child.ui.control.container, active, id) - - tabList.appendChild(tab.list) - tabContent.appendChild(child.ui.control.container) - - if (this.disabled || this.instance.isReadOnly()) { - child.ui.disable() - } else { - child.ui.enable() - } - } - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorObjectNav); - - -/***/ }), - -/***/ "./src/editors/object.js": -/*!*******************************!*\ - !*** ./src/editors/object.js ***! - \*******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents an EditorObject instance. - * @extends Editor - */ -class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.propertyActivators = {} - const schemaOptions = this.instance.schema.options || {} - let addProperty = true - const additionalProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAdditionalProperties)(this.instance.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(additionalProperties) && additionalProperties === false) { - addProperty = false - } - - let editableProperties = false - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.instance.jedi.options.editableProperties)) { - editableProperties = this.instance.jedi.options.editableProperties - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaOptions.editableProperties)) { - editableProperties = schemaOptions.editableProperties - } - - this.control = this.theme.getObjectControl({ - title: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema), - editableProperties: editableProperties, - addProperty: addProperty - }) - } - - addEventListeners () { - this.control.addPropertyBtn.addEventListener('click', () => { - const key = this.control.addPropertyControl.input.value.split(' ').join('') - - const propertyNameEmpty = key.length === 0 - - if (propertyNameEmpty) { - return - } - - const propertyExist = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.instance.value[key]) - - if (propertyExist) { - return - } - - let schema = {} - - const schemaAdditionalProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAdditionalProperties)(this.instance.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaAdditionalProperties)) { - schema = schemaAdditionalProperties - } - - const child = this.instance.createChild(schema, key) - child.activate() - this.instance.properties[key] = { schema } - this.instance.setValue(this.instance.value) - this.control.addPropertyControl.input.value = '' - - const ariaLive = this.control.ariaLive - ariaLive.innerHTML = '' - const schemaTitle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(child.schema) - const label = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaTitle) ? schemaTitle : key - const ariaLiveMessage = this.theme.getAriaLiveMessage() - ariaLiveMessage.textContent = label + ' field was added to the form' - ariaLive.appendChild(ariaLiveMessage) - }) - } - - sanitize (value) { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isObject)(value)) { - return value - } - - return {} - } - - getInvalidFeedback (config) { - return this.theme.getAlert(config) - } - - refreshPropertiesSlot () { - const schemaOptionEditableProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'editableProperties') - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(this.instance.jedi.options.editableProperties, true) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(schemaOptionEditableProperties, true)) { - Object.keys(this.instance.properties).forEach((property) => { - // refactor with isNotRequired - const isRequired = this.instance.isRequired(property) - const isDependentRequired = this.instance.isDependentRequired(property) - const notRequired = !isRequired && !isDependentRequired - - const activatorInDom = this.propertyActivators[property] - const ariaLive = this.control.ariaLive - const schema = this.instance.properties[property].schema - const schemaTitle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(schema) - const path = this.instance.path + this.instance.jedi.pathSeparator + property - const id = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(path) + '-activator' - const label = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaTitle) ? schemaTitle : property - - if (notRequired && !activatorInDom) { - const checkboxControl = this.theme.getCheckboxControl({ - id: id, - label: label, - srOnly: false - }) - - const checkbox = checkboxControl.input - this.propertyActivators[property] = checkbox - - checkbox.addEventListener('change', () => { - ariaLive.innerHTML = '' - const ariaLiveMessage = this.theme.getAriaLiveMessage() - - if (checkbox.checked) { - const child = this.instance.getChild(property) - - if (!child) { - this.instance.createChild(schema, property) - } - - this.instance.getChild(property).activate() - ariaLiveMessage.textContent = label + ' field was added to the form' - ariaLive.appendChild(ariaLiveMessage) - } else { - this.instance.getChild(property).deactivate() - ariaLiveMessage.textContent = label + ' field was removed from the form' - ariaLive.appendChild(ariaLiveMessage) - } - }) - - this.control.propertiesActivators.appendChild(checkboxControl.container) - } - - const checkbox = this.propertyActivators[property] - if (checkbox) { - checkbox.disabled = this.disabled - checkbox.checked = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(this.instance.getValue(), property) - } - }) - } + /** + * Returns an array of validation error messages + */ + getErrors() { + if (!this.isActive) + return []; + const t = this.jedi.validator.getErrors(this.getValue(), this.schema, this.getKey(), this.path); + return Kt(t); } - - refreshEditors () { - this.instance.children.forEach((child) => { - if (child.isActive) { - if (child.ui.control.container.parentNode === null) { - this.control.childrenSlot.appendChild(child.ui.control.container) - } - - if (this.disabled || this.instance.isReadOnly()) { - child.ui.disable() - } else { - child.ui.enable() - } - } else { - if (child.ui.control.container.parentNode) { - child.ui.control.container.parentNode.removeChild(child.ui.control.container) - } - } - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.refreshPropertiesSlot() - this.refreshEditors() - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorObject); - - -/***/ }), - -/***/ "./src/editors/string-enum-radio.js": -/*!******************************************!*\ - !*** ./src/editors/string-enum-radio.js ***! - \******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./string.js */ "./src/editors/string.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorStringEnumRadio instance. - * @extends Editor - */ -class EditorStringEnumRadio extends _string_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getRadiosControl({ - values: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - titles: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enumTitles') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.radios.forEach((radio) => { - radio.addEventListener('change', () => { - this.instance.setValue(radio.value) - }) - }) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.radios.forEach((radio) => { - radio.checked = (radio.value === this.instance.getValue()) - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorStringEnumRadio); - - -/***/ }), - -/***/ "./src/editors/string-enum-select.js": -/*!*******************************************!*\ - !*** ./src/editors/string-enum-select.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./string.js */ "./src/editors/string.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorStringEnumSelect instance. - * @extends Editor - */ -class EditorStringEnumSelect extends _string_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getSelectControl({ - values: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - titles: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enumTitles') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaEnum)(this.instance.schema), - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle'), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - - this.control.input.addEventListener('change', () => { - this.instance.setValue(this.control.input.value) - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorStringEnumSelect); - - -/***/ }), - -/***/ "./src/editors/string-textarea.js": -/*!****************************************!*\ - !*** ./src/editors/string-textarea.js ***! - \****************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorStringTextarea instance. - * @extends Editor - */ -class EditorStringTextarea extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - this.control = this.theme.getTextareaControl({ - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle') || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaFormat)(this.instance.schema) === 'hidden', - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - } - - addEventListeners () { - this.control.input.addEventListener('change', () => { - this.instance.setValue(this.control.input.value) - }) - } - - sanitize (value) { - return String(value) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.input.value = this.instance.getValue() - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorStringTextarea); - - -/***/ }), - -/***/ "./src/editors/string.js": -/*!*******************************!*\ - !*** ./src/editors/string.js ***! - \*******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _editor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.js */ "./src/editors/editor.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a EditorString instance. - * @extends Editor - */ -class EditorString extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - build () { - const inputTypes = ['hidden', 'color', 'date', 'datetime-local', 'email', 'number', 'month', 'password', 'search', 'time', 'tel', 'text', 'textarea', 'url', 'week'] - const schemaFormat = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaFormat)(this.instance.schema) - - this.control = this.theme.getInputControl({ - type: inputTypes.includes(schemaFormat) ? schemaFormat : 'text', - id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - label: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), - srOnly: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'hideTitle') || schemaFormat === 'hidden', - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) - }) - - // fix color picker bug - if (schemaFormat === 'color' && this.instance.value.length === 0) { - this.instance.setValue('#000000', false) - } + /** + * Prepare data before building the editor + */ + prepare() { } - - addEventListeners () { - this.control.input.addEventListener('change', () => { - this.instance.setValue(this.control.input.value) - }) - } - - sanitize (value) { - return String(value) - } - - refreshUI () { - this.refreshInteractiveElements() - this.control.input.value = this.instance.getValue() - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditorString); - - -/***/ }), - -/***/ "./src/event-emitter.js": -/*!******************************!*\ - !*** ./src/event-emitter.js ***! - \******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/** - * Represents an EventEmitter instance. - */ -class EventEmitter { - constructor () { - this.listeners = [] - } - /** - * Adds a named event listener - * @public - * @param {string} name - The name of the event - * @param {function} callback - A callback functions that will be executed when this event is emitted + * Activates the instance */ - on (name, callback) { - this.listeners.push({ name, callback }) + activate() { + this.isActive === !1 && (this.isActive = !0, this.emit("change")); } - /** - * Triggers the callback function of a named event listener - * @public - * @param {string} name - The name of the event to be emitted - * @param {*} payload - Payload containing data that is passed along with the callback function + * Deactivates the instance */ - emit (name, payload = undefined) { - const listeners = this.listeners.filter(listener => listener.name === name) - - listeners.forEach((listener) => { - listener.callback(payload) - }) - } - + deactivate() { + this.isActive === !0 && (this.isActive = !1, this.emit("change")); + } /** - * Deletes all properties of the class + * Returns true if this instance is read only */ - destroy () { - Object.keys(this).forEach((key) => { - delete this[key] - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EventEmitter); - - -/***/ }), - -/***/ "./src/helpers/schema.js": -/*!*******************************!*\ - !*** ./src/helpers/schema.js ***! - \*******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ getSchemaAdditionalProperties: () => (/* binding */ getSchemaAdditionalProperties), -/* harmony export */ getSchemaAllOf: () => (/* binding */ getSchemaAllOf), -/* harmony export */ getSchemaAnyOf: () => (/* binding */ getSchemaAnyOf), -/* harmony export */ getSchemaConst: () => (/* binding */ getSchemaConst), -/* harmony export */ getSchemaContains: () => (/* binding */ getSchemaContains), -/* harmony export */ getSchemaDefault: () => (/* binding */ getSchemaDefault), -/* harmony export */ getSchemaDependentRequired: () => (/* binding */ getSchemaDependentRequired), -/* harmony export */ getSchemaDependentSchemas: () => (/* binding */ getSchemaDependentSchemas), -/* harmony export */ getSchemaDescription: () => (/* binding */ getSchemaDescription), -/* harmony export */ getSchemaElse: () => (/* binding */ getSchemaElse), -/* harmony export */ getSchemaEnum: () => (/* binding */ getSchemaEnum), -/* harmony export */ getSchemaExclusiveMaximum: () => (/* binding */ getSchemaExclusiveMaximum), -/* harmony export */ getSchemaExclusiveMinimum: () => (/* binding */ getSchemaExclusiveMinimum), -/* harmony export */ getSchemaFormat: () => (/* binding */ getSchemaFormat), -/* harmony export */ getSchemaIf: () => (/* binding */ getSchemaIf), -/* harmony export */ getSchemaItems: () => (/* binding */ getSchemaItems), -/* harmony export */ getSchemaMaxContains: () => (/* binding */ getSchemaMaxContains), -/* harmony export */ getSchemaMaxItems: () => (/* binding */ getSchemaMaxItems), -/* harmony export */ getSchemaMaxLength: () => (/* binding */ getSchemaMaxLength), -/* harmony export */ getSchemaMaxProperties: () => (/* binding */ getSchemaMaxProperties), -/* harmony export */ getSchemaMaximum: () => (/* binding */ getSchemaMaximum), -/* harmony export */ getSchemaMinContains: () => (/* binding */ getSchemaMinContains), -/* harmony export */ getSchemaMinItems: () => (/* binding */ getSchemaMinItems), -/* harmony export */ getSchemaMinLength: () => (/* binding */ getSchemaMinLength), -/* harmony export */ getSchemaMinProperties: () => (/* binding */ getSchemaMinProperties), -/* harmony export */ getSchemaMinimum: () => (/* binding */ getSchemaMinimum), -/* harmony export */ getSchemaMultipleOf: () => (/* binding */ getSchemaMultipleOf), -/* harmony export */ getSchemaNot: () => (/* binding */ getSchemaNot), -/* harmony export */ getSchemaOneOf: () => (/* binding */ getSchemaOneOf), -/* harmony export */ getSchemaOption: () => (/* binding */ getSchemaOption), -/* harmony export */ getSchemaPattern: () => (/* binding */ getSchemaPattern), -/* harmony export */ getSchemaPatternProperties: () => (/* binding */ getSchemaPatternProperties), -/* harmony export */ getSchemaPrefixItems: () => (/* binding */ getSchemaPrefixItems), -/* harmony export */ getSchemaProperties: () => (/* binding */ getSchemaProperties), -/* harmony export */ getSchemaPropertyNames: () => (/* binding */ getSchemaPropertyNames), -/* harmony export */ getSchemaReadOnly: () => (/* binding */ getSchemaReadOnly), -/* harmony export */ getSchemaRequired: () => (/* binding */ getSchemaRequired), -/* harmony export */ getSchemaSchema: () => (/* binding */ getSchemaSchema), -/* harmony export */ getSchemaThen: () => (/* binding */ getSchemaThen), -/* harmony export */ getSchemaTitle: () => (/* binding */ getSchemaTitle), -/* harmony export */ getSchemaType: () => (/* binding */ getSchemaType), -/* harmony export */ getSchemaUnevaluatedProperties: () => (/* binding */ getSchemaUnevaluatedProperties), -/* harmony export */ getSchemaUniqueItems: () => (/* binding */ getSchemaUniqueItems), -/* harmony export */ getSchemaX: () => (/* binding */ getSchemaX) -/* harmony export */ }); -/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./src/helpers/utils.js"); - - -function getSchemaX (schema, keyword) { - const key = 'x-' + keyword - return schema[key] -} - -function getSchemaSchema (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(schema.$schema) ? schema.$schema : undefined -} - -function getSchemaAdditionalProperties (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.additionalProperties) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.additionalProperties) ? schema.additionalProperties : undefined -} - -function getSchemaPropertyNames (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.propertyNames) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.propertyNames) ? schema.propertyNames : undefined -} - -function getSchemaAllOf (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.allOf) ? schema.allOf : undefined -} - -function getSchemaAnyOf (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.anyOf) ? schema.anyOf : undefined -} - -function getSchemaConst (schema) { - return schema.const -} - -function getSchemaContains (schema) { - return ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.contains) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.contains)) ? schema.contains : undefined -} - -function getSchemaDefault (schema) { - return schema.default -} - -function getSchemaDependentRequired (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.dependentRequired) ? schema.dependentRequired : undefined -} - -function getSchemaDependentSchemas (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.dependentSchemas) ? schema.dependentSchemas : undefined -} - -function getSchemaDescription (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(schema.description) ? schema.description : undefined -} - -function getSchemaElse (schema) { - return ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.else) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.else)) ? schema.else : undefined -} - -function getSchemaEnum (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.enum) && schema.enum.length > 0) { - return schema.enum - } - - return undefined -} - -function getSchemaExclusiveMaximum (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(schema.exclusiveMaximum) ? schema.exclusiveMaximum : undefined -} - -function getSchemaExclusiveMinimum (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(schema.exclusiveMinimum) ? schema.exclusiveMinimum : undefined -} - -function getSchemaFormat (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(schema.format) ? schema.format : undefined -} - -function getSchemaIf (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.if)) { - return schema.if - } - - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.if)) { - return schema.if - } - - return undefined -} - -function getSchemaItems (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.items) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.items) ? schema.items : undefined -} - -function getSchemaMaximum (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(schema.maximum) ? schema.maximum : undefined -} - -function getSchemaMaxContains (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.maxContains) && schema.maxContains >= 0) { - return schema.maxContains - } - - return undefined -} - -function getSchemaMaxItems (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.maxItems) && schema.maxItems >= 0) { - return schema.maxItems + isReadOnly() { + let t = !1; + return Ut(this.schema) === !0 && (t = !0), this.parent && Ut(this.parent.schema) === !0 && (t = !0), t; } - - return undefined -} - -function getSchemaMaxLength (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.maxLength) && schema.maxLength >= 0) { - return schema.maxLength + /** + * Destroy the instance and it's children + */ + destroy() { + this.listeners = [], this.children.forEach((t) => { + t.destroy(); + }), this.unregister(), this.ui && this.ui.destroy(), Object.keys(this).forEach((t) => { + delete this[t]; + }), super.destroy(); + } +} +const ke = { + properties: "glyphicon glyphicon-list", + delete: "glyphicon glyphicon-trash", + add: "glyphicon glyphicon-plus", + moveUp: "glyphicon glyphicon-arrow-up", + moveDown: "glyphicon glyphicon-arrow-down" +}, Me = { + properties: "bi bi-card-list", + delete: "bi bi-trash2", + add: "bi bi-plus", + moveUp: "bi bi-arrow-up", + moveDown: "bi bi-arrow-down" +}, Ve = { + properties: "icon-list", + delete: "icon-trash", + add: "icon-plus", + moveUp: "icon-arrow-up", + moveDown: "icon-arrow-down" +}, Re = { + properties: "fa fa-list", + delete: "fa fa-trash-o", + add: "fa fa-plus", + moveUp: "fa fa-arrow-up", + moveDown: "fa fa-arrow-down" +}, Be = { + properties: "fas fa-list", + delete: "fas fa-trash", + add: "fas fa-plus", + moveUp: "fas fa-arrow-up", + moveDown: "fas fa-arrow-down" +}, qe = { + properties: "fa-solid fa-list", + delete: "fa-solid fa-trash", + add: "fa-solid fa-plus", + moveUp: "fa-solid fa-arrow-up", + moveDown: "fa-solid fa-arrow-down" +}; +class xt { + constructor(t = null) { + this.icons = t, this.useToggleEvents = !0, this.init(); } - - return undefined -} - -function getSchemaMaxProperties (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.maxProperties)) { - return schema.maxProperties + /** + * Inits some instance properties + * @private + */ + init() { + this.useToggleEvents = !0; } - - return undefined -} - -function getSchemaMinimum (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(schema.minimum) ? schema.minimum : undefined -} - -function getSchemaMinContains (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.minContains) && schema.minContains >= 0) { - return schema.minContains - } - - return undefined -} - -function getSchemaMinItems (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.minItems) && schema.minItems >= 0) { - return schema.minItems - } - - return undefined -} - -function getSchemaMinLength (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.minLength) && schema.minLength >= 0) { - return schema.minLength - } - - return undefined -} - -function getSchemaMinProperties (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(schema.minProperties) && schema.minProperties >= 0) { - return schema.minProperties - } - - return undefined -} - -function getSchemaMultipleOf (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(schema.multipleOf) && schema.multipleOf >= 0) { - return schema.multipleOf - } - - return undefined -} - -function getSchemaNot (schema) { - return ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.not) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.not)) ? schema.not : undefined -} - -function getSchemaOption (schema, option) { - return (schema.options && schema.options[option]) ? schema.options[option] : undefined -} - -function getSchemaPattern (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(schema.pattern) ? schema.pattern : undefined -} - -function getSchemaPatternProperties (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.patternProperties) ? schema.patternProperties : undefined -} - -function getSchemaPrefixItems (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.prefixItems) ? schema.prefixItems : undefined -} - -function getSchemaProperties (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.properties) ? schema.properties : undefined -} - -function getSchemaReadOnly (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.readOnly) ? schema.readOnly : undefined -} - -function getSchemaRequired (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.required) ? [...new Set(schema.required)] : undefined -} - -function getSchemaThen (schema) { - return ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(schema.then) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.then)) ? schema.then : undefined -} - -function getSchemaTitle (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(schema.title) ? schema.title : undefined -} - -function getSchemaType (schema) { - if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(schema.type) || (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.type)) { - return schema.type - } - - return undefined -} - -function getSchemaOneOf (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(schema.oneOf) ? schema.oneOf : undefined -} - -function getSchemaUnevaluatedProperties (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.unevaluatedProperties) ? schema.unevaluatedProperties : undefined -} - -function getSchemaUniqueItems (schema) { - return (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(schema.uniqueItems) ? schema.uniqueItems : undefined -} - - -/***/ }), - -/***/ "./src/helpers/utils.js": -/*!******************************!*\ - !*** ./src/helpers/utils.js ***! - \******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ clamp: () => (/* binding */ clamp), -/* harmony export */ clone: () => (/* binding */ clone), -/* harmony export */ compileTemplate: () => (/* binding */ compileTemplate), -/* harmony export */ different: () => (/* binding */ different), -/* harmony export */ equal: () => (/* binding */ equal), -/* harmony export */ escapeRegExp: () => (/* binding */ escapeRegExp), -/* harmony export */ getCircularReplacer: () => (/* binding */ getCircularReplacer), -/* harmony export */ getType: () => (/* binding */ getType), -/* harmony export */ getValueByJSONPath: () => (/* binding */ getValueByJSONPath), -/* harmony export */ hasOwn: () => (/* binding */ hasOwn), -/* harmony export */ isArray: () => (/* binding */ isArray), -/* harmony export */ isBoolean: () => (/* binding */ isBoolean), -/* harmony export */ isInteger: () => (/* binding */ isInteger), -/* harmony export */ isNull: () => (/* binding */ isNull), -/* harmony export */ isNumber: () => (/* binding */ isNumber), -/* harmony export */ isObject: () => (/* binding */ isObject), -/* harmony export */ isSet: () => (/* binding */ isSet), -/* harmony export */ isString: () => (/* binding */ isString), -/* harmony export */ mergeDeep: () => (/* binding */ mergeDeep), -/* harmony export */ notSet: () => (/* binding */ notSet), -/* harmony export */ overwriteExistingProperties: () => (/* binding */ overwriteExistingProperties), -/* harmony export */ pathToAttribute: () => (/* binding */ pathToAttribute), -/* harmony export */ removeDuplicatesFromArray: () => (/* binding */ removeDuplicatesFromArray), -/* harmony export */ replaceAll: () => (/* binding */ replaceAll), -/* harmony export */ sortObject: () => (/* binding */ sortObject) -/* harmony export */ }); -/** - * Utils. - * @module utils - */ - -function getCircularReplacer () { - const ancestors = [] - - return function (key, value) { - if (typeof value !== 'object' || value === null) { - return value - } - // `this` is the object that value is contained in, - // i.e., its direct parent. - while (ancestors.length > 0 && ancestors.at(-1) !== this) { - ancestors.pop() - } - if (ancestors.includes(value)) { - return '[Circular]' - } - ancestors.push(value) - return value - } -} - -/** - * Returns a clone of a thing - * @param {*} thing - The thing to be cloned - * @return {*} The clone of the thing - */ -function clone (thing) { - if (typeof thing === 'undefined') { - return undefined - } - - return JSON.parse(JSON.stringify(thing, getCircularReplacer())) -} - -/** - * Returns escaped regexp - * @param {string} string - The string - * @return {string} Escaped regexp - */ -function escapeRegExp (string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // $& means the whole matched string -} - -/** - * Multiple search and replace - * @param {string} str - The string - * @param {string} find - The part to be replaced - * @param {string} replace - The replacement - * @return {void} - */ -function replaceAll (str, find, replace) { - return str.replace(new RegExp(escapeRegExp(find), 'g'), replace) -} - -/** - * Formats a json path to be used as an html attribute value - * @param {string} path - The json path - * @return {string} - */ -function pathToAttribute (path) { - return replaceAll(replaceAll(path, '#', 'root'), '/', '-') -} - -/** - * Returns true if a given object has a given property - * @param {object} obj - The object - * @param {string} prop - The property - * @return {boolean} - */ -function hasOwn (obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop) -} - -/** - * Sort object properties - * @param {object} obj - The object - * @return {void} - */ -function sortObject (obj) { - return Object.keys(obj).sort().reduce((result, key) => { - result[key] = obj[key] - return result - }, {}) -} - -/** - * Returns true if the two values passed are equal - * @param {*} a - Value A - * @param {*} b - Value B - * @return {boolean} - */ -function equal (a, b) { - if (isObject(a) && isObject(b)) { - a = sortObject(a) - b = sortObject(b) - } - return JSON.stringify(a) === JSON.stringify(b) -} - -/** - * Returns true if the two values passed are different - * @param {*} a - Value A - * @param {*} b - Value B - * @return {boolean} - */ -function different (a, b) { - return !equal(a, b) -} - -/** - * Returns true if the value passed is null - * @param {*} value - The value - * @return {boolean} - */ -function isNull (value) { - return value === null -} - -/** - * Returns true if the value is defined - * @param {*} value - The value - * @return {boolean} - */ -function isSet (value) { - return typeof value !== 'undefined' -} - -/** - * Returns true if the value is undefined - * @param {*} value - The value - * @return {boolean} - */ -function notSet (value) { - return typeof value === 'undefined' -} - -/** - * Returns true if the value passed is a number - * @param {*} value - The value - * @return {boolean} - */ -function isNumber (value) { - return typeof value === 'number' -} - -/** - * Returns true if the value passed is an integer - * @param {*} value - The value - * @return {boolean} - */ -function isInteger (value) { - return isNumber(value) && value === Math.floor(value) -} - -/** - * Returns true if the value passed is a string - * @param {*} value - The value - * @return {boolean} - */ -function isString (value) { - return typeof value === 'string' -} - -/** - * Returns true if the value passed is a boolean - * @param {*} value - The value - * @return {boolean} - */ -function isBoolean (value) { - return typeof value === 'boolean' -} - -/** - * Returns true if the value passed is an array - * @param {*} value - The value - * @return {boolean} - */ -function isArray (value) { - return Array.isArray(value) -} - -/** - * Returns true if the value passed is an object - * @param {*} value - The value - * @return {boolean} - */ -function isObject (value) { - return !isNull(value) && !isArray(value) && typeof value === 'object' -} - -/** - * Returns the type of a value - * @param {*} value - The value - * @return {string} The type of the value - */ -function getType (value) { - let type = 'any' - - if (isNumber(value)) { - type = isInteger(value) ? 'integer' : 'number' - } else if (isString(value)) { - type = 'string' - } else if (isBoolean(value)) { - type = 'boolean' - } else if (isArray(value)) { - type = 'array' - } else if (isNull(value)) { - type = 'null' - } else if (isObject(value)) { - type = 'object' - } - - return type -} - -/** - * Merges objects - * @param {object} target - The target object - * @param {object[]} sources - Objects to be merged into the target object - * @return {object} The merged object - */ -function mergeDeep (target, ...sources) { - if (!sources.length) return target - const source = sources.shift() - - if (isObject(target) && isObject(source)) { - Object.keys(source).forEach((key) => { - if (isObject(source[key])) { - if (!target[key]) { - Object.assign(target, { - [key]: {} - }) - } - mergeDeep(target[key], source[key]) - } else { - Object.assign(target, { - [key]: source[key] - }) - } - }) - } - - return mergeDeep(target, ...sources) -} - -/** - * Merges objects but only the properties that exists in boths objects - * if they are the same type of value - * @param {object} obj1 - The target object - * @param {object[]} obj2 - Objects who's properties are the overrides - * @return {object} The overwritten object - */ -function overwriteExistingProperties (obj1, obj2) { - Object.keys(obj2).forEach(function (key) { - if (key in obj1) { - if (typeof obj1[key] === typeof obj2[key]) { - obj1[key] = obj2[key] - } - } - }) - - return obj1 -} - -/** - * Get some value by traversing the data using JSON path - * @param {object} data - The data source - * @param {string} path - JSON path - * @return {*} - */ -function getValueByJSONPath (data, path) { - const keys = path.split('.') // Split the path into individual keys - - let value = data - for (const key of keys) { - if (Array.isArray(value) && /^\d+$/.test(key)) { - const index = parseInt(key) - if (index >= 0 && index < value.length) { - value = value[index] - } else { - return undefined // Index is out of bounds, return undefined - } - } else if (hasOwn(value, key)) { - value = value[key] - } else { - return undefined // Key doesn't exist, return undefined - } + /** + * Returns a icon element + * @private + */ + getIcon(t) { + const e = document.createElement("i"), s = this.icons[t].split(" "); + return s.length > 0 && s.forEach((n) => { + e.classList.add(n); + }), e; } - - return value -} - -/** - * Compiles a template by search and replace - * @param {string} template - The template string - * @param {object} data - Where template data lives - * @return {string} - */ -function compileTemplate (template, data) { - return template.replace(/{{(.*?)}}/g, (match) => { - match = match.replace(/\s/g, '') - const path = match.split(/{{|}}/)[1] - return getValueByJSONPath(data, path) - }) -} - -function clamp (number, min, max) { - return Math.max(min, Math.min(number, max)) -} - -function removeDuplicatesFromArray (arr) { - const uniqueObjects = [] - const uniqueValues = new Set() - - for (const obj of arr) { - const objString = JSON.stringify(obj) - if (!uniqueValues.has(objString)) { - uniqueValues.add(objString) - uniqueObjects.push(obj) - } + /** + * Used to wrap the editor UI elements + * @private + */ + getEditorContainer() { + const t = document.createElement("div"); + return t.classList.add("jedi-editor-container"), t; } - - return uniqueObjects -} - - -/***/ }), - -/***/ "./src/i18n.js": -/*!*********************!*\ - !*** ./src/i18n.js ***! - \*********************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ i18n: () => (/* binding */ i18n) -/* harmony export */ }); -/** - * Simple translation module. - * @module i18n - */ - -/** - * Locale messages - * @type {object} - */ -const i18n = { - errorAdditionalProperties: 'Has additional property "{{ property }}" but no additional properties are allowed.', - errorAnyOf: 'Must validate against at least one of the provided schemas.', - errorConst: 'Must have value of: {{ const }}.', - errorContains: 'Must contain at least one item matching the provided schema.', - errorDependentRequired: 'Must have the required properties: {{ dependentRequired }}.', - errorEnum: 'Must be one of the enumerated values: {{ enum }}.', - errorExclusiveMaximum: 'Must be less than {{ exclusiveMaximum }}.', - errorExclusiveMinimum: 'Must be greater than {{ exclusiveMinimum }}.', - errorFormat: 'Must be a valid {{ format }}.', - errorItems: 'Must have items that validate against the provided schema.', - errorMaximum: 'Must be at most {{ maximum }}.', - errorMaxItems: 'Must have at most {{ maxItems }} items.', - errorMaxLength: 'Must be at most {{ maxLength }} characters long.', - errorMaxProperties: 'Must have at most {{ maxProperties }} properties.', - errorMaxContains: 'Must contain at most {{ maxContains }} items matching the provided schema. It currently contains {{ counter }}.', - errorMinContains: 'Must contain at least {{ minContains }} items matching the provided schema. It currently contains {{ counter }}.', - errorMinimum: 'Must be at least {{ minimum }}.', - errorMinItems: 'Must have at least {{ minItems }} items.', - errorMinLength: 'Must be at least {{ minLength }} characters long.', - errorMinProperties: 'Must have at least {{ minProperties }} properties.', - errorMultipleOf: 'Must be multiple of {{ multipleOf }}.', - errorNot: 'Must not validate against the provided schema.', - errorOneOf: 'Must validate against exactly one of the provided schemas. It currently validates against {{ counter }} of the schemas.', - errorPattern: 'Must match the pattern: "{{ pattern }}".', - errorPrefixItems: 'Item {{ index }} fails validation.', - errorPropertyNames: 'Property name "{{ propertyName }}" fails validation.', - errorRequired: 'Must have the required properties: {{ required }}.', - errorType: 'Must be of type {{ type }}.', - errorUnevaluatedProperties: 'Has invalid unevaluated property "{{ property }}"', - errorUniqueItems: 'Must have unique items.' -} - - -/***/ }), - -/***/ "./src/instances/array.js": -/*!********************************!*\ - !*** ./src/instances/array.js ***! - \********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _editors_array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editors/array.js */ "./src/editors/array.js"); -/* harmony import */ var _editors_array_nav_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editors/array-nav.js */ "./src/editors/array-nav.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - -/** - * Represents an InstanceArray instance. - * @extends Instance - */ -class InstanceArray extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaType)(this.schema) - const schemaFormat = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaFormat)(this.schema) - - if (schemaType === 'array' && schemaFormat === 'nav') { - this.ui = new _editors_array_nav_js__WEBPACK_IMPORTED_MODULE_3__["default"](this) - } else { - this.ui = new _editors_array_js__WEBPACK_IMPORTED_MODULE_2__["default"](this) - } - } - - prepare () { - this.refreshChildren() - - this.on('set-value', () => { - this.refreshChildren() - }) - } - - createItemInstance (value) { - let schema - const itemsCount = this.children.length - const schemaItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaItems)(this.schema) - const schemaPrefixItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaPrefixItems)(this.schema) - schema = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaItems) ? schemaItems : {} - - const hasPrefixItemsSchema = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaPrefixItems) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaPrefixItems[itemsCount]) - - if (hasPrefixItemsSchema) { - schema = schemaPrefixItems[itemsCount] - } - - const child = this.jedi.createInstance({ - jedi: this.jedi, - schema: schema, - path: this.path + this.jedi.pathSeparator + itemsCount, - parent: this, - value: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.clone)(value) - }) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(value)) { - child.setValue(value, false) - } - - return child - } - - move (fromIndex, toIndex) { - const value = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.clone)(this.getValue()) - const item = value[fromIndex] - value.splice(fromIndex, 1) - value.splice(toIndex, 0, item) - this.setValue(value) - } - - addItem () { - const tempEditor = this.createItemInstance() - const value = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.clone)(this.getValue()) - value.push(tempEditor.getValue()) - tempEditor.destroy() - this.setValue(value) - } - - deleteItem (itemIndex) { - const currentValue = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.clone)(this.getValue()) - const newValue = currentValue.filter((item, index) => index !== itemIndex) - this.setValue(newValue) - } - - onChildChange () { - const value = [] - - this.children.forEach((child) => { - value.push(child.getValue()) - }) - - this.setValue(value) - } - - refreshChildren () { - this.children = [] - - const value = this.getValue() - - if (!(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(value)) { - return - } - - value.forEach((itemValue) => { - const child = this.createItemInstance(itemValue) - this.children.push(child) - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceArray); - - -/***/ }), - -/***/ "./src/instances/boolean.js": -/*!**********************************!*\ - !*** ./src/instances/boolean.js ***! - \**********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _editors_boolean_enum_radio_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editors/boolean-enum-radio.js */ "./src/editors/boolean-enum-radio.js"); -/* harmony import */ var _editors_boolean_enum_select_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editors/boolean-enum-select.js */ "./src/editors/boolean-enum-select.js"); -/* harmony import */ var _editors_boolean_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editors/boolean.js */ "./src/editors/boolean.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - -/** - * Represents a InstanceBoolean instance. - * @extends Instance - */ -class InstanceBoolean extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaType)(this.schema) - const schemaFormat = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaFormat)(this.schema) - - if (schemaType === 'boolean' && schemaFormat === 'radio') { - this.ui = new _editors_boolean_enum_radio_js__WEBPACK_IMPORTED_MODULE_1__["default"](this) - } else if (schemaType === 'boolean' && schemaFormat === 'select') { - this.ui = new _editors_boolean_enum_select_js__WEBPACK_IMPORTED_MODULE_2__["default"](this) - } else if (schemaType === 'boolean') { - this.ui = new _editors_boolean_js__WEBPACK_IMPORTED_MODULE_3__["default"](this) - } - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceBoolean); - - -/***/ }), - -/***/ "./src/instances/if-then-else.js": -/*!***************************************!*\ - !*** ./src/instances/if-then-else.js ***! - \***************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _editors_multiple_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editors/multiple.js */ "./src/editors/multiple.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../jedi.js */ "./src/jedi.js"); - - - - - - -/** - * Represents a InstanceMultiple instance. - * @extends Instance - */ -class InstanceIfThenElse extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - this.ui = new _editors_multiple_js__WEBPACK_IMPORTED_MODULE_1__["default"](this) - } - - prepare () { - this.instances = [] - this.activeInstance = null - this.activeInstanceChanged = true - this.index = 0 - this.schemas = [] - this.switcherOptionValues = [] - this.switcherOptionsLabels = [] - this.ifThenElseShemas = [] - - this.traverseSchema(this.schema) - - delete this.schema.if - delete this.schema.then - delete this.schema.else - - let index = 0 - - this.ifThenElseShemas.forEach((item) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(item.then)) { - this.schemas.push((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeDeep)({}, (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.schema), item.then)) - this.switcherOptionValues.push(index) - this.switcherOptionsLabels.push(JSON.stringify(item.then)) - index++ - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(item.else)) { - this.schemas.push((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeDeep)({}, (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.schema), item.else)) - this.switcherOptionValues.push(index) - this.switcherOptionsLabels.push(JSON.stringify(item.else)) - index++ - } - }) - - const schemaClone = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.schema) - delete schemaClone.if - delete schemaClone.then - delete schemaClone.else - - const instanceWithoutIf = this.jedi.createInstance({ - jedi: this.jedi, - schema: schemaClone, - path: this.path, - parent: this.parent - }) - - this.schemas.forEach((schema) => { - const instance = this.jedi.createInstance({ - jedi: this.jedi, - schema: schema, - path: this.path, - parent: this.parent - }) - - instance.unregister() - - instance.on('change', () => { - const afterChangeValue = this.activeInstance.getValue() - const fittestIndex = this.getFittestIndex(afterChangeValue) - const mustSwitch = fittestIndex !== this.index - - if (mustSwitch) { - this.setValue(afterChangeValue) - } else { - this.value = this.activeInstance.getValue() - this.emit('change') - } - }) - - this.instances.push(instance) - - this.register() - }) - - this.on('set-value', (newValue) => { - this.instances.forEach((instance) => { - const valueBefore = instance.getValue() - let futureValue = newValue - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isObject)(valueBefore) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isObject)(futureValue)) { - futureValue = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.overwriteExistingProperties)(valueBefore, futureValue) - } - - instance.setValue(futureValue, false) - }) - - const fittestIndex = this.getFittestIndex(newValue) - const mustSwitch = fittestIndex !== this.index - - if (mustSwitch) { - this.switchInstance(fittestIndex) - this.emit('change') - } - }) - - // initial value and active instance - this.value = instanceWithoutIf.getValue() - instanceWithoutIf.destroy() - const fittestIndex = this.getFittestIndex(this.value) - this.switchInstance(fittestIndex) - } - - switchInstance (index) { - this.index = index - this.activeInstance = this.instances[this.index] - this.value = this.activeInstance.getValue() - this.emit('change') - } - - traverseSchema (schema) { - const schemaIf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_3__.getSchemaIf)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(schemaIf)) { - const schemaThen = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_3__.getSchemaThen)(schema) - const schemaElse = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_3__.getSchemaElse)(schema) - - this.ifThenElseShemas.push({ - if: schemaIf, - then: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(schemaThen) ? schemaThen : {} - }) - - this.ifThenElseShemas.push({ - if: schemaIf, - else: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(schemaElse) ? schemaElse : {} - }) - } - } - /** - * Returns the index of the instance that has less validation errors + * Used to group several controls + * @private */ - getFittestIndex (value) { - let fittestIndex = this.index - - this.ifThenElseShemas.forEach((schema, index) => { - const ifValidator = new _jedi_js__WEBPACK_IMPORTED_MODULE_4__["default"]({ - schema: schema.if, - data: value - }) - - const ifErrors = ifValidator.getErrors() - ifValidator.destroy() - - if (ifErrors.length === 0 && schema.then) { - fittestIndex = index - } - - if (ifErrors.length > 0 && schema.else) { - fittestIndex = index - } - }) - - return fittestIndex - } - - destroy () { - this.instances.forEach((instance) => { - instance.destroy() - }) - - super.destroy() - } - - getAllOfCombinations (schemas) { - const result = [] - - const combineProperties = (schema1, schema2) => { - return { ...schema1, ...schema2 } - } - - const generateCombinations = (current, remaining) => { - if (remaining.length === 0) { - result.push(current) - return - } - - const nextSchema = remaining[0] - - generateCombinations(combineProperties(current, nextSchema), remaining.slice(1)) - generateCombinations(current, remaining.slice(1)) - } - - for (let i = 0; i < schemas.length; i++) { - generateCombinations(schemas[i], schemas.slice(i + 1)) - } - - result.sort((a, b) => Object.keys(a).length - Object.keys(b).length) - - return result - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceIfThenElse); - - -/***/ }), - -/***/ "./src/instances/instance.js": -/*!***********************************!*\ - !*** ./src/instances/instance.js ***! - \***********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _event_emitter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../event-emitter.js */ "./src/event-emitter.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -/** - * Represents a JSON instance. - */ -class Instance extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - constructor (config) { - super() - - /** - * A reference to the Jedi instance to which this instance belongs. - * @type {Jedi} - * @protected - */ - this.jedi = config.jedi - - /** - * The schema path of this instance. - * @type {string} - * @private - */ - this.path = config.path || this.jedi.rootName - - /** - * A JSON schema. - * @type {boolean|object} - * @private - */ - this.schema = config.schema - - /** - * The json value of this instance. - * @type {*} - * @protected - */ - this.value = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(config.value) ? config.value : undefined - - /** - * The active state of this instance. If false the editor is not participating - * in the value. - * @type {boolean} - * @private - */ - this.isActive = true - - /** - * The Parent instance of this instance. - * @type {Instance|null} - * @private - */ - this.parent = config.parent || null - - /** - * Child instances of this instance. - * @type {Instance[]} - * @private - */ - this.children = [] - - /** - * The editor controlling this Instance if any - * @type {Editor|null} - * @private - */ - this.ui = null - - this.init() - } - + getFieldset() { + const t = document.createElement("fieldset"); + return t.classList.add("jedi-editor-fieldset"), t; + } /** - * Initializes and register the instance + * Represents a caption for the content of its parent fieldset + * @private */ - init () { - this.register() - this.setInitialValue() - this.prepare() - this.setDefaultValue() - - if (this.jedi.options.isEditor) { - this.setUI() - } - - this.on('change', () => { - if (this.parent) { - this.parent.onChildChange() - } - }) + getLegend(t) { + const e = document.createElement("legend"), s = document.createElement("span"); + return e.classList.add("jedi-editor-legend"), s.classList.add("jedi-editor-legend-text"), e.setAttribute("aria-labelledby", "#legend-" + t.id), s.textContent = t.textContent, s.setAttribute("id", "#legend-" + t.id), e.appendChild(s), e; } - /** - * Sets the instance ui property. UI can be an editor instance or similar + * Container for complex editors like arrays, objects and multiple + * @private */ - setUI () { + getCard() { + const t = document.createElement("div"); + return t.classList.add("jedi-editor-card"), t; } - /** - * Return the last part of the instance path + * Header for cards + * @private */ - getKey () { - return this.path.split(this.jedi.pathSeparator).pop() + getCardHeader() { + const t = document.createElement("div"); + return t.classList.add("jedi-editor-card-header"), t; } - /** - * Adds a child instance pointer to the instances list + * A body for the cards + * @private */ - register () { - this.jedi.register(this) + getCardBody() { + const t = document.createElement("div"); + return t.classList.add("jedi-editor-card-body"), t; } - /** - * Deletes a child instance pointer from the instances list + * Wrapper for editor actions buttons + * @private */ - unregister () { - this.jedi.unregister(this) + getActionsSlot() { + const t = document.createElement("div"); + return t.classList.add("jedi-actions-slot"), t; } - /** - * Sets the default value of the instance based on it's type + * Wrapper for editor array specific actions buttons + * @private */ - setInitialValue () { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.notSet)(this.value)) { - let value - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaType)(this.schema) - - if (schemaType === 'boolean') value = false - if (schemaType === 'number') value = 0.0 - if (schemaType === 'integer') value = 0 - if (schemaType === 'string') value = '' - if (schemaType === 'array') value = [] - if (schemaType === 'object') value = {} - if (schemaType === 'null') value = null - - this.value = value - } + getArrayActionsSlot() { + const t = this.getBtnGroup(); + return t.classList.add("jedi-array-actions-slot"), t; } - - setDefaultValue () { - const schemaDefault = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDefault)(this.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaDefault)) { - this.setValue(schemaDefault, false) - } + /** + * Wrapper for child editors + * @private + */ + getChildrenSlot() { + const t = document.createElement("div"); + return t.classList.add("jedi-children-slot"), t; } - /** - * Returns the value of the instance + * Wrapper for error messages + * @private */ - getValue () { - return this.value + getMessagesSlot(t = {}) { + const e = document.createElement("div"); + return e.classList.add("jedi-messages-slot"), e.setAttribute("aria-atomic", "false"), e.setAttribute("aria-live", "polite"), t.id && e.setAttribute("id", t.id), e; } - /** - * Sets the instance value + * Wrapper for editor controls + * @private */ - setValue (newValue, triggersChange = true) { - this.value = newValue - - this.emit('set-value', newValue) - - if (triggersChange) { - this.emit('change') - } + getControlSlot() { + const t = document.createElement("div"); + return t.classList.add("jedi-control-slot"), t; } - /** - * Fires when a child's instance state changes + * Container for properties editing elements like property activators + * @private */ - onChildChange () { + getPropertiesSlot(t) { + const e = document.createElement("div"); + return e.classList.add("jedi-properties-slot"), e.setAttribute("id", t.id), this.useToggleEvents && (e.style.display = "none"), e; } - /** - * Returns an array of validation error messages + * Container for screen reader announced messages + * @private */ - getErrors () { - if (!this.isActive) { - return [] - } - - const errors = this.jedi.validator.getErrors(this.getValue(), this.schema, this.getKey(), this.path) - - return (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.removeDuplicatesFromArray)(errors) + getPropertiesAriaLive() { + const t = document.createElement("div"); + return t.classList.add("jedi-properties-aria-live"), t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t; } - /** - * Prepare data before building the editor + * A message that will be announced by screen reader + * @private */ - prepare () { + getAriaLiveMessage(t) { + const e = document.createElement("p"); + return e.classList.add("jedi-aria-live-message"), e.textContent = t, this.visuallyHidden(e), e; } - /** - * Activates the instance + * Toggles the ObjectEditor properties wrapper visibility + * @private */ - activate () { - if (this.isActive === false) { - this.isActive = true - this.emit('change') - } + getPropertiesToggle(t) { + const e = this.getButton(t); + return e.classList.add("jedi-properties-toggle"), this.useToggleEvents && e.addEventListener("click", () => { + t.propertiesContainer.hasAttribute("style") ? this.visuallyVisible(t.propertiesContainer) : this.visuallyHidden(t.propertiesContainer); + }), e; } - /** - * Deactivates the instance + * Wrapper for property activators + * @private */ - deactivate () { - if (this.isActive === true) { - this.isActive = false - this.emit('change') - } + getPropertiesActivators() { + const t = document.createElement("div"); + return t.classList.add("jedi-properties-activators"), t; } - /** - * Returns true if this instance is read only + * Wrapper buttons + * @private */ - isReadOnly () { - let readOnly = false - - if ((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaReadOnly)(this.schema) === true) { - readOnly = true - } - - if (this.parent && (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaReadOnly)(this.parent.schema) === true) { - readOnly = true - } - - return readOnly + getBtnGroup() { + const t = document.createElement("span"); + return t.classList.add("jedi-btn-group"), t.style.display = "initial", t; } - /** - * Destroy the instance and it's children + * A button + * @private */ - destroy () { - this.listeners = [] - - this.children.forEach((child) => { - child.destroy() - }) - - this.unregister() - - if (this.ui) { - this.ui.destroy() - } - - Object.keys(this).forEach((key) => { - delete this[key] - }) - - super.destroy() - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Instance); - - -/***/ }), - -/***/ "./src/instances/multiple.js": -/*!***********************************!*\ - !*** ./src/instances/multiple.js ***! - \***********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _editors_multiple_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editors/multiple.js */ "./src/editors/multiple.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - -/** - * Represents a InstanceMultiple instance. - * @extends Instance - */ -class InstanceMultiple extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - this.ui = new _editors_multiple_js__WEBPACK_IMPORTED_MODULE_1__["default"](this) - } - - prepare () { - this.instances = [] - this.activeInstance = null - this.activeInstanceChanged = true - this.lastIndex = 0 - this.index = 0 - this.schemas = [] - this.switcherOptionValues = [] - this.switcherOptionsLabels = [] - - this.on('set-value', () => { - this.onSetValue() - }) - - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaType)(this.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaAnyOf)(this.schema)) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaOneOf)(this.schema))) { - const schemasOf = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaAnyOf)(this.schema)) ? (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaAnyOf)(this.schema) : (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaOneOf)(this.schema) - const schemaCopy = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.schema) - delete schemaCopy['anyOf'] - delete schemaCopy['oneOf'] - delete schemaCopy['options'] - - schemasOf.forEach((schema, index) => { - schema = { ...schemaCopy, ...schema } - - if (this.jedi.refParser) { - schema = this.jedi.refParser.expand(schema) - } - - let switcherOptionsLabel = 'Option-' + (index + 1) - const switcherTitle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaOption)(schema, 'switcherTitle') - const schemaTitle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_4__.getSchemaTitle)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(schemaTitle)) { - switcherOptionsLabel = schemaTitle - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(switcherTitle)) { - switcherOptionsLabel = switcherTitle - } - - this.switcherOptionValues.push(index) - this.switcherOptionsLabels.push(switcherOptionsLabel) - this.schemas.push(schema) - }) - } else if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isArray)(schemaType)) { - schemaType.forEach((type, index) => { - const schemaClone = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeDeep)(this.schema) - - const schema = { - ...schemaClone, - ...{ type: type, title: type[0].toUpperCase() + type.slice(1) } - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(schemaClone.title)) { - schema.title = schemaClone.title - } - - this.switcherOptionValues.push(index) - this.switcherOptionsLabels.push(type.charAt(0).toUpperCase() + type.slice(1)) - - this.schemas.push(schema) - }) - } else if (schemaType === 'any' || !schemaType) { - const schemaClone = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.schema) - - this.schemas = [ - { ...schemaClone, ...{ type: 'object' } }, - { ...schemaClone, ...{ type: 'array' } }, - { ...schemaClone, ...{ type: 'string' } }, - { ...schemaClone, ...{ type: 'number' } }, - { ...schemaClone, ...{ type: 'integer' } }, - { ...schemaClone, ...{ type: 'boolean' } }, - { ...schemaClone, ...{ type: 'null' } } - ] - - this.schemas.forEach((schema, index) => { - this.switcherOptionValues.push(index) - }) - - this.switcherOptionsLabels = [ - 'Object', 'Array', 'String', 'Number', 'Integer', 'Boolean', 'Null' - ] - } - - this.schemas.forEach((schema) => { - const instance = this.jedi.createInstance({ - jedi: this.jedi, - schema: schema, - path: this.path, - parent: this.parent, - value: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.value) - }) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(this.value)) { - instance.setValue(this.value, false) - } - - instance.unregister() - - instance.on('change', () => { - this.activeInstanceChanged = true - this.setValue(this.activeInstance.getValue()) - }) - - this.instances.push(instance) - - this.register() - }) - - const fittestIndex = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(this.if) ? this.getIfIndex(this.value) : this.getFittestIndex(this.value) - this.switchInstance(fittestIndex, this.value) - } - - switchInstance (index, value) { - this.lastIndex = this.index - this.index = index - this.activeInstance = this.instances[index] - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(value)) { - this.activeInstance.setValue(value, false) - } - - this.setValue(this.activeInstance.getValue()) - } - - onSetValue () { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.different)(this.activeInstance.getValue(), this.value) || this.activeInstanceChanged) { - this.activeInstanceChanged = false - const fittestIndex = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isSet)(this.if) ? this.getIfIndex(this.value) : this.getFittestIndex(this.value) - this.switchInstance(fittestIndex, this.value) + getButton(t) { + const e = document.createElement("button"); + e.classList.add("jedi-btn"), e.setAttribute("type", "button"), t.value && (e.value = t.value), t.id && e.setAttribute("id", t.id); + const s = document.createElement("span"); + if (s.textContent = t.textContent, this.icons && t.icon) { + const n = this.getIcon(t.icon); + n.setAttribute("title", t.textContent), e.appendChild(n), this.visuallyHidden(s); } + return e.appendChild(s), e; } - - reassignValues () { - const lastInstanceValue = this.instances[this.lastIndex].getValue() - const currentInstanceValue = this.activeInstance.getValue() - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isObject)(lastInstanceValue) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.isObject)(currentInstanceValue)) { - const mergedValue = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.overwriteExistingProperties)(currentInstanceValue, lastInstanceValue) - this.activeInstance.setValue(mergedValue, false) - } + /** + * Array "add" item button + * @private + */ + getArrayBtnAdd() { + const t = this.getButton({ + textContent: "Add item into", + icon: "add" + }); + return t.classList.add("jedi-array-add"), t; } - - getIfIndex (value) { - const ifEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_3__["default"]({ schema: this.if, data: value }) - const ifErrors = ifEditor.getErrors() - ifEditor.destroy() - return ifErrors.length === 0 ? 0 : 1 + getAddPropertyButton() { + const t = this.getButton({ + textContent: "Add property" + }); + return t.classList.add("jedi-add-property-btn"), t; } - /** - * Returns the index of the instance that has less validation errors + * Array "delete" item button + * @private */ - getFittestIndex (value) { - let index = 0 - let fittestIndex - let championErrors - - for (const instance of this.instances) { - const instanceErrors = this.jedi.validator.getErrors(value, instance.schema, instance.getKey(), instance.path) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.notSet)(fittestIndex) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_2__.notSet)(championErrors)) { - fittestIndex = index - championErrors = instanceErrors - } - - if (instanceErrors.length < championErrors.length) { - fittestIndex = index - championErrors = instanceErrors - } - - index++ - } - - return fittestIndex - } - - destroy () { - this.instances.forEach((instance) => { - instance.destroy() - }) - - super.destroy() - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceMultiple); - - -/***/ }), - -/***/ "./src/instances/null.js": -/*!*******************************!*\ - !*** ./src/instances/null.js ***! - \*******************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _editors_null_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editors/null.js */ "./src/editors/null.js"); - - - -/** - * Represents a InstanceNull instance. - * @extends Instance - */ -class InstanceNull extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - this.ui = new _editors_null_js__WEBPACK_IMPORTED_MODULE_1__["default"](this) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceNull); - - -/***/ }), - -/***/ "./src/instances/number.js": -/*!*********************************!*\ - !*** ./src/instances/number.js ***! - \*********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _editors_number_enum_radio_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editors/number-enum-radio.js */ "./src/editors/number-enum-radio.js"); -/* harmony import */ var _editors_number_enum_select_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editors/number-enum-select.js */ "./src/editors/number-enum-select.js"); -/* harmony import */ var _editors_number_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editors/number.js */ "./src/editors/number.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - - -/** - * Represents a InstanceNumber instance. - * @extends Instance - */ -class InstanceNumber extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaType)(this.schema) - const schemaEnum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaEnum)(this.schema) - const schemaFormat = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaFormat)(this.schema) - const typeIsNumeric = schemaType === 'number' || schemaType === 'integer' - - if (typeIsNumeric && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_4__.isSet)(schemaEnum) && schemaFormat === 'radio') { - this.ui = new _editors_number_enum_radio_js__WEBPACK_IMPORTED_MODULE_1__["default"](this) - } else if (typeIsNumeric && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_4__.isSet)(schemaEnum)) { - this.ui = new _editors_number_enum_select_js__WEBPACK_IMPORTED_MODULE_2__["default"](this) - } else if (typeIsNumeric) { - this.ui = new _editors_number_js__WEBPACK_IMPORTED_MODULE_3__["default"](this) - } - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceNumber); - - -/***/ }), - -/***/ "./src/instances/object.js": -/*!*********************************!*\ - !*** ./src/instances/object.js ***! - \*********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _editors_object_grid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editors/object-grid.js */ "./src/editors/object-grid.js"); -/* harmony import */ var _editors_object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editors/object.js */ "./src/editors/object.js"); -/* harmony import */ var _editors_object_nav_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editors/object-nav.js */ "./src/editors/object-nav.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - - -/** - * Represents an InstanceObject instance. - * @extends Instance - */ -class InstanceObject extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaType)(this.schema) - const schemaFormat = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaFormat)(this.schema) - const schemaControl = this.schema['x-control'] - - if (schemaType === 'object' && schemaFormat === 'grid') { - this.ui = new _editors_object_grid_js__WEBPACK_IMPORTED_MODULE_2__["default"](this) - } else if (schemaType === 'object' && schemaControl === 'nav') { - this.ui = new _editors_object_nav_js__WEBPACK_IMPORTED_MODULE_4__["default"](this) - } else { - this.ui = new _editors_object_js__WEBPACK_IMPORTED_MODULE_3__["default"](this) - } + getDeleteItemBtn() { + const t = this.getButton({ + textContent: "Delete item", + icon: "delete" + }); + return t.classList.add("jedi-array-delete"), t; } - - prepare () { - this.properties = {} - const schemaProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaProperties)(this.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaProperties)) { - Object.keys(schemaProperties).forEach((key) => { - const schema = schemaProperties[key] - this.properties[key] = { schema } - - let musstCreateChild = true - - const deactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') - const schemaDeactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(schema, 'deactivateNonRequired') - - if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(deactivateNonRequired) && deactivateNonRequired === true) { - musstCreateChild = false - } - - if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaDeactivateNonRequired) && schemaDeactivateNonRequired === true) { - musstCreateChild = false - } - - if (musstCreateChild) { - this.createChild(schema, key) - } - }) - } - - this.refreshInstances() - - this.on('set-value', () => { - this.refreshInstances() - }) - } - /** - * Returns true if the property is required + * Array "move up" item button + * @private */ - isRequired (property) { - const schemaRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaRequired)(this.schema) - - return (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaRequired) && schemaRequired.includes(property) + getMoveUpItemBtn() { + const t = this.getButton({ + textContent: "Move up", + icon: "moveUp" + }); + return t.classList.add("jedi-array-move-up"), t; } - /** - * Returns true if the property is dependent required + * Array "move down" item button + * @private */ - isDependentRequired (property) { - const dependentRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaDependentRequired)(this.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(dependentRequired)) { - let missingProperties = [] - - Object.keys(dependentRequired).forEach((key) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.value[key])) { - const requiredProperties = dependentRequired[key] - - missingProperties = requiredProperties.filter((property) => { - return !(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.hasOwn)(this.value, property) - }) - } - }) - - return missingProperties.includes(property) - } - - return false + getMoveDownItemBtn() { + const t = this.getButton({ + textContent: "Move down", + icon: "moveDown" + }); + return t.classList.add("jedi-array-move-down"), t; } - - createChild (schema, key, value) { - const instance = this.jedi.createInstance({ - jedi: this.jedi, - schema: schema, - path: this.path + this.jedi.pathSeparator + key, - parent: this, - value: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.clone)(value) - }) - - this.children.push(instance) - this.value[key] = instance.getValue() - - const deactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') - - if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(deactivateNonRequired) && deactivateNonRequired === true) { - instance.deactivate() - } - - return instance - } - - isNotRequired (property) { - return !this.isRequired(property) && !this.isDependentRequired(property) - } - - deleteChild (key) { - for (let i = this.children.length - 1; i >= 0; i--) { - const instance = this.children[i] - if (instance.getKey() === key) { - instance.destroy() - this.children.splice(i, 1) - this.onChildChange() - } - } + /** + * Wrapper for the editor description + * @private + */ + getDescription(t = {}) { + const e = document.createElement("small"); + return e.classList.add("jedi-description"), t.textContent && (e.textContent = t.textContent), t.id && e.setAttribute("id", t.id), e; } - - getChild (key) { - return this.children.find((instance) => { - return key === instance.getKey().split(this.jedi.pathSeparator).pop() - }) - } - - onChildChange () { - const value = {} - - this.children.forEach((child) => { - if (child.isActive) { - value[child.getKey()] = child.getValue() - } - }) - - this.setValue(value) - } - - refreshInstances () { - const value = this.getValue() - - if (!(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isObject)(value)) { - return - } - - Object.keys(value).forEach((key) => { - const child = this.getChild(key) - - // If a value has a already a child instance - if (child) { - child.activate() - const oldValue = child.getValue() - const newValue = value[child.getKey()] - - // update child value if the old value and the new value are different - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.different)(oldValue, newValue)) { - child.setValue(newValue, false) - } - } else { - // create new child instance for the new value entry having the value as default - this.createChild({}, key, value[key]) - } - }) - - // remove any children that are not included in the value - for (let i = this.children.length - 1; i >= 0; i--) { - const instance = this.children[i] - const key = instance.getKey() - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.notSet)(value[key])) { - if (this.getChild(key)) { - instance.deactivate() - } else { - this.deleteChild(key) - } - } - } + /** + * Object control is a card containing multiple editors. + * Each editor is mapped to an object instance property. + * Properties can be added, activated and deactivated depending on configuration + * @private + */ + getObjectControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = this.getCardBody(), a = this.getPropertiesAriaLive(), o = this.getDescription({ + textContent: t.description + }), c = this.getMessagesSlot(), l = this.getChildrenSlot(), h = this.getPropertiesSlot({ + id: "properties-slot-" + t.id + }), u = this.getPropertiesToggle({ + textContent: t.title + " properties", + id: "properties-slot-toggle-" + t.id, + icon: "properties", + propertiesContainer: h + }), p = this.getPropertiesActivators(), g = this.getInputControl({ + type: "text", + id: "jedi-add-property-input-" + t.id, + label: "Property" + }), b = this.getAddPropertyButton(), E = this.getFieldset(), y = this.getLegend({ + textContent: t.title, + id: t.id + }); + return b.classList.add("jedi-object-add"), e.appendChild(E), E.appendChild(y), E.appendChild(r), r.appendChild(o), r.appendChild(c), y.appendChild(s), s.appendChild(n), r.appendChild(h), r.appendChild(l), t.addProperty && (h.appendChild(g.container), h.appendChild(b)), t.editableProperties && (s.appendChild(u), h.appendChild(a), h.appendChild(p)), { + container: e, + body: r, + actions: s, + messages: c, + childrenSlot: l, + propertiesToggle: u, + propertiesContainer: h, + addPropertyControl: g, + addPropertyBtn: b, + ariaLive: a, + propertiesActivators: p, + arrayActions: n + }; } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceObject); - - -/***/ }), - -/***/ "./src/instances/string.js": -/*!*********************************!*\ - !*** ./src/instances/string.js ***! - \*********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _instance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance.js */ "./src/instances/instance.js"); -/* harmony import */ var _editors_string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../editors/string.js */ "./src/editors/string.js"); -/* harmony import */ var _editors_string_enum_radio_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editors/string-enum-radio.js */ "./src/editors/string-enum-radio.js"); -/* harmony import */ var _editors_string_enum_select_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editors/string-enum-select.js */ "./src/editors/string-enum-select.js"); -/* harmony import */ var _editors_string_textarea_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editors/string-textarea.js */ "./src/editors/string-textarea.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - - - -/** - * Represents a InstanceString instance. - * @extends Instance - */ -class InstanceString extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - setUI () { - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaType)(this.schema) - const schemaEnum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaEnum)(this.schema) - const schemaFormat = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaFormat)(this.schema) - - if (schemaType === 'string' && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isSet)(schemaEnum) && schemaFormat === 'radio') { - this.ui = new _editors_string_enum_radio_js__WEBPACK_IMPORTED_MODULE_2__["default"](this) - } else if (schemaType === 'string' && schemaFormat === 'textarea') { - this.ui = new _editors_string_textarea_js__WEBPACK_IMPORTED_MODULE_4__["default"](this) - } else if (schemaType === 'string' && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isSet)(schemaEnum)) { - this.ui = new _editors_string_enum_select_js__WEBPACK_IMPORTED_MODULE_3__["default"](this) - } else if (schemaType === 'string') { - this.ui = new _editors_string_js__WEBPACK_IMPORTED_MODULE_1__["default"](this) - } + /** + * Array control is a card containing multiple editors. + * Items can bve added, deleted or moved up or down. + * @private + */ + getArrayControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = this.getCardBody(), a = this.getDescription({ + textContent: t.description + }), o = this.getMessagesSlot(), c = this.getChildrenSlot(), l = this.getBtnGroup(), h = this.getArrayBtnAdd(), u = this.getFieldset(), p = this.getLegend({ + textContent: t.title, + id: t.id + }); + return e.appendChild(u), u.appendChild(p), u.appendChild(r), r.appendChild(a), r.appendChild(o), p.appendChild(s), s.appendChild(l), l.appendChild(h), s.appendChild(n), r.appendChild(c), { + container: e, + body: r, + actions: s, + messages: o, + childrenSlot: c, + btnGroup: l, + addBtn: h, + arrayActions: n + }; } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InstanceString); - - -/***/ }), - -/***/ "./src/jedi.js": -/*!*********************!*\ - !*** ./src/jedi.js ***! - \*********************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _validation_validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validation/validator.js */ "./src/validation/validator.js"); -/* harmony import */ var _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./event-emitter.js */ "./src/event-emitter.js"); -/* harmony import */ var _instances_if_then_else_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./instances/if-then-else.js */ "./src/instances/if-then-else.js"); -/* harmony import */ var _instances_multiple_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./instances/multiple.js */ "./src/instances/multiple.js"); -/* harmony import */ var _instances_boolean_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./instances/boolean.js */ "./src/instances/boolean.js"); -/* harmony import */ var _instances_object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./instances/object.js */ "./src/instances/object.js"); -/* harmony import */ var _instances_array_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./instances/array.js */ "./src/instances/array.js"); -/* harmony import */ var _instances_string_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./instances/string.js */ "./src/instances/string.js"); -/* harmony import */ var _instances_number_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./instances/number.js */ "./src/instances/number.js"); -/* harmony import */ var _instances_null_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./instances/null.js */ "./src/instances/null.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - - - - - - - - -/** - * Represents a Jedi instance. - */ -class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { /** - * Creates a Jedi instance. - * @param {object} options - Options object - * @param {object|boolean} options.schema - A JSON schema - * @param {boolean} options.isEditor - Generates UI controls to edit the JSON value - * @param {boolean} options.container - Where the UI controls will be rendered - * @param {string} options.theme - How the UI controls will be rendered + * Multiple control is a card containing multiple editors options that can be + * selected with a switcher control. Only one editor can be active/visible + * at a time + * @private */ - constructor (options) { - super() - - this.options = Object.assign({ - container: null, - refParser: null, - isEditor: false, - editableProperties: false, - schema: {}, - showErrors: 'change', - data: undefined, - validateFormat: false - }, options) - - /** - * Roots symbol used in paths - * @type {string} - * @private - */ - this.rootName = '#' - - /** - * Separator symbol used in paths - * @type {string} - * @private - */ - this.pathSeparator = '/' - - /** - * List of registered instances - * @type {object} - * @private - */ - this.instances = {} - - /** - * The root editor - * @type {Instance} - * @private - */ - this.root = null - - /** - * The Theme instance used to generate editors user interfaces - * @type {Theme} - * @private - */ - this.theme = null - - /** - * The Validator instance used to validate instance values - * @type {Validator} - * @private - */ - this.validator = null - - /** - * A json schema used - * @type {*} - * @private - */ - this.schema = {} - - /** - * A RefParser instance - * @type {RefParser} - * @private - */ - this.refParser = this.options.refParser ? this.options.refParser : null - - this.init() - } - + getMultipleControl(t) { + const e = document.createElement("div"), s = this.getCard(), n = this.getActionsSlot(), r = this.getArrayActionsSlot(), a = this.getCardHeader({ + textContent: t.title, + srOnly: t.srOnly + }), o = this.getCardBody(), c = this.getDescription({ + textContent: t.description + }), l = this.getMessagesSlot(), h = this.getChildrenSlot(), u = this.getSwitcher({ + values: t.switcherOptionValues, + titles: t.switcherOptionsLabels, + id: t.id + "-switcher", + label: t.id + "-switcher", + srOnly: !0, + readOnly: t.readOnly + }); + return u.container.classList.add("jedi-switcher"), e.appendChild(c), e.appendChild(s), s.appendChild(a), s.appendChild(o), a.appendChild(n), n.appendChild(r), n.appendChild(u.container), o.appendChild(l), o.appendChild(h), { + container: e, + card: s, + header: a, + body: o, + actions: n, + messages: l, + childrenSlot: h, + switcher: u, + arrayActions: r + }; + } /** - * Initializes instance properties + * Control for NullEditor * @private */ - init () { - this.schema = this.options.schema - this.validator = new _validation_validator_js__WEBPACK_IMPORTED_MODULE_0__["default"]({ refParser: this.refParser, validateFormat: this.options.validateFormat }) - - this.root = this.createInstance({ - jedi: this, - schema: this.options.schema, - path: this.rootName - }) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isSet)(this.options.data)) { - this.root.setValue(this.options.data, false) - } - - if (this.options.isEditor && this.options.container) { - this.container = this.options.container - this.appendHiddenInput() - this.container.appendChild(this.root.ui.control.container) - this.container.classList.add('jedi-ready') - } - - this.bindEventListeners() - } - - bindEventListeners () { - if (this.root) { - this.root.on('change', () => { - this.emit('change') - }) - } - - if (this.hiddenInput) { - this.on('change', () => { - this.hiddenInput.value = JSON.stringify(this.getValue()) - }) - } + getNullControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = document.createElement("label"); + r.setAttribute("for", t.id); + const a = document.createElement("span"); + a.textContent = t.label, t.srOnly && this.visuallyHidden(r); + const o = t.id + "-description", c = this.getDescription({ + textContent: t.description, + id: o + }), l = this.getMessagesSlot(); + return e.appendChild(r), e.appendChild(c), e.appendChild(l), e.appendChild(s), s.appendChild(n), r.appendChild(a), { container: e, label: r, labelText: a, description: c, messages: l, actions: s, arrayActions: n }; } - /** - * Appends a hidden input to the root container whose value will be the value - * of the root instance. + * A Textarea * @private */ - appendHiddenInput () { - const hiddenControl = this.root.ui.theme.getInputControl({ - type: 'hidden', - id: 'jedi-hidden-input' - }) - - this.hiddenInput = hiddenControl.input - this.hiddenInput.setAttribute('name', 'json') - this.hiddenInput.removeAttribute('aria-describedby') - this.container.appendChild(this.hiddenInput) - this.hiddenInput.value = JSON.stringify(this.getValue()) - } - + getTextareaControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = document.createElement("textarea"); + r.setAttribute("id", t.id), r.style.width = "100%"; + const a = document.createElement("label"); + a.setAttribute("for", t.id); + const o = document.createElement("span"); + o.textContent = t.label, t.srOnly && this.visuallyHidden(a); + const c = t.id + "-description", l = this.getDescription({ + textContent: t.description, + id: c + }), h = t.id + "-messages", u = this.getMessagesSlot({ + id: h + }), p = h + " " + c; + return r.setAttribute("aria-describedby", p), e.appendChild(a), e.appendChild(r), e.appendChild(l), e.appendChild(u), e.appendChild(s), s.appendChild(n), a.appendChild(o), { container: e, input: r, label: a, labelText: o, description: l, messages: u, actions: s, arrayActions: n }; + } /** - * Adds a child instance pointer to the instances list + * An Input control * @private */ - register (instance) { - this.instances[instance.path] = instance + getInputControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = document.createElement("input"); + r.setAttribute("type", t.type), r.setAttribute("id", t.id), r.style.width = "100%"; + const a = document.createElement("label"); + a.setAttribute("for", t.id); + const o = document.createElement("span"); + o.textContent = t.label, t.srOnly && this.visuallyHidden(a); + const c = t.id + "-description", l = this.getDescription({ + textContent: t.description, + id: c + }), h = t.id + "-messages", u = this.getMessagesSlot({ + id: h + }), p = h + " " + c; + return r.setAttribute("aria-describedby", p), e.appendChild(a), e.appendChild(r), e.appendChild(l), e.appendChild(u), e.appendChild(s), s.appendChild(n), a.appendChild(o), { container: e, input: r, label: a, labelText: o, description: l, messages: u, actions: s, arrayActions: n }; } - /** - * Deletes a child instance pointer from the instances list + * A radio group control * @private */ - unregister (instance) { - this.instances[instance.path] = null - delete this.instances[instance.path] + getRadiosControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = this.getFieldset(), a = this.getCardBody(), o = this.getLegend({ + textContent: t.label, + id: t.id + }), c = t.id + "-messages", l = this.getMessagesSlot({ + id: c + }), h = t.id + "-description", u = this.getDescription({ + textContent: t.description, + id: h + }); + t.srOnly && this.visuallyHidden(o); + const p = [], g = [], b = [], E = []; + return t.values.forEach((y, L) => { + const N = document.createElement("div"); + p.push(N); + const M = document.createElement("input"); + M.setAttribute("type", "radio"), M.setAttribute("id", t.id + "-" + L), M.setAttribute("value", y), g.push(M); + const P = c + " " + h; + M.setAttribute("aria-describedby", P); + const gt = document.createElement("label"); + gt.setAttribute("for", t.id + "-" + L); + const Dt = document.createElement("span"); + E.push(Dt), t.titles && t.titles[L] && (Dt.textContent = t.titles[L]), b.push(gt); + }), e.appendChild(r), e.appendChild(s), r.appendChild(o), r.appendChild(a), s.appendChild(n), p.forEach((y, L) => { + a.appendChild(p[L]), y.appendChild(g[L]), y.appendChild(b[L]), b[L].appendChild(E[L]); + }), r.appendChild(u), r.appendChild(l), { container: e, fieldset: r, legend: o, body: a, radios: g, labels: b, labelTexts: E, radioControls: p, description: u, messages: l, actions: s, arrayActions: n }; } - /** - * Creates a json instance and dereference schema on the fly if needed. + * A checkbox control * @private */ - createInstance (config) { - if (this.refParser) { - config.schema = this.refParser.expand(config.schema, config.path) - } - const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaType)(config.schema) - const schemaOneOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaOneOf)(config.schema) - const schemaAnyOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaAnyOf)(config.schema) - const schemaIf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaIf)(config.schema) - const schemaThen = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaThen)(config.schema) - const schemaElse = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaElse)(config.schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isSet)(schemaAnyOf) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isSet)(schemaOneOf) || schemaType === 'any' || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isArray)(schemaType) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.notSet)(schemaType)) { - return new _instances_multiple_js__WEBPACK_IMPORTED_MODULE_3__["default"](config) - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isSet)(schemaIf) && ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isSet)(schemaThen) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_10__.isSet)(schemaElse))) { - return new _instances_if_then_else_js__WEBPACK_IMPORTED_MODULE_2__["default"](config) - } - - if (schemaType === 'object') { - return new _instances_object_js__WEBPACK_IMPORTED_MODULE_5__["default"](config) - } - - if (schemaType === 'array') { - return new _instances_array_js__WEBPACK_IMPORTED_MODULE_6__["default"](config) - } - - if (schemaType === 'string') { - return new _instances_string_js__WEBPACK_IMPORTED_MODULE_7__["default"](config) - } - - if (schemaType === 'number' || schemaType === 'integer') { - return new _instances_number_js__WEBPACK_IMPORTED_MODULE_8__["default"](config) - } - - if (schemaType === 'boolean') { - return new _instances_boolean_js__WEBPACK_IMPORTED_MODULE_4__["default"](config) - } - - if (schemaType === 'null') { - return new _instances_null_js__WEBPACK_IMPORTED_MODULE_9__["default"](config) - } + getCheckboxControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = document.createElement("div"), a = document.createElement("input"); + a.setAttribute("type", "checkbox"), a.setAttribute("id", t.id); + const o = document.createElement("label"); + o.setAttribute("for", t.id); + const c = document.createElement("span"); + c.textContent = t.label, t.srOnly && this.visuallyHidden(o); + const l = t.id + "-description", h = this.getDescription({ + textContent: t.description, + id: l + }), u = t.id + "-messages", p = this.getMessagesSlot({ + id: u + }), g = u + " " + l; + return a.setAttribute("aria-describedby", g), e.appendChild(r), e.appendChild(s), s.appendChild(n), r.appendChild(a), r.appendChild(o), o.appendChild(c), r.appendChild(h), r.appendChild(p), { container: e, formGroup: r, input: a, label: o, labelText: c, description: h, messages: p, actions: s, arrayActions: n }; } - /** - * Returns the value of the root instance - * @return {*} + * A select control + * @private */ - getValue () { - return this.root.getValue() + getSelectControl(t) { + const e = document.createElement("div"), s = this.getActionsSlot(), n = this.getArrayActionsSlot(), r = document.createElement("select"); + r.setAttribute("id", t.id), r.style.width = "100%", t.values.forEach((g, b) => { + const E = document.createElement("option"); + E.setAttribute("value", g), t.titles && t.titles[b] && (E.textContent = t.titles[b]), r.appendChild(E); + }); + const a = document.createElement("label"); + a.setAttribute("for", t.id); + const o = document.createElement("span"); + o.textContent = t.label, t.srOnly && this.visuallyHidden(a); + const c = t.id + "-description", l = this.getDescription({ + textContent: t.description, + id: c + }), h = t.id + "-messages", u = this.getMessagesSlot({ + id: h + }), p = h + " " + c; + return r.setAttribute("aria-describedby", p), e.appendChild(a), e.appendChild(r), a.appendChild(o), e.appendChild(l), e.appendChild(u), e.appendChild(s), s.appendChild(n), { container: e, input: r, label: a, labelText: o, description: l, messages: u, actions: s, arrayActions: n }; } - /** - * Sets the value of the root instance + * Control to switch between multiple editors options + * @private */ - setValue () { - this.root.setValue(...arguments) + getSwitcher(t) { + return this.getSelectControl(t); } - /** - * Returns an instance by path - * @return {*} + * Another type of error message container used for more complex editors like + * object, array and multiple editors + * @private */ - getInstance (path) { - return this.instances[path] + getAlert(t) { + return this.getInvalidFeedback(t); } - /** - * Disables the root instance and it's children user interfaces + * Error messages + * @public */ - disable () { - this.root.ui.disable() + getInvalidFeedback(t) { + const e = document.createElement("div"), s = document.createElement("span"), n = document.createElement("span"); + return s.textContent = t.message, n.textContent = "⚠ ", n.classList.add("jedi-error-message"), n.setAttribute("aria-hidden", "true"), e.classList.add("jedi-error-message"), e.appendChild(n), e.appendChild(s), e; } - /** - * Enables the root instance and it's children user interfaces + * Container for columns + * @private */ - enable () { - this.root.ui.enable() + getRow() { + const t = document.createElement("div"); + return t.classList.add("jedi-row"), t; } - /** - * Returns an array of validation error messages + * A column to contain content to a specific width + * @private */ - getErrors () { - let errors = [] - - Object.keys(this.instances).forEach((key) => { - const instance = this.instances[key] - errors = [...errors, ...instance.getErrors()] - }) - - return errors - } - + getCol(t, e, s) { + const n = document.createElement("div"); + return n.classList.add("jedi-col-xs-" + t), n.classList.add("jedi-col-md-" + e), s && n.classList.add("jedi-col-md-offset-" + s), n; + } /** - * Destroy the root instance and it's children + * Tab list is a list of links that triggers tabs visibility ne at the time + * @private */ - destroy () { - this.root.destroy() - - if (this.options.isEditor) { - this.container.innerHTML = '' - } - - Object.keys(this).forEach((key) => { - delete this[key] - }) - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Jedi); - - -/***/ }), - -/***/ "./src/ref-parser/ref-parser.js": -/*!**************************************!*\ - !*** ./src/ref-parser/ref-parser.js ***! - \**************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -class RefParser { - constructor () { - this.refs = {} - } - - async dereference (schema) { - await this.traverseExternal(schema) - this.traverseLocal(schema) - } - + getTabList() { + const t = document.createElement("ul"); + return t.classList.add("jedi-nav-list"), t; + } /** - * Traverses the given schema recursively and for each schema with $ref - * add a new property in the this.refs object with key being the json path to that schema. - * Initially the added properties will habe a value of null. This value will be later - * replaced with the resolved schema for that json path using resolveExternal() and resolveLocal(). - * - * It also adds a new property in the this.refs object with key being the json path to that schema - * and value being the schema. - * @param schema - * @param path + * A Tab is a wrapper for content + * @private */ - async traverseExternal (schema, path = '#') { - if (typeof schema !== 'object' || schema === null) { - return - } - - for (const [key, value] of Object.entries(schema)) { - const nextPath = path ? `${path}/${key}` : `/${key}` - - if (this.hasRef(schema)) { - const ref = schema['$ref'] - - if (this.refs[ref]) { - return - } - - this.refs[ref] = null - - if (this.hasExternalRef(schema)) { - const resolvedSchema = await this.resolveExternal(schema) - await this.traverseExternal(resolvedSchema, nextPath) - } - } - - this.refs[path] = schema - - await this.traverseExternal(value, nextPath) - } + getTab(t) { + const e = document.createElement("li"), s = document.createElement("a"); + return s.classList.add("jedi-nav-link"), s.setAttribute("href", "#" + t.id), s.textContent = t.title, e.appendChild(s), { list: e, link: s }; } - - traverseLocal (schema, path = '#') { - if (typeof schema !== 'object' || schema === null) { - return - } - - for (const [key, value] of Object.entries(schema)) { - const nextPath = path ? `${path}/${key}` : `/${key}` - - if (this.hasRef(schema)) { - const ref = schema['$ref'] - - if (this.refs[ref]) { - return - } - - if (!this.hasExternalRef(schema)) { - const resolvedSchema = this.resolveLocal(schema) - this.traverseLocal(resolvedSchema, nextPath) - } - } - - this.traverseLocal(value, nextPath) - } + /** + * Wrapper for tabs + * @private + */ + getTabContent() { + const t = document.createElement("div"); + return t.classList.add("tab-content"), t; } - /** - * Iterates through the this.refs object keys. If the key is an uri containing "http" or "https" then - * uses that key as the url in a http request to retrieve the external schema. The retrieved schema - * will be used for the value of that property + * Set tab attributes to make it toggleable + * @private */ - async resolveExternal (schema) { - const ref = schema['$ref'] - const resolvedSchema = await this.load(ref) - this.refs[ref] = resolvedSchema - return resolvedSchema + setTabPaneAttributes(t, e, s) { + t.setAttribute("id", s), t.classList.add("jedi-tab-pane"); } - /** - * Iterates through the this.refs object keys and resolve all schemas that can be found in this.refs object + * Makes an element visually hidden + * @private */ - resolveLocal (schema) { - const ref = schema['$ref'] - - let resolvedSchema = null - - if (this.refs[ref]) { - resolvedSchema = this.refs[ref] - this.refs[ref] = resolvedSchema - } - - return resolvedSchema - } - - hasRef (schema) { - return typeof schema['$ref'] !== 'undefined' - } - - hasExternalRef (schema) { - const ref = schema['$ref'] - - if (typeof ref !== 'string') { - return false - } - - return ref.startsWith('http') || ref.startsWith('https') - } - - isCircularRef (ref) { - const test = `"$ref":"${ref}"` - const refSchema = this.refs[ref] - const schemaString = JSON.stringify(refSchema) - return schemaString.includes(test) - } - - isObject (value) { - return value !== null && typeof value === 'object' - } - - expand (schema) { - const cloneSchema = JSON.parse(JSON.stringify(schema)) - - if (this.isObject(cloneSchema) && '$ref' in cloneSchema) { - const ref = cloneSchema.$ref - delete cloneSchema['$ref'] - return Object.assign({}, this.refs[ref], cloneSchema) - } - - return cloneSchema + visuallyHidden(t) { + t.setAttribute("style", "position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;"); } - /** - * Loads a schema with a synchronous http request - * @param uri - * @returns {any} + * Reveals a visually hidden element + * @private */ - async load (uri) { - try { - const response = await fetch(uri) - if (!response.ok) { - throw new Error('Network response was not ok') - } - return await response.json() - } catch (error) { - console.error('Error loading', uri, error) - throw error - } + visuallyVisible(t) { + t.removeAttribute("style"); } } - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RefParser); - - -/***/ }), - -/***/ "./src/themes/bootstrap3.js": -/*!**********************************!*\ - !*** ./src/themes/bootstrap3.js ***! - \**********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _theme_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme.js */ "./src/themes/theme.js"); - - -/** - * Represents a ThemeBootstrap3 instance. - * @extends Theme - */ -class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - init () { - this.useToggleEvents = false - } - - getFieldset () { - const fieldset = document.createElement('fieldset') - fieldset.classList.add('panel') - fieldset.classList.add('panel-default') - return fieldset - } - - getLegend (config) { - const legend = super.getLegend(config) - legend.classList.add('h5') - legend.classList.add('panel-heading') - legend.classList.add('pull-left') - legend.setAttribute('style', 'margin: 0; display: flex; justify-content: space-between; align-items: center;') - return legend - } - - getCard () { - const card = super.getCard() - card.classList.add('panel') - card.classList.add('panel-default') - return card - } - - getCardHeader (config) { - const header = super.getCardHeader(config) - header.classList.add('panel-heading') - header.classList.add('text-right') - return header - } - - getCardBody () { - const html = super.getCardBody() - html.classList.add('panel-body') - html.style.clear = 'both' - return html - } - - getPropertiesToggle (config) { - const html = this.getButton(config) - html.setAttribute('data-toggle', 'collapse') - html.setAttribute('data-target', '#' + config.propertiesContainer.id) - html.classList.add('jedi-properties-toggle') - return html - } - - getPropertiesSlot (config) { - const html = super.getPropertiesSlot(config) - html.classList.add('collapse') - html.setAttribute('id', config.id) - return html - } - - getBtnGroup () { - const html = super.getBtnGroup() - html.classList.add('btn-group') - return html - } - - getButton (config) { - const html = super.getButton(config) - html.classList.add('btn') - html.classList.add('btn-xs') - html.classList.add('btn-default') - return html - } - - getDescription (config) { - const description = super.getDescription(config) - description.classList.add('text-muted') - return description - } - - getTextareaControl (config) { - const control = super.getTextareaControl(config) - const { container, input, label } = control - container.classList.add('form-group') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getInputControl (config) { - const control = super.getInputControl(config) - const { container, input, label } = control - container.classList.add('form-group') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getRadiosControl (config) { - const control = super.getRadiosControl(config) - const { body, radios, labels, labelTexts, radioControls, description, messages } = control - - radioControls.forEach((radioControl, index) => { - radioControl.classList.add('radio') - - body.appendChild(radioControls[index]) - radioControl.appendChild(labels[index]) - labels[index].appendChild(radios[index]) - labels[index].appendChild(labelTexts[index]) - }) - - body.appendChild(description) - body.appendChild(messages) - - return control - } - - getCheckboxControl (config) { - const control = super.getCheckboxControl(config) - const { container, formGroup, input, label, labelText, description, messages } = control - formGroup.classList.add('checkbox') - - container.appendChild(formGroup) - formGroup.appendChild(label) - label.appendChild(input) - label.appendChild(labelText) - formGroup.appendChild(description) - formGroup.appendChild(messages) - return control - } - - getSelectControl (config) { - const control = super.getSelectControl(config) - const { container, input, label } = control - container.classList.add('form-group') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - - getAlert (config) { - const html = super.getAlert(config) - html.classList.add('alert') - html.classList.add('alert-danger') - return html - } - - getInvalidFeedback (config) { - const html = super.getInvalidFeedback(config) - html.classList.add('text-danger') - return html - } - - getRow () { - const row = super.getRow() - row.classList.add('row') - return row - } - - getCol (xs, md, offsetMd) { - const col = super.getRow() - col.classList.add('col-xs-' + xs) - col.classList.add('col-md-' + md) - - if (offsetMd) { - col.classList.add('col-md-offset-' + offsetMd) - } - - return col - } - - getTabList (config) { - const tabList = super.getTabList(config) - tabList.classList.add('nav') - - if (config.type === 'tabs') { - tabList.classList.add('nav-tabs') - } else { - tabList.classList.add('nav-pills') - } - - tabList.classList.add('nav-stacked') - - if (config.stacked === false) { - tabList.classList.remove('nav-stacked') - } - - return tabList - } - - getTab (config) { - const tab = super.getTab(config) - - if (config.active) { - tab.list.classList.add('active') - } - - tab.link.setAttribute('data-toggle', 'tab') - return tab - } - - setTabPaneAttributes (element, active, id) { - super.setTabPaneAttributes(element, active, id) - element.classList.add('tab-pane') - - if (active) { - element.classList.add('in') - element.classList.add('active') - } +class Ne extends xt { + init() { + this.useToggleEvents = !1; } - - visuallyHidden (element) { - element.classList.add('sr-only') - } - - visuallyVisible (element) { - element.classList.remove('sr-only') - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeBootstrap3); - - -/***/ }), - -/***/ "./src/themes/bootstrap4.js": -/*!**********************************!*\ - !*** ./src/themes/bootstrap4.js ***! - \**********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _theme_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme.js */ "./src/themes/theme.js"); - - -/** - * Represents a ThemeBootstrap4 instance. - * @extends Theme - */ -class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - init () { - this.useToggleEvents = false - } - - getFieldset () { - const fieldset = document.createElement('fieldset') - fieldset.classList.add('card') - fieldset.classList.add('mb-3') - return fieldset - } - - getLegend (config) { - const legend = super.getLegend(config) - legend.classList.add('h6') - legend.classList.add('card-header') - legend.classList.add('d-flex') - legend.classList.add('justify-content-between') - legend.classList.add('align-items-center') - legend.classList.add('float-left') - legend.classList.add('py-2') - return legend - } - - getCard () { - const card = super.getCard() - card.classList.add('card') - card.classList.add('mb-3') - return card - } - - getCardHeader (config) { - const html = super.getCardHeader(config) - html.classList.add('card-header') - html.classList.add('d-flex') - html.classList.add('justify-content-end') - html.classList.add('align-items-center') - html.classList.add('py-1') - return html - } - - getCardBody () { - const html = super.getCardBody() - html.classList.add('card-body') - return html - } - - getPropertiesSlot (config) { - const html = super.getPropertiesSlot(config) - html.classList.add('collapse') - html.setAttribute('id', config.id) - return html - } - - getPropertiesToggle (config) { - const html = this.getButton(config) - html.setAttribute('data-toggle', 'collapse') - html.setAttribute('data-target', '#' + config.propertiesContainer.id) - html.classList.add('jedi-properties-toggle') - return html - } - - getBtnGroup () { - const html = super.getBtnGroup() - html.classList.add('btn-group') - return html - } - - getButton (config) { - const html = super.getButton(config) - html.classList.add('btn') - html.classList.add('btn-sm') - return html - } - - getDescription (config) { - const description = super.getDescription(config) - description.classList.add('text-muted') - return description - } - - getTextareaControl (config) { - const control = super.getTextareaControl(config) - const { container, input, label } = control - container.classList.add('form-group') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getInputControl (config) { - const control = super.getInputControl(config) - const { container, input, label } = control - container.classList.add('form-group') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getRadiosControl (config) { - const control = super.getRadiosControl(config) - const { container, body, radios, labels, labelTexts, radioControls, description, messages } = control - - container.classList.add('form-group') - - radioControls.forEach((radioControl, index) => { - radioControl.classList.add('form-check') - radios[index].classList.add('form-check-input') - labels[index].classList.add('form-check-label') - - body.appendChild(radioControls[index]) - radioControl.appendChild(radios[index]) - radioControl.appendChild(labels[index]) - labels[index].appendChild(labelTexts[index]) - }) - - body.appendChild(description) - body.appendChild(messages) - - return control - } - - getCheckboxControl (config) { - const control = super.getCheckboxControl(config) - const { container, formGroup, input, label, description, messages } = control - formGroup.classList.add('form-group') - formGroup.classList.add('form-check') - input.classList.add('form-check-input') - label.classList.add('form-check-label') - - container.appendChild(formGroup) - formGroup.appendChild(input) - formGroup.appendChild(label) - formGroup.appendChild(description) - formGroup.appendChild(messages) - return control - } - - getSelectControl (config) { - const control = super.getSelectControl(config) - const { container, input } = control - container.classList.add('form-group') - input.classList.add('form-control') - return control - } - - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input } = control - container.classList.remove('form-group') - input.classList.remove('form-control') - return control - } - - getAlert (config) { - const html = super.getAlert(config) - html.classList.add('alert') - html.classList.add('alert-danger') - return html - } - - getInvalidFeedback (config) { - const html = super.getInvalidFeedback(config) - html.classList.add('text-danger') - html.classList.add('form-text') - html.classList.add('d-block') - return html - } - - getColumnClass (size, cols) { - return 'col-' + size + '-' + cols - } - - getRow () { - const row = super.getRow() - row.classList.add('row') - return row - } - - getCol (xs, md, offsetMd) { - const col = super.getRow(xs, md, offsetMd) - col.classList.add('col-' + xs) - col.classList.add('col-md-' + md) - - if (offsetMd) { - col.classList.add('offset-md-' + offsetMd) - } - - return col - } - - getTabList (config) { - const tabList = super.getTabList() - tabList.classList.add('nav') - - if (config.type === 'tabs') { - tabList.classList.add('nav-tabs') - } else { - tabList.classList.add('nav-pills') - } - - tabList.classList.add('flex-column') - - if (config.stacked === false) { - tabList.classList.remove('flex-column') - } - - return tabList - } - - getTab (config) { - const tab = super.getTab(config) - tab.list.classList.add('nav-item') - - tab.link.classList.add('nav-link') - tab.link.setAttribute('data-toggle', 'tab') - - if (config.active) { - tab.link.classList.add('active') - } - - return tab - } - - setTabPaneAttributes (element, active, id) { - super.setTabPaneAttributes(element, active, id) - element.classList.add('tab-pane') - - if (active) { - element.classList.add('active') - } + getFieldset() { + const t = document.createElement("fieldset"); + return t.classList.add("panel"), t.classList.add("panel-default"), t; } - - visuallyHidden (element) { - element.classList.add('sr-only') - } - - visuallyVisible (element) { - element.classList.remove('sr-only') - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeBootstrap4); - - -/***/ }), - -/***/ "./src/themes/bootstrap5.js": -/*!**********************************!*\ - !*** ./src/themes/bootstrap5.js ***! - \**********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _theme_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme.js */ "./src/themes/theme.js"); - - -/** - * Represents a ThemeBootstrap5 instance. - * @extends Theme - */ -class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] { - init () { - this.useToggleEvents = false - } - - getFieldset () { - const fieldset = document.createElement('fieldset') - fieldset.classList.add('card') - fieldset.classList.add('mb-3') - return fieldset - } - - getLegend (config) { - const legend = super.getLegend(config) - legend.classList.add('h6') - legend.classList.add('card-header') - legend.classList.add('d-flex') - legend.classList.add('justify-content-between') - legend.classList.add('align-items-center') - legend.classList.add('py-2') - return legend - } - - getCard () { - const card = super.getCard() - card.classList.add('card') - card.classList.add('mb-3') - return card - } - - getCardHeader (config) { - const html = super.getCardHeader(config) - html.classList.add('card-header') - html.classList.add('d-flex') - html.classList.add('justify-content-end') - html.classList.add('align-items-center') - html.classList.add('py-1') - return html - } - - getCardBody () { - const html = super.getCardBody() - html.classList.add('card-body') - return html - } - - getPropertiesSlot (config) { - const html = super.getPropertiesSlot(config) - html.classList.add('collapse') - html.setAttribute('id', config.id) - return html - } - - getControlSlot () { - const controlSlot = super.getControlSlot() - controlSlot.classList.add('mb-3') - return controlSlot - } - - getPropertiesToggle (config) { - const html = this.getButton(config) - html.setAttribute('data-bs-toggle', 'collapse') - html.setAttribute('data-bs-target', '#' + config.propertiesContainer.id) - html.classList.add('jedi-properties-toggle') - return html - } - - getBtnGroup () { - const html = super.getBtnGroup() - html.classList.add('btn-group') - return html - } - - getButton (config) { - const html = super.getButton(config) - html.classList.add('btn') - html.classList.add('btn-sm') - return html - } - - getDescription (config) { - const description = super.getDescription(config) - description.classList.add('text-muted') - return description - } - - getTextareaControl (config) { - const control = super.getTextareaControl(config) - const { container, input, label } = control - container.classList.add('mb-3') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getInputControl (config) { - const control = super.getInputControl(config) - const { container, input, label } = control - container.classList.add('mb-3') - input.classList.add('form-control') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - return control - } - - getRadiosControl (config) { - const control = super.getRadiosControl(config) - const { container, body, radios, labels, labelTexts, radioControls, description, messages } = control - - container.classList.add('mb-3') - - radioControls.forEach((radioControl, index) => { - radioControl.classList.add('form-check') - radios[index].classList.add('form-check-input') - labels[index].classList.add('form-check-label') - - body.appendChild(radioControls[index]) - radioControl.appendChild(radios[index]) - radioControl.appendChild(labels[index]) - labels[index].appendChild(labelTexts[index]) - }) - - body.appendChild(description) - body.appendChild(messages) - - return control - } - - getCheckboxControl (config) { - const control = super.getCheckboxControl(config) - const { container, formGroup, input, label, description, messages } = control - container.classList.add('mb-3') - formGroup.classList.add('form-check') - input.classList.add('form-check-input') - label.classList.add('form-check-label') - - if (config.srOnly) { - this.visuallyHidden(label) - } - - container.appendChild(formGroup) - formGroup.appendChild(input) - formGroup.appendChild(label) - formGroup.appendChild(description) - formGroup.appendChild(messages) - return control - } - - getSelectControl (config) { - const control = super.getSelectControl(config) - const { container, input } = control - container.classList.add('mb-3') - input.classList.add('form-select') - return control - } - - getSwitcher (config) { - const control = super.getSwitcher(config) - const { container, input, label } = control - container.classList.remove('mb-3') - input.classList.remove('form-select') - this.visuallyHidden(label) - return control - } - - getAlert (config) { - const html = super.getAlert(config) - html.classList.add('alert') - html.classList.add('alert-danger') - return html - } - - getInvalidFeedback (config) { - const html = super.getInvalidFeedback(config) - html.classList.add('text-danger') - html.classList.add('d-block') - html.classList.add('form-text') - html.classList.add('form-text') - return html - } - - getRow () { - const row = super.getRow() - row.classList.add('row') - return row - } - - getCol (xs, md, offsetMd) { - const col = super.getRow(xs, md, offsetMd) - col.classList.add('col-' + xs) - col.classList.add('col-md-' + md) - - if (offsetMd) { - col.classList.add('offset-md-' + offsetMd) - } - - return col - } - - getTabList (config) { - const tabList = super.getTabList(config) - tabList.classList.add('nav') - - if (config.type === 'tabs') { - tabList.classList.add('nav-tabs') - } else { - tabList.classList.add('nav-pills') - } - - tabList.classList.add('flex-column') - - if (config.stacked === false) { - tabList.classList.remove('flex-column') - } - - return tabList - } - - getTab (config) { - const tab = super.getTab(config) - tab.list.classList.add('nav-item') - - tab.link.classList.add('nav-link') - tab.link.setAttribute('data-bs-toggle', 'tab') - - if (config.active) { - tab.link.classList.add('active') - } - - return tab - } - - setTabPaneAttributes (element, active, id) { - super.setTabPaneAttributes(element, active, id) - element.classList.add('tab-pane') - - if (active) { - element.classList.add('active') - } + getLegend(t) { + const e = super.getLegend(t); + return e.classList.add("h5"), e.classList.add("panel-heading"), e.classList.add("pull-left"), e.setAttribute("style", "margin: 0; display: flex; justify-content: space-between; align-items: center;"), e; } - - visuallyHidden (element) { - element.classList.add('visually-hidden') - } - - visuallyVisible (element) { - element.classList.remove('visually-hidden') - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeBootstrap5); - - -/***/ }), - -/***/ "./src/themes/icons/icons.js": -/*!***********************************!*\ - !*** ./src/themes/icons/icons.js ***! - \***********************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ bootstrapIcons: () => (/* binding */ bootstrapIcons), -/* harmony export */ fontAwesome3: () => (/* binding */ fontAwesome3), -/* harmony export */ fontAwesome4: () => (/* binding */ fontAwesome4), -/* harmony export */ fontAwesome5: () => (/* binding */ fontAwesome5), -/* harmony export */ fontAwesome6: () => (/* binding */ fontAwesome6), -/* harmony export */ glyphicons: () => (/* binding */ glyphicons) -/* harmony export */ }); -/** - * Lists of html classes used for icons. - * @module icons - */ - -/** - * HTML classes for glyphicons icons - * @type {object} - */ -const glyphicons = { - properties: 'glyphicon glyphicon-list', - delete: 'glyphicon glyphicon-trash', - add: 'glyphicon glyphicon-plus', - moveUp: 'glyphicon glyphicon-arrow-up', - moveDown: 'glyphicon glyphicon-arrow-down' -} - -/** - * HTML classes for bootstrap-icons icons - * @type {object} - */ -const bootstrapIcons = { - properties: 'bi bi-card-list', - delete: 'bi bi-trash2', - add: 'bi bi-plus', - moveUp: 'bi bi-arrow-up', - moveDown: 'bi bi-arrow-down' -} - -/** - * HTML classes for fontawesome3 icons - * @type {object} - */ -const fontAwesome3 = { - properties: 'icon-list', - delete: 'icon-trash', - add: 'icon-plus', - moveUp: 'icon-arrow-up', - moveDown: 'icon-arrow-down' -} - -/** - * HTML classes for fontawesome4 icons - * @type {object} - */ -const fontAwesome4 = { - properties: 'fa fa-list', - delete: 'fa fa-trash-o', - add: 'fa fa-plus', - moveUp: 'fa fa-arrow-up', - moveDown: 'fa fa-arrow-down' -} - -/** - * HTML classes for fontawesome5 icons - * @type {object} - */ -const fontAwesome5 = { - properties: 'fas fa-list', - delete: 'fas fa-trash', - add: 'fas fa-plus', - moveUp: 'fas fa-arrow-up', - moveDown: 'fas fa-arrow-down' -} - -/** - * HTML classes for fontawesome6 icons - * @type {object} - */ -const fontAwesome6 = { - properties: 'fa-solid fa-list', - delete: 'fa-solid fa-trash', - add: 'fa-solid fa-plus', - moveUp: 'fa-solid fa-arrow-up', - moveDown: 'fa-solid fa-arrow-down' -} - - -/***/ }), - -/***/ "./src/themes/theme.js": -/*!*****************************!*\ - !*** ./src/themes/theme.js ***! - \*****************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/** - * Represents a Theme instance. - */ -class Theme { - constructor (icons = null) { - this.icons = icons - this.useToggleEvents = true - this.init() - } - - /** - * Inits some instance properties - * @private - */ - init () { - this.useToggleEvents = true + getCard() { + const t = super.getCard(); + return t.classList.add("panel"), t.classList.add("panel-default"), t; } - - /** - * Returns a icon element - * @private - */ - getIcon (name) { - const icon = document.createElement('i') - const iconClasses = this.icons[name].split(' ') - - if (iconClasses.length > 0) { - iconClasses.forEach((className) => { - icon.classList.add(className) - }) + getCardHeader(t) { + const e = super.getCardHeader(t); + return e.classList.add("panel-heading"), e.classList.add("text-right"), e; + } + getCardBody() { + const t = super.getCardBody(); + return t.classList.add("panel-body"), t.style.clear = "both", t; + } + getPropertiesToggle(t) { + const e = this.getButton(t); + return e.setAttribute("data-toggle", "collapse"), e.setAttribute("data-target", "#" + t.propertiesContainer.id), e.classList.add("jedi-properties-toggle"), e; + } + getPropertiesSlot(t) { + const e = super.getPropertiesSlot(t); + return e.classList.add("collapse"), e.setAttribute("id", t.id), e; + } + getBtnGroup() { + const t = super.getBtnGroup(); + return t.classList.add("btn-group"), t; + } + getButton(t) { + const e = super.getButton(t); + return e.classList.add("btn"), e.classList.add("btn-xs"), e.classList.add("btn-default"), e; + } + getDescription(t) { + const e = super.getDescription(t); + return e.classList.add("text-muted"), e; + } + getTextareaControl(t) { + const e = super.getTextareaControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("form-group"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getInputControl(t) { + const e = super.getInputControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("form-group"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getRadiosControl(t) { + const e = super.getRadiosControl(t), { body: s, radios: n, labels: r, labelTexts: a, radioControls: o, description: c, messages: l } = e; + return o.forEach((h, u) => { + h.classList.add("radio"), s.appendChild(o[u]), h.appendChild(r[u]), r[u].appendChild(n[u]), r[u].appendChild(a[u]); + }), s.appendChild(c), s.appendChild(l), e; + } + getCheckboxControl(t) { + const e = super.getCheckboxControl(t), { container: s, formGroup: n, input: r, label: a, labelText: o, description: c, messages: l } = e; + return n.classList.add("checkbox"), s.appendChild(n), n.appendChild(a), a.appendChild(r), a.appendChild(o), n.appendChild(c), n.appendChild(l), e; + } + getSelectControl(t) { + const e = super.getSelectControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("form-group"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getSwitcher(t) { + const e = super.getSwitcher(t), { container: s, input: n } = e; + return s.classList.remove("form-group"), n.classList.remove("form-control"), e; + } + getAlert(t) { + const e = super.getAlert(t); + return e.classList.add("alert"), e.classList.add("alert-danger"), e; + } + getInvalidFeedback(t) { + const e = super.getInvalidFeedback(t); + return e.classList.add("text-danger"), e; + } + getRow() { + const t = super.getRow(); + return t.classList.add("row"), t; + } + getCol(t, e, s) { + const n = super.getRow(); + return n.classList.add("col-xs-" + t), n.classList.add("col-md-" + e), s && n.classList.add("col-md-offset-" + s), n; + } + getTabList(t) { + const e = super.getTabList(t); + return e.classList.add("nav"), t.type === "tabs" ? e.classList.add("nav-tabs") : e.classList.add("nav-pills"), e.classList.add("nav-stacked"), t.stacked === !1 && e.classList.remove("nav-stacked"), e; + } + getTab(t) { + const e = super.getTab(t); + return t.active && e.list.classList.add("active"), e.link.setAttribute("data-toggle", "tab"), e; + } + setTabPaneAttributes(t, e, s) { + super.setTabPaneAttributes(t, e, s), t.classList.add("tab-pane"), e && (t.classList.add("in"), t.classList.add("active")); + } + visuallyHidden(t) { + t.classList.add("sr-only"); + } + visuallyVisible(t) { + t.classList.remove("sr-only"); + } +} +class De extends xt { + init() { + this.useToggleEvents = !1; + } + getFieldset() { + const t = document.createElement("fieldset"); + return t.classList.add("card"), t.classList.add("mb-3"), t; + } + getLegend(t) { + const e = super.getLegend(t); + return e.classList.add("h6"), e.classList.add("card-header"), e.classList.add("d-flex"), e.classList.add("justify-content-between"), e.classList.add("align-items-center"), e.classList.add("float-left"), e.classList.add("py-2"), e; + } + getCard() { + const t = super.getCard(); + return t.classList.add("card"), t.classList.add("mb-3"), t; + } + getCardHeader(t) { + const e = super.getCardHeader(t); + return e.classList.add("card-header"), e.classList.add("d-flex"), e.classList.add("justify-content-end"), e.classList.add("align-items-center"), e.classList.add("py-1"), e; + } + getCardBody() { + const t = super.getCardBody(); + return t.classList.add("card-body"), t; + } + getPropertiesSlot(t) { + const e = super.getPropertiesSlot(t); + return e.classList.add("collapse"), e.setAttribute("id", t.id), e; + } + getPropertiesToggle(t) { + const e = this.getButton(t); + return e.setAttribute("data-toggle", "collapse"), e.setAttribute("data-target", "#" + t.propertiesContainer.id), e.classList.add("jedi-properties-toggle"), e; + } + getBtnGroup() { + const t = super.getBtnGroup(); + return t.classList.add("btn-group"), t; + } + getButton(t) { + const e = super.getButton(t); + return e.classList.add("btn"), e.classList.add("btn-sm"), e; + } + getDescription(t) { + const e = super.getDescription(t); + return e.classList.add("text-muted"), e; + } + getTextareaControl(t) { + const e = super.getTextareaControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("form-group"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getInputControl(t) { + const e = super.getInputControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("form-group"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getRadiosControl(t) { + const e = super.getRadiosControl(t), { container: s, body: n, radios: r, labels: a, labelTexts: o, radioControls: c, description: l, messages: h } = e; + return s.classList.add("form-group"), c.forEach((u, p) => { + u.classList.add("form-check"), r[p].classList.add("form-check-input"), a[p].classList.add("form-check-label"), n.appendChild(c[p]), u.appendChild(r[p]), u.appendChild(a[p]), a[p].appendChild(o[p]); + }), n.appendChild(l), n.appendChild(h), e; + } + getCheckboxControl(t) { + const e = super.getCheckboxControl(t), { container: s, formGroup: n, input: r, label: a, description: o, messages: c } = e; + return n.classList.add("form-group"), n.classList.add("form-check"), r.classList.add("form-check-input"), a.classList.add("form-check-label"), s.appendChild(n), n.appendChild(r), n.appendChild(a), n.appendChild(o), n.appendChild(c), e; + } + getSelectControl(t) { + const e = super.getSelectControl(t), { container: s, input: n } = e; + return s.classList.add("form-group"), n.classList.add("form-control"), e; + } + getSwitcher(t) { + const e = super.getSwitcher(t), { container: s, input: n } = e; + return s.classList.remove("form-group"), n.classList.remove("form-control"), e; + } + getAlert(t) { + const e = super.getAlert(t); + return e.classList.add("alert"), e.classList.add("alert-danger"), e; + } + getInvalidFeedback(t) { + const e = super.getInvalidFeedback(t); + return e.classList.add("text-danger"), e.classList.add("form-text"), e.classList.add("d-block"), e; + } + getColumnClass(t, e) { + return "col-" + t + "-" + e; + } + getRow() { + const t = super.getRow(); + return t.classList.add("row"), t; + } + getCol(t, e, s) { + const n = super.getRow(t, e, s); + return n.classList.add("col-" + t), n.classList.add("col-md-" + e), s && n.classList.add("offset-md-" + s), n; + } + getTabList(t) { + const e = super.getTabList(); + return e.classList.add("nav"), t.type === "tabs" ? e.classList.add("nav-tabs") : e.classList.add("nav-pills"), e.classList.add("flex-column"), t.stacked === !1 && e.classList.remove("flex-column"), e; + } + getTab(t) { + const e = super.getTab(t); + return e.list.classList.add("nav-item"), e.link.classList.add("nav-link"), e.link.setAttribute("data-toggle", "tab"), t.active && e.link.classList.add("active"), e; + } + setTabPaneAttributes(t, e, s) { + super.setTabPaneAttributes(t, e, s), t.classList.add("tab-pane"), e && t.classList.add("active"); + } + visuallyHidden(t) { + t.classList.add("sr-only"); + } + visuallyVisible(t) { + t.classList.remove("sr-only"); + } +} +class Fe extends xt { + init() { + this.useToggleEvents = !1; + } + getFieldset() { + const t = document.createElement("fieldset"); + return t.classList.add("card"), t.classList.add("mb-3"), t; + } + getLegend(t) { + const e = super.getLegend(t); + return e.classList.add("h6"), e.classList.add("card-header"), e.classList.add("d-flex"), e.classList.add("justify-content-between"), e.classList.add("align-items-center"), e.classList.add("py-2"), e; + } + getCard() { + const t = super.getCard(); + return t.classList.add("card"), t.classList.add("mb-3"), t; + } + getCardHeader(t) { + const e = super.getCardHeader(t); + return e.classList.add("card-header"), e.classList.add("d-flex"), e.classList.add("justify-content-end"), e.classList.add("align-items-center"), e.classList.add("py-1"), e; + } + getCardBody() { + const t = super.getCardBody(); + return t.classList.add("card-body"), t; + } + getPropertiesSlot(t) { + const e = super.getPropertiesSlot(t); + return e.classList.add("collapse"), e.setAttribute("id", t.id), e; + } + getControlSlot() { + const t = super.getControlSlot(); + return t.classList.add("mb-3"), t; + } + getPropertiesToggle(t) { + const e = this.getButton(t); + return e.setAttribute("data-bs-toggle", "collapse"), e.setAttribute("data-bs-target", "#" + t.propertiesContainer.id), e.classList.add("jedi-properties-toggle"), e; + } + getBtnGroup() { + const t = super.getBtnGroup(); + return t.classList.add("btn-group"), t; + } + getButton(t) { + const e = super.getButton(t); + return e.classList.add("btn"), e.classList.add("btn-sm"), e; + } + getDescription(t) { + const e = super.getDescription(t); + return e.classList.add("text-muted"), e; + } + getTextareaControl(t) { + const e = super.getTextareaControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("mb-3"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getInputControl(t) { + const e = super.getInputControl(t), { container: s, input: n, label: r } = e; + return s.classList.add("mb-3"), n.classList.add("form-control"), t.srOnly && this.visuallyHidden(r), e; + } + getRadiosControl(t) { + const e = super.getRadiosControl(t), { container: s, body: n, radios: r, labels: a, labelTexts: o, radioControls: c, description: l, messages: h } = e; + return s.classList.add("mb-3"), c.forEach((u, p) => { + u.classList.add("form-check"), r[p].classList.add("form-check-input"), a[p].classList.add("form-check-label"), n.appendChild(c[p]), u.appendChild(r[p]), u.appendChild(a[p]), a[p].appendChild(o[p]); + }), n.appendChild(l), n.appendChild(h), e; + } + getCheckboxControl(t) { + const e = super.getCheckboxControl(t), { container: s, formGroup: n, input: r, label: a, description: o, messages: c } = e; + return s.classList.add("mb-3"), n.classList.add("form-check"), r.classList.add("form-check-input"), a.classList.add("form-check-label"), t.srOnly && this.visuallyHidden(a), s.appendChild(n), n.appendChild(r), n.appendChild(a), n.appendChild(o), n.appendChild(c), e; + } + getSelectControl(t) { + const e = super.getSelectControl(t), { container: s, input: n } = e; + return s.classList.add("mb-3"), n.classList.add("form-select"), e; + } + getSwitcher(t) { + const e = super.getSwitcher(t), { container: s, input: n, label: r } = e; + return s.classList.remove("mb-3"), n.classList.remove("form-select"), this.visuallyHidden(r), e; + } + getAlert(t) { + const e = super.getAlert(t); + return e.classList.add("alert"), e.classList.add("alert-danger"), e; + } + getInvalidFeedback(t) { + const e = super.getInvalidFeedback(t); + return e.classList.add("text-danger"), e.classList.add("d-block"), e.classList.add("form-text"), e.classList.add("form-text"), e; + } + getRow() { + const t = super.getRow(); + return t.classList.add("row"), t; + } + getCol(t, e, s) { + const n = super.getRow(t, e, s); + return n.classList.add("col-" + t), n.classList.add("col-md-" + e), s && n.classList.add("offset-md-" + s), n; + } + getTabList(t) { + const e = super.getTabList(t); + return e.classList.add("nav"), t.type === "tabs" ? e.classList.add("nav-tabs") : e.classList.add("nav-pills"), e.classList.add("flex-column"), t.stacked === !1 && e.classList.remove("flex-column"), e; + } + getTab(t) { + const e = super.getTab(t); + return e.list.classList.add("nav-item"), e.link.classList.add("nav-link"), e.link.setAttribute("data-bs-toggle", "tab"), t.active && e.link.classList.add("active"), e; + } + setTabPaneAttributes(t, e, s) { + super.setTabPaneAttributes(t, e, s), t.classList.add("tab-pane"), e && t.classList.add("active"); + } + visuallyHidden(t) { + t.classList.add("visually-hidden"); + } + visuallyVisible(t) { + t.classList.remove("visually-hidden"); + } +} +class U { + constructor(t) { + if (this.instance = t, this.theme = null, this.control = null, this.disabled = !1, this.readOnly = this.instance.isReadOnly(), this.init(), this.build(), this.coerceValue(), this.addEventListeners(), this.setContainerAttributes(), this.refreshUI(), this.instance.jedi.options.showErrors === "always" || f(this.instance.schema, "showErrors") === "always") { + const s = this.instance.getErrors(); + this.showValidationErrors(s); } - - return icon + this.instance.on("set-value", () => { + this.refreshUI(); + const s = this.instance.getErrors(); + this.showValidationErrors(s); + }), this.instance.on("change", () => { + this.refreshUI(); + const s = this.instance.getErrors(); + this.showValidationErrors(s); + }); } - /** - * Used to wrap the editor UI elements + * Initializes the editor * @private */ - getEditorContainer () { - const html = document.createElement('div') - html.classList.add('jedi-editor-container') - return html + init() { + let t = null; + if (d(this.instance.jedi.options.iconLib)) + switch (this.instance.jedi.options.iconLib) { + case "glyphicons": + t = ke; + break; + case "bootstrap-icons": + t = Me; + break; + case "fontawesome3": + t = Ve; + break; + case "fontawesome4": + t = Re; + break; + case "fontawesome5": + t = Be; + break; + case "fontawesome6": + t = qe; + break; + } + switch (this.instance.jedi.options.theme) { + case "bootstrap3": + this.theme = new Ne(t); + break; + case "bootstrap4": + this.theme = new De(t); + break; + case "bootstrap5": + this.theme = new Fe(t); + break; + default: + this.theme = new xt(t); + } } - /** - * Used to group several controls + * Sets container attributes like data-path and data-type * @private */ - getFieldset () { - return document.createElement('fieldset') + setContainerAttributes() { + this.control.container.setAttribute("data-path", this.instance.path), this.control.container.setAttribute("data-type", R(this.instance.schema)); } - /** - * Represents a caption for the content of its parent fieldset + * Builds the editor control and appends it to the editor container * @private */ - getLegend (config) { - const legend = document.createElement('legend') - const legendText = document.createElement('span') - legend.setAttribute('aria-labelledby', '#legend-' + config.id) - legendText.textContent = config.textContent - legendText.setAttribute('id', '#legend-' + config.id) - legend.appendChild(legendText) - return legend - } - + build() { + } /** - * Container for complex editors like arrays, objects and multiple - * @private + * Updates the value of the instance by making assumptions based on constrains */ - getCard () { - return document.createElement('div') + coerceValue() { + const t = k(this.instance.schema); + d(t) && !t.includes(this.instance.getValue()) && d(t[0]) && this.instance.setValue(t[0], !1); } - /** - * Header for cards + * Add event listeners to ui elements * @private */ - getCardHeader () { - return document.createElement('div') + addEventListeners() { } - /** - * A body for the cards + * Shows validation messages in the editor container. * @private */ - getCardBody () { - return document.createElement('div') + showValidationErrors(t) { + if (this.instance.jedi.options.showErrors === "never" || f(this.instance.schema, "showErrors") === "never") + return; + this.control.messages.innerHTML = ""; + const s = I(this.instance.schema) || this.instance.getKey(); + t.forEach((n) => { + n.messages.forEach((r) => { + const a = this.getInvalidFeedback({ + message: s + ": " + r + }); + this.control.messages.appendChild(a); + }); + }); } - /** - * Wrapper for editor actions buttons + * Get an error message container * @private */ - getActionsSlot () { - const html = document.createElement('div') - html.classList.add('jedi-actions-slot') - return html + getInvalidFeedback(t) { + return this.theme.getInvalidFeedback(t); } - /** - * Wrapper for editor array specific actions buttons - * @private + * Disables the editor */ - getArrayActionsSlot () { - const html = this.getBtnGroup() - html.classList.add('jedi-array-actions-slot') - return html + disable() { + this.disabled = !0, this.refreshUI(); } - /** - * Wrapper for child editors - * @private + * Enables the editor */ - getChildrenSlot () { - const html = document.createElement('div') - html.classList.add('jedi-child-editors-slot') - return html + enable() { + this.disabled = !1, this.refreshUI(); } - /** - * Wrapper for error messages + * Updates control UI when its state changes * @private */ - getMessagesSlot () { - const html = document.createElement('div') - html.classList.add('jedi-messages-slot') - html.setAttribute('aria-atomic', 'false') - html.setAttribute('aria-live', 'polite') - return html - } - + refreshUI() { + this.refreshInteractiveElements(); + } + refreshInteractiveElements() { + this.control.container.querySelectorAll("button, input, select, textarea").forEach((e) => { + this.disabled || this.readOnly ? e.setAttribute("disabled", "") : e.removeAttribute("disabled", ""); + }); + } /** - * Wrapper for editor controls + * Transforms the input value if necessary before value set * @private */ - getControlSlot () { - const html = document.createElement('div') - html.classList.add('jedi-control-slot') - return html + sanitize(t) { + return t; } - /** - * Container for properties editing elements like property activators + * Destroys the editor * @private */ - getPropertiesSlot (config) { - const html = document.createElement('div') - html.classList.add('jedi-properties-slot') - html.setAttribute('id', config.id) - - if (this.useToggleEvents) { - html.style.display = 'none' + destroy() { + this.control.container && this.control.container.parentNode && this.control.container.parentNode.removeChild(this.control.container), Object.keys(this).forEach((t) => { + delete this[t]; + }); + } +} +class Zt extends U { + build() { + this.control = this.theme.getMultipleControl({ + title: "Options", + srOnly: f(this.instance.schema, "hideTitle"), + id: S(this.instance.path), + description: j(this.instance.schema), + switcherOptionValues: this.instance.switcherOptionValues, + switcherOptionsLabels: this.instance.switcherOptionsLabels + }); + } + addEventListeners() { + this.control.switcher.input.addEventListener("change", () => { + const t = Number(this.control.switcher.input.value); + this.instance.switchInstance(t); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.childrenSlot.innerHTML = "", this.control.childrenSlot.appendChild(this.instance.activeInstance.ui.control.container), this.control.switcher.input.value = this.instance.index, this.disabled || this.instance.isReadOnly() ? this.instance.activeInstance.ui.disable() : this.instance.activeInstance.ui.enable(); + } + getInvalidFeedback(t) { + return this.theme.getAlert(t); + } +} +class Ue extends F { + setUI() { + this.ui = new Zt(this); + } + prepare() { + this.instances = [], this.activeInstance = null, this.activeInstanceChanged = !0, this.index = 0, this.schemas = [], this.switcherOptionValues = [], this.switcherOptionsLabels = [], this.ifThenElseShemas = [], this.traverseSchema(this.schema), delete this.schema.if, delete this.schema.then, delete this.schema.else; + let t = 0; + this.ifThenElseShemas.forEach((r) => { + d(r.then) && (this.schemas.push(K({}, T(this.schema), r.then)), this.switcherOptionValues.push(t), this.switcherOptionsLabels.push(JSON.stringify(r.then)), t++), d(r.else) && (this.schemas.push(K({}, T(this.schema), r.else)), this.switcherOptionValues.push(t), this.switcherOptionsLabels.push(JSON.stringify(r.else)), t++); + }); + const e = T(this.schema); + delete e.if, delete e.then, delete e.else; + const s = this.jedi.createInstance({ + jedi: this.jedi, + schema: e, + path: this.path, + parent: this.parent + }); + this.schemas.forEach((r) => { + const a = this.jedi.createInstance({ + jedi: this.jedi, + schema: r, + path: this.path, + parent: this.parent + }); + a.unregister(), a.on("change", () => { + const o = this.activeInstance.getValue(); + this.getFittestIndex(o) !== this.index ? this.setValue(o) : (this.value = this.activeInstance.getValue(), this.emit("change")); + }), this.instances.push(a), this.register(); + }), this.on("set-value", (r) => { + this.instances.forEach((c) => { + const l = c.getValue(); + let h = r; + m(l) && m(h) && (h = $t(l, h)), c.setValue(h, !1); + }); + const a = this.getFittestIndex(r); + a !== this.index && (this.switchInstance(a), this.emit("change")); + }), this.value = s.getValue(), s.destroy(); + const n = this.getFittestIndex(this.value); + this.switchInstance(n); + } + switchInstance(t) { + this.index = t, this.activeInstance = this.instances[this.index], this.value = this.activeInstance.getValue(), this.emit("change"); + } + traverseSchema(t) { + const e = jt(t); + if (d(e)) { + const s = Vt(t), n = At(t); + this.ifThenElseShemas.push({ + if: e, + then: d(s) ? s : {} + }), this.ifThenElseShemas.push({ + if: e, + else: d(n) ? n : {} + }); } - - return html } - /** - * Container for screen reader announced messages - * @private + * Returns the index of the instance that has less validation errors */ - getPropertiesAriaLive () { - const html = document.createElement('div') - html.setAttribute('role', 'status') - html.setAttribute('aria-live', 'polite') - return html + getFittestIndex(t) { + let e = this.index; + return this.ifThenElseShemas.forEach((s, n) => { + const r = new w({ + schema: s.if, + data: t + }), a = r.getErrors(); + r.destroy(), a.length === 0 && s.then && (e = n), a.length > 0 && s.else && (e = n); + }), e; + } + destroy() { + this.instances.forEach((t) => { + t.destroy(); + }), super.destroy(); + } + getAllOfCombinations(t) { + const e = [], s = (r, a) => ({ ...r, ...a }), n = (r, a) => { + if (a.length === 0) { + e.push(r); + return; + } + const o = a[0]; + n(s(r, o), a.slice(1)), n(r, a.slice(1)); + }; + for (let r = 0; r < t.length; r++) + n(t[r], t.slice(r + 1)); + return e.sort((r, a) => Object.keys(r).length - Object.keys(a).length), e; + } +} +class He extends F { + setUI() { + this.ui = new Zt(this); + } + prepare() { + this.instances = [], this.activeInstance = null, this.activeInstanceChanged = !0, this.lastIndex = 0, this.index = 0, this.schemas = [], this.switcherOptionValues = [], this.switcherOptionsLabels = [], this.on("set-value", () => { + this.onSetValue(); + }); + const t = R(this.schema); + if (d($(this.schema)) || d(z(this.schema))) { + const s = d($(this.schema)) ? $(this.schema) : z(this.schema), n = T(this.schema); + delete n.anyOf, delete n.oneOf, delete n.options, s.forEach((r, a) => { + r = { ...n, ...r }, this.jedi.refParser && (r = this.jedi.refParser.expand(r)); + let o = "Option-" + (a + 1); + const c = f(r, "switcherTitle"), l = I(r); + d(l) && (o = l), d(c) && (o = c), this.switcherOptionValues.push(a), this.switcherOptionsLabels.push(o), this.schemas.push(r); + }); + } else if (x(t)) + t.forEach((s, n) => { + const r = K(this.schema), a = { + ...r, + type: s, + title: s[0].toUpperCase() + s.slice(1) + }; + d(r.title) && (a.title = r.title), this.switcherOptionValues.push(n), this.switcherOptionsLabels.push(s.charAt(0).toUpperCase() + s.slice(1)), this.schemas.push(a); + }); + else if (t === "any" || !t) { + const s = T(this.schema); + this.schemas = [ + { ...s, type: "object" }, + { ...s, type: "array" }, + { ...s, type: "string" }, + { ...s, type: "number" }, + { ...s, type: "integer" }, + { ...s, type: "boolean" }, + { ...s, type: "null" } + ], this.schemas.forEach((n, r) => { + this.switcherOptionValues.push(r); + }), this.switcherOptionsLabels = [ + "Object", + "Array", + "String", + "Number", + "Integer", + "Boolean", + "Null" + ]; + } + this.schemas.forEach((s) => { + const n = this.jedi.createInstance({ + jedi: this.jedi, + schema: s, + path: this.path, + parent: this.parent, + value: T(this.value) + }); + d(this.value) && n.setValue(this.value, !1), n.unregister(), n.on("change", () => { + this.activeInstanceChanged = !0, this.setValue(this.activeInstance.getValue()); + }), this.instances.push(n), this.register(); + }); + const e = d(this.if) ? this.getIfIndex(this.value) : this.getFittestIndex(this.value); + this.switchInstance(e, this.value); } - - /** - * A message that will be announced by screen reader - * @private - */ - getAriaLiveMessage (message) { - const html = document.createElement('p') - html.textContent = message - this.visuallyHidden(html) - return html + switchInstance(t, e) { + this.lastIndex = this.index, this.index = t, this.activeInstance = this.instances[t], d(e) && this.activeInstance.setValue(e, !1), this.setValue(this.activeInstance.getValue()); } - - /** - * Toggles the ObjectEditor properties wrapper visibility - * @private - */ - getPropertiesToggle (config) { - const toggle = this.getButton(config) - toggle.classList.add('jedi-properties-toggle') - - if (this.useToggleEvents) { - toggle.addEventListener('click', () => { - if (config.propertiesContainer.hasAttribute('style')) { - this.visuallyVisible(config.propertiesContainer) - } else { - this.visuallyHidden(config.propertiesContainer) - } - }) + onSetValue() { + if (Ot(this.activeInstance.getValue(), this.value) || this.activeInstanceChanged) { + this.activeInstanceChanged = !1; + const t = d(this.if) ? this.getIfIndex(this.value) : this.getFittestIndex(this.value); + this.switchInstance(t, this.value); + } + } + reassignValues() { + const t = this.instances[this.lastIndex].getValue(), e = this.activeInstance.getValue(); + if (m(t) && m(e)) { + const s = $t(e, t); + this.activeInstance.setValue(s, !1); } - - return toggle } - + getIfIndex(t) { + const e = new w({ schema: this.if, data: t }), s = e.getErrors(); + return e.destroy(), s.length === 0 ? 0 : 1; + } /** - * Wrapper for property activators - * @private + * Returns the index of the instance that has less validation errors */ - getPropertiesActivators () { - const html = document.createElement('div') - html.classList.add('jedi-properties-container') - return html + getFittestIndex(t) { + let e = 0, s, n; + for (const r of this.instances) { + const a = this.jedi.validator.getErrors(t, r.schema, r.getKey(), r.path); + (H(s) || H(n)) && (s = e, n = a), a.length < n.length && (s = e, n = a), e++; + } + return s; + } + destroy() { + this.instances.forEach((t) => { + t.destroy(); + }), super.destroy(); + } +} +class Rt extends U { + build() { + this.control = this.theme.getCheckboxControl({ + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.input.addEventListener("change", () => { + this.instance.setValue(this.control.input.checked); + }); + } + sanitize(t) { + return !!t; + } + refreshUI() { + this.refreshInteractiveElements(), this.control.input.checked = this.instance.getValue(); + } +} +class $e extends Rt { + build() { + this.control = this.theme.getRadiosControl({ + values: ["false", "true"], + titles: f(this.instance.schema, "enumTitles") || ["false", "true"], + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.radios.forEach((t) => { + t.addEventListener("change", () => { + const e = t.value === "true"; + this.instance.setValue(e); + }); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.radios.forEach((t) => { + const e = t.value === "true"; + t.checked = e === this.instance.getValue(); + }); + } +} +class Ke extends Rt { + build() { + this.control = this.theme.getSelectControl({ + values: ["false", "true"], + titles: f(this.instance.schema, "enumTitles") || ["false", "true"], + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.input.addEventListener("change", () => { + const t = this.control.input.value === "true"; + this.instance.setValue(t); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.input.value = this.instance.getValue() === !0 ? "true" : "false"; + } +} +class ze extends F { + setUI() { + const t = R(this.schema), e = q(this.schema); + t === "boolean" && e === "radio" ? this.ui = new $e(this) : t === "boolean" && e === "select" ? this.ui = new Ke(this) : t === "boolean" && (this.ui = new Rt(this)); + } +} +class Bt extends U { + build() { + this.propertyActivators = {}; + const t = this.instance.schema.options || {}; + let e = !0; + const s = St(this.instance.schema); + d(s) && s === !1 && (e = !1); + let n = !1; + d(this.instance.jedi.options.editableProperties) && (n = this.instance.jedi.options.editableProperties), d(t.editableProperties) && (n = t.editableProperties), this.control = this.theme.getObjectControl({ + title: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + id: S(this.instance.path), + description: j(this.instance.schema), + editableProperties: n, + addProperty: e + }); + } + addEventListeners() { + this.control.addPropertyBtn.addEventListener("click", () => { + const t = this.control.addPropertyControl.input.value.split(" ").join(""); + if (t.length === 0 || d(this.instance.value[t])) + return; + let n = {}; + const r = St(this.instance.schema); + d(r) && (n = r); + const a = this.instance.createChild(n, t); + a.activate(), this.instance.properties[t] = { schema: n }, this.instance.setValue(this.instance.value), this.control.addPropertyControl.input.value = ""; + const o = this.control.ariaLive; + o.innerHTML = ""; + const c = I(a.schema), l = d(c) ? c : t, h = this.theme.getAriaLiveMessage(); + h.textContent = l + " field was added to the form", o.appendChild(h); + }); + } + sanitize(t) { + return m(t) ? t : {}; + } + getInvalidFeedback(t) { + return this.theme.getAlert(t); + } + refreshPropertiesSlot() { + const t = f(this.instance.schema, "editableProperties"); + (wt(this.instance.jedi.options.editableProperties, !0) || wt(t, !0)) && Object.keys(this.instance.properties).forEach((e) => { + const s = this.instance.isRequired(e), n = this.instance.isDependentRequired(e), r = !s && !n, a = this.propertyActivators[e], o = this.control.ariaLive, c = this.instance.properties[e].schema, l = I(c), h = this.instance.path + this.instance.jedi.pathSeparator + e, u = S(h) + "-activator", p = d(l) ? l : e; + if (r && !a) { + const b = this.theme.getCheckboxControl({ + id: u, + label: p, + srOnly: !1 + }), E = b.input; + this.propertyActivators[e] = E, E.addEventListener("change", () => { + o.innerHTML = ""; + const y = this.theme.getAriaLiveMessage(); + E.checked ? (this.instance.getChild(e) || this.instance.createChild(c, e), this.instance.getChild(e).activate(), y.textContent = p + " field was added to the form", o.appendChild(y)) : (this.instance.getChild(e).deactivate(), y.textContent = p + " field was removed from the form", o.appendChild(y)); + }), this.control.propertiesActivators.appendChild(b.container); + } + const g = this.propertyActivators[e]; + g && (g.disabled = this.disabled, g.checked = D(this.instance.getValue(), e)); + }); + } + refreshEditors() { + this.instance.children.forEach((t) => { + t.isActive ? (t.ui.control.container.parentNode === null && this.control.childrenSlot.appendChild(t.ui.control.container), this.disabled || this.instance.isReadOnly() ? t.ui.disable() : t.ui.enable()) : t.ui.control.container.parentNode && t.ui.control.container.parentNode.removeChild(t.ui.control.container); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.refreshPropertiesSlot(), this.refreshEditors(); + } +} +class Je extends Bt { + refreshEditors() { + for (; this.control.childrenSlot.firstChild; ) + this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild); + let t = this.theme.getRow(); + this.control.childrenSlot.appendChild(t), this.instance.children.forEach((e) => { + if (e.isActive) { + const s = f(e.schema, "columns") || 12, n = f(e.schema, "offset") || 0, r = this.theme.getCol(12, s, n); + f(e.schema, "newRow") === !0 && (t = this.theme.getRow(), this.control.childrenSlot.appendChild(t)), t.appendChild(r), r.appendChild(e.ui.control.container), this.disabled || this.instance.isReadOnly() ? e.ui.disable() : e.ui.enable(); + } + }); + } +} +class Ge extends Bt { + init() { + super.init(), this.activeTabIndex = 0; + } + refreshEditors() { + for (; this.control.childrenSlot.firstChild; ) + this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild); + const t = this.instance.schema["x-control-cols"], e = this.instance.schema["x-control-stacked"], s = this.instance.schema["x-control-variant"], n = this.theme.getRow(), r = d(t) ? t : 3, a = this.theme.getCol(12, r), o = this.theme.getCol(12, 12 - r), c = this.theme.getTabContent(), l = this.theme.getTabList({ + stacked: d(e) ? e : !1, + type: d(s) ? s : "pils" + }); + this.control.childrenSlot.appendChild(n), n.appendChild(a), n.appendChild(o), a.appendChild(l), o.appendChild(c), this.instance.children.forEach((h, u) => { + if (h.isActive) { + const p = u === this.activeTabIndex, g = S(h.path), b = I(h.schema), E = this.theme.getTab({ + title: d(b) ? b : h.getKey(), + id: g, + active: p + }); + E.list.addEventListener("click", () => { + this.activeTabIndex = u; + }), this.theme.setTabPaneAttributes(h.ui.control.container, p, g), l.appendChild(E.list), c.appendChild(h.ui.control.container), this.disabled || this.instance.isReadOnly() ? h.ui.disable() : h.ui.enable(); + } + }); + } +} +class _e extends F { + setUI() { + const t = R(this.schema), e = q(this.schema), s = this.schema["x-control"]; + t === "object" && e === "grid" ? this.ui = new Je(this) : t === "object" && s === "nav" ? this.ui = new Ge(this) : this.ui = new Bt(this); + } + prepare() { + this.properties = {}; + const t = Mt(this.schema); + d(t) && Object.keys(t).forEach((e) => { + const s = t[e]; + this.properties[e] = { schema: s }; + let n = !0; + const r = f(this.schema, "deactivateNonRequired"), a = f(s, "deactivateNonRequired"); + this.isNotRequired(e) && d(r) && r === !0 && (n = !1), this.isNotRequired(e) && d(a) && a === !0 && (n = !1), n && this.createChild(s, e); + }), this.refreshInstances(), this.on("set-value", () => { + this.refreshInstances(); + }); } - /** - * Wrapper buttons - * @private + * Returns true if the property is required */ - getBtnGroup () { - const html = document.createElement('span') - html.style.display = 'initial' - return html + isRequired(t) { + const e = Qt(this.schema); + return d(e) && e.includes(t); } - /** - * A button - * @private + * Returns true if the property is dependent required */ - getButton (config) { - const button = document.createElement('button') - button.setAttribute('type', 'button') - - if (config.value) { - button.value = config.value + isDependentRequired(t) { + const e = Jt(this.schema); + if (d(e)) { + let s = []; + return Object.keys(e).forEach((n) => { + d(this.value[n]) && (s = e[n].filter((a) => !D(this.value, a))); + }), s.includes(t); } - - if (config.id) { - button.setAttribute('id', config.id) - } - - const text = document.createElement('span') - text.textContent = config.textContent - - if (this.icons && config.icon) { - const icon = this.getIcon(config.icon) - icon.setAttribute('title', config.textContent) - button.appendChild(icon) - this.visuallyHidden(text) + return !1; + } + createChild(t, e, s) { + const n = this.jedi.createInstance({ + jedi: this.jedi, + schema: t, + path: this.path + this.jedi.pathSeparator + e, + parent: this, + value: T(s) + }); + this.children.push(n), this.value[e] = n.getValue(); + const r = f(this.schema, "deactivateNonRequired"); + return this.isNotRequired(e) && d(r) && r === !0 && n.deactivate(), n; + } + isNotRequired(t) { + return !this.isRequired(t) && !this.isDependentRequired(t); + } + deleteChild(t) { + for (let e = this.children.length - 1; e >= 0; e--) { + const s = this.children[e]; + s.getKey() === t && (s.destroy(), this.children.splice(e, 1), this.onChildChange()); + } + } + getChild(t) { + return this.children.find((e) => t === e.getKey().split(this.jedi.pathSeparator).pop()); + } + onChildChange() { + const t = {}; + this.children.forEach((e) => { + e.isActive && (t[e.getKey()] = e.getValue()); + }), this.setValue(t); + } + refreshInstances() { + const t = this.getValue(); + if (m(t)) { + Object.keys(t).forEach((e) => { + const s = this.getChild(e); + if (s) { + s.activate(); + const n = s.getValue(), r = t[s.getKey()]; + Ot(n, r) && s.setValue(r, !1); + } else + this.createChild({}, e, t[e]); + }); + for (let e = this.children.length - 1; e >= 0; e--) { + const s = this.children[e], n = s.getKey(); + H(t[n]) && (this.getChild(n) ? s.deactivate() : this.deleteChild(n)); + } } - - button.appendChild(text) - - return button } - - /** - * Array "add" item button - * @private - */ - getArrayBtnAdd () { - const html = this.getButton({ - textContent: 'Add item into', - icon: 'add' - }) - html.classList.add('jedi-array-add') - return html - } - - getAddPropertyButton () { - const html = this.getButton({ - textContent: 'Add property' - }) - html.classList.add('jedi-add-property-btn') - return html - } - - /** - * Array "delete" item button - * @private - */ - getDeleteItemBtn () { - const deleteItemBtn = this.getButton({ - textContent: 'Delete item', - icon: 'delete' - }) - - deleteItemBtn.classList.add('jedi-array-delete') - - return deleteItemBtn - } - - /** - * Array "move up" item button - * @private - */ - getMoveUpItemBtn () { - const moveUpItemBtn = this.getButton({ - textContent: 'Move up', - icon: 'moveUp' - }) - - moveUpItemBtn.classList.add('jedi-array-move-up') - - return moveUpItemBtn - } - - /** - * Array "move down" item button - * @private - */ - getMoveDownItemBtn () { - const moveDownItemBtn = this.getButton({ - textContent: 'Move down', - icon: 'moveDown' - }) - - moveDownItemBtn.classList.add('jedi-array-move-down') - - return moveDownItemBtn - } - - /** - * Wrapper for the editor description - * @private - */ - getDescription (config) { - const description = document.createElement('small') - description.textContent = config.textContent - return description +} +class te extends U { + build() { + this.control = this.theme.getArrayControl({ + title: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + id: S(this.instance.path), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.addBtn.addEventListener("click", () => { + this.instance.addItem(); + }); + } + getInvalidFeedback(t) { + return this.theme.getAlert(t); + } + sanitize(t) { + return x(t) ? t : []; + } + refreshUI() { + this.refreshInteractiveElements(); + const t = _t(this.instance.schema), e = Wt(this.instance.schema); + d(t) && t === this.instance.value.length && this.control.addBtn.setAttribute("disabled", ""), this.control.childrenSlot.innerHTML = "", this.instance.children.forEach((s) => { + const n = Number(s.getKey()), r = this.theme.getDeleteItemBtn(), a = this.theme.getMoveUpItemBtn(), o = this.theme.getMoveDownItemBtn(); + s.ui.control.arrayActions.innerHTML = "", s.ui.control.arrayActions.appendChild(r), s.ui.control.arrayActions.appendChild(a), s.ui.control.arrayActions.appendChild(o), this.control.childrenSlot.appendChild(s.ui.control.container), r.addEventListener("click", () => { + const c = Number(s.path.split(this.instance.jedi.pathSeparator).pop()); + this.instance.deleteItem(c); + }), a.addEventListener("click", () => { + const c = n - 1; + this.instance.move(n, c); + }), o.addEventListener("click", () => { + const c = n + 1; + this.instance.move(n, c); + }), this.disabled || this.instance.isReadOnly() ? s.ui.disable() : s.ui.enable(), d(e) && this.instance.value.length <= e && r.setAttribute("disabled", ""); + }); + } +} +class We extends te { + init() { + super.init(), this.activeTabIndex = 0; + } + addEventListeners() { + this.control.addBtn.addEventListener("click", () => { + this.activeTabIndex = this.instance.value.length, this.instance.addItem(); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.childrenSlot.innerHTML = ""; + const t = f(this.instance.schema, "navCols"), e = f(this.instance.schema, "navStacked"), s = f(this.instance.schema, "navType"), n = this.theme.getRow(), r = d(t) ? t : 3, a = this.theme.getCol(12, r), o = this.theme.getCol(12, 12 - r), c = this.theme.getTabContent(), l = this.theme.getTabList({ + stacked: d(e) ? e : !1, + type: d(s) ? s : "pils" + }); + this.control.childrenSlot.appendChild(n), n.appendChild(a), n.appendChild(o), a.appendChild(l), o.appendChild(c), this.instance.children.forEach((h, u) => { + const p = this.theme.getDeleteItemBtn(), g = this.theme.getMoveUpItemBtn(), b = this.theme.getMoveDownItemBtn(); + h.ui.control.arrayActions.innerHTML = "", h.ui.control.arrayActions.appendChild(p), h.ui.control.arrayActions.appendChild(g), h.ui.control.arrayActions.appendChild(b), this.control.childrenSlot.appendChild(h.ui.control.container); + let E; + const y = f(this.instance.schema, "itemTemplate"); + if (y) { + const P = y, gt = { + i0: u, + i1: u + 1, + value: h.getValue() + }; + E = C(P, gt); + } else { + const P = I(h.schema); + E = d(P) ? P + " " + (u + 1) : h.getKey(); + } + p.addEventListener("click", () => { + this.activeTabIndex = re(u - 1, 0, this.instance.value.length - 1), this.instance.deleteItem(u); + }), g.addEventListener("click", () => { + const P = u - 1; + this.activeTabIndex = P, this.instance.move(u, P); + }), b.addEventListener("click", () => { + const P = u + 1; + this.activeTabIndex = P, this.instance.move(u, P); + }); + const L = u === this.activeTabIndex, N = S(h.path), M = this.theme.getTab({ + title: E, + id: N, + active: L + }); + M.list.addEventListener("click", () => { + this.activeTabIndex = u; + }), this.theme.setTabPaneAttributes(h.ui.control.container, L, N), l.appendChild(M.list), c.appendChild(h.ui.control.container), this.disabled || this.instance.isReadOnly() ? h.ui.disable() : h.ui.enable(), u === 0 && g.setAttribute("disabled", ""), this.instance.value.length - 1 === u && b.setAttribute("disabled", ""); + }); + } +} +class Qe extends F { + setUI() { + const t = R(this.schema), e = q(this.schema); + t === "array" && e === "nav" ? this.ui = new We(this) : this.ui = new te(this); + } + prepare() { + this.refreshChildren(), this.on("set-value", () => { + this.refreshChildren(); + }); + } + createItemInstance(t) { + let e; + const s = this.children.length, n = Gt(this.schema), r = kt(this.schema); + e = d(n) ? n : {}, d(r) && d(r[s]) && (e = r[s]); + const o = this.jedi.createInstance({ + jedi: this.jedi, + schema: e, + path: this.path + this.jedi.pathSeparator + s, + parent: this, + value: T(t) + }); + return d(t) && o.setValue(t, !1), o; + } + move(t, e) { + const s = T(this.getValue()), n = s[t]; + s.splice(t, 1), s.splice(e, 0, n), this.setValue(s); + } + addItem() { + const t = this.createItemInstance(), e = T(this.getValue()); + e.push(t.getValue()), t.destroy(), this.setValue(e); + } + deleteItem(t) { + const s = T(this.getValue()).filter((n, r) => r !== t); + this.setValue(s); + } + onChildChange() { + const t = []; + this.children.forEach((e) => { + t.push(e.getValue()); + }), this.setValue(t); + } + refreshChildren() { + this.children = []; + const t = this.getValue(); + x(t) && t.forEach((e) => { + const s = this.createItemInstance(e); + this.children.push(s); + }); + } +} +class qt extends U { + build() { + const t = ["hidden", "color", "date", "datetime-local", "email", "number", "month", "password", "search", "time", "tel", "text", "textarea", "url", "week"], e = q(this.instance.schema); + this.control = this.theme.getInputControl({ + type: t.includes(e) ? e : "text", + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle") || e === "hidden", + description: j(this.instance.schema) + }), e === "color" && this.instance.value.length === 0 && this.instance.setValue("#000000", !1); } - - /** - * Object control is a card containing multiple editors. - * Each editor is mapped to an object instance property. - * Properties can be added, activated and deactivated depending on configuration - * @private - */ - getObjectControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - const body = this.getCardBody() - const ariaLive = this.getPropertiesAriaLive() - - const description = this.getDescription({ - textContent: config.description - }) - - const messages = this.getMessagesSlot() - const childrenSlot = this.getChildrenSlot() - - const propertiesContainer = this.getPropertiesSlot({ - id: 'properties-slot-' + config.id - }) - - const propertiesToggle = this.getPropertiesToggle({ - textContent: config.title + ' ' + 'properties', - id: 'properties-slot-toggle-' + config.id, - icon: 'properties', - propertiesContainer: propertiesContainer - }) - - const propertiesActivators = this.getPropertiesActivators() - - const addPropertyControl = this.getInputControl({ - type: 'text', - id: 'jedi-add-property-input-' + config.id, - label: 'Property' - }) - - const addPropertyBtn = this.getAddPropertyButton() - - const fieldset = this.getFieldset() - const legend = this.getLegend({ - textContent: config.title, - id: config.id - }) - - addPropertyBtn.classList.add('jedi-object-add') - - container.appendChild(fieldset) - fieldset.appendChild(legend) - fieldset.appendChild(body) - body.appendChild(description) - body.appendChild(messages) - legend.appendChild(actions) - actions.appendChild(arrayActions) - body.appendChild(propertiesContainer) - body.appendChild(childrenSlot) - - if (config.addProperty) { - propertiesContainer.appendChild(addPropertyControl.container) - propertiesContainer.appendChild(addPropertyBtn) - } - - if (config.editableProperties) { - actions.appendChild(propertiesToggle) - propertiesContainer.appendChild(ariaLive) - propertiesContainer.appendChild(propertiesActivators) - } - - return { - container, - body, - actions, - messages, - childrenSlot, - propertiesToggle, - propertiesContainer, - addPropertyControl, - addPropertyBtn, - ariaLive, - propertiesActivators, - arrayActions - } + addEventListeners() { + this.control.input.addEventListener("change", () => { + this.instance.setValue(this.control.input.value); + }); } - - /** - * Array control is a card containing multiple editors. - * Items can bve added, deleted or moved up or down. - * @private - */ - getArrayControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - const body = this.getCardBody() - - const description = this.getDescription({ - textContent: config.description - }) - - const messages = this.getMessagesSlot() - const childrenSlot = this.getChildrenSlot() - const btnGroup = this.getBtnGroup() - const addBtn = this.getArrayBtnAdd() - const fieldset = this.getFieldset() - const legend = this.getLegend({ - textContent: config.title, - id: config.id - }) - - container.appendChild(fieldset) - fieldset.appendChild(legend) - fieldset.appendChild(body) - body.appendChild(description) - body.appendChild(messages) - legend.appendChild(actions) - actions.appendChild(btnGroup) - btnGroup.appendChild(addBtn) - actions.appendChild(arrayActions) - body.appendChild(childrenSlot) - - return { - container, - body, - actions, - messages, - childrenSlot, - btnGroup, - addBtn, - arrayActions - } + sanitize(t) { + return String(t); } - - /** - * Multiple control is a card containing multiple editors options that can be - * selected with a switcher control. Only one editor can be active/visible - * at a time - * @private - */ - getMultipleControl (config) { - const container = document.createElement('div') - const card = this.getCard() - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - - const header = this.getCardHeader({ - textContent: config.title, - srOnly: config.srOnly - }) - - const body = this.getCardBody() - - const description = this.getDescription({ - textContent: config.description - }) - - const messages = this.getMessagesSlot() - - const childrenSlot = this.getChildrenSlot() - - const switcher = this.getSwitcher({ - values: config.switcherOptionValues, - titles: config.switcherOptionsLabels, - id: config.id + '-switcher', - label: config.id + '-switcher', - srOnly: true, - readOnly: config.readOnly - }) - - switcher.container.classList.add('jedi-switcher') - - container.appendChild(description) - container.appendChild(card) - card.appendChild(header) - card.appendChild(body) - header.appendChild(actions) - actions.appendChild(arrayActions) - actions.appendChild(switcher.container) - body.appendChild(messages) - body.appendChild(childrenSlot) - - return { - container, - card, - header, - body, - actions, - messages, - childrenSlot, - switcher, - arrayActions - } + refreshUI() { + this.refreshInteractiveElements(), this.control.input.value = this.instance.getValue(); } - - /** - * Control for NullEditor - * @private - */ - getCircularControl () { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - const description = document.createElement('div') - const messages = this.getMessagesSlot() - - description.textContent = 'CIRCULAR' - - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - - return { container, description, messages, actions, arrayActions } - } - - /** - * Control for NullEditor - * @private - */ - getNullControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - - const label = document.createElement('label') - label.setAttribute('for', config.id) - - const labelText = document.createElement('span') - labelText.textContent = config.label - - if (config.srOnly) { - this.visuallyHidden(label) - } - - const descriptionId = config.id + '-description' - const description = document.createElement('div') - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } - - const messages = this.getMessagesSlot() - - container.appendChild(label) - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - label.appendChild(labelText) - - return { container, label, labelText, description, messages, actions, arrayActions } - } - - /** - * A Textarea - * @private - */ - getTextareaControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - - const input = document.createElement('textarea') - input.setAttribute('id', config.id) - input.style.width = '100%' - - const label = document.createElement('label') - label.setAttribute('for', config.id) - - const labelText = document.createElement('span') - labelText.textContent = config.label - - if (config.srOnly) { - this.visuallyHidden(label) - } - - const description = document.createElement('div') - const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } - - const messages = this.getMessagesSlot() - const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) - - const describedBy = messagesId + ' ' + descriptionId - input.setAttribute('aria-describedby', describedBy) - - container.appendChild(label) - container.appendChild(input) - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - label.appendChild(labelText) - - return { container, input, label, labelText, description, messages, actions, arrayActions } - } - - /** - * An Input control - * @private - */ - getInputControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - - const input = document.createElement('input') - input.setAttribute('type', config.type) - input.setAttribute('id', config.id) - input.style.width = '100%' - - const label = document.createElement('label') - label.setAttribute('for', config.id) - - const labelText = document.createElement('span') - labelText.textContent = config.label - - if (config.srOnly) { - this.visuallyHidden(label) - } - - const description = document.createElement('div') - const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } - - const messages = this.getMessagesSlot() - const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) - - const describedBy = messagesId + ' ' + descriptionId - input.setAttribute('aria-describedby', describedBy) - - container.appendChild(label) - container.appendChild(input) - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - label.appendChild(labelText) - - return { container, input, label, labelText, description, messages, actions, arrayActions } - } - +} +class Xe extends qt { + build() { + this.control = this.theme.getRadiosControl({ + values: k(this.instance.schema), + titles: f(this.instance.schema, "enumTitles") || k(this.instance.schema), + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.radios.forEach((t) => { + t.addEventListener("change", () => { + this.instance.setValue(t.value); + }); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.radios.forEach((t) => { + t.checked = t.value === this.instance.getValue(); + }); + } +} +class Ye extends qt { + build() { + this.control = this.theme.getSelectControl({ + values: k(this.instance.schema), + titles: f(this.instance.schema, "enumTitles") || k(this.instance.schema), + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }), this.control.input.addEventListener("change", () => { + this.instance.setValue(this.control.input.value); + }); + } +} +class Ze extends U { + build() { + this.control = this.theme.getTextareaControl({ + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle") || q(this.instance.schema) === "hidden", + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.input.addEventListener("change", () => { + this.instance.setValue(this.control.input.value); + }); + } + sanitize(t) { + return String(t); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.input.value = this.instance.getValue(); + } +} +class ts extends F { + setUI() { + const t = R(this.schema), e = k(this.schema), s = q(this.schema); + t === "string" && d(e) && s === "radio" ? this.ui = new Xe(this) : t === "string" && s === "textarea" ? this.ui = new Ze(this) : t === "string" && d(e) ? this.ui = new Ye(this) : t === "string" && (this.ui = new qt(this)); + } +} +class Nt extends U { + build() { + this.control = this.theme.getInputControl({ + type: "number", + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle") || q(this.instance.schema) === "hidden", + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.input.addEventListener("change", () => { + const t = this.sanitize(this.control.input.value); + this.instance.setValue(t); + }); + } + sanitize(t) { + return R(this.instance.schema) === "integer" ? Math.floor(Number(t)) : Number(t); + } + refreshUI() { + this.refreshInteractiveElements(); + const t = this.instance.getValue(); + A(t) && (this.control.input.value = this.instance.getValue()); + } +} +class es extends Nt { + build() { + this.control = this.theme.getRadiosControl({ + values: k(this.instance.schema), + titles: f(this.instance.schema, "enumTitles") || k(this.instance.schema), + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.radios.forEach((t) => { + t.addEventListener("change", () => { + const e = this.sanitize(t.value); + this.instance.setValue(e); + }); + }); + } + refreshUI() { + this.refreshInteractiveElements(), this.control.radios.forEach((t) => { + t.checked = Number(t.value) === Number(this.instance.getValue()); + }); + } +} +class ss extends Nt { + build() { + this.control = this.theme.getSelectControl({ + values: k(this.instance.schema), + titles: f(this.instance.schema, "enumTitles") || k(this.instance.schema), + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle"), + description: j(this.instance.schema) + }); + } + addEventListeners() { + this.control.input.addEventListener("change", () => { + const t = this.sanitize(this.control.input.value); + this.instance.setValue(t); + }); + } +} +class is extends F { + setUI() { + const t = R(this.schema), e = k(this.schema), s = q(this.schema), n = t === "number" || t === "integer"; + n && d(e) && s === "radio" ? this.ui = new es(this) : n && d(e) ? this.ui = new ss(this) : n && (this.ui = new Nt(this)); + } +} +class ns extends U { + build() { + this.control = this.theme.getNullControl({ + id: S(this.instance.path), + label: I(this.instance.schema) || this.instance.getKey(), + srOnly: f(this.instance.schema, "hideTitle") || q(this.instance.schema) === "hidden", + description: j(this.instance.schema) + }); + } + sanitize() { + return null; + } +} +class rs extends F { + setUI() { + this.ui = new ns(this); + } +} +class as extends Yt { /** - * A radio group control - * @private + * Creates a Jedi instance. + * @param {object} options - Options object + * @param {object|boolean} options.schema - A JSON schema + * @param {boolean} options.isEditor - Generates UI controls to edit the JSON value + * @param {boolean} options.container - Where the UI controls will be rendered + * @param {string} options.theme - How the UI controls will be rendered */ - getRadiosControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - const fieldset = this.getFieldset() - const messages = this.getMessagesSlot() - const body = this.getCardBody() - const legend = this.getLegend({ - id: config.label - }) - - const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) - - const description = document.createElement('div') - const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.srOnly) { - this.visuallyHidden(legend) - } - - const radioControls = [] - const radios = [] - const labels = [] - const labelTexts = [] - - config.values.forEach((value, index) => { - const radioControl = document.createElement('div') - radioControls.push(radioControl) - - const radio = document.createElement('input') - radio.setAttribute('type', 'radio') - radio.setAttribute('id', config.id + '-' + index) - radio.setAttribute('value', value) - radios.push(radio) - - const describedBy = messagesId + ' ' + descriptionId - radio.setAttribute('aria-describedby', describedBy) - - const label = document.createElement('label') - label.setAttribute('for', config.id + '-' + index) - - const labelText = document.createElement('span') - labelTexts.push(labelText) - - if (config.titles && config.titles[index]) { - labelText.textContent = config.titles[index] - } - - labels.push(label) - }) - - if (config.description) { - description.textContent = config.description - } - - if (config.label) { - legend.textContent = config.label - } - - container.appendChild(fieldset) - container.appendChild(actions) - fieldset.appendChild(legend) - fieldset.appendChild(body) - actions.appendChild(arrayActions) - - radioControls.forEach((radioControl, index) => { - body.appendChild(radioControls[index]) - radioControl.appendChild(radios[index]) - radioControl.appendChild(labels[index]) - labels[index].appendChild(labelTexts[index]) - }) - - fieldset.appendChild(description) - fieldset.appendChild(messages) - - return { container, fieldset, legend, body, radios, labels, labelTexts, radioControls, description, messages, actions, arrayActions } - } - + constructor(t) { + super(), this.options = Object.assign({ + container: null, + refParser: null, + isEditor: !1, + editableProperties: !1, + schema: {}, + showErrors: "change", + data: void 0, + validateFormat: !1 + }, t), this.rootName = "#", this.pathSeparator = "/", this.instances = {}, this.root = null, this.theme = null, this.validator = null, this.schema = {}, this.refParser = this.options.refParser ? this.options.refParser : null, this.init(); + } /** - * A checkbox control + * Initializes instance properties * @private */ - getCheckboxControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - - const formGroup = document.createElement('div') - - const input = document.createElement('input') - input.setAttribute('type', 'checkbox') - input.setAttribute('id', config.id) - - const label = document.createElement('label') - label.setAttribute('for', config.id) - - const labelText = document.createElement('span') - labelText.textContent = config.label - - if (config.srOnly) { - this.visuallyHidden(label) - } - - const description = document.createElement('div') - const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } - - const messages = this.getMessagesSlot() - const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) - - const describedBy = messagesId + ' ' + descriptionId - input.setAttribute('aria-describedby', describedBy) - - container.appendChild(formGroup) - container.appendChild(actions) - actions.appendChild(arrayActions) - formGroup.appendChild(input) - formGroup.appendChild(label) - label.appendChild(labelText) - formGroup.appendChild(description) - formGroup.appendChild(messages) - - return { container, formGroup, input, label, labelText, description, messages, actions, arrayActions } - } - + init() { + this.schema = this.options.schema, this.validator = new Te({ refParser: this.refParser, validateFormat: this.options.validateFormat }), this.root = this.createInstance({ + jedi: this, + schema: this.options.schema, + path: this.rootName + }), d(this.options.data) && this.root.setValue(this.options.data, !1), this.options.isEditor && this.options.container && (this.container = this.options.container, this.appendHiddenInput(), this.container.appendChild(this.root.ui.control.container), this.container.classList.add("jedi-ready")), this.bindEventListeners(); + } + bindEventListeners() { + this.root && this.root.on("change", () => { + this.emit("change"); + }), this.hiddenInput && this.on("change", () => { + this.hiddenInput.value = JSON.stringify(this.getValue()); + }); + } /** - * A select control + * Appends a hidden input to the root container whose value will be the value + * of the root instance. * @private */ - getSelectControl (config) { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - - const input = document.createElement('select') - input.setAttribute('id', config.id) - input.style.width = '100%' - - config.values.forEach((value, index) => { - const option = document.createElement('option') - option.setAttribute('value', value) - - if (config.titles && config.titles[index]) { - option.textContent = config.titles[index] - } - - input.appendChild(option) - }) - - const label = document.createElement('label') - label.setAttribute('for', config.id) - - const labelText = document.createElement('span') - labelText.textContent = config.label - - if (config.srOnly) { - this.visuallyHidden(label) - } - - const description = document.createElement('div') - const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } - - const messages = this.getMessagesSlot() - const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) - - const describedBy = messagesId + ' ' + descriptionId - input.setAttribute('aria-describedby', describedBy) - - container.appendChild(label) - container.appendChild(input) - label.appendChild(labelText) - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - - return { container, input, label, labelText, description, messages, actions, arrayActions } - } - + appendHiddenInput() { + const t = this.root.ui.theme.getInputControl({ + type: "hidden", + id: "jedi-hidden-input" + }); + this.hiddenInput = t.input, this.hiddenInput.setAttribute("name", "json"), this.hiddenInput.removeAttribute("aria-describedby"), this.container.appendChild(this.hiddenInput), this.hiddenInput.value = JSON.stringify(this.getValue()); + } /** - * Control to switch between multiple editors options + * Adds a child instance pointer to the instances list * @private */ - getSwitcher (config) { - return this.getSelectControl(config) + register(t) { + this.instances[t.path] = t; } - /** - * Another type of error message container used for more complex editors like - * object, array and multiple editors + * Deletes a child instance pointer from the instances list * @private */ - getAlert (config) { - return this.getInvalidFeedback(config) + unregister(t) { + this.instances[t.path] = null, delete this.instances[t.path]; } - - /** - * Error messages - * @public - */ - getInvalidFeedback (config) { - const html = document.createElement('div') - const invalidFeedbackText = document.createElement('span') - const invalidFeedbackIcon = document.createElement('small') - invalidFeedbackText.textContent = config.message - invalidFeedbackIcon.textContent = '❌ ' - invalidFeedbackIcon.classList.add('jedi-error-message') - invalidFeedbackIcon.setAttribute('aria-hidden', 'true') - html.classList.add('jedi-error-message') - html.appendChild(invalidFeedbackIcon) - html.appendChild(invalidFeedbackText) - return html - } - /** - * Container for columns + * Creates a json instance and dereference schema on the fly if needed. * @private */ - getRow () { - const row = document.createElement('div') - row.classList.add('jedi-row') - return row + createInstance(t) { + this.refParser && (t.schema = this.refParser.expand(t.schema, t.path)); + const e = R(t.schema), s = z(t.schema), n = $(t.schema), r = jt(t.schema), a = Vt(t.schema), o = At(t.schema); + if (d(n) || d(s) || e === "any" || x(e) || H(e)) + return new He(t); + if (d(r) && (d(a) || d(o))) + return new Ue(t); + if (e === "object") + return new _e(t); + if (e === "array") + return new Qe(t); + if (e === "string") + return new ts(t); + if (e === "number" || e === "integer") + return new is(t); + if (e === "boolean") + return new ze(t); + if (e === "null") + return new rs(t); } - /** - * A column to contain content to a specific width - * @private + * Returns the value of the root instance + * @return {*} */ - getCol (xs, md, offsetMd) { - const col = document.createElement('div') - col.classList.add('jedi-col-xs-' + xs) - col.classList.add('jedi-col-md-' + md) - - if (offsetMd) { - col.classList.add('jedi-col-md-offset-' + offsetMd) - } - - return col + getValue() { + return this.root.getValue(); } - /** - * Tab list is a list of links that triggers tabs visibility ne at the time - * @private + * Sets the value of the root instance */ - getTabList () { - const tabList = document.createElement('ul') - tabList.classList.add('jedi-nav-list') - return tabList + setValue() { + this.root.setValue(...arguments); } - /** - * A Tab is a wrapper for content - * @private + * Returns an instance by path + * @return {*} */ - getTab (config) { - const list = document.createElement('li') - const link = document.createElement('a') - link.classList.add('jedi-nav-link') - link.setAttribute('href', '#' + config.id) - link.textContent = config.title - list.appendChild(link) - return { list, link } - } - + getInstance(t) { + return this.instances[t]; + } /** - * Wrapper for tabs - * @private + * Disables the root instance and it's children user interfaces */ - getTabContent () { - const tabContent = document.createElement('div') - tabContent.classList.add('tab-content') - return tabContent + disable() { + this.root.ui.disable(); } - /** - * Set tab attributes to make it toggleable - * @private + * Enables the root instance and it's children user interfaces */ - setTabPaneAttributes (element, active, id) { - element.setAttribute('id', id) - element.classList.add('jedi-tab-pane') + enable() { + this.root.ui.enable(); } - /** - * Makes an element visually hidden - * @private + * Returns an array of validation error messages */ - visuallyHidden (element) { - element.setAttribute('style', 'position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;') + getErrors() { + let t = []; + return Object.keys(this.instances).forEach((e) => { + const s = this.instances[e]; + t = [...t, ...s.getErrors()]; + }), t; } - /** - * Reveals a visually hidden element - * @private + * Destroy the root instance and it's children */ - visuallyVisible (element) { - element.removeAttribute('style') - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Theme); - - -/***/ }), - -/***/ "./src/validation/constrains/additionalProperties.js": -/*!***********************************************************!*\ - !*** ./src/validation/constrains/additionalProperties.js ***! - \***********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ additionalProperties: () => (/* binding */ additionalProperties) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); -/** - * constrains additionalProperties - */ - - - - - - -function additionalProperties (validator, value, schema, key, path) { - let errors = [] - const schemaAdditionalProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAdditionalProperties)(schema) - const schemaPatternProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaPatternProperties)(schema) - const schemaProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaProperties)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaAdditionalProperties)) { - const properties = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaProperties) ? schemaProperties : {} - const additionalProperties = schemaAdditionalProperties - const patternProperties = schemaPatternProperties - - if (properties) { - Object.keys(value).forEach((property) => { - let definedInPatternProperty = false - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(patternProperties)) { - Object.keys(patternProperties).forEach((pattern) => { - const regexp = new RegExp(pattern) - definedInPatternProperty = regexp.test(property) - }) - } - - if (!definedInPatternProperty && additionalProperties === false && !(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(properties, property)) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorAdditionalProperties, { - property: property - }) - ], - path: path, - constrain: 'additionalProperties' - }) - } - - if (!definedInPatternProperty && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(additionalProperties) && !(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(properties, property)) { - const editor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ - refParser: validator.refParser, - schema: additionalProperties, - data: value[property] - }) - - const additionalPropertyErrors = editor.getErrors().map((error) => { - return { - messages: error.messages, - path: property, - constrain: 'additionalProperties' - } - }) - - errors = [...errors, ...additionalPropertyErrors] - - editor.destroy() - } - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/allOf.js": -/*!********************************************!*\ - !*** ./src/validation/constrains/allOf.js ***! - \********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ allOf: () => (/* binding */ allOf) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -function allOf (validator, value, schema, key) { - let errors = [] - const allOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAllOf)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(allOf)) { - allOf.forEach((schema) => { - const subSchemaEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ refParser: validator.refParser, schema: schema, data: value, rootName: key }) - const subSchemaErrors = subSchemaEditor.getErrors() - subSchemaEditor.destroy() - errors = [...errors, ...subSchemaErrors] - errors = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.removeDuplicatesFromArray)(errors) - }) - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/anyOf.js": -/*!********************************************!*\ - !*** ./src/validation/constrains/anyOf.js ***! - \********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ anyOf: () => (/* binding */ anyOf) -/* harmony export */ }); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - - -function anyOf (validator, value, schema, key, path) { - const errors = [] - const anyOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAnyOf)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(anyOf)) { - let valid = false - - anyOf.forEach((schema) => { - const anyOfEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_0__["default"]({ refParser: validator.refParser, schema: schema, data: value }) - const anyOfErrors = anyOfEditor.getErrors() - anyOfEditor.destroy() - - if (anyOfErrors.length === 0) { - valid = true - } - }) - - if (!valid) { - errors.push({ - messages: [ - _i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorAnyOf - ], - path: path, - constrain: 'anyOf' - }) - } + destroy() { + this.root.destroy(), this.options.isEditor && (this.container.innerHTML = ""), Object.keys(this).forEach((t) => { + delete this[t]; + }); } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/const.js": -/*!********************************************!*\ - !*** ./src/validation/constrains/const.js ***! - \********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ _const: () => (/* binding */ _const) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function _const (validator, value, schema, key, path) { - const errors = [] - const schemaConst = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaConst)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaConst)) { - const valueIsNotEqualConst = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.different)(value, schemaConst) - const invalid = (valueIsNotEqualConst) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorConst, { - const: JSON.stringify(schemaConst) - }) - ], - path: path, - constrain: 'const' - }) - } +} +const w = as; +class os { + constructor() { + this.refs = {}; } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/contains.js": -/*!***********************************************!*\ - !*** ./src/validation/constrains/contains.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ contains: () => (/* binding */ contains) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - - -function contains (validator, value, schema, key, path) { - const errors = [] - const contains = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaContains)(schema) - const minContains = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaMinContains)(schema) - const maxContains = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaMaxContains)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(contains)) { - let counter = 0 - - value.forEach((item) => { - const containsEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ refParser: validator.refParser, schema: contains, data: item }) - const containsErrors = containsEditor.getErrors() - - if (containsErrors.length === 0) { - counter++ - } - - containsEditor.destroy() - }) - - const containsInvalid = (counter === 0) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(minContains)) { - const minContainsInvalid = (counter < minContains) - - if (minContainsInvalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorMinContains, { - counter: counter, - minContains: minContains - }) - ], - path: path, - constrain: 'minContains' - }) - } - } else { - if (containsInvalid) { - errors.push({ - messages: [_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorContains], - path: path, - constrain: 'contains' - }) - } - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(maxContains)) { - const maxContainsInvalid = (counter > maxContains) - - if (maxContainsInvalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorMaxContains, { - counter: counter, - maxContains: maxContains - }) - ], - path: path, - constrain: 'maxContains' - }) - } - } + async dereference(t) { + await this.traverseExternal(t), this.traverseLocal(t); } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/dependentRequired.js": -/*!********************************************************!*\ - !*** ./src/validation/constrains/dependentRequired.js ***! - \********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ dependentRequired: () => (/* binding */ dependentRequired) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function dependentRequired (validator, value, schema, key, path) { - const errors = [] - const dependentRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaDependentRequired)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(dependentRequired)) { - let missingProperties = [] - - Object.keys(dependentRequired).forEach((key) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(value[key])) { - const requiredProperties = dependentRequired[key] - - missingProperties = requiredProperties.filter((property) => { - return !(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(value, property) - }) + /** + * Traverses the given schema recursively and for each schema with $ref + * add a new property in the this.refs object with key being the json path to that schema. + * Initially the added properties will habe a value of null. This value will be later + * replaced with the resolved schema for that json path using resolveExternal() and resolveLocal(). + * + * It also adds a new property in the this.refs object with key being the json path to that schema + * and value being the schema. + * @param schema + * @param path + */ + async traverseExternal(t, e = "#") { + if (!(typeof t != "object" || t === null)) + for (const [s, n] of Object.entries(t)) { + const r = e ? `${e}/${s}` : `/${s}`; + if (this.hasRef(t)) { + const a = t.$ref; + if (this.refs[a]) + return; + if (this.refs[a] = null, this.hasExternalRef(t)) { + const o = await this.resolveExternal(t); + await this.traverseExternal(o, r); + } + } + this.refs[e] = t, await this.traverseExternal(n, r); } - }) - - const invalid = missingProperties.length > 0 - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorDependentRequired, { - dependentRequired: missingProperties.join(', ') - }) - ], - path: path, - constrain: 'dependentRequired' - }) - } } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/dependentSchemas.js": -/*!*******************************************************!*\ - !*** ./src/validation/constrains/dependentSchemas.js ***! - \*******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ dependentSchemas: () => (/* binding */ dependentSchemas) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -function dependentSchemas (validator, value, schema) { - let errors = [] - const dependentSchemas = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDependentSchemas)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(dependentSchemas)) { - Object.keys(dependentSchemas).forEach((key) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(value[key])) { - const dependentSchema = dependentSchemas[key] - const tmpEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ refParser: validator.refParser, schema: dependentSchema, data: value }) - const tmpErrors = tmpEditor.getErrors() - tmpEditor.destroy() - errors = [...errors, ...tmpErrors] + traverseLocal(t, e = "#") { + if (!(typeof t != "object" || t === null)) + for (const [s, n] of Object.entries(t)) { + const r = e ? `${e}/${s}` : `/${s}`; + if (this.hasRef(t)) { + const a = t.$ref; + if (this.refs[a]) + return; + if (!this.hasExternalRef(t)) { + const o = this.resolveLocal(t); + this.traverseLocal(o, r); + } + } + this.traverseLocal(n, r); } - }) - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/enum.js": -/*!*******************************************!*\ - !*** ./src/validation/constrains/enum.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ _enum: () => (/* binding */ _enum) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function _enum (validator, value, schema, key, path) { - const errors = [] - const schemaEnum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaEnum)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaEnum)) { - const invalid = !schemaEnum.some(e => JSON.stringify(value) === JSON.stringify(e)) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorEnum, { - enum: JSON.stringify(schemaEnum) - }) - ], - path: path, - constrain: 'enum' - }) - } - } - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/exclusiveMaximum.js": -/*!*******************************************************!*\ - !*** ./src/validation/constrains/exclusiveMaximum.js ***! - \*******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ exclusiveMaximum: () => (/* binding */ exclusiveMaximum) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function exclusiveMaximum (validator, value, schema, key, path) { - const errors = [] - const exclusiveMaximum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaExclusiveMaximum)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(exclusiveMaximum)) { - const invalid = (value >= exclusiveMaximum) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorExclusiveMaximum, { - exclusiveMaximum: exclusiveMaximum - }) - ], - path: path, - constrain: 'exclusiveMaximum' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/exclusiveMinimum.js": -/*!*******************************************************!*\ - !*** ./src/validation/constrains/exclusiveMinimum.js ***! - \*******************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ exclusiveMinimum: () => (/* binding */ exclusiveMinimum) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function exclusiveMinimum (validator, value, schema, key, path) { - const errors = [] - const exclusiveMinimum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaExclusiveMinimum)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(exclusiveMinimum)) { - const invalid = (value <= exclusiveMinimum) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorExclusiveMinimum, { - exclusiveMinimum: exclusiveMinimum - }) - ], - path: path, - constrain: 'exclusiveMinimum' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/format.js": -/*!*********************************************!*\ - !*** ./src/validation/constrains/format.js ***! - \*********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ format: () => (/* binding */ format) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function format (validator, value, schema, key, path) { - const errors = [] - const format = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaFormat)(schema) - let validateFormat = validator.validateFormat - - if ((0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaOption)(schema, 'validateFormat')) { - validateFormat = schema.options.validateFormat - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(format) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value) && validateFormat) { - let regexp - - if (format === 'email') { - regexp = new RegExp(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i) - } - - if (format === 'url') { - regexp = new RegExp(/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu) - } - - if (format === 'uuid') { - regexp = new RegExp(/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i) - } - - const invalid = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(regexp) && !regexp.test(value) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorFormat, { format: format }) - ], - path: path, - constrain: 'format' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/if-then-else.js": -/*!***************************************************!*\ - !*** ./src/validation/constrains/if-then-else.js ***! - \***************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ ifThenElse: () => (/* binding */ ifThenElse) -/* harmony export */ }); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -function ifThenElse (validator, value, schema) { - const errors = [] - const schemaIf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaIf)(schema) - const schemaThen = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaThen)(schema) - const schemaElse = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaElse)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaIf)) { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.notSet)(schemaThen) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.notSet)(schemaElse)) { - return errors - } - - const ifEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_0__["default"]({ refParser: validator.refParser, schema: schemaIf, data: value }) - const ifErrors = ifEditor.getErrors() - ifEditor.destroy() - - let thenErrors = [] - let elseErrors = [] - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaThen)) { - const thenEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_0__["default"]({ refParser: validator.refParser, schema: schemaThen, data: value }) - thenErrors = thenEditor.getErrors() - thenEditor.destroy() - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaElse)) { - const elseEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_0__["default"]({ refParser: validator.refParser, schema: schemaElse, data: value }) - elseErrors = elseEditor.getErrors() - elseEditor.destroy() - } - - if (schemaIf === true) { - return thenErrors - } - - if (schemaIf === false) { - return elseErrors - } - - if (ifErrors.length === 0) { - return thenErrors - } - - if (ifErrors.length > 0) { - return elseErrors - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/items.js": -/*!********************************************!*\ - !*** ./src/validation/constrains/items.js ***! - \********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ items: () => (/* binding */ items) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function items (validator, value, schema, key, path) { - const errors = [] - const items = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaItems)(schema) - const prefixItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaPrefixItems)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(items)) { - const prefixItemsSchemasCount = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(prefixItems) ? prefixItems.length : 0 - - if (items === false && value.length > 0 && value.length > prefixItemsSchemasCount) { - errors.push({ - messages: [_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorItems], - path: path, - constrain: 'items' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/maxItems.js": -/*!***********************************************!*\ - !*** ./src/validation/constrains/maxItems.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ maxItems: () => (/* binding */ maxItems) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function maxItems (validator, value, schema, key, path) { - const errors = [] - const maxItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMaxItems)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(maxItems)) { - const invalid = (value.length > maxItems) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMaxItems, { - maxItems: maxItems - }) - ], - path: path, - constrain: 'maxItems' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/maxLength.js": -/*!************************************************!*\ - !*** ./src/validation/constrains/maxLength.js ***! - \************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ maxLength: () => (/* binding */ maxLength) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function maxLength (validator, value, schema, key, path) { - const errors = [] - const maxLength = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMaxLength)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(maxLength)) { - value = value.replace(/[\uDCA9]/g, '') // remove Unicode code points - const invalid = (value.length > maxLength) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMaxLength, { - maxLength: maxLength - }) - ], - path: path, - constrain: 'maxLength' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/maxProperties.js": -/*!****************************************************!*\ - !*** ./src/validation/constrains/maxProperties.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ maxProperties: () => (/* binding */ maxProperties) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function maxProperties (validator, value, schema, key, path) { - const errors = [] - const maxProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMaxProperties)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(maxProperties)) { - const propertiesCount = Object.keys(value).length - const invalid = (propertiesCount > maxProperties) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMaxProperties, { - maxProperties: maxProperties - }) - ], - path: path, - constrain: 'maxProperties' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/maximum.js": -/*!**********************************************!*\ - !*** ./src/validation/constrains/maximum.js ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ maximum: () => (/* binding */ maximum) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function maximum (validator, value, schema, key, path) { - const errors = [] - const maximum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMaximum)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(maximum)) { - const invalid = (value > maximum) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMaximum, { - maximum: maximum - }) - ], - path: path, - constrain: 'maximum' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/minItems.js": -/*!***********************************************!*\ - !*** ./src/validation/constrains/minItems.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ minItems: () => (/* binding */ minItems) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function minItems (validator, value, schema, key, path) { - const errors = [] - const minItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMinItems)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(minItems)) { - const invalid = (value.length < minItems) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMinItems, { - minItems: minItems - }) - ], - path: path, - constrain: 'minItems' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/minLength.js": -/*!************************************************!*\ - !*** ./src/validation/constrains/minLength.js ***! - \************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ minLength: () => (/* binding */ minLength) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function minLength (validator, value, schema, key, path) { - const errors = [] - const minLength = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMinLength)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(minLength)) { - value = value.replace(/[\uDCA9]/g, '') // remove Unicode code points - const invalid = (value.length < minLength) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMinLength, { - minLength: minLength - }) - ], - path: path, - constrain: 'minLength' - }) - } } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/minProperties.js": -/*!****************************************************!*\ - !*** ./src/validation/constrains/minProperties.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ minProperties: () => (/* binding */ minProperties) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function minProperties (validator, value, schema, key, path) { - const errors = [] - const minProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMinProperties)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(minProperties)) { - const propertiesCount = Object.keys(value).length - const invalid = (propertiesCount < minProperties) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMinProperties, { - minProperties: minProperties - }) - ], - path: path, - constrain: 'minProperties' - }) - } + /** + * Iterates through the this.refs object keys. If the key is an uri containing "http" or "https" then + * uses that key as the url in a http request to retrieve the external schema. The retrieved schema + * will be used for the value of that property + */ + async resolveExternal(t) { + const e = t.$ref, s = await this.load(e); + return this.refs[e] = s, s; } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/minimum.js": -/*!**********************************************!*\ - !*** ./src/validation/constrains/minimum.js ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ minimum: () => (/* binding */ minimum) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function minimum (validator, value, schema, key, path) { - const errors = [] - const minimum = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMinimum)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(minimum)) { - const invalid = (value < minimum) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMinimum, { - minimum: minimum - }) - ], - path: path, - constrain: 'minimum' - }) - } + /** + * Iterates through the this.refs object keys and resolve all schemas that can be found in this.refs object + */ + resolveLocal(t) { + const e = t.$ref; + let s = null; + return this.refs[e] && (s = this.refs[e], this.refs[e] = s), s; } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/multipleOf.js": -/*!*************************************************!*\ - !*** ./src/validation/constrains/multipleOf.js ***! - \*************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ multipleOf: () => (/* binding */ multipleOf) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function multipleOf (validator, value, schema, key, path) { - const errors = [] - const multipleOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaMultipleOf)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(multipleOf)) { - if (value === 0) { - return errors - } - - const isMultipleOf = (value / multipleOf === Math.floor(value / multipleOf)) - const invalid = (!isMultipleOf || value.toString().includes('e')) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorMultipleOf, { - multipleOf: multipleOf - }) - ], - path: path, - constrain: 'multipleOf' - }) - } + hasRef(t) { + return typeof t.$ref < "u"; } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/not.js": -/*!******************************************!*\ - !*** ./src/validation/constrains/not.js ***! - \******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ not: () => (/* binding */ not) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); - - - - - -function not (validator, value, schema, key, path) { - const errors = [] - const not = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaNot)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(not)) { - const notEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_3__["default"]({ refParser: validator.refParser, schema: not, data: value }) - const notErrors = notEditor.getErrors() - notEditor.destroy() - - const invalid = notErrors.length === 0 - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorNot) - ], - path: path, - constrain: 'not' - }) - } + hasExternalRef(t) { + const e = t.$ref; + return typeof e != "string" ? !1 : e.startsWith("http") || e.startsWith("https"); } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/oneOf.js": -/*!********************************************!*\ - !*** ./src/validation/constrains/oneOf.js ***! - \********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ oneOf: () => (/* binding */ oneOf) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - - -function oneOf (validator, value, schema, key, path) { - const errors = [] - const oneOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOneOf)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(oneOf)) { - let counter = 0 - - oneOf.forEach((schema) => { - const oneOfEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ refParser: validator.refParser, schema: schema, data: value }) - const oneOfErrors = oneOfEditor.getErrors() - oneOfEditor.destroy() - - if (oneOfErrors.length === 0) { - counter++ - } - }) - - if (counter !== 1) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorOneOf, { - counter: counter - }) - ], - path: path, - constrain: 'oneOf' - }) - } + isCircularRef(t) { + const e = `"$ref":"${t}"`, s = this.refs[t]; + return JSON.stringify(s).includes(e); } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/pattern.js": -/*!**********************************************!*\ - !*** ./src/validation/constrains/pattern.js ***! - \**********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ pattern: () => (/* binding */ pattern) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function pattern (validator, value, schema, key, path) { - const errors = [] - const pattern = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaPattern)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(pattern)) { - const regexp = new RegExp(pattern) - const invalid = !regexp.test(value) - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorPattern, { - pattern: pattern - }) - ], - path: path, - constrain: 'pattern' - }) - } + isObject(t) { + return t !== null && typeof t == "object"; } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/patternProperties.js": -/*!********************************************************!*\ - !*** ./src/validation/constrains/patternProperties.js ***! - \********************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ patternProperties: () => (/* binding */ patternProperties) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); - - - - -function patternProperties (validator, value, schema, path) { - let errors = [] - const patternProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaPatternProperties)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(patternProperties)) { - Object.keys(value).forEach((propertyName) => { - Object.keys(patternProperties).forEach((pattern) => { - const regexp = new RegExp(pattern) - if (regexp.test(propertyName)) { - const schema = patternProperties[pattern] - - const editor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ - refParser: validator.refParser, - schema: schema, - data: value[propertyName] - }) - - const editorErrors = editor.getErrors().map((error) => { - return { - messages: error.messages, - path: path + '/' + propertyName, - constrain: 'patternProperties' - } - }) - - errors = [...errors, ...editorErrors] - - editor.destroy() - } - }) - }) - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/prefixItems.js": -/*!**************************************************!*\ - !*** ./src/validation/constrains/prefixItems.js ***! - \**************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ prefixItems: () => (/* binding */ prefixItems) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - - -function prefixItems (validator, value, schema, key, path) { - const errors = [] - const prefixItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaPrefixItems)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(prefixItems)) { - prefixItems.forEach((itemSchema, index) => { - const itemValue = value[index] - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(itemValue)) { - const tmpEditor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ refParser: validator.refParser, schema: itemSchema, data: itemValue }) - const tmpErrors = tmpEditor.getErrors() - tmpEditor.destroy() - - if (tmpErrors.length > 0) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorPrefixItems, { - index: index - }) - ], - path: path, - constrain: 'prefixItems' - }) - } - } - }) - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/propertyNames.js": -/*!****************************************************!*\ - !*** ./src/validation/constrains/propertyNames.js ***! - \****************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ propertyNames: () => (/* binding */ propertyNames) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); -/** - * constrains propertyNames - */ - - - - - - -function propertyNames (validator, value, schema, key, path) { - const errors = [] - const schemaPropertyNames = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaPropertyNames)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaPropertyNames)) { - Object.keys(value).forEach((propertyName) => { - const editor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ - refParser: validator.refParser, - schema: schemaPropertyNames, - data: propertyName - }) - - const invalid = editor.getErrors().length > 0 - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorPropertyNames, { propertyName: propertyName }) - ], - path: path, - constrain: 'propertyNames' - }) - } - }) - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/required.js": -/*!***********************************************!*\ - !*** ./src/validation/constrains/required.js ***! - \***********************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ required: () => (/* binding */ required) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function required (validator, value, schema, key, path) { - const errors = [] - const required = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaRequired)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(required)) { - const missingProperties = [] - const keys = Object.keys(value) - - required.forEach((key) => { - if (!keys.includes(key)) { - missingProperties.push(key) - } - }) - - const invalid = missingProperties.length > 0 - - if (invalid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorRequired, { - required: missingProperties.join(', ') - }) - ], - path: path, - constrain: 'required' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/type.js": -/*!*******************************************!*\ - !*** ./src/validation/constrains/type.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ type: () => (/* binding */ type) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function type (validator, value, schema, key, path) { - const errors = [] - const type = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaType)(schema) - - if (type === 'any') { - return errors - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(type)) { - const types = { - string: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isString)(value), - number: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNumber)(value), - integer: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isInteger)(value), - boolean: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(value), - array: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value), - object: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value), - null: value => (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isNull)(value) - } - - let valid = true - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(type)) { - valid = type.some((type) => { - return types[type](value) - }) - } else { - valid = types[type](value) - } - - if (!valid) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorType, { - type: type, - valueType: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.getType)(value) - }) - ], - path: path, - constrain: 'type' - }) + expand(t) { + const e = JSON.parse(JSON.stringify(t)); + if (this.isObject(e) && "$ref" in e) { + const s = e.$ref; + return delete e.$ref, Object.assign({}, this.refs[s], e); } + return e; } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/unevaluatedProperties.js": -/*!************************************************************!*\ - !*** ./src/validation/constrains/unevaluatedProperties.js ***! - \************************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ unevaluatedProperties: () => (/* binding */ unevaluatedProperties) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jedi.js */ "./src/jedi.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); -/** - * constrains unevaluatedProperties - */ - - - - - - -function unevaluatedProperties (validator, value, schema, key, path) { - let errors = [] - const schemaUnevaluatedProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaUnevaluatedProperties)(schema) - const schemaPatternProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaPatternProperties)(schema) - const schemaProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaProperties)(schema) - const schemaAllOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAllOf)(schema) - const schemaAnyOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaAnyOf)(schema) - const schemaOneOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOneOf)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaUnevaluatedProperties)) { - let properties = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(schemaProperties) ? schemaProperties : {} - const unevaluatedProperties = schemaUnevaluatedProperties - const patternProperties = schemaPatternProperties - - // see through allOf, anyOf and oneOf - const ofSchemas = [ - schemaAllOf, - schemaAnyOf, - schemaOneOf - ] - - ofSchemas.forEach((subSchema) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(subSchema)) { - subSchema.forEach((subschema) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(subschema['properties'])) { - properties = { ...properties, ...subschema['properties'] } - } - }) - } - }) - - if (properties) { - Object.keys(value).forEach((property) => { - let definedInPatternProperty = false - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(patternProperties)) { - Object.keys(patternProperties).forEach((pattern) => { - const regexp = new RegExp(pattern) - definedInPatternProperty = regexp.test(property) - }) - } - - if (!definedInPatternProperty && unevaluatedProperties === false && !(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(properties, property)) { - errors.push({ - messages: [ - (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.compileTemplate)(_i18n_js__WEBPACK_IMPORTED_MODULE_3__.i18n.errorUnevaluatedProperties, { - property: property - }) - ], - path: path, - constrain: 'unevaluatedProperties' - }) - } - - if (!definedInPatternProperty && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(unevaluatedProperties) && !(0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasOwn)(properties, property)) { - const editor = new _jedi_js__WEBPACK_IMPORTED_MODULE_1__["default"]({ - refParser: validator.refParser, - schema: unevaluatedProperties, - data: value[property] - }) - - const unevaluatedPropertiesErrors = editor.getErrors().map((error) => { - return { - messages: error.messages, - path: property, - constrain: 'unevaluatedProperties' - } - }) - - errors = [...errors, ...unevaluatedPropertiesErrors] - - editor.destroy() - } - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/constrains/uniqueItems.js": -/*!**************************************************!*\ - !*** ./src/validation/constrains/uniqueItems.js ***! - \**************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ uniqueItems: () => (/* binding */ uniqueItems) -/* harmony export */ }); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers/schema.js */ "./src/helpers/schema.js"); -/* harmony import */ var _i18n_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../i18n.js */ "./src/i18n.js"); - - - - -function uniqueItems (validator, value, schema, key, path) { - const errors = [] - const uniqueItems = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaUniqueItems)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isArray)(value) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isSet)(uniqueItems) && uniqueItems === true) { - const seen = [] - let hasDuplicatedItems = false - - for (let i = 0; i < value.length; i++) { - let item = value[i] - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.isObject)(item)) { - item = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_0__.sortObject)(item) - } - - const itemStringified = JSON.stringify(item) - hasDuplicatedItems = seen.some((seen) => seen === itemStringified) - - if (hasDuplicatedItems) { - break - } else { - seen.push(itemStringified) - } - } - - const invalid = (hasDuplicatedItems) - - if (invalid) { - errors.push({ - messages: [ - _i18n_js__WEBPACK_IMPORTED_MODULE_2__.i18n.errorUniqueItems - ], - path: path, - constrain: 'uniqueItems' - }) - } - } - - return errors -} - - -/***/ }), - -/***/ "./src/validation/drafts/draft-04.js": -/*!*******************************************!*\ - !*** ./src/validation/drafts/draft-04.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constrains/allOf.js */ "./src/validation/constrains/allOf.js"); -/* harmony import */ var _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constrains/minLength.js */ "./src/validation/constrains/minLength.js"); -/* harmony import */ var _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constrains/anyOf.js */ "./src/validation/constrains/anyOf.js"); -/* harmony import */ var _constrains_enum_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constrains/enum.js */ "./src/validation/constrains/enum.js"); -/* harmony import */ var _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constrains/exclusiveMaximum.js */ "./src/validation/constrains/exclusiveMaximum.js"); -/* harmony import */ var _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constrains/exclusiveMinimum.js */ "./src/validation/constrains/exclusiveMinimum.js"); -/* harmony import */ var _constrains_format_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constrains/format.js */ "./src/validation/constrains/format.js"); -/* harmony import */ var _constrains_items_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constrains/items.js */ "./src/validation/constrains/items.js"); -/* harmony import */ var _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../constrains/maxItems.js */ "./src/validation/constrains/maxItems.js"); -/* harmony import */ var _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constrains/maxLength.js */ "./src/validation/constrains/maxLength.js"); -/* harmony import */ var _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constrains/maxProperties.js */ "./src/validation/constrains/maxProperties.js"); -/* harmony import */ var _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../constrains/minimum.js */ "./src/validation/constrains/minimum.js"); -/* harmony import */ var _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../constrains/minItems.js */ "./src/validation/constrains/minItems.js"); -/* harmony import */ var _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constrains/minProperties.js */ "./src/validation/constrains/minProperties.js"); -/* harmony import */ var _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constrains/multipleOf.js */ "./src/validation/constrains/multipleOf.js"); -/* harmony import */ var _constrains_not_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../constrains/not.js */ "./src/validation/constrains/not.js"); -/* harmony import */ var _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../constrains/oneOf.js */ "./src/validation/constrains/oneOf.js"); -/* harmony import */ var _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../constrains/pattern.js */ "./src/validation/constrains/pattern.js"); -/* harmony import */ var _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../constrains/patternProperties.js */ "./src/validation/constrains/patternProperties.js"); -/* harmony import */ var _constrains_required_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../constrains/required.js */ "./src/validation/constrains/required.js"); -/* harmony import */ var _constrains_type_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../constrains/type.js */ "./src/validation/constrains/type.js"); -/* harmony import */ var _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../constrains/maximum.js */ "./src/validation/constrains/maximum.js"); -/* harmony import */ var _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../constrains/uniqueItems.js */ "./src/validation/constrains/uniqueItems.js"); -/* harmony import */ var _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../constrains/additionalProperties.js */ "./src/validation/constrains/additionalProperties.js"); - - - - - - - - - - - - - - - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - additionalProperties: _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_23__.additionalProperties, - allOf: _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__.allOf, - anyOf: _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_2__.anyOf, - enum: _constrains_enum_js__WEBPACK_IMPORTED_MODULE_3__._enum, - exclusiveMaximum: _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_4__.exclusiveMaximum, - exclusiveMinimum: _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_5__.exclusiveMinimum, - format: _constrains_format_js__WEBPACK_IMPORTED_MODULE_6__.format, - items: _constrains_items_js__WEBPACK_IMPORTED_MODULE_7__.items, - maximum: _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_21__.maximum, - maxItems: _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_8__.maxItems, - maxLength: _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_9__.maxLength, - maxProperties: _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_10__.maxProperties, - minimum: _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_11__.minimum, - minItems: _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_12__.minItems, - minLength: _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__.minLength, - minProperties: _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_13__.minProperties, - multipleOf: _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_14__.multipleOf, - not: _constrains_not_js__WEBPACK_IMPORTED_MODULE_15__.not, - oneOf: _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_16__.oneOf, - pattern: _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_17__.pattern, - patternProperties: _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_18__.patternProperties, - required: _constrains_required_js__WEBPACK_IMPORTED_MODULE_19__.required, - type: _constrains_type_js__WEBPACK_IMPORTED_MODULE_20__.type, - uniqueItems: _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_22__.uniqueItems -}); - - -/***/ }), - -/***/ "./src/validation/drafts/draft-06.js": -/*!*******************************************!*\ - !*** ./src/validation/drafts/draft-06.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constrains/allOf.js */ "./src/validation/constrains/allOf.js"); -/* harmony import */ var _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constrains/minLength.js */ "./src/validation/constrains/minLength.js"); -/* harmony import */ var _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constrains/const.js */ "./src/validation/constrains/const.js"); -/* harmony import */ var _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constrains/contains.js */ "./src/validation/constrains/contains.js"); -/* harmony import */ var _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constrains/anyOf.js */ "./src/validation/constrains/anyOf.js"); -/* harmony import */ var _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constrains/dependentRequired.js */ "./src/validation/constrains/dependentRequired.js"); -/* harmony import */ var _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constrains/dependentSchemas.js */ "./src/validation/constrains/dependentSchemas.js"); -/* harmony import */ var _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constrains/enum.js */ "./src/validation/constrains/enum.js"); -/* harmony import */ var _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../constrains/exclusiveMaximum.js */ "./src/validation/constrains/exclusiveMaximum.js"); -/* harmony import */ var _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constrains/exclusiveMinimum.js */ "./src/validation/constrains/exclusiveMinimum.js"); -/* harmony import */ var _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constrains/format.js */ "./src/validation/constrains/format.js"); -/* harmony import */ var _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../constrains/if-then-else.js */ "./src/validation/constrains/if-then-else.js"); -/* harmony import */ var _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../constrains/items.js */ "./src/validation/constrains/items.js"); -/* harmony import */ var _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constrains/maxItems.js */ "./src/validation/constrains/maxItems.js"); -/* harmony import */ var _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constrains/maxLength.js */ "./src/validation/constrains/maxLength.js"); -/* harmony import */ var _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../constrains/maxProperties.js */ "./src/validation/constrains/maxProperties.js"); -/* harmony import */ var _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../constrains/minimum.js */ "./src/validation/constrains/minimum.js"); -/* harmony import */ var _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../constrains/minItems.js */ "./src/validation/constrains/minItems.js"); -/* harmony import */ var _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../constrains/minProperties.js */ "./src/validation/constrains/minProperties.js"); -/* harmony import */ var _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../constrains/multipleOf.js */ "./src/validation/constrains/multipleOf.js"); -/* harmony import */ var _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../constrains/not.js */ "./src/validation/constrains/not.js"); -/* harmony import */ var _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../constrains/oneOf.js */ "./src/validation/constrains/oneOf.js"); -/* harmony import */ var _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../constrains/pattern.js */ "./src/validation/constrains/pattern.js"); -/* harmony import */ var _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../constrains/patternProperties.js */ "./src/validation/constrains/patternProperties.js"); -/* harmony import */ var _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../constrains/prefixItems.js */ "./src/validation/constrains/prefixItems.js"); -/* harmony import */ var _constrains_required_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../constrains/required.js */ "./src/validation/constrains/required.js"); -/* harmony import */ var _constrains_type_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../constrains/type.js */ "./src/validation/constrains/type.js"); -/* harmony import */ var _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../constrains/maximum.js */ "./src/validation/constrains/maximum.js"); -/* harmony import */ var _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../constrains/uniqueItems.js */ "./src/validation/constrains/uniqueItems.js"); -/* harmony import */ var _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../constrains/additionalProperties.js */ "./src/validation/constrains/additionalProperties.js"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - additionalProperties: _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_29__.additionalProperties, - allOf: _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__.allOf, - anyOf: _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__.anyOf, - const: _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__._const, - contains: _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__.contains, - dependentRequired: _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__.dependentRequired, - dependentSchemas: _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__.dependentSchemas, - enum: _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__._enum, - exclusiveMaximum: _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__.exclusiveMaximum, - exclusiveMinimum: _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__.exclusiveMinimum, - format: _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__.format, - if: _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__.ifThenElse, - items: _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__.items, - maximum: _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_27__.maximum, - maxItems: _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__.maxItems, - maxLength: _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__.maxLength, - maxProperties: _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__.maxProperties, - minimum: _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__.minimum, - minItems: _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__.minItems, - minLength: _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__.minLength, - minProperties: _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__.minProperties, - multipleOf: _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__.multipleOf, - not: _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__.not, - oneOf: _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__.oneOf, - pattern: _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__.pattern, - patternProperties: _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__.patternProperties, - prefixItems: _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__.prefixItems, - required: _constrains_required_js__WEBPACK_IMPORTED_MODULE_25__.required, - type: _constrains_type_js__WEBPACK_IMPORTED_MODULE_26__.type, - uniqueItems: _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_28__.uniqueItems -}); - - -/***/ }), - -/***/ "./src/validation/drafts/draft-07.js": -/*!*******************************************!*\ - !*** ./src/validation/drafts/draft-07.js ***! - \*******************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constrains/allOf.js */ "./src/validation/constrains/allOf.js"); -/* harmony import */ var _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constrains/minLength.js */ "./src/validation/constrains/minLength.js"); -/* harmony import */ var _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constrains/const.js */ "./src/validation/constrains/const.js"); -/* harmony import */ var _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constrains/contains.js */ "./src/validation/constrains/contains.js"); -/* harmony import */ var _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constrains/anyOf.js */ "./src/validation/constrains/anyOf.js"); -/* harmony import */ var _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constrains/dependentRequired.js */ "./src/validation/constrains/dependentRequired.js"); -/* harmony import */ var _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constrains/dependentSchemas.js */ "./src/validation/constrains/dependentSchemas.js"); -/* harmony import */ var _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constrains/enum.js */ "./src/validation/constrains/enum.js"); -/* harmony import */ var _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../constrains/exclusiveMaximum.js */ "./src/validation/constrains/exclusiveMaximum.js"); -/* harmony import */ var _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constrains/exclusiveMinimum.js */ "./src/validation/constrains/exclusiveMinimum.js"); -/* harmony import */ var _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constrains/format.js */ "./src/validation/constrains/format.js"); -/* harmony import */ var _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../constrains/if-then-else.js */ "./src/validation/constrains/if-then-else.js"); -/* harmony import */ var _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../constrains/items.js */ "./src/validation/constrains/items.js"); -/* harmony import */ var _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constrains/maxItems.js */ "./src/validation/constrains/maxItems.js"); -/* harmony import */ var _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constrains/maxLength.js */ "./src/validation/constrains/maxLength.js"); -/* harmony import */ var _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../constrains/maxProperties.js */ "./src/validation/constrains/maxProperties.js"); -/* harmony import */ var _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../constrains/minimum.js */ "./src/validation/constrains/minimum.js"); -/* harmony import */ var _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../constrains/minItems.js */ "./src/validation/constrains/minItems.js"); -/* harmony import */ var _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../constrains/minProperties.js */ "./src/validation/constrains/minProperties.js"); -/* harmony import */ var _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../constrains/multipleOf.js */ "./src/validation/constrains/multipleOf.js"); -/* harmony import */ var _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../constrains/not.js */ "./src/validation/constrains/not.js"); -/* harmony import */ var _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../constrains/oneOf.js */ "./src/validation/constrains/oneOf.js"); -/* harmony import */ var _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../constrains/pattern.js */ "./src/validation/constrains/pattern.js"); -/* harmony import */ var _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../constrains/patternProperties.js */ "./src/validation/constrains/patternProperties.js"); -/* harmony import */ var _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../constrains/prefixItems.js */ "./src/validation/constrains/prefixItems.js"); -/* harmony import */ var _constrains_required_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../constrains/required.js */ "./src/validation/constrains/required.js"); -/* harmony import */ var _constrains_type_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../constrains/type.js */ "./src/validation/constrains/type.js"); -/* harmony import */ var _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../constrains/maximum.js */ "./src/validation/constrains/maximum.js"); -/* harmony import */ var _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../constrains/uniqueItems.js */ "./src/validation/constrains/uniqueItems.js"); -/* harmony import */ var _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../constrains/additionalProperties.js */ "./src/validation/constrains/additionalProperties.js"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - additionalProperties: _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_29__.additionalProperties, - allOf: _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__.allOf, - anyOf: _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__.anyOf, - const: _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__._const, - contains: _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__.contains, - dependentRequired: _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__.dependentRequired, - dependentSchemas: _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__.dependentSchemas, - enum: _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__._enum, - exclusiveMaximum: _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__.exclusiveMaximum, - exclusiveMinimum: _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__.exclusiveMinimum, - format: _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__.format, - if: _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__.ifThenElse, - items: _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__.items, - maximum: _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_27__.maximum, - maxItems: _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__.maxItems, - maxLength: _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__.maxLength, - maxProperties: _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__.maxProperties, - minimum: _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__.minimum, - minItems: _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__.minItems, - minLength: _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__.minLength, - minProperties: _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__.minProperties, - multipleOf: _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__.multipleOf, - not: _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__.not, - oneOf: _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__.oneOf, - pattern: _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__.pattern, - patternProperties: _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__.patternProperties, - prefixItems: _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__.prefixItems, - required: _constrains_required_js__WEBPACK_IMPORTED_MODULE_25__.required, - type: _constrains_type_js__WEBPACK_IMPORTED_MODULE_26__.type, - uniqueItems: _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_28__.uniqueItems -}); - - -/***/ }), - -/***/ "./src/validation/drafts/draft-2019-09.js": -/*!************************************************!*\ - !*** ./src/validation/drafts/draft-2019-09.js ***! - \************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constrains/allOf.js */ "./src/validation/constrains/allOf.js"); -/* harmony import */ var _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constrains/minLength.js */ "./src/validation/constrains/minLength.js"); -/* harmony import */ var _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constrains/const.js */ "./src/validation/constrains/const.js"); -/* harmony import */ var _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constrains/contains.js */ "./src/validation/constrains/contains.js"); -/* harmony import */ var _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constrains/anyOf.js */ "./src/validation/constrains/anyOf.js"); -/* harmony import */ var _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constrains/dependentRequired.js */ "./src/validation/constrains/dependentRequired.js"); -/* harmony import */ var _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constrains/dependentSchemas.js */ "./src/validation/constrains/dependentSchemas.js"); -/* harmony import */ var _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constrains/enum.js */ "./src/validation/constrains/enum.js"); -/* harmony import */ var _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../constrains/exclusiveMaximum.js */ "./src/validation/constrains/exclusiveMaximum.js"); -/* harmony import */ var _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constrains/exclusiveMinimum.js */ "./src/validation/constrains/exclusiveMinimum.js"); -/* harmony import */ var _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constrains/format.js */ "./src/validation/constrains/format.js"); -/* harmony import */ var _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../constrains/if-then-else.js */ "./src/validation/constrains/if-then-else.js"); -/* harmony import */ var _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../constrains/items.js */ "./src/validation/constrains/items.js"); -/* harmony import */ var _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constrains/maxItems.js */ "./src/validation/constrains/maxItems.js"); -/* harmony import */ var _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constrains/maxLength.js */ "./src/validation/constrains/maxLength.js"); -/* harmony import */ var _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../constrains/maxProperties.js */ "./src/validation/constrains/maxProperties.js"); -/* harmony import */ var _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../constrains/minimum.js */ "./src/validation/constrains/minimum.js"); -/* harmony import */ var _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../constrains/minItems.js */ "./src/validation/constrains/minItems.js"); -/* harmony import */ var _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../constrains/minProperties.js */ "./src/validation/constrains/minProperties.js"); -/* harmony import */ var _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../constrains/multipleOf.js */ "./src/validation/constrains/multipleOf.js"); -/* harmony import */ var _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../constrains/not.js */ "./src/validation/constrains/not.js"); -/* harmony import */ var _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../constrains/oneOf.js */ "./src/validation/constrains/oneOf.js"); -/* harmony import */ var _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../constrains/pattern.js */ "./src/validation/constrains/pattern.js"); -/* harmony import */ var _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../constrains/patternProperties.js */ "./src/validation/constrains/patternProperties.js"); -/* harmony import */ var _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../constrains/prefixItems.js */ "./src/validation/constrains/prefixItems.js"); -/* harmony import */ var _constrains_required_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../constrains/required.js */ "./src/validation/constrains/required.js"); -/* harmony import */ var _constrains_type_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../constrains/type.js */ "./src/validation/constrains/type.js"); -/* harmony import */ var _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../constrains/maximum.js */ "./src/validation/constrains/maximum.js"); -/* harmony import */ var _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../constrains/uniqueItems.js */ "./src/validation/constrains/uniqueItems.js"); -/* harmony import */ var _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../constrains/additionalProperties.js */ "./src/validation/constrains/additionalProperties.js"); -/* harmony import */ var _constrains_unevaluatedProperties_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../constrains/unevaluatedProperties.js */ "./src/validation/constrains/unevaluatedProperties.js"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - additionalProperties: _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_29__.additionalProperties, - allOf: _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__.allOf, - anyOf: _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__.anyOf, - const: _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__._const, - contains: _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__.contains, - dependentRequired: _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__.dependentRequired, - dependentSchemas: _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__.dependentSchemas, - enum: _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__._enum, - exclusiveMaximum: _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__.exclusiveMaximum, - exclusiveMinimum: _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__.exclusiveMinimum, - format: _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__.format, - if: _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__.ifThenElse, - items: _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__.items, - maximum: _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_27__.maximum, - maxItems: _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__.maxItems, - maxLength: _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__.maxLength, - maxProperties: _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__.maxProperties, - minimum: _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__.minimum, - minItems: _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__.minItems, - minLength: _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__.minLength, - minProperties: _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__.minProperties, - multipleOf: _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__.multipleOf, - not: _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__.not, - oneOf: _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__.oneOf, - pattern: _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__.pattern, - patternProperties: _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__.patternProperties, - prefixItems: _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__.prefixItems, - required: _constrains_required_js__WEBPACK_IMPORTED_MODULE_25__.required, - type: _constrains_type_js__WEBPACK_IMPORTED_MODULE_26__.type, - unevaluatedProperties: _constrains_unevaluatedProperties_js__WEBPACK_IMPORTED_MODULE_30__.unevaluatedProperties, - uniqueItems: _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_28__.uniqueItems -}); - - -/***/ }), - -/***/ "./src/validation/drafts/draft-2020-12.js": -/*!************************************************!*\ - !*** ./src/validation/drafts/draft-2020-12.js ***! - \************************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constrains/allOf.js */ "./src/validation/constrains/allOf.js"); -/* harmony import */ var _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constrains/minLength.js */ "./src/validation/constrains/minLength.js"); -/* harmony import */ var _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constrains/const.js */ "./src/validation/constrains/const.js"); -/* harmony import */ var _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constrains/contains.js */ "./src/validation/constrains/contains.js"); -/* harmony import */ var _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constrains/anyOf.js */ "./src/validation/constrains/anyOf.js"); -/* harmony import */ var _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constrains/dependentRequired.js */ "./src/validation/constrains/dependentRequired.js"); -/* harmony import */ var _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constrains/dependentSchemas.js */ "./src/validation/constrains/dependentSchemas.js"); -/* harmony import */ var _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constrains/enum.js */ "./src/validation/constrains/enum.js"); -/* harmony import */ var _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../constrains/exclusiveMaximum.js */ "./src/validation/constrains/exclusiveMaximum.js"); -/* harmony import */ var _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constrains/exclusiveMinimum.js */ "./src/validation/constrains/exclusiveMinimum.js"); -/* harmony import */ var _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constrains/format.js */ "./src/validation/constrains/format.js"); -/* harmony import */ var _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../constrains/if-then-else.js */ "./src/validation/constrains/if-then-else.js"); -/* harmony import */ var _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../constrains/items.js */ "./src/validation/constrains/items.js"); -/* harmony import */ var _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constrains/maxItems.js */ "./src/validation/constrains/maxItems.js"); -/* harmony import */ var _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../constrains/maxLength.js */ "./src/validation/constrains/maxLength.js"); -/* harmony import */ var _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../constrains/maxProperties.js */ "./src/validation/constrains/maxProperties.js"); -/* harmony import */ var _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../constrains/minimum.js */ "./src/validation/constrains/minimum.js"); -/* harmony import */ var _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../constrains/minItems.js */ "./src/validation/constrains/minItems.js"); -/* harmony import */ var _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../constrains/minProperties.js */ "./src/validation/constrains/minProperties.js"); -/* harmony import */ var _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../constrains/multipleOf.js */ "./src/validation/constrains/multipleOf.js"); -/* harmony import */ var _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../constrains/not.js */ "./src/validation/constrains/not.js"); -/* harmony import */ var _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../constrains/oneOf.js */ "./src/validation/constrains/oneOf.js"); -/* harmony import */ var _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../constrains/pattern.js */ "./src/validation/constrains/pattern.js"); -/* harmony import */ var _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../constrains/patternProperties.js */ "./src/validation/constrains/patternProperties.js"); -/* harmony import */ var _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../constrains/prefixItems.js */ "./src/validation/constrains/prefixItems.js"); -/* harmony import */ var _constrains_propertyNames_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../constrains/propertyNames.js */ "./src/validation/constrains/propertyNames.js"); -/* harmony import */ var _constrains_required_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../constrains/required.js */ "./src/validation/constrains/required.js"); -/* harmony import */ var _constrains_type_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../constrains/type.js */ "./src/validation/constrains/type.js"); -/* harmony import */ var _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../constrains/maximum.js */ "./src/validation/constrains/maximum.js"); -/* harmony import */ var _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../constrains/uniqueItems.js */ "./src/validation/constrains/uniqueItems.js"); -/* harmony import */ var _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../constrains/additionalProperties.js */ "./src/validation/constrains/additionalProperties.js"); -/* harmony import */ var _constrains_unevaluatedProperties_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../constrains/unevaluatedProperties.js */ "./src/validation/constrains/unevaluatedProperties.js"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - additionalProperties: _constrains_additionalProperties_js__WEBPACK_IMPORTED_MODULE_30__.additionalProperties, - allOf: _constrains_allOf_js__WEBPACK_IMPORTED_MODULE_0__.allOf, - anyOf: _constrains_anyOf_js__WEBPACK_IMPORTED_MODULE_4__.anyOf, - const: _constrains_const_js__WEBPACK_IMPORTED_MODULE_2__._const, - contains: _constrains_contains_js__WEBPACK_IMPORTED_MODULE_3__.contains, - dependentRequired: _constrains_dependentRequired_js__WEBPACK_IMPORTED_MODULE_5__.dependentRequired, - dependentSchemas: _constrains_dependentSchemas_js__WEBPACK_IMPORTED_MODULE_6__.dependentSchemas, - enum: _constrains_enum_js__WEBPACK_IMPORTED_MODULE_7__._enum, - exclusiveMaximum: _constrains_exclusiveMaximum_js__WEBPACK_IMPORTED_MODULE_8__.exclusiveMaximum, - exclusiveMinimum: _constrains_exclusiveMinimum_js__WEBPACK_IMPORTED_MODULE_9__.exclusiveMinimum, - format: _constrains_format_js__WEBPACK_IMPORTED_MODULE_10__.format, - if: _constrains_if_then_else_js__WEBPACK_IMPORTED_MODULE_11__.ifThenElse, - items: _constrains_items_js__WEBPACK_IMPORTED_MODULE_12__.items, - maximum: _constrains_maximum_js__WEBPACK_IMPORTED_MODULE_28__.maximum, - maxItems: _constrains_maxItems_js__WEBPACK_IMPORTED_MODULE_13__.maxItems, - maxLength: _constrains_maxLength_js__WEBPACK_IMPORTED_MODULE_14__.maxLength, - maxProperties: _constrains_maxProperties_js__WEBPACK_IMPORTED_MODULE_15__.maxProperties, - minimum: _constrains_minimum_js__WEBPACK_IMPORTED_MODULE_16__.minimum, - minItems: _constrains_minItems_js__WEBPACK_IMPORTED_MODULE_17__.minItems, - minLength: _constrains_minLength_js__WEBPACK_IMPORTED_MODULE_1__.minLength, - minProperties: _constrains_minProperties_js__WEBPACK_IMPORTED_MODULE_18__.minProperties, - multipleOf: _constrains_multipleOf_js__WEBPACK_IMPORTED_MODULE_19__.multipleOf, - not: _constrains_not_js__WEBPACK_IMPORTED_MODULE_20__.not, - oneOf: _constrains_oneOf_js__WEBPACK_IMPORTED_MODULE_21__.oneOf, - pattern: _constrains_pattern_js__WEBPACK_IMPORTED_MODULE_22__.pattern, - patternProperties: _constrains_patternProperties_js__WEBPACK_IMPORTED_MODULE_23__.patternProperties, - prefixItems: _constrains_prefixItems_js__WEBPACK_IMPORTED_MODULE_24__.prefixItems, - propertyNames: _constrains_propertyNames_js__WEBPACK_IMPORTED_MODULE_25__.propertyNames, - required: _constrains_required_js__WEBPACK_IMPORTED_MODULE_26__.required, - type: _constrains_type_js__WEBPACK_IMPORTED_MODULE_27__.type, - unevaluatedProperties: _constrains_unevaluatedProperties_js__WEBPACK_IMPORTED_MODULE_31__.unevaluatedProperties, - uniqueItems: _constrains_uniqueItems_js__WEBPACK_IMPORTED_MODULE_29__.uniqueItems -}); - - -/***/ }), - -/***/ "./src/validation/validator.js": -/*!*************************************!*\ - !*** ./src/validation/validator.js ***! - \*************************************/ -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _drafts_draft_04_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drafts/draft-04.js */ "./src/validation/drafts/draft-04.js"); -/* harmony import */ var _drafts_draft_06_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./drafts/draft-06.js */ "./src/validation/drafts/draft-06.js"); -/* harmony import */ var _drafts_draft_07_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./drafts/draft-07.js */ "./src/validation/drafts/draft-07.js"); -/* harmony import */ var _drafts_draft_2019_09_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./drafts/draft-2019-09.js */ "./src/validation/drafts/draft-2019-09.js"); -/* harmony import */ var _drafts_draft_2020_12_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./drafts/draft-2020-12.js */ "./src/validation/drafts/draft-2020-12.js"); -/* harmony import */ var _helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers/utils.js */ "./src/helpers/utils.js"); -/* harmony import */ var _helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/schema.js */ "./src/helpers/schema.js"); - - - - - - - - -/** - * Represents a Validator instance. - */ -class Validator { - constructor (config = {}) { - this.refParser = config.refParser - this.validateFormat = config.validateFormat ? config.validateFormat : false - this.draft = _drafts_draft_2020_12_js__WEBPACK_IMPORTED_MODULE_4__["default"] - - this.jsonSchemaDrafts = { - 'http://json-schema.org/draft-04/schema#': _drafts_draft_04_js__WEBPACK_IMPORTED_MODULE_0__["default"], - 'http://json-schema.org/draft-06/schema#': _drafts_draft_06_js__WEBPACK_IMPORTED_MODULE_1__["default"], - 'http://json-schema.org/draft-07/schema#': _drafts_draft_07_js__WEBPACK_IMPORTED_MODULE_2__["default"], - 'https://json-schema.org/draft/2019-09/schema': _drafts_draft_2019_09_js__WEBPACK_IMPORTED_MODULE_3__["default"], - 'https://json-schema.org/draft/2020-12/schema': _drafts_draft_2020_12_js__WEBPACK_IMPORTED_MODULE_4__["default"] - } - } - /** - * Validates a value against it's schema + * Loads a schema with a synchronous http request + * @param uri + * @returns {any} */ - getErrors (value, schema, key, path) { - let schemaErrors = [] - const schemaOptionsMessages = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_6__.getSchemaOption)(schema, 'messages') - - const schemaClone = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.clone)(schema) - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isBoolean)(schemaClone) && schemaClone === true) { - return schemaErrors - } - - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isBoolean)(schemaClone) && schemaClone === false) { - return [{ - messages: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.isSet)(schemaOptionsMessages) ? schemaOptionsMessages : ['invalid'], - path: path - }] - } - - Object.keys(this.draft).forEach((constrain) => { - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_5__.hasOwn)(schemaClone, constrain)) { - const validator = this.draft[constrain] - const validatorErrors = validator(this, value, schema, key, path) - - if (validatorErrors) { - schemaErrors = [...schemaErrors, ...validatorErrors] - } - } - }) - - if (schemaErrors.length > 0 && schemaOptionsMessages) { - schemaErrors = [ - { - messages: schemaOptionsMessages, - path: path - } - ] - } - - return schemaErrors - } -} - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Validator); - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -/*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _jedi_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jedi.js */ "./src/jedi.js"); -/* harmony import */ var _ref_parser_ref_parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ref-parser/ref-parser.js */ "./src/ref-parser/ref-parser.js"); - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - Jedi: _jedi_js__WEBPACK_IMPORTED_MODULE_0__["default"], - RefParser: _ref_parser_ref_parser_js__WEBPACK_IMPORTED_MODULE_1__["default"] -}); - -})(); - -__webpack_exports__ = __webpack_exports__["default"]; -/******/ return __webpack_exports__; -/******/ })() -; -}); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWb0M7QUFDZ0Q7QUFDZDs7QUFFdEU7QUFDQTtBQUNBO0FBQ0E7QUFDQSw2QkFBNkIsaURBQVc7QUFDeEM7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7O0FBRUE7QUFDQTtBQUNBOztBQUVBLG9CQUFvQixtRUFBZTtBQUNuQyx1QkFBdUIsbUVBQWU7QUFDdEMsb0JBQW9CLG1FQUFlOztBQUVuQztBQUNBLGlCQUFpQix3REFBSztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsd0RBQUs7QUFDcEIsWUFBWSx3REFBSztBQUNqQixLQUFLOztBQUVMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSx1Q0FBdUMsbUVBQWU7O0FBRXREO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EscUJBQXFCLGtFQUFlO0FBQ3BDLFFBQVE7QUFDUiw0QkFBNEIsa0VBQWM7QUFDMUMscUJBQXFCLHdEQUFLO0FBQzFCOztBQUVBO0FBQ0EsOEJBQThCLHdEQUFLO0FBQ25DO0FBQ0EsT0FBTzs7QUFFUDtBQUNBO0FBQ0E7QUFDQTtBQUNBLE9BQU87O0F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bmdlJywgKCkgPT4ge1xuICAgICAgdGhpcy5yZWZyZXNoVUkoKVxuICAgICAgY29uc3QgZXJyb3JzID0gdGhpcy5pbnN0YW5jZS5nZXRFcnJvcnMoKVxuICAgICAgdGhpcy5zaG93VmFsaWRhdGlvbkVycm9ycyhlcnJvcnMpXG4gICAgfSlcbiAgfVxuXG4gIC8qKlxuICAgKiBJbml0aWFsaXplcyB0aGUgZWRpdG9yXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKHRoaXMua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HJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2hpbGQoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCB8fCB0aGlzLmluc3RhbmNlLmlzUmVhZE9ubHkoKSkge1xuICAgICAgICAgIGNoaWxkLnVpLmRpc2FibGUoKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNoaWxkLnVpLmVuYWJsZSgpXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChjaGlsZC51aS5jb250cm9sLmNvbnRhaW5lci5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZS5yZW1vdmVDaGlsZChjaGlsZC51aS5jb250cm9sLmNvbnRhaW5lcilcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pXG4gIH1cblxuICByZWZyZXNoVUkgKCkge1xuICAgIHRoaXMucmVmcmVzaEludGVyYWN0aXZlR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cnJvckFkZGl0aW9uYWxQcm9wZXJ0aWVzLCB7XG4gICAgICAgICAgICAgICAgcHJvcGVydHk6IHByb3BlcnR5XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICAgIGNvbnN0cmFpbjogJ2FkZGl0aW9uYWxQcm9wZXJ0aWVzJ1xuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWRlZmluZWRJblBhdHRlcm5Qcm9wZXJ0eSAmJiBpc09iamVjdChhZGRpdGlvbmFsUHJvcGVydGllcykgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBjb25zdCBlZGl0b3IgPSBuZXcgSmVkaSh7XG4gICAgICAgICAgICByZWZQYXJzZXI6IHZhbGlkYXRvci5yZWZQYXJzZXIsXG4gICAgICAgICAgICBzY2hlbWE6IGFkZGl0aW9uYWxQcm9wZXJ0aWVzLFxuICAgICAgICAgICAgZGF0YTogdmFsdWVbcHJvcGVydHldXG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGNvbnN0IGFkZGl0aW9uYWxQcm9wZXJ0eUVycm9ycyA9IGVkaXRvci5nZXRFcnJvcnMoKS5tYXAoKGVycm9yKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBtZXNzYWdlczogZXJyb3IubWVzc2FnZXMsXG4gICAgICAgICAgICAgIHBhdGg6IHByb3BlcnR5LFxuICAgICAgICAgICAgICBjb25zdHJhaW46ICdhZGRpdGlvbmFsUHJvcGVydGllcydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgZXJyb3JzID0gWy4uLmVycm9ycywgLi4uYWRkaXRpb25hbFByb3BlcnR5RXJyb3JzXVxuXG4gICAgICAgICAgZWRpdG9yLmRlc3Ryb3koKVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH1cb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luQ29udGFpbnMpXG5cbiAgICAgIGlmIChtaW5Db250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvck1pbkNvbnRhaW5zLCB7XG4gICAgICAgICAgICAgIGNvdW50ZXI6IGNvdW50ZXIsXG4gICAgICAgICAgICAgIG1pbkNvbnRhaW5zOiBtaW5Db250YWluc1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICBdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnbWluQ29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChjb250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbaTE4bi5lcnJvckNvbnRhaW5zXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ2NvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChpc1NldChtYXhDb250YWlucykpIHtcbiAgICAgIGNvbnN0IG1heENvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyID4gbWF4Q29udGFpbnMpXG5cbiAgICAgIGlmIChtYXhDb250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvck1heENvbnRhaW5zLCB7XG4gICAgICAgICAgICAgIGNvdW50ZXI6IGNvdW50ZXIsXG4gICAgICAgICAgICAgIG1heENvbnRhaW5zOiBtYXhDb250YWluc1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICBdLFxuICAgICAgICAgIHBhdGg6IH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KSA9PiB7XG4gICAgICAgICAgaWYgKGlzU2V0KHN1YnNjaGVtYVsncHJvcGVydGllcyddKSkge1xuICAgICAgICAgICAgcHJvcGVydGllcyA9IHsgLi4ucHJvcGVydGllcywgLi4uc3Vic2NoZW1hWydwcm9wZXJ0aWVzJ10gfVxuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9KVxuXG4gICAgaWYgKHByb3BlcnRpZXMpIHtcbiAgICAgIE9iamVjdC5rZXlzKHZhbHVlKS5mb3JFYWNoKChwcm9wZXJ0eSkgPT4ge1xuICAgICAgICBsZXQgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gZmFsc2VcblxuICAgICAgICBpZiAoaXNTZXQocGF0dGVyblByb3BlcnRpZXMpKSB7XG4gICAgICAgICAgT2JqZWN0LmtleXMocGF0dGVyblByb3BlcnRpZXMpLmZvckVhY2goKHBhdHRlcm4pID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHJlZ2V4cCA9IG5ldyBSZWdFeHAocGF0dGVybilcbiAgICAgICAgICAgIGRlZmluZWRJblBhdHRlcm5Qcm9wZXJ0eSA9IHJlZ2V4cC50ZXN0KHByb3BlcnR5KVxuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWRlZmluZWRJblBhdHRlcm5Qcm9wZXJ0eSAmJiB1bmV2YWx1YXRlZFByb3BlcnRpZXMgPT09IGZhbHNlICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JVbmV2YWx1YXRlZFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAndW5ldmFsdWF0ZWRQcm9wZXJ0aWVzJ1xuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWRlZmluZWRJblBhdHRlcm5Qcm9wZXJ0eSAmJiBpc09iamVjdCh1bmV2YWx1YXRlZFByb3BlcnRpZXMpICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgY29uc3QgZWRpdG9yID0gbmV3IEplZGkoe1xuICAgICAgICAgICAgcmVmUGFyc2VyOiB2YWxpZGF0b3IucmVmUGFyc2VyLFxuICAgICAgICAgICAgc2NoZW1hOiB1bmV2YWx1YXRlZFByb3BlcnRpZXMsXG4gICAgICAgICAgICBkYXRhOiB2YWx1ZVtwcm9wZXJ0eV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgdW5ldmFsdWF0ZWRQcm9wZXJ0aWVzRXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG1lc3NhZ2VzOiBlcnJvci5tZXNzYWdlcyxcbiAgICAgICAgICAgICAgcGF0aDogcHJvcGVydHksXG4gICAgICAgICAgICAgIGNvbnN0cmFpbjogJ3VuZXZhbHVhdGVkUHJvcGVydGllcydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgZXJyb3JzID0gWy4uLmVycm9ycywgLi4udW5ldmFsdWF0ZWRQcm9wZXJ0aWVzRXJyb3JzXVxuXG4gICAgICAgICAgZWRpdG9yLmRlc3Ryb3koKVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBlcnJvcnNcbn1cbiIsImltcG9ydCB7IGlzQXJyYXksIGlzT2JqZWN0LCBpc1NldCwgc29ydE9iamVjdCB9IGZyb20gJy4uLy4uL2hlbHB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aSxcbiAgUmVmUGFyc2VyXG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file + async load(t) { + try { + const e = await fetch(t); + if (!e.ok) + throw new Error("Network response was not ok"); + return await e.json(); + } catch (e) { + throw console.error("Error loading", t, e), e; + } + } +} +const cs = { + Jedi: w, + RefParser: os +}; +export { + cs as default +}; diff --git a/dist/jedi.umd.cjs b/dist/jedi.umd.cjs index d2d85b8..2a8380e 100644 --- a/dist/jedi.umd.cjs +++ b/dist/jedi.umd.cjs @@ -1 +1 @@ -(function(K,O){typeof exports=="object"&&typeof module<"u"?module.exports=O():typeof define=="function"&&define.amd?define(O):(K=typeof globalThis<"u"?globalThis:K||self,K.Jedi=O())})(this,function(){"use strict";function K(){const i=[];return function(t,e){if(typeof e!="object"||e===null)return e;for(;i.length>0&&i.at(-1)!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)}}function O(i){if(!(typeof i>"u"))return JSON.parse(JSON.stringify(i,K()))}function se(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ut(i,t,e){return i.replace(new RegExp(se(t),"g"),e)}function w(i){return Ut(Ut(i,"#","root"),"/","-")}function N(i,t){return Object.prototype.hasOwnProperty.call(i,t)}function wt(i){return Object.keys(i).sort().reduce((t,e)=>(t[e]=i[e],t),{})}function St(i,t){return m(i)&&m(t)&&(i=wt(i),t=wt(t)),JSON.stringify(i)===JSON.stringify(t)}function Ot(i,t){return!St(i,t)}function At(i){return i===null}function d(i){return typeof i<"u"}function H(i){return typeof i>"u"}function P(i){return typeof i=="number"}function B(i){return P(i)&&i===Math.floor(i)}function M(i){return typeof i=="string"}function A(i){return typeof i=="boolean"}function L(i){return Array.isArray(i)}function m(i){return!At(i)&&!L(i)&&typeof i=="object"}function ie(i){let t="any";return P(i)?t=B(i)?"integer":"number":M(i)?t="string":A(i)?t="boolean":L(i)?t="array":At(i)?t="null":m(i)&&(t="object"),t}function z(i,...t){if(!t.length)return i;const e=t.shift();return m(i)&&m(e)&&Object.keys(e).forEach(s=>{m(e[s])?(i[s]||Object.assign(i,{[s]:{}}),z(i[s],e[s])):Object.assign(i,{[s]:e[s]})}),z(i,...t)}function Dt(i,t){return Object.keys(t).forEach(function(e){e in i&&typeof i[e]==typeof t[e]&&(i[e]=t[e])}),i}function ne(i,t){const e=t.split(".");let s=i;for(const n of e)if(Array.isArray(s)&&/^\d+$/.test(n)){const r=parseInt(n);if(r>=0&&r{e=e.replace(/\s/g,"");const s=e.split(/{{|}}/)[1];return ne(t,s)})}function re(i,t,e){return Math.max(t,Math.min(i,e))}function Ht(i){const t=[],e=new Set;for(const s of i){const n=JSON.stringify(s);e.has(n)||(e.add(n),t.push(s))}return t}function Pt(i){return m(i.additionalProperties)||A(i.additionalProperties)?i.additionalProperties:void 0}function ae(i){return m(i.propertyNames)||A(i.propertyNames)?i.propertyNames:void 0}function $t(i){return L(i.allOf)?i.allOf:void 0}function $(i){return L(i.anyOf)?i.anyOf:void 0}function oe(i){return i.const}function ce(i){return m(i.contains)||A(i.contains)?i.contains:void 0}function le(i){return i.default}function Kt(i){return m(i.dependentRequired)?i.dependentRequired:void 0}function de(i){return m(i.dependentSchemas)?i.dependentSchemas:void 0}function T(i){return M(i.description)?i.description:void 0}function Tt(i){return m(i.else)||A(i.else)?i.else:void 0}function k(i){if(L(i.enum)&&i.enum.length>0)return i.enum}function he(i){return P(i.exclusiveMaximum)?i.exclusiveMaximum:void 0}function ue(i){return P(i.exclusiveMinimum)?i.exclusiveMinimum:void 0}function q(i){return M(i.format)?i.format:void 0}function jt(i){if(m(i.if)||A(i.if))return i.if}function zt(i){return m(i.items)||A(i.items)?i.items:void 0}function pe(i){return P(i.maximum)?i.maximum:void 0}function me(i){if(B(i.maxContains)&&i.maxContains>=0)return i.maxContains}function Jt(i){if(B(i.maxItems)&&i.maxItems>=0)return i.maxItems}function fe(i){if(B(i.maxLength)&&i.maxLength>=0)return i.maxLength}function ge(i){if(B(i.maxProperties))return i.maxProperties}function ve(i){return P(i.minimum)?i.minimum:void 0}function be(i){if(B(i.minContains)&&i.minContains>=0)return i.minContains}function Gt(i){if(B(i.minItems)&&i.minItems>=0)return i.minItems}function ye(i){if(B(i.minLength)&&i.minLength>=0)return i.minLength}function Ce(i){if(B(i.minProperties)&&i.minProperties>=0)return i.minProperties}function Ee(i){if(P(i.multipleOf)&&i.multipleOf>=0)return i.multipleOf}function Le(i){return m(i.not)||A(i.not)?i.not:void 0}function f(i,t){return i.options&&i.options[t]?i.options[t]:void 0}function xe(i){return M(i.pattern)?i.pattern:void 0}function kt(i){return m(i.patternProperties)?i.patternProperties:void 0}function Mt(i){return L(i.prefixItems)?i.prefixItems:void 0}function Vt(i){return m(i.properties)?i.properties:void 0}function _t(i){return A(i.readOnly)?i.readOnly:void 0}function Wt(i){return L(i.required)?[...new Set(i.required)]:void 0}function Rt(i){return m(i.then)||A(i.then)?i.then:void 0}function I(i){return M(i.title)?i.title:void 0}function V(i){if(M(i.type)||L(i.type))return i.type}function J(i){return L(i.oneOf)?i.oneOf:void 0}function Ie(i){return A(i.unevaluatedProperties)?i.unevaluatedProperties:void 0}function we(i){return A(i.uniqueItems)?i.uniqueItems:void 0}function G(i,t,e,s){let n=[];const r=$t(e);return d(r)&&r.forEach(a=>{const o=new S({refParser:i.refParser,schema:a,data:t,rootName:s}),c=o.getErrors();o.destroy(),n=[...n,...c],n=Ht(n)}),n}const v={errorAdditionalProperties:'Has additional property "{{ property }}" but no additional properties are allowed.',errorAnyOf:"Must validate against at least one of the provided schemas.",errorConst:"Must have value of: {{ const }}.",errorContains:"Must contain at least one item matching the provided schema.",errorDependentRequired:"Must have the required properties: {{ dependentRequired }}.",errorEnum:"Must be one of the enumerated values: {{ enum }}.",errorExclusiveMaximum:"Must be less than {{ exclusiveMaximum }}.",errorExclusiveMinimum:"Must be greater than {{ exclusiveMinimum }}.",errorFormat:"Must be a valid {{ format }}.",errorItems:"Must have items that validate against the provided schema.",errorMaximum:"Must be at most {{ maximum }}.",errorMaxItems:"Must have at most {{ maxItems }} items.",errorMaxLength:"Must be at most {{ maxLength }} characters long.",errorMaxProperties:"Must have at most {{ maxProperties }} properties.",errorMaxContains:"Must contain at most {{ maxContains }} items matching the provided schema. It currently contains {{ counter }}.",errorMinContains:"Must contain at least {{ minContains }} items matching the provided schema. It currently contains {{ counter }}.",errorMinimum:"Must be at least {{ minimum }}.",errorMinItems:"Must have at least {{ minItems }} items.",errorMinLength:"Must be at least {{ minLength }} characters long.",errorMinProperties:"Must have at least {{ minProperties }} properties.",errorMultipleOf:"Must be multiple of {{ multipleOf }}.",errorNot:"Must not validate against the provided schema.",errorOneOf:"Must validate against exactly one of the provided schemas. It currently validates against {{ counter }} of the schemas.",errorPattern:'Must match the pattern: "{{ pattern }}".',errorPrefixItems:"Item {{ index }} fails validation.",errorPropertyNames:'Property name "{{ propertyName }}" fails validation.',errorRequired:"Must have the required properties: {{ required }}.",errorType:"Must be of type {{ type }}.",errorUnevaluatedProperties:'Has invalid unevaluated property "{{ property }}"',errorUniqueItems:"Must have unique items."};function _(i,t,e,s,n){const r=[],a=ye(e);return M(t)&&d(a)&&(t=t.replace(/[\uDCA9]/g,""),t.length{const l=new S({refParser:i.refParser,schema:c,data:t}),h=l.getErrors();l.destroy(),h.length===0&&(o=!0)}),o||r.push({messages:[v.errorAnyOf],path:n,constrain:"anyOf"})}return r}function Q(i,t,e,s,n){const r=[],a=k(e);return d(a)&&!a.some(c=>JSON.stringify(t)===JSON.stringify(c))&&r.push({messages:[y(v.errorEnum,{enum:JSON.stringify(a)})],path:n,constrain:"enum"}),r}function X(i,t,e,s,n){const r=[],a=he(e);return P(t)&&d(a)&&t>=a&&r.push({messages:[y(v.errorExclusiveMaximum,{exclusiveMaximum:a})],path:n,constrain:"exclusiveMaximum"}),r}function Y(i,t,e,s,n){const r=[],a=ue(e);return P(t)&&d(a)&&t<=a&&r.push({messages:[y(v.errorExclusiveMinimum,{exclusiveMinimum:a})],path:n,constrain:"exclusiveMinimum"}),r}function Z(i,t,e,s,n){const r=[],a=q(e);let o=i.validateFormat;if(f(e,"validateFormat")&&(o=e.options.validateFormat),d(a)&&M(t)&&o){let c;a==="email"&&(c=new RegExp(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i)),a==="url"&&(c=new RegExp(/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu)),a==="uuid"&&(c=new RegExp(/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i)),d(c)&&!c.test(t)&&r.push({messages:[y(v.errorFormat,{format:a})],path:n,constrain:"format"})}return r}function tt(i,t,e,s,n){const r=[],a=zt(e),o=Mt(e);if(L(t)&&d(a)){const c=d(o)?o.length:0;a===!1&&t.length>0&&t.length>c&&r.push({messages:[v.errorItems],path:n,constrain:"items"})}return r}function et(i,t,e,s,n){const r=[],a=Jt(e);return L(t)&&d(a)&&t.length>a&&r.push({messages:[y(v.errorMaxItems,{maxItems:a})],path:n,constrain:"maxItems"}),r}function st(i,t,e,s,n){const r=[],a=fe(e);return M(t)&&d(a)&&(t=t.replace(/[\uDCA9]/g,""),t.length>a&&r.push({messages:[y(v.errorMaxLength,{maxLength:a})],path:n,constrain:"maxLength"})),r}function it(i,t,e,s,n){const r=[],a=ge(e);return m(t)&&d(a)&&Object.keys(t).length>a&&r.push({messages:[y(v.errorMaxProperties,{maxProperties:a})],path:n,constrain:"maxProperties"}),r}function nt(i,t,e,s,n){const r=[],a=ve(e);return P(t)&&d(a)&&t{const l=new S({refParser:i.refParser,schema:c,data:t}),h=l.getErrors();l.destroy(),h.length===0&&o++}),o!==1&&r.push({messages:[y(v.errorOneOf,{counter:o})],path:n,constrain:"oneOf"})}return r}function dt(i,t,e,s,n){const r=[],a=xe(e);return M(t)&&d(a)&&!new RegExp(a).test(t)&&r.push({messages:[y(v.errorPattern,{pattern:a})],path:n,constrain:"pattern"}),r}function ht(i,t,e,s){let n=[];const r=kt(e);return m(t)&&d(r)&&Object.keys(t).forEach(a=>{Object.keys(r).forEach(o=>{if(new RegExp(o).test(a)){const l=r[o],h=new S({refParser:i.refParser,schema:l,data:t[a]}),u=h.getErrors().map(p=>({messages:p.messages,path:s+"/"+a,constrain:"patternProperties"}));n=[...n,...u],h.destroy()}})}),n}function ut(i,t,e,s,n){const r=[],a=Wt(e);if(m(t)&&d(a)){const o=[],c=Object.keys(t);a.forEach(h=>{c.includes(h)||o.push(h)}),o.length>0&&r.push({messages:[y(v.errorRequired,{required:o.join(", ")})],path:n,constrain:"required"})}return r}function pt(i,t,e,s,n){const r=[],a=V(e);if(a==="any")return r;if(d(a)){const o={string:l=>M(l),number:l=>P(l),integer:l=>B(l),boolean:l=>A(l),array:l=>L(l),object:l=>m(l),null:l=>At(l)};let c=!0;L(a)?c=a.some(l=>o[l](t)):c=o[a](t),c||r.push({messages:[y(v.errorType,{type:a,valueType:ie(t)})],path:n,constrain:"type"})}return r}function mt(i,t,e,s,n){const r=[],a=pe(e);return P(t)&&d(a)&&t>a&&r.push({messages:[y(v.errorMaximum,{maximum:a})],path:n,constrain:"maximum"}),r}function ft(i,t,e,s,n){const r=[],a=we(e);if(L(t)&&d(a)&&a===!0){const o=[];let c=!1;for(let h=0;hg===p),c)break;o.push(p)}c&&r.push({messages:[v.errorUniqueItems],path:n,constrain:"uniqueItems"})}return r}function gt(i,t,e,s,n){let r=[];const a=Pt(e),o=kt(e),c=Vt(e);if(m(t)&&d(a)){const l=d(c)?c:{},h=a,u=o;l&&Object.keys(t).forEach(p=>{let g=!1;if(d(u)&&Object.keys(u).forEach(b=>{g=new RegExp(b).test(p)}),!g&&h===!1&&!N(l,p)&&r.push({messages:[y(v.errorAdditionalProperties,{property:p})],path:n,constrain:"additionalProperties"}),!g&&m(h)&&!N(l,p)){const b=new S({refParser:i.refParser,schema:h,data:t[p]}),E=b.getErrors().map(C=>({messages:C.messages,path:p,constrain:"additionalProperties"}));r=[...r,...E],b.destroy()}})}return r}const Se={additionalProperties:gt,allOf:G,anyOf:W,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,required:ut,type:pt,uniqueItems:ft};function vt(i,t,e,s,n){const r=[],a=oe(e);return d(a)&&Ot(t,a)&&r.push({messages:[y(v.errorConst,{const:JSON.stringify(a)})],path:n,constrain:"const"}),r}function bt(i,t,e,s,n){const r=[],a=ce(e),o=be(e),c=me(e);if(L(t)&&d(a)){let l=0;t.forEach(u=>{const p=new S({refParser:i.refParser,schema:a,data:u});p.getErrors().length===0&&l++,p.destroy()});const h=l===0;d(o)?lc&&r.push({messages:[y(v.errorMaxContains,{counter:l,maxContains:c})],path:n,constrain:"maxContains"})}return r}function yt(i,t,e,s,n){const r=[],a=Kt(e);if(m(t)&&d(a)){let o=[];Object.keys(a).forEach(l=>{d(t[l])&&(o=a[l].filter(u=>!N(t,u)))}),o.length>0&&r.push({messages:[y(v.errorDependentRequired,{dependentRequired:o.join(", ")})],path:n,constrain:"dependentRequired"})}return r}function Ct(i,t,e){let s=[];const n=de(e);return m(t)&&d(n)&&Object.keys(n).forEach(r=>{if(d(t[r])){const a=n[r],o=new S({refParser:i.refParser,schema:a,data:t}),c=o.getErrors();o.destroy(),s=[...s,...c]}}),s}function Et(i,t,e){const s=[],n=jt(e),r=Rt(e),a=Tt(e);if(d(n)){if(H(r)&&H(a))return s;const o=new S({refParser:i.refParser,schema:n,data:t}),c=o.getErrors();o.destroy();let l=[],h=[];if(d(r)){const u=new S({refParser:i.refParser,schema:r,data:t});l=u.getErrors(),u.destroy()}if(d(a)){const u=new S({refParser:i.refParser,schema:a,data:t});h=u.getErrors(),u.destroy()}if(n===!0)return l;if(n===!1)return h;if(c.length===0)return l;if(c.length>0)return h}return s}function Lt(i,t,e,s,n){const r=[],a=Mt(e);return L(t)&&d(a)&&a.forEach((o,c)=>{const l=t[c];if(d(l)){const h=new S({refParser:i.refParser,schema:o,data:l}),u=h.getErrors();h.destroy(),u.length>0&&r.push({messages:[y(v.errorPrefixItems,{index:c})],path:n,constrain:"prefixItems"})}}),r}const Oe={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,required:ut,type:pt,uniqueItems:ft},Ae={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,required:ut,type:pt,uniqueItems:ft};function Qt(i,t,e,s,n){let r=[];const a=Ie(e),o=kt(e),c=Vt(e),l=$t(e),h=$(e),u=J(e);if(m(t)&&d(a)){let p=d(c)?c:{};const g=a,b=o;[l,h,u].forEach(C=>{d(C)&&C.forEach(x=>{d(x.properties)&&(p={...p,...x.properties})})}),p&&Object.keys(t).forEach(C=>{let x=!1;if(d(b)&&Object.keys(b).forEach(F=>{x=new RegExp(F).test(C)}),!x&&g===!1&&!N(p,C)&&r.push({messages:[y(v.errorUnevaluatedProperties,{property:C})],path:n,constrain:"unevaluatedProperties"}),!x&&m(g)&&!N(p,C)){const F=new S({refParser:i.refParser,schema:g,data:t[C]}),R=F.getErrors().map(j=>({messages:j.messages,path:C,constrain:"unevaluatedProperties"}));r=[...r,...R],F.destroy()}})}return r}const Pe={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,required:ut,type:pt,unevaluatedProperties:Qt,uniqueItems:ft};function Te(i,t,e,s,n){const r=[],a=ae(e);return m(t)&&d(a)&&Object.keys(t).forEach(o=>{new S({refParser:i.refParser,schema:a,data:o}).getErrors().length>0&&r.push({messages:[y(v.errorPropertyNames,{propertyName:o})],path:n,constrain:"propertyNames"})}),r}const Xt={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,propertyNames:Te,required:ut,type:pt,unevaluatedProperties:Qt,uniqueItems:ft};class je{constructor(t={}){this.refParser=t.refParser,this.validateFormat=t.validateFormat?t.validateFormat:!1,this.draft=Xt,this.jsonSchemaDrafts={"http://json-schema.org/draft-04/schema#":Se,"http://json-schema.org/draft-06/schema#":Oe,"http://json-schema.org/draft-07/schema#":Ae,"https://json-schema.org/draft/2019-09/schema":Pe,"https://json-schema.org/draft/2020-12/schema":Xt}}getErrors(t,e,s,n){let r=[];const a=f(e,"messages"),o=O(e);return A(o)&&o===!0?r:A(o)&&o===!1?[{messages:d(a)?a:["invalid"],path:n}]:(Object.keys(this.draft).forEach(c=>{if(N(o,c)){const l=this.draft[c],h=l(this,t,e,s,n);h&&(r=[...r,...h])}}),r.length>0&&a&&(r=[{messages:a,path:n}]),r)}}class Yt{constructor(){this.listeners=[]}on(t,e){this.listeners.push({name:t,callback:e})}emit(t,e=void 0){this.listeners.filter(n=>n.name===t).forEach(n=>{n.callback(e)})}destroy(){Object.keys(this).forEach(t=>{delete this[t]})}}class U extends Yt{constructor(t){super(),this.jedi=t.jedi,this.path=t.path||this.jedi.rootName,this.schema=t.schema,this.value=d(t.value)?t.value:void 0,this.isActive=!0,this.parent=t.parent||null,this.children=[],this.ui=null,this.init()}init(){this.register(),this.setInitialValue(),this.prepare(),this.setDefaultValue(),this.jedi.options.isEditor&&this.setUI(),this.on("change",()=>{this.parent&&this.parent.onChildChange()})}setUI(){}getKey(){return this.path.split(this.jedi.pathSeparator).pop()}register(){this.jedi.register(this)}unregister(){this.jedi.unregister(this)}setInitialValue(){if(H(this.value)){let t;const e=V(this.schema);e==="boolean"&&(t=!1),e==="number"&&(t=0),e==="integer"&&(t=0),e==="string"&&(t=""),e==="array"&&(t=[]),e==="object"&&(t={}),e==="null"&&(t=null),this.value=t}}setDefaultValue(){const t=le(this.schema);d(t)&&this.setValue(t,!1)}getValue(){return this.value}setValue(t,e=!0){this.value=t,this.emit("set-value",t),e&&this.emit("change")}onChildChange(){}getErrors(){if(!this.isActive)return[];const t=this.jedi.validator.getErrors(this.getValue(),this.schema,this.getKey(),this.path);return Ht(t)}prepare(){}activate(){this.isActive===!1&&(this.isActive=!0,this.emit("change"))}deactivate(){this.isActive===!0&&(this.isActive=!1,this.emit("change"))}isReadOnly(){let t=!1;return _t(this.schema)===!0&&(t=!0),this.parent&&_t(this.parent.schema)===!0&&(t=!0),t}destroy(){this.listeners=[],this.children.forEach(t=>{t.destroy()}),this.unregister(),this.ui&&this.ui.destroy(),Object.keys(this).forEach(t=>{delete this[t]}),super.destroy()}}const ke={properties:"glyphicon glyphicon-list",delete:"glyphicon glyphicon-trash",add:"glyphicon glyphicon-plus",moveUp:"glyphicon glyphicon-arrow-up",moveDown:"glyphicon glyphicon-arrow-down"},Me={properties:"bi bi-card-list",delete:"bi bi-trash2",add:"bi bi-plus",moveUp:"bi bi-arrow-up",moveDown:"bi bi-arrow-down"},Ve={properties:"icon-list",delete:"icon-trash",add:"icon-plus",moveUp:"icon-arrow-up",moveDown:"icon-arrow-down"},Re={properties:"fa fa-list",delete:"fa fa-trash-o",add:"fa fa-plus",moveUp:"fa fa-arrow-up",moveDown:"fa fa-arrow-down"},Be={properties:"fas fa-list",delete:"fas fa-trash",add:"fas fa-plus",moveUp:"fas fa-arrow-up",moveDown:"fas fa-arrow-down"},qe={properties:"fa-solid fa-list",delete:"fa-solid fa-trash",add:"fa-solid fa-plus",moveUp:"fa-solid fa-arrow-up",moveDown:"fa-solid fa-arrow-down"};class xt{constructor(t=null){this.icons=t,this.useToggleEvents=!0,this.init()}init(){this.useToggleEvents=!0}getIcon(t){const e=document.createElement("i"),s=this.icons[t].split(" ");return s.length>0&&s.forEach(n=>{e.classList.add(n)}),e}getEditorContainer(){const t=document.createElement("div");return t.classList.add("jedi-editor-container"),t}getFieldset(){return document.createElement("fieldset")}getLegend(t){const e=document.createElement("legend"),s=document.createElement("span");return e.setAttribute("aria-labelledby","#legend-"+t.id),s.textContent=t.textContent,s.setAttribute("id","#legend-"+t.id),e.appendChild(s),e}getCard(){return document.createElement("div")}getCardHeader(){return document.createElement("div")}getCardBody(){return document.createElement("div")}getActionsSlot(){const t=document.createElement("div");return t.classList.add("jedi-actions-slot"),t}getArrayActionsSlot(){const t=this.getBtnGroup();return t.classList.add("jedi-array-actions-slot"),t}getChildrenSlot(){const t=document.createElement("div");return t.classList.add("jedi-child-editors-slot"),t}getMessagesSlot(){const t=document.createElement("div");return t.classList.add("jedi-messages-slot"),t.setAttribute("aria-atomic","false"),t.setAttribute("aria-live","polite"),t}getControlSlot(){const t=document.createElement("div");return t.classList.add("jedi-control-slot"),t}getPropertiesSlot(t){const e=document.createElement("div");return e.classList.add("jedi-properties-slot"),e.setAttribute("id",t.id),this.useToggleEvents&&(e.style.display="none"),e}getPropertiesAriaLive(){const t=document.createElement("div");return t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t}getAriaLiveMessage(t){const e=document.createElement("p");return e.textContent=t,this.visuallyHidden(e),e}getPropertiesToggle(t){const e=this.getButton(t);return e.classList.add("jedi-properties-toggle"),this.useToggleEvents&&e.addEventListener("click",()=>{t.propertiesContainer.hasAttribute("style")?this.visuallyVisible(t.propertiesContainer):this.visuallyHidden(t.propertiesContainer)}),e}getPropertiesActivators(){const t=document.createElement("div");return t.classList.add("jedi-properties-container"),t}getBtnGroup(){const t=document.createElement("span");return t.style.display="initial",t}getButton(t){const e=document.createElement("button");e.setAttribute("type","button"),t.value&&(e.value=t.value),t.id&&e.setAttribute("id",t.id);const s=document.createElement("span");if(s.textContent=t.textContent,this.icons&&t.icon){const n=this.getIcon(t.icon);n.setAttribute("title",t.textContent),e.appendChild(n),this.visuallyHidden(s)}return e.appendChild(s),e}getArrayBtnAdd(){const t=this.getButton({textContent:"Add item into",icon:"add"});return t.classList.add("jedi-array-add"),t}getAddPropertyButton(){const t=this.getButton({textContent:"Add property"});return t.classList.add("jedi-add-property-btn"),t}getDeleteItemBtn(){const t=this.getButton({textContent:"Delete item",icon:"delete"});return t.classList.add("jedi-array-delete"),t}getMoveUpItemBtn(){const t=this.getButton({textContent:"Move up",icon:"moveUp"});return t.classList.add("jedi-array-move-up"),t}getMoveDownItemBtn(){const t=this.getButton({textContent:"Move down",icon:"moveDown"});return t.classList.add("jedi-array-move-down"),t}getDescription(t){const e=document.createElement("small");return e.textContent=t.textContent,e}getObjectControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=this.getCardBody(),a=this.getPropertiesAriaLive(),o=this.getDescription({textContent:t.description}),c=this.getMessagesSlot(),l=this.getChildrenSlot(),h=this.getPropertiesSlot({id:"properties-slot-"+t.id}),u=this.getPropertiesToggle({textContent:t.title+" properties",id:"properties-slot-toggle-"+t.id,icon:"properties",propertiesContainer:h}),p=this.getPropertiesActivators(),g=this.getInputControl({type:"text",id:"jedi-add-property-input-"+t.id,label:"Property"}),b=this.getAddPropertyButton(),E=this.getFieldset(),C=this.getLegend({textContent:t.title,id:t.id});return b.classList.add("jedi-object-add"),e.appendChild(E),E.appendChild(C),E.appendChild(r),r.appendChild(o),r.appendChild(c),C.appendChild(s),s.appendChild(n),r.appendChild(h),r.appendChild(l),t.addProperty&&(h.appendChild(g.container),h.appendChild(b)),t.editableProperties&&(s.appendChild(u),h.appendChild(a),h.appendChild(p)),{container:e,body:r,actions:s,messages:c,childrenSlot:l,propertiesToggle:u,propertiesContainer:h,addPropertyControl:g,addPropertyBtn:b,ariaLive:a,propertiesActivators:p,arrayActions:n}}getArrayControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=this.getCardBody(),a=this.getDescription({textContent:t.description}),o=this.getMessagesSlot(),c=this.getChildrenSlot(),l=this.getBtnGroup(),h=this.getArrayBtnAdd(),u=this.getFieldset(),p=this.getLegend({textContent:t.title,id:t.id});return e.appendChild(u),u.appendChild(p),u.appendChild(r),r.appendChild(a),r.appendChild(o),p.appendChild(s),s.appendChild(l),l.appendChild(h),s.appendChild(n),r.appendChild(c),{container:e,body:r,actions:s,messages:o,childrenSlot:c,btnGroup:l,addBtn:h,arrayActions:n}}getMultipleControl(t){const e=document.createElement("div"),s=this.getCard(),n=this.getActionsSlot(),r=this.getArrayActionsSlot(),a=this.getCardHeader({textContent:t.title,srOnly:t.srOnly}),o=this.getCardBody(),c=this.getDescription({textContent:t.description}),l=this.getMessagesSlot(),h=this.getChildrenSlot(),u=this.getSwitcher({values:t.switcherOptionValues,titles:t.switcherOptionsLabels,id:t.id+"-switcher",label:t.id+"-switcher",srOnly:!0,readOnly:t.readOnly});return u.container.classList.add("jedi-switcher"),e.appendChild(c),e.appendChild(s),s.appendChild(a),s.appendChild(o),a.appendChild(n),n.appendChild(r),n.appendChild(u.container),o.appendChild(l),o.appendChild(h),{container:e,card:s,header:a,body:o,actions:n,messages:l,childrenSlot:h,switcher:u,arrayActions:r}}getCircularControl(){const t=document.createElement("div"),e=this.getActionsSlot(),s=this.getArrayActionsSlot(),n=document.createElement("div"),r=this.getMessagesSlot();return n.textContent="CIRCULAR",t.appendChild(n),t.appendChild(r),t.appendChild(e),e.appendChild(s),{container:t,description:n,messages:r,actions:e,arrayActions:s}}getNullControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("label");r.setAttribute("for",t.id);const a=document.createElement("span");a.textContent=t.label,t.srOnly&&this.visuallyHidden(r);const o=t.id+"-description",c=document.createElement("div");c.setAttribute("id",o),t.description&&(c.textContent=t.description);const l=this.getMessagesSlot();return e.appendChild(r),e.appendChild(c),e.appendChild(l),e.appendChild(s),s.appendChild(n),r.appendChild(a),{container:e,label:r,labelText:a,description:c,messages:l,actions:s,arrayActions:n}}getTextareaControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("textarea");r.setAttribute("id",t.id),r.style.width="100%";const a=document.createElement("label");a.setAttribute("for",t.id);const o=document.createElement("span");o.textContent=t.label,t.srOnly&&this.visuallyHidden(a);const c=document.createElement("div"),l=t.id+"-description";c.setAttribute("id",l),t.description&&(c.textContent=t.description);const h=this.getMessagesSlot(),u=t.id+"-messages";h.setAttribute("id",u);const p=u+" "+l;return r.setAttribute("aria-describedby",p),e.appendChild(a),e.appendChild(r),e.appendChild(c),e.appendChild(h),e.appendChild(s),s.appendChild(n),a.appendChild(o),{container:e,input:r,label:a,labelText:o,description:c,messages:h,actions:s,arrayActions:n}}getInputControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("input");r.setAttribute("type",t.type),r.setAttribute("id",t.id),r.style.width="100%";const a=document.createElement("label");a.setAttribute("for",t.id);const o=document.createElement("span");o.textContent=t.label,t.srOnly&&this.visuallyHidden(a);const c=document.createElement("div"),l=t.id+"-description";c.setAttribute("id",l),t.description&&(c.textContent=t.description);const h=this.getMessagesSlot(),u=t.id+"-messages";h.setAttribute("id",u);const p=u+" "+l;return r.setAttribute("aria-describedby",p),e.appendChild(a),e.appendChild(r),e.appendChild(c),e.appendChild(h),e.appendChild(s),s.appendChild(n),a.appendChild(o),{container:e,input:r,label:a,labelText:o,description:c,messages:h,actions:s,arrayActions:n}}getRadiosControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=this.getFieldset(),a=this.getMessagesSlot(),o=this.getCardBody(),c=this.getLegend({id:t.label}),l=t.id+"-messages";a.setAttribute("id",l);const h=document.createElement("div"),u=t.id+"-description";h.setAttribute("id",u),t.srOnly&&this.visuallyHidden(c);const p=[],g=[],b=[],E=[];return t.values.forEach((C,x)=>{const F=document.createElement("div");p.push(F);const R=document.createElement("input");R.setAttribute("type","radio"),R.setAttribute("id",t.id+"-"+x),R.setAttribute("value",C),g.push(R);const j=l+" "+u;R.setAttribute("aria-describedby",j);const It=document.createElement("label");It.setAttribute("for",t.id+"-"+x);const ee=document.createElement("span");E.push(ee),t.titles&&t.titles[x]&&(ee.textContent=t.titles[x]),b.push(It)}),t.description&&(h.textContent=t.description),t.label&&(c.textContent=t.label),e.appendChild(r),e.appendChild(s),r.appendChild(c),r.appendChild(o),s.appendChild(n),p.forEach((C,x)=>{o.appendChild(p[x]),C.appendChild(g[x]),C.appendChild(b[x]),b[x].appendChild(E[x])}),r.appendChild(h),r.appendChild(a),{container:e,fieldset:r,legend:c,body:o,radios:g,labels:b,labelTexts:E,radioControls:p,description:h,messages:a,actions:s,arrayActions:n}}getCheckboxControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("div"),a=document.createElement("input");a.setAttribute("type","checkbox"),a.setAttribute("id",t.id);const o=document.createElement("label");o.setAttribute("for",t.id);const c=document.createElement("span");c.textContent=t.label,t.srOnly&&this.visuallyHidden(o);const l=document.createElement("div"),h=t.id+"-description";l.setAttribute("id",h),t.description&&(l.textContent=t.description);const u=this.getMessagesSlot(),p=t.id+"-messages";u.setAttribute("id",p);const g=p+" "+h;return a.setAttribute("aria-describedby",g),e.appendChild(r),e.appendChild(s),s.appendChild(n),r.appendChild(a),r.appendChild(o),o.appendChild(c),r.appendChild(l),r.appendChild(u),{container:e,formGroup:r,input:a,label:o,labelText:c,description:l,messages:u,actions:s,arrayActions:n}}getSelectControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("select");r.setAttribute("id",t.id),r.style.width="100%",t.values.forEach((g,b)=>{const E=document.createElement("option");E.setAttribute("value",g),t.titles&&t.titles[b]&&(E.textContent=t.titles[b]),r.appendChild(E)});const a=document.createElement("label");a.setAttribute("for",t.id);const o=document.createElement("span");o.textContent=t.label,t.srOnly&&this.visuallyHidden(a);const c=document.createElement("div"),l=t.id+"-description";c.setAttribute("id",l),t.description&&(c.textContent=t.description);const h=this.getMessagesSlot(),u=t.id+"-messages";h.setAttribute("id",u);const p=u+" "+l;return r.setAttribute("aria-describedby",p),e.appendChild(a),e.appendChild(r),a.appendChild(o),e.appendChild(c),e.appendChild(h),e.appendChild(s),s.appendChild(n),{container:e,input:r,label:a,labelText:o,description:c,messages:h,actions:s,arrayActions:n}}getSwitcher(t){return this.getSelectControl(t)}getAlert(t){return this.getInvalidFeedback(t)}getInvalidFeedback(t){const e=document.createElement("div"),s=document.createElement("span"),n=document.createElement("small");return s.textContent=t.message,n.textContent="❌ ",n.classList.add("jedi-error-message"),n.setAttribute("aria-hidden","true"),e.classList.add("jedi-error-message"),e.appendChild(n),e.appendChild(s),e}getRow(){const t=document.createElement("div");return t.classList.add("jedi-row"),t}getCol(t,e,s){const n=document.createElement("div");return n.classList.add("jedi-col-xs-"+t),n.classList.add("jedi-col-md-"+e),s&&n.classList.add("jedi-col-md-offset-"+s),n}getTabList(){const t=document.createElement("ul");return t.classList.add("jedi-nav-list"),t}getTab(t){const e=document.createElement("li"),s=document.createElement("a");return s.classList.add("jedi-nav-link"),s.setAttribute("href","#"+t.id),s.textContent=t.title,e.appendChild(s),{list:e,link:s}}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-content"),t}setTabPaneAttributes(t,e,s){t.setAttribute("id",s),t.classList.add("jedi-tab-pane")}visuallyHidden(t){t.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;")}visuallyVisible(t){t.removeAttribute("style")}}class Ne extends xt{init(){this.useToggleEvents=!1}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("panel"),t.classList.add("panel-default"),t}getLegend(t){const e=super.getLegend(t);return e.classList.add("h5"),e.classList.add("panel-heading"),e.classList.add("pull-left"),e.setAttribute("style","margin: 0; display: flex; justify-content: space-between; align-items: center;"),e}getCard(){const t=super.getCard();return t.classList.add("panel"),t.classList.add("panel-default"),t}getCardHeader(t){const e=super.getCardHeader(t);return e.classList.add("panel-heading"),e.classList.add("text-right"),e}getCardBody(){const t=super.getCardBody();return t.classList.add("panel-body"),t.style.clear="both",t}getPropertiesToggle(t){const e=this.getButton(t);return e.setAttribute("data-toggle","collapse"),e.setAttribute("data-target","#"+t.propertiesContainer.id),e.classList.add("jedi-properties-toggle"),e}getPropertiesSlot(t){const e=super.getPropertiesSlot(t);return e.classList.add("collapse"),e.setAttribute("id",t.id),e}getBtnGroup(){const t=super.getBtnGroup();return t.classList.add("btn-group"),t}getButton(t){const e=super.getButton(t);return e.classList.add("btn"),e.classList.add("btn-xs"),e.classList.add("btn-default"),e}getDescription(t){const e=super.getDescription(t);return e.classList.add("text-muted"),e}getTextareaControl(t){const e=super.getTextareaControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getInputControl(t){const e=super.getInputControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getRadiosControl(t){const e=super.getRadiosControl(t),{body:s,radios:n,labels:r,labelTexts:a,radioControls:o,description:c,messages:l}=e;return o.forEach((h,u)=>{h.classList.add("radio"),s.appendChild(o[u]),h.appendChild(r[u]),r[u].appendChild(n[u]),r[u].appendChild(a[u])}),s.appendChild(c),s.appendChild(l),e}getCheckboxControl(t){const e=super.getCheckboxControl(t),{container:s,formGroup:n,input:r,label:a,labelText:o,description:c,messages:l}=e;return n.classList.add("checkbox"),s.appendChild(n),n.appendChild(a),a.appendChild(r),a.appendChild(o),n.appendChild(c),n.appendChild(l),e}getSelectControl(t){const e=super.getSelectControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getSwitcher(t){const e=super.getSwitcher(t),{container:s,input:n}=e;return s.classList.remove("form-group"),n.classList.remove("form-control"),e}getAlert(t){const e=super.getAlert(t);return e.classList.add("alert"),e.classList.add("alert-danger"),e}getInvalidFeedback(t){const e=super.getInvalidFeedback(t);return e.classList.add("text-danger"),e}getRow(){const t=super.getRow();return t.classList.add("row"),t}getCol(t,e,s){const n=super.getRow();return n.classList.add("col-xs-"+t),n.classList.add("col-md-"+e),s&&n.classList.add("col-md-offset-"+s),n}getTabList(t){const e=super.getTabList(t);return e.classList.add("nav"),t.type==="tabs"?e.classList.add("nav-tabs"):e.classList.add("nav-pills"),e.classList.add("nav-stacked"),t.stacked===!1&&e.classList.remove("nav-stacked"),e}getTab(t){const e=super.getTab(t);return t.active&&e.list.classList.add("active"),e.link.setAttribute("data-toggle","tab"),e}setTabPaneAttributes(t,e,s){super.setTabPaneAttributes(t,e,s),t.classList.add("tab-pane"),e&&(t.classList.add("in"),t.classList.add("active"))}visuallyHidden(t){t.classList.add("sr-only")}visuallyVisible(t){t.classList.remove("sr-only")}}class Fe extends xt{init(){this.useToggleEvents=!1}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("card"),t.classList.add("mb-3"),t}getLegend(t){const e=super.getLegend(t);return e.classList.add("h6"),e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-between"),e.classList.add("align-items-center"),e.classList.add("float-left"),e.classList.add("py-2"),e}getCard(){const t=super.getCard();return t.classList.add("card"),t.classList.add("mb-3"),t}getCardHeader(t){const e=super.getCardHeader(t);return e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-end"),e.classList.add("align-items-center"),e.classList.add("py-1"),e}getCardBody(){const t=super.getCardBody();return t.classList.add("card-body"),t}getPropertiesSlot(t){const e=super.getPropertiesSlot(t);return e.classList.add("collapse"),e.setAttribute("id",t.id),e}getPropertiesToggle(t){const e=this.getButton(t);return e.setAttribute("data-toggle","collapse"),e.setAttribute("data-target","#"+t.propertiesContainer.id),e.classList.add("jedi-properties-toggle"),e}getBtnGroup(){const t=super.getBtnGroup();return t.classList.add("btn-group"),t}getButton(t){const e=super.getButton(t);return e.classList.add("btn"),e.classList.add("btn-sm"),e}getDescription(t){const e=super.getDescription(t);return e.classList.add("text-muted"),e}getTextareaControl(t){const e=super.getTextareaControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getInputControl(t){const e=super.getInputControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getRadiosControl(t){const e=super.getRadiosControl(t),{container:s,body:n,radios:r,labels:a,labelTexts:o,radioControls:c,description:l,messages:h}=e;return s.classList.add("form-group"),c.forEach((u,p)=>{u.classList.add("form-check"),r[p].classList.add("form-check-input"),a[p].classList.add("form-check-label"),n.appendChild(c[p]),u.appendChild(r[p]),u.appendChild(a[p]),a[p].appendChild(o[p])}),n.appendChild(l),n.appendChild(h),e}getCheckboxControl(t){const e=super.getCheckboxControl(t),{container:s,formGroup:n,input:r,label:a,description:o,messages:c}=e;return n.classList.add("form-group"),n.classList.add("form-check"),r.classList.add("form-check-input"),a.classList.add("form-check-label"),s.appendChild(n),n.appendChild(r),n.appendChild(a),n.appendChild(o),n.appendChild(c),e}getSelectControl(t){const e=super.getSelectControl(t),{container:s,input:n}=e;return s.classList.add("form-group"),n.classList.add("form-control"),e}getSwitcher(t){const e=super.getSwitcher(t),{container:s,input:n}=e;return s.classList.remove("form-group"),n.classList.remove("form-control"),e}getAlert(t){const e=super.getAlert(t);return e.classList.add("alert"),e.classList.add("alert-danger"),e}getInvalidFeedback(t){const e=super.getInvalidFeedback(t);return e.classList.add("text-danger"),e.classList.add("form-text"),e.classList.add("d-block"),e}getColumnClass(t,e){return"col-"+t+"-"+e}getRow(){const t=super.getRow();return t.classList.add("row"),t}getCol(t,e,s){const n=super.getRow(t,e,s);return n.classList.add("col-"+t),n.classList.add("col-md-"+e),s&&n.classList.add("offset-md-"+s),n}getTabList(t){const e=super.getTabList();return e.classList.add("nav"),t.type==="tabs"?e.classList.add("nav-tabs"):e.classList.add("nav-pills"),e.classList.add("flex-column"),t.stacked===!1&&e.classList.remove("flex-column"),e}getTab(t){const e=super.getTab(t);return e.list.classList.add("nav-item"),e.link.classList.add("nav-link"),e.link.setAttribute("data-toggle","tab"),t.active&&e.link.classList.add("active"),e}setTabPaneAttributes(t,e,s){super.setTabPaneAttributes(t,e,s),t.classList.add("tab-pane"),e&&t.classList.add("active")}visuallyHidden(t){t.classList.add("sr-only")}visuallyVisible(t){t.classList.remove("sr-only")}}class Ue extends xt{init(){this.useToggleEvents=!1}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("card"),t.classList.add("mb-3"),t}getLegend(t){const e=super.getLegend(t);return e.classList.add("h6"),e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-between"),e.classList.add("align-items-center"),e.classList.add("py-2"),e}getCard(){const t=super.getCard();return t.classList.add("card"),t.classList.add("mb-3"),t}getCardHeader(t){const e=super.getCardHeader(t);return e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-end"),e.classList.add("align-items-center"),e.classList.add("py-1"),e}getCardBody(){const t=super.getCardBody();return t.classList.add("card-body"),t}getPropertiesSlot(t){const e=super.getPropertiesSlot(t);return e.classList.add("collapse"),e.setAttribute("id",t.id),e}getControlSlot(){const t=super.getControlSlot();return t.classList.add("mb-3"),t}getPropertiesToggle(t){const e=this.getButton(t);return e.setAttribute("data-bs-toggle","collapse"),e.setAttribute("data-bs-target","#"+t.propertiesContainer.id),e.classList.add("jedi-properties-toggle"),e}getBtnGroup(){const t=super.getBtnGroup();return t.classList.add("btn-group"),t}getButton(t){const e=super.getButton(t);return e.classList.add("btn"),e.classList.add("btn-sm"),e}getDescription(t){const e=super.getDescription(t);return e.classList.add("text-muted"),e}getTextareaControl(t){const e=super.getTextareaControl(t),{container:s,input:n,label:r}=e;return s.classList.add("mb-3"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getInputControl(t){const e=super.getInputControl(t),{container:s,input:n,label:r}=e;return s.classList.add("mb-3"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getRadiosControl(t){const e=super.getRadiosControl(t),{container:s,body:n,radios:r,labels:a,labelTexts:o,radioControls:c,description:l,messages:h}=e;return s.classList.add("mb-3"),c.forEach((u,p)=>{u.classList.add("form-check"),r[p].classList.add("form-check-input"),a[p].classList.add("form-check-label"),n.appendChild(c[p]),u.appendChild(r[p]),u.appendChild(a[p]),a[p].appendChild(o[p])}),n.appendChild(l),n.appendChild(h),e}getCheckboxControl(t){const e=super.getCheckboxControl(t),{container:s,formGroup:n,input:r,label:a,description:o,messages:c}=e;return s.classList.add("mb-3"),n.classList.add("form-check"),r.classList.add("form-check-input"),a.classList.add("form-check-label"),t.srOnly&&this.visuallyHidden(a),s.appendChild(n),n.appendChild(r),n.appendChild(a),n.appendChild(o),n.appendChild(c),e}getSelectControl(t){const e=super.getSelectControl(t),{container:s,input:n}=e;return s.classList.add("mb-3"),n.classList.add("form-select"),e}getSwitcher(t){const e=super.getSwitcher(t),{container:s,input:n,label:r}=e;return s.classList.remove("mb-3"),n.classList.remove("form-select"),this.visuallyHidden(r),e}getAlert(t){const e=super.getAlert(t);return e.classList.add("alert"),e.classList.add("alert-danger"),e}getInvalidFeedback(t){const e=super.getInvalidFeedback(t);return e.classList.add("text-danger"),e.classList.add("d-block"),e.classList.add("form-text"),e.classList.add("form-text"),e}getRow(){const t=super.getRow();return t.classList.add("row"),t}getCol(t,e,s){const n=super.getRow(t,e,s);return n.classList.add("col-"+t),n.classList.add("col-md-"+e),s&&n.classList.add("offset-md-"+s),n}getTabList(t){const e=super.getTabList(t);return e.classList.add("nav"),t.type==="tabs"?e.classList.add("nav-tabs"):e.classList.add("nav-pills"),e.classList.add("flex-column"),t.stacked===!1&&e.classList.remove("flex-column"),e}getTab(t){const e=super.getTab(t);return e.list.classList.add("nav-item"),e.link.classList.add("nav-link"),e.link.setAttribute("data-bs-toggle","tab"),t.active&&e.link.classList.add("active"),e}setTabPaneAttributes(t,e,s){super.setTabPaneAttributes(t,e,s),t.classList.add("tab-pane"),e&&t.classList.add("active")}visuallyHidden(t){t.classList.add("visually-hidden")}visuallyVisible(t){t.classList.remove("visually-hidden")}}class D{constructor(t){if(this.instance=t,this.theme=null,this.control=null,this.disabled=!1,this.readOnly=this.instance.isReadOnly(),this.init(),this.build(),this.coerceValue(),this.addEventListeners(),this.setContainerAttributes(),this.refreshUI(),this.instance.jedi.options.showErrors==="always"||f(this.instance.schema,"showErrors")==="always"){const s=this.instance.getErrors();this.showValidationErrors(s)}this.instance.on("set-value",()=>{this.refreshUI();const s=this.instance.getErrors();this.showValidationErrors(s)}),this.instance.on("change",()=>{this.refreshUI();const s=this.instance.getErrors();this.showValidationErrors(s)})}init(){let t=null;if(d(this.instance.jedi.options.iconLib))switch(this.instance.jedi.options.iconLib){case"glyphicons":t=ke;break;case"bootstrap-icons":t=Me;break;case"fontawesome3":t=Ve;break;case"fontawesome4":t=Re;break;case"fontawesome5":t=Be;break;case"fontawesome6":t=qe;break}switch(this.instance.jedi.options.theme){case"bootstrap3":this.theme=new Ne(t);break;case"bootstrap4":this.theme=new Fe(t);break;case"bootstrap5":this.theme=new Ue(t);break;default:this.theme=new xt(t)}}setContainerAttributes(){this.control.container.setAttribute("data-path",this.instance.path),this.control.container.setAttribute("data-type",V(this.instance.schema))}build(){}coerceValue(){const t=k(this.instance.schema);d(t)&&!t.includes(this.instance.getValue())&&d(t[0])&&this.instance.setValue(t[0],!1)}addEventListeners(){}showValidationErrors(t){if(this.instance.jedi.options.showErrors==="never"||f(this.instance.schema,"showErrors")==="never")return;this.control.messages.innerHTML="";const s=I(this.instance.schema)||this.instance.getKey();t.forEach(n=>{n.messages.forEach(r=>{const a=this.getInvalidFeedback({message:s+": "+r});this.control.messages.appendChild(a)})})}getInvalidFeedback(t){return this.theme.getInvalidFeedback(t)}disable(){this.disabled=!0,this.refreshUI()}enable(){this.disabled=!1,this.refreshUI()}refreshUI(){this.refreshInteractiveElements()}refreshInteractiveElements(){this.control.container.querySelectorAll("button, input, select, textarea").forEach(e=>{this.disabled||this.readOnly?e.setAttribute("disabled",""):e.removeAttribute("disabled","")})}sanitize(t){return t}destroy(){this.control.container&&this.control.container.parentNode&&this.control.container.parentNode.removeChild(this.control.container),Object.keys(this).forEach(t=>{delete this[t]})}}class Zt extends D{build(){this.control=this.theme.getMultipleControl({title:"Options",srOnly:f(this.instance.schema,"hideTitle"),id:w(this.instance.path),description:T(this.instance.schema),switcherOptionValues:this.instance.switcherOptionValues,switcherOptionsLabels:this.instance.switcherOptionsLabels})}addEventListeners(){this.control.switcher.input.addEventListener("change",()=>{const t=Number(this.control.switcher.input.value);this.instance.switchInstance(t)})}refreshUI(){this.refreshInteractiveElements(),this.control.childrenSlot.innerHTML="",this.control.childrenSlot.appendChild(this.instance.activeInstance.ui.control.container),this.control.switcher.input.value=this.instance.index,this.disabled||this.instance.isReadOnly()?this.instance.activeInstance.ui.disable():this.instance.activeInstance.ui.enable()}getInvalidFeedback(t){return this.theme.getAlert(t)}}class De extends U{setUI(){this.ui=new Zt(this)}prepare(){this.instances=[],this.activeInstance=null,this.activeInstanceChanged=!0,this.index=0,this.schemas=[],this.switcherOptionValues=[],this.switcherOptionsLabels=[],this.ifThenElseShemas=[],this.traverseSchema(this.schema),delete this.schema.if,delete this.schema.then,delete this.schema.else;let t=0;this.ifThenElseShemas.forEach(r=>{d(r.then)&&(this.schemas.push(z({},O(this.schema),r.then)),this.switcherOptionValues.push(t),this.switcherOptionsLabels.push(JSON.stringify(r.then)),t++),d(r.else)&&(this.schemas.push(z({},O(this.schema),r.else)),this.switcherOptionValues.push(t),this.switcherOptionsLabels.push(JSON.stringify(r.else)),t++)});const e=O(this.schema);delete e.if,delete e.then,delete e.else;const s=this.jedi.createInstance({jedi:this.jedi,schema:e,path:this.path,parent:this.parent});this.schemas.forEach(r=>{const a=this.jedi.createInstance({jedi:this.jedi,schema:r,path:this.path,parent:this.parent});a.unregister(),a.on("change",()=>{const o=this.activeInstance.getValue();this.getFittestIndex(o)!==this.index?this.setValue(o):(this.value=this.activeInstance.getValue(),this.emit("change"))}),this.instances.push(a),this.register()}),this.on("set-value",r=>{this.instances.forEach(c=>{const l=c.getValue();let h=r;m(l)&&m(h)&&(h=Dt(l,h)),c.setValue(h,!1)});const a=this.getFittestIndex(r);a!==this.index&&(this.switchInstance(a),this.emit("change"))}),this.value=s.getValue(),s.destroy();const n=this.getFittestIndex(this.value);this.switchInstance(n)}switchInstance(t){this.index=t,this.activeInstance=this.instances[this.index],this.value=this.activeInstance.getValue(),this.emit("change")}traverseSchema(t){const e=jt(t);if(d(e)){const s=Rt(t),n=Tt(t);this.ifThenElseShemas.push({if:e,then:d(s)?s:{}}),this.ifThenElseShemas.push({if:e,else:d(n)?n:{}})}}getFittestIndex(t){let e=this.index;return this.ifThenElseShemas.forEach((s,n)=>{const r=new S({schema:s.if,data:t}),a=r.getErrors();r.destroy(),a.length===0&&s.then&&(e=n),a.length>0&&s.else&&(e=n)}),e}destroy(){this.instances.forEach(t=>{t.destroy()}),super.destroy()}getAllOfCombinations(t){const e=[],s=(r,a)=>({...r,...a}),n=(r,a)=>{if(a.length===0){e.push(r);return}const o=a[0];n(s(r,o),a.slice(1)),n(r,a.slice(1))};for(let r=0;rObject.keys(r).length-Object.keys(a).length),e}}class He extends U{setUI(){this.ui=new Zt(this)}prepare(){this.instances=[],this.activeInstance=null,this.activeInstanceChanged=!0,this.lastIndex=0,this.index=0,this.schemas=[],this.switcherOptionValues=[],this.switcherOptionsLabels=[],this.on("set-value",()=>{this.onSetValue()});const t=V(this.schema);if(d($(this.schema))||d(J(this.schema))){const s=d($(this.schema))?$(this.schema):J(this.schema),n=O(this.schema);delete n.anyOf,delete n.oneOf,delete n.options,s.forEach((r,a)=>{r={...n,...r},this.jedi.refParser&&(r=this.jedi.refParser.expand(r));let o="Option-"+(a+1);const c=f(r,"switcherTitle"),l=I(r);d(l)&&(o=l),d(c)&&(o=c),this.switcherOptionValues.push(a),this.switcherOptionsLabels.push(o),this.schemas.push(r)})}else if(L(t))t.forEach((s,n)=>{const r=z(this.schema),a={...r,type:s,title:s[0].toUpperCase()+s.slice(1)};d(r.title)&&(a.title=r.title),this.switcherOptionValues.push(n),this.switcherOptionsLabels.push(s.charAt(0).toUpperCase()+s.slice(1)),this.schemas.push(a)});else if(t==="any"||!t){const s=O(this.schema);this.schemas=[{...s,type:"object"},{...s,type:"array"},{...s,type:"string"},{...s,type:"number"},{...s,type:"integer"},{...s,type:"boolean"},{...s,type:"null"}],this.schemas.forEach((n,r)=>{this.switcherOptionValues.push(r)}),this.switcherOptionsLabels=["Object","Array","String","Number","Integer","Boolean","Null"]}this.schemas.forEach(s=>{const n=this.jedi.createInstance({jedi:this.jedi,schema:s,path:this.path,parent:this.parent,value:O(this.value)});d(this.value)&&n.setValue(this.value,!1),n.unregister(),n.on("change",()=>{this.activeInstanceChanged=!0,this.setValue(this.activeInstance.getValue())}),this.instances.push(n),this.register()});const e=d(this.if)?this.getIfIndex(this.value):this.getFittestIndex(this.value);this.switchInstance(e,this.value)}switchInstance(t,e){this.lastIndex=this.index,this.index=t,this.activeInstance=this.instances[t],d(e)&&this.activeInstance.setValue(e,!1),this.setValue(this.activeInstance.getValue())}onSetValue(){if(Ot(this.activeInstance.getValue(),this.value)||this.activeInstanceChanged){this.activeInstanceChanged=!1;const t=d(this.if)?this.getIfIndex(this.value):this.getFittestIndex(this.value);this.switchInstance(t,this.value)}}reassignValues(){const t=this.instances[this.lastIndex].getValue(),e=this.activeInstance.getValue();if(m(t)&&m(e)){const s=Dt(e,t);this.activeInstance.setValue(s,!1)}}getIfIndex(t){const e=new S({schema:this.if,data:t}),s=e.getErrors();return e.destroy(),s.length===0?0:1}getFittestIndex(t){let e=0,s,n;for(const r of this.instances){const a=this.jedi.validator.getErrors(t,r.schema,r.getKey(),r.path);(H(s)||H(n))&&(s=e,n=a),a.length{t.destroy()}),super.destroy()}}class Bt extends D{build(){this.control=this.theme.getCheckboxControl({id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.checked)})}sanitize(t){return!!t}refreshUI(){this.refreshInteractiveElements(),this.control.input.checked=this.instance.getValue()}}class $e extends Bt{build(){this.control=this.theme.getRadiosControl({values:["false","true"],titles:f(this.instance.schema,"enumTitles")||["false","true"],id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)})}addEventListeners(){this.control.radios.forEach(t=>{t.addEventListener("change",()=>{const e=t.value==="true";this.instance.setValue(e)})})}refreshUI(){this.refreshInteractiveElements(),this.control.radios.forEach(t=>{const e=t.value==="true";t.checked=e===this.instance.getValue()})}}class Ke extends Bt{build(){this.control=this.theme.getSelectControl({values:["false","true"],titles:f(this.instance.schema,"enumTitles")||["false","true"],id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{const t=this.control.input.value==="true";this.instance.setValue(t)})}refreshUI(){this.refreshInteractiveElements(),this.control.input.value=this.instance.getValue()===!0?"true":"false"}}class ze extends U{setUI(){const t=V(this.schema),e=q(this.schema);t==="boolean"&&e==="radio"?this.ui=new $e(this):t==="boolean"&&e==="select"?this.ui=new Ke(this):t==="boolean"&&(this.ui=new Bt(this))}}class qt extends D{build(){this.propertyActivators={};const t=this.instance.schema.options||{};let e=!0;const s=Pt(this.instance.schema);d(s)&&s===!1&&(e=!1);let n=!1;d(this.instance.jedi.options.editableProperties)&&(n=this.instance.jedi.options.editableProperties),d(t.editableProperties)&&(n=t.editableProperties),this.control=this.theme.getObjectControl({title:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),id:w(this.instance.path),description:T(this.instance.schema),editableProperties:n,addProperty:e})}addEventListeners(){this.control.addPropertyBtn.addEventListener("click",()=>{const t=this.control.addPropertyControl.input.value.split(" ").join("");if(t.length===0||d(this.instance.value[t]))return;let n={};const r=Pt(this.instance.schema);d(r)&&(n=r);const a=this.instance.createChild(n,t);a.activate(),this.instance.properties[t]={schema:n},this.instance.setValue(this.instance.value),this.control.addPropertyControl.input.value="";const o=this.control.ariaLive;o.innerHTML="";const c=I(a.schema),l=d(c)?c:t,h=this.theme.getAriaLiveMessage();h.textContent=l+" field was added to the form",o.appendChild(h)})}sanitize(t){return m(t)?t:{}}getInvalidFeedback(t){return this.theme.getAlert(t)}refreshPropertiesSlot(){const t=f(this.instance.schema,"editableProperties");(St(this.instance.jedi.options.editableProperties,!0)||St(t,!0))&&Object.keys(this.instance.properties).forEach(e=>{const s=this.instance.isRequired(e),n=this.instance.isDependentRequired(e),r=!s&&!n,a=this.propertyActivators[e],o=this.control.ariaLive,c=this.instance.properties[e].schema,l=I(c),h=this.instance.path+this.instance.jedi.pathSeparator+e,u=w(h)+"-activator",p=d(l)?l:e;if(r&&!a){const b=this.theme.getCheckboxControl({id:u,label:p,srOnly:!1}),E=b.input;this.propertyActivators[e]=E,E.addEventListener("change",()=>{o.innerHTML="";const C=this.theme.getAriaLiveMessage();E.checked?(this.instance.getChild(e)||this.instance.createChild(c,e),this.instance.getChild(e).activate(),C.textContent=p+" field was added to the form",o.appendChild(C)):(this.instance.getChild(e).deactivate(),C.textContent=p+" field was removed from the form",o.appendChild(C))}),this.control.propertiesActivators.appendChild(b.container)}const g=this.propertyActivators[e];g&&(g.disabled=this.disabled,g.checked=N(this.instance.getValue(),e))})}refreshEditors(){this.instance.children.forEach(t=>{t.isActive?(t.ui.control.container.parentNode===null&&this.control.childrenSlot.appendChild(t.ui.control.container),this.disabled||this.instance.isReadOnly()?t.ui.disable():t.ui.enable()):t.ui.control.container.parentNode&&t.ui.control.container.parentNode.removeChild(t.ui.control.container)})}refreshUI(){this.refreshInteractiveElements(),this.refreshPropertiesSlot(),this.refreshEditors()}}class Je extends qt{refreshEditors(){for(;this.control.childrenSlot.firstChild;)this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild);let t=this.theme.getRow();this.control.childrenSlot.appendChild(t),this.instance.children.forEach(e=>{if(e.isActive){const s=f(e.schema,"columns")||12,n=f(e.schema,"offset")||0,r=this.theme.getCol(12,s,n);f(e.schema,"newRow")===!0&&(t=this.theme.getRow(),this.control.childrenSlot.appendChild(t)),t.appendChild(r),r.appendChild(e.ui.control.container),this.disabled||this.instance.isReadOnly()?e.ui.disable():e.ui.enable()}})}}class Ge extends qt{init(){super.init(),this.activeTabIndex=0}refreshEditors(){for(;this.control.childrenSlot.firstChild;)this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild);const t=this.instance.schema["x-control-cols"],e=this.instance.schema["x-control-stacked"],s=this.instance.schema["x-control-variant"],n=this.theme.getRow(),r=d(t)?t:3,a=this.theme.getCol(12,r),o=this.theme.getCol(12,12-r),c=this.theme.getTabContent(),l=this.theme.getTabList({stacked:d(e)?e:!1,type:d(s)?s:"pils"});this.control.childrenSlot.appendChild(n),n.appendChild(a),n.appendChild(o),a.appendChild(l),o.appendChild(c),this.instance.children.forEach((h,u)=>{if(h.isActive){const p=u===this.activeTabIndex,g=w(h.path),b=I(h.schema),E=this.theme.getTab({title:d(b)?b:h.getKey(),id:g,active:p});E.list.addEventListener("click",()=>{this.activeTabIndex=u}),this.theme.setTabPaneAttributes(h.ui.control.container,p,g),l.appendChild(E.list),c.appendChild(h.ui.control.container),this.disabled||this.instance.isReadOnly()?h.ui.disable():h.ui.enable()}})}}class _e extends U{setUI(){const t=V(this.schema),e=q(this.schema),s=this.schema["x-control"];t==="object"&&e==="grid"?this.ui=new Je(this):t==="object"&&s==="nav"?this.ui=new Ge(this):this.ui=new qt(this)}prepare(){this.properties={};const t=Vt(this.schema);d(t)&&Object.keys(t).forEach(e=>{const s=t[e];this.properties[e]={schema:s};let n=!0;const r=f(this.schema,"deactivateNonRequired"),a=f(s,"deactivateNonRequired");this.isNotRequired(e)&&d(r)&&r===!0&&(n=!1),this.isNotRequired(e)&&d(a)&&a===!0&&(n=!1),n&&this.createChild(s,e)}),this.refreshInstances(),this.on("set-value",()=>{this.refreshInstances()})}isRequired(t){const e=Wt(this.schema);return d(e)&&e.includes(t)}isDependentRequired(t){const e=Kt(this.schema);if(d(e)){let s=[];return Object.keys(e).forEach(n=>{d(this.value[n])&&(s=e[n].filter(a=>!N(this.value,a)))}),s.includes(t)}return!1}createChild(t,e,s){const n=this.jedi.createInstance({jedi:this.jedi,schema:t,path:this.path+this.jedi.pathSeparator+e,parent:this,value:O(s)});this.children.push(n),this.value[e]=n.getValue();const r=f(this.schema,"deactivateNonRequired");return this.isNotRequired(e)&&d(r)&&r===!0&&n.deactivate(),n}isNotRequired(t){return!this.isRequired(t)&&!this.isDependentRequired(t)}deleteChild(t){for(let e=this.children.length-1;e>=0;e--){const s=this.children[e];s.getKey()===t&&(s.destroy(),this.children.splice(e,1),this.onChildChange())}}getChild(t){return this.children.find(e=>t===e.getKey().split(this.jedi.pathSeparator).pop())}onChildChange(){const t={};this.children.forEach(e=>{e.isActive&&(t[e.getKey()]=e.getValue())}),this.setValue(t)}refreshInstances(){const t=this.getValue();if(m(t)){Object.keys(t).forEach(e=>{const s=this.getChild(e);if(s){s.activate();const n=s.getValue(),r=t[s.getKey()];Ot(n,r)&&s.setValue(r,!1)}else this.createChild({},e,t[e])});for(let e=this.children.length-1;e>=0;e--){const s=this.children[e],n=s.getKey();H(t[n])&&(this.getChild(n)?s.deactivate():this.deleteChild(n))}}}}class te extends D{build(){this.control=this.theme.getArrayControl({title:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),id:w(this.instance.path),description:T(this.instance.schema)})}addEventListeners(){this.control.addBtn.addEventListener("click",()=>{this.instance.addItem()})}getInvalidFeedback(t){return this.theme.getAlert(t)}sanitize(t){return L(t)?t:[]}refreshUI(){this.refreshInteractiveElements();const t=Jt(this.instance.schema),e=Gt(this.instance.schema);d(t)&&t===this.instance.value.length&&this.control.addBtn.setAttribute("disabled",""),this.control.childrenSlot.innerHTML="",this.instance.children.forEach(s=>{const n=Number(s.getKey()),r=this.theme.getDeleteItemBtn(),a=this.theme.getMoveUpItemBtn(),o=this.theme.getMoveDownItemBtn();s.ui.control.arrayActions.innerHTML="",s.ui.control.arrayActions.appendChild(r),s.ui.control.arrayActions.appendChild(a),s.ui.control.arrayActions.appendChild(o),this.control.childrenSlot.appendChild(s.ui.control.container),r.addEventListener("click",()=>{const c=Number(s.path.split(this.instance.jedi.pathSeparator).pop());this.instance.deleteItem(c)}),a.addEventListener("click",()=>{const c=n-1;this.instance.move(n,c)}),o.addEventListener("click",()=>{const c=n+1;this.instance.move(n,c)}),this.disabled||this.instance.isReadOnly()?s.ui.disable():s.ui.enable(),d(e)&&this.instance.value.length<=e&&r.setAttribute("disabled","")})}}class We extends te{init(){super.init(),this.activeTabIndex=0}addEventListeners(){this.control.addBtn.addEventListener("click",()=>{this.activeTabIndex=this.instance.value.length,this.instance.addItem()})}refreshUI(){this.refreshInteractiveElements(),this.control.childrenSlot.innerHTML="";const t=f(this.instance.schema,"navCols"),e=f(this.instance.schema,"navStacked"),s=f(this.instance.schema,"navType"),n=this.theme.getRow(),r=d(t)?t:3,a=this.theme.getCol(12,r),o=this.theme.getCol(12,12-r),c=this.theme.getTabContent(),l=this.theme.getTabList({stacked:d(e)?e:!1,type:d(s)?s:"pils"});this.control.childrenSlot.appendChild(n),n.appendChild(a),n.appendChild(o),a.appendChild(l),o.appendChild(c),this.instance.children.forEach((h,u)=>{const p=this.theme.getDeleteItemBtn(),g=this.theme.getMoveUpItemBtn(),b=this.theme.getMoveDownItemBtn();h.ui.control.arrayActions.innerHTML="",h.ui.control.arrayActions.appendChild(p),h.ui.control.arrayActions.appendChild(g),h.ui.control.arrayActions.appendChild(b),this.control.childrenSlot.appendChild(h.ui.control.container);let E;const C=f(this.instance.schema,"itemTemplate");if(C){const j=C,It={i0:u,i1:u+1,value:h.getValue()};E=y(j,It)}else{const j=I(h.schema);E=d(j)?j+" "+(u+1):h.getKey()}p.addEventListener("click",()=>{this.activeTabIndex=re(u-1,0,this.instance.value.length-1),this.instance.deleteItem(u)}),g.addEventListener("click",()=>{const j=u-1;this.activeTabIndex=j,this.instance.move(u,j)}),b.addEventListener("click",()=>{const j=u+1;this.activeTabIndex=j,this.instance.move(u,j)});const x=u===this.activeTabIndex,F=w(h.path),R=this.theme.getTab({title:E,id:F,active:x});R.list.addEventListener("click",()=>{this.activeTabIndex=u}),this.theme.setTabPaneAttributes(h.ui.control.container,x,F),l.appendChild(R.list),c.appendChild(h.ui.control.container),this.disabled||this.instance.isReadOnly()?h.ui.disable():h.ui.enable(),u===0&&g.setAttribute("disabled",""),this.instance.value.length-1===u&&b.setAttribute("disabled","")})}}class Qe extends U{setUI(){const t=V(this.schema),e=q(this.schema);t==="array"&&e==="nav"?this.ui=new We(this):this.ui=new te(this)}prepare(){this.refreshChildren(),this.on("set-value",()=>{this.refreshChildren()})}createItemInstance(t){let e;const s=this.children.length,n=zt(this.schema),r=Mt(this.schema);e=d(n)?n:{},d(r)&&d(r[s])&&(e=r[s]);const o=this.jedi.createInstance({jedi:this.jedi,schema:e,path:this.path+this.jedi.pathSeparator+s,parent:this,value:O(t)});return d(t)&&o.setValue(t,!1),o}move(t,e){const s=O(this.getValue()),n=s[t];s.splice(t,1),s.splice(e,0,n),this.setValue(s)}addItem(){const t=this.createItemInstance(),e=O(this.getValue());e.push(t.getValue()),t.destroy(),this.setValue(e)}deleteItem(t){const s=O(this.getValue()).filter((n,r)=>r!==t);this.setValue(s)}onChildChange(){const t=[];this.children.forEach(e=>{t.push(e.getValue())}),this.setValue(t)}refreshChildren(){this.children=[];const t=this.getValue();L(t)&&t.forEach(e=>{const s=this.createItemInstance(e);this.children.push(s)})}}class Nt extends D{build(){const t=["hidden","color","date","datetime-local","email","number","month","password","search","time","tel","text","textarea","url","week"],e=q(this.instance.schema);this.control=this.theme.getInputControl({type:t.includes(e)?e:"text",id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||e==="hidden",description:T(this.instance.schema)}),e==="color"&&this.instance.value.length===0&&this.instance.setValue("#000000",!1)}addEventListeners(){this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.value)})}sanitize(t){return String(t)}refreshUI(){this.refreshInteractiveElements(),this.control.input.value=this.instance.getValue()}}class Xe extends Nt{build(){this.control=this.theme.getRadiosControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)})}addEventListeners(){this.control.radios.forEach(t=>{t.addEventListener("change",()=>{this.instance.setValue(t.value)})})}refreshUI(){this.refreshInteractiveElements(),this.control.radios.forEach(t=>{t.checked=t.value===this.instance.getValue()})}}class Ye extends Nt{build(){this.control=this.theme.getSelectControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)}),this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.value)})}}class Ze extends D{build(){this.control=this.theme.getTextareaControl({id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||q(this.instance.schema)==="hidden",description:T(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.value)})}sanitize(t){return String(t)}refreshUI(){this.refreshInteractiveElements(),this.control.input.value=this.instance.getValue()}}class ts extends U{setUI(){const t=V(this.schema),e=k(this.schema),s=q(this.schema);t==="string"&&d(e)&&s==="radio"?this.ui=new Xe(this):t==="string"&&s==="textarea"?this.ui=new Ze(this):t==="string"&&d(e)?this.ui=new Ye(this):t==="string"&&(this.ui=new Nt(this))}}class Ft extends D{build(){this.control=this.theme.getInputControl({type:"number",id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||q(this.instance.schema)==="hidden",description:T(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{const t=this.sanitize(this.control.input.value);this.instance.setValue(t)})}sanitize(t){return V(this.instance.schema)==="integer"?Math.floor(Number(t)):Number(t)}refreshUI(){this.refreshInteractiveElements();const t=this.instance.getValue();P(t)&&(this.control.input.value=this.instance.getValue())}}class es extends Ft{build(){this.control=this.theme.getRadiosControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)})}addEventListeners(){this.control.radios.forEach(t=>{t.addEventListener("change",()=>{const e=this.sanitize(t.value);this.instance.setValue(e)})})}refreshUI(){this.refreshInteractiveElements(),this.control.radios.forEach(t=>{t.checked=Number(t.value)===Number(this.instance.getValue())})}}class ss extends Ft{build(){this.control=this.theme.getSelectControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:T(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{const t=this.sanitize(this.control.input.value);this.instance.setValue(t)})}}class is extends U{setUI(){const t=V(this.schema),e=k(this.schema),s=q(this.schema),n=t==="number"||t==="integer";n&&d(e)&&s==="radio"?this.ui=new es(this):n&&d(e)?this.ui=new ss(this):n&&(this.ui=new Ft(this))}}class ns extends D{build(){this.control=this.theme.getNullControl({id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||q(this.instance.schema)==="hidden",description:T(this.instance.schema)})}sanitize(){return null}}class rs extends U{setUI(){this.ui=new ns(this)}}class as extends Yt{constructor(t){super(),this.options=Object.assign({container:null,refParser:null,isEditor:!1,editableProperties:!1,schema:{},showErrors:"change",data:void 0,validateFormat:!1},t),this.rootName="#",this.pathSeparator="/",this.instances={},this.root=null,this.theme=null,this.validator=null,this.schema={},this.refParser=this.options.refParser?this.options.refParser:null,this.init()}init(){this.schema=this.options.schema,this.validator=new je({refParser:this.refParser,validateFormat:this.options.validateFormat}),this.root=this.createInstance({jedi:this,schema:this.options.schema,path:this.rootName}),d(this.options.data)&&this.root.setValue(this.options.data,!1),this.options.isEditor&&this.options.container&&(this.container=this.options.container,this.appendHiddenInput(),this.container.appendChild(this.root.ui.control.container),this.container.classList.add("jedi-ready")),this.bindEventListeners()}bindEventListeners(){this.root&&this.root.on("change",()=>{this.emit("change")}),this.hiddenInput&&this.on("change",()=>{this.hiddenInput.value=JSON.stringify(this.getValue())})}appendHiddenInput(){const t=this.root.ui.theme.getInputControl({type:"hidden",id:"jedi-hidden-input"});this.hiddenInput=t.input,this.hiddenInput.setAttribute("name","json"),this.hiddenInput.removeAttribute("aria-describedby"),this.container.appendChild(this.hiddenInput),this.hiddenInput.value=JSON.stringify(this.getValue())}register(t){this.instances[t.path]=t}unregister(t){this.instances[t.path]=null,delete this.instances[t.path]}createInstance(t){this.refParser&&(t.schema=this.refParser.expand(t.schema,t.path));const e=V(t.schema),s=J(t.schema),n=$(t.schema),r=jt(t.schema),a=Rt(t.schema),o=Tt(t.schema);if(d(n)||d(s)||e==="any"||L(e)||H(e))return new He(t);if(d(r)&&(d(a)||d(o)))return new De(t);if(e==="object")return new _e(t);if(e==="array")return new Qe(t);if(e==="string")return new ts(t);if(e==="number"||e==="integer")return new is(t);if(e==="boolean")return new ze(t);if(e==="null")return new rs(t)}getValue(){return this.root.getValue()}setValue(){this.root.setValue(...arguments)}getInstance(t){return this.instances[t]}disable(){this.root.ui.disable()}enable(){this.root.ui.enable()}getErrors(){let t=[];return Object.keys(this.instances).forEach(e=>{const s=this.instances[e];t=[...t,...s.getErrors()]}),t}destroy(){this.root.destroy(),this.options.isEditor&&(this.container.innerHTML=""),Object.keys(this).forEach(t=>{delete this[t]})}}const S=as;class os{constructor(){this.refs={}}async dereference(t){await this.traverseExternal(t),this.traverseLocal(t)}async traverseExternal(t,e="#"){if(!(typeof t!="object"||t===null))for(const[s,n]of Object.entries(t)){const r=e?`${e}/${s}`:`/${s}`;if(this.hasRef(t)){const a=t.$ref;if(this.refs[a])return;if(this.refs[a]=null,this.hasExternalRef(t)){const o=await this.resolveExternal(t);await this.traverseExternal(o,r)}}this.refs[e]=t,await this.traverseExternal(n,r)}}traverseLocal(t,e="#"){if(!(typeof t!="object"||t===null))for(const[s,n]of Object.entries(t)){const r=e?`${e}/${s}`:`/${s}`;if(this.hasRef(t)){const a=t.$ref;if(this.refs[a])return;if(!this.hasExternalRef(t)){const o=this.resolveLocal(t);this.traverseLocal(o,r)}}this.traverseLocal(n,r)}}async resolveExternal(t){const e=t.$ref,s=await this.load(e);return this.refs[e]=s,s}resolveLocal(t){const e=t.$ref;let s=null;return this.refs[e]&&(s=this.refs[e],this.refs[e]=s),s}hasRef(t){return typeof t.$ref<"u"}hasExternalRef(t){const e=t.$ref;return typeof e!="string"?!1:e.startsWith("http")||e.startsWith("https")}isCircularRef(t){const e=`"$ref":"${t}"`,s=this.refs[t];return JSON.stringify(s).includes(e)}isObject(t){return t!==null&&typeof t=="object"}expand(t){const e=JSON.parse(JSON.stringify(t));if(this.isObject(e)&&"$ref"in e){const s=e.$ref;return delete e.$ref,Object.assign({},this.refs[s],e)}return e}async load(t){try{const e=await fetch(t);if(!e.ok)throw new Error("Network response was not ok");return await e.json()}catch(e){throw console.error("Error loading",t,e),e}}}return{Jedi:S,RefParser:os}}); +(function(K,O){typeof exports=="object"&&typeof module<"u"?module.exports=O():typeof define=="function"&&define.amd?define(O):(K=typeof globalThis<"u"?globalThis:K||self,K.Jedi=O())})(this,function(){"use strict";function K(){const i=[];return function(t,e){if(typeof e!="object"||e===null)return e;for(;i.length>0&&i.at(-1)!==this;)i.pop();return i.includes(e)?"[Circular]":(i.push(e),e)}}function O(i){if(!(typeof i>"u"))return JSON.parse(JSON.stringify(i,K()))}function se(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ft(i,t,e){return i.replace(new RegExp(se(t),"g"),e)}function w(i){return Ft(Ft(i,"#","root"),"/","-")}function N(i,t){return Object.prototype.hasOwnProperty.call(i,t)}function wt(i){return Object.keys(i).sort().reduce((t,e)=>(t[e]=i[e],t),{})}function St(i,t){return m(i)&&m(t)&&(i=wt(i),t=wt(t)),JSON.stringify(i)===JSON.stringify(t)}function Ot(i,t){return!St(i,t)}function Pt(i){return i===null}function d(i){return typeof i<"u"}function H(i){return typeof i>"u"}function A(i){return typeof i=="number"}function B(i){return A(i)&&i===Math.floor(i)}function M(i){return typeof i=="string"}function P(i){return typeof i=="boolean"}function L(i){return Array.isArray(i)}function m(i){return!Pt(i)&&!L(i)&&typeof i=="object"}function ie(i){let t="any";return A(i)?t=B(i)?"integer":"number":M(i)?t="string":P(i)?t="boolean":L(i)?t="array":Pt(i)?t="null":m(i)&&(t="object"),t}function z(i,...t){if(!t.length)return i;const e=t.shift();return m(i)&&m(e)&&Object.keys(e).forEach(s=>{m(e[s])?(i[s]||Object.assign(i,{[s]:{}}),z(i[s],e[s])):Object.assign(i,{[s]:e[s]})}),z(i,...t)}function Ut(i,t){return Object.keys(t).forEach(function(e){e in i&&typeof i[e]==typeof t[e]&&(i[e]=t[e])}),i}function ne(i,t){const e=t.split(".");let s=i;for(const n of e)if(Array.isArray(s)&&/^\d+$/.test(n)){const r=parseInt(n);if(r>=0&&r{e=e.replace(/\s/g,"");const s=e.split(/{{|}}/)[1];return ne(t,s)})}function re(i,t,e){return Math.max(t,Math.min(i,e))}function Ht(i){const t=[],e=new Set;for(const s of i){const n=JSON.stringify(s);e.has(n)||(e.add(n),t.push(s))}return t}function At(i){return m(i.additionalProperties)||P(i.additionalProperties)?i.additionalProperties:void 0}function ae(i){return m(i.propertyNames)||P(i.propertyNames)?i.propertyNames:void 0}function $t(i){return L(i.allOf)?i.allOf:void 0}function $(i){return L(i.anyOf)?i.anyOf:void 0}function oe(i){return i.const}function ce(i){return m(i.contains)||P(i.contains)?i.contains:void 0}function le(i){return i.default}function Kt(i){return m(i.dependentRequired)?i.dependentRequired:void 0}function de(i){return m(i.dependentSchemas)?i.dependentSchemas:void 0}function j(i){return M(i.description)?i.description:void 0}function jt(i){return m(i.else)||P(i.else)?i.else:void 0}function k(i){if(L(i.enum)&&i.enum.length>0)return i.enum}function he(i){return A(i.exclusiveMaximum)?i.exclusiveMaximum:void 0}function ue(i){return A(i.exclusiveMinimum)?i.exclusiveMinimum:void 0}function q(i){return M(i.format)?i.format:void 0}function Tt(i){if(m(i.if)||P(i.if))return i.if}function zt(i){return m(i.items)||P(i.items)?i.items:void 0}function pe(i){return A(i.maximum)?i.maximum:void 0}function me(i){if(B(i.maxContains)&&i.maxContains>=0)return i.maxContains}function Jt(i){if(B(i.maxItems)&&i.maxItems>=0)return i.maxItems}function fe(i){if(B(i.maxLength)&&i.maxLength>=0)return i.maxLength}function ge(i){if(B(i.maxProperties))return i.maxProperties}function ve(i){return A(i.minimum)?i.minimum:void 0}function be(i){if(B(i.minContains)&&i.minContains>=0)return i.minContains}function Gt(i){if(B(i.minItems)&&i.minItems>=0)return i.minItems}function ye(i){if(B(i.minLength)&&i.minLength>=0)return i.minLength}function Ce(i){if(B(i.minProperties)&&i.minProperties>=0)return i.minProperties}function Ee(i){if(A(i.multipleOf)&&i.multipleOf>=0)return i.multipleOf}function Le(i){return m(i.not)||P(i.not)?i.not:void 0}function f(i,t){return i.options&&i.options[t]?i.options[t]:void 0}function xe(i){return M(i.pattern)?i.pattern:void 0}function kt(i){return m(i.patternProperties)?i.patternProperties:void 0}function Mt(i){return L(i.prefixItems)?i.prefixItems:void 0}function Vt(i){return m(i.properties)?i.properties:void 0}function _t(i){return P(i.readOnly)?i.readOnly:void 0}function Wt(i){return L(i.required)?[...new Set(i.required)]:void 0}function Rt(i){return m(i.then)||P(i.then)?i.then:void 0}function I(i){return M(i.title)?i.title:void 0}function V(i){if(M(i.type)||L(i.type))return i.type}function J(i){return L(i.oneOf)?i.oneOf:void 0}function Ie(i){return P(i.unevaluatedProperties)?i.unevaluatedProperties:void 0}function we(i){return P(i.uniqueItems)?i.uniqueItems:void 0}function G(i,t,e,s){let n=[];const r=$t(e);return d(r)&&r.forEach(a=>{const o=new S({refParser:i.refParser,schema:a,data:t,rootName:s}),c=o.getErrors();o.destroy(),n=[...n,...c],n=Ht(n)}),n}const v={errorAdditionalProperties:'Has additional property "{{ property }}" but no additional properties are allowed.',errorAnyOf:"Must validate against at least one of the provided schemas.",errorConst:"Must have value of: {{ const }}.",errorContains:"Must contain at least one item matching the provided schema.",errorDependentRequired:"Must have the required properties: {{ dependentRequired }}.",errorEnum:"Must be one of the enumerated values: {{ enum }}.",errorExclusiveMaximum:"Must be less than {{ exclusiveMaximum }}.",errorExclusiveMinimum:"Must be greater than {{ exclusiveMinimum }}.",errorFormat:"Must be a valid {{ format }}.",errorItems:"Must have items that validate against the provided schema.",errorMaximum:"Must be at most {{ maximum }}.",errorMaxItems:"Must have at most {{ maxItems }} items.",errorMaxLength:"Must be at most {{ maxLength }} characters long.",errorMaxProperties:"Must have at most {{ maxProperties }} properties.",errorMaxContains:"Must contain at most {{ maxContains }} items matching the provided schema. It currently contains {{ counter }}.",errorMinContains:"Must contain at least {{ minContains }} items matching the provided schema. It currently contains {{ counter }}.",errorMinimum:"Must be at least {{ minimum }}.",errorMinItems:"Must have at least {{ minItems }} items.",errorMinLength:"Must be at least {{ minLength }} characters long.",errorMinProperties:"Must have at least {{ minProperties }} properties.",errorMultipleOf:"Must be multiple of {{ multipleOf }}.",errorNot:"Must not validate against the provided schema.",errorOneOf:"Must validate against exactly one of the provided schemas. It currently validates against {{ counter }} of the schemas.",errorPattern:'Must match the pattern: "{{ pattern }}".',errorPrefixItems:"Item {{ index }} fails validation.",errorPropertyNames:'Property name "{{ propertyName }}" fails validation.',errorRequired:"Must have the required properties: {{ required }}.",errorType:"Must be of type {{ type }}.",errorUnevaluatedProperties:'Has invalid unevaluated property "{{ property }}"',errorUniqueItems:"Must have unique items."};function _(i,t,e,s,n){const r=[],a=ye(e);return M(t)&&d(a)&&(t=t.replace(/[\uDCA9]/g,""),t.length{const l=new S({refParser:i.refParser,schema:c,data:t}),h=l.getErrors();l.destroy(),h.length===0&&(o=!0)}),o||r.push({messages:[v.errorAnyOf],path:n,constrain:"anyOf"})}return r}function Q(i,t,e,s,n){const r=[],a=k(e);return d(a)&&!a.some(c=>JSON.stringify(t)===JSON.stringify(c))&&r.push({messages:[y(v.errorEnum,{enum:JSON.stringify(a)})],path:n,constrain:"enum"}),r}function X(i,t,e,s,n){const r=[],a=he(e);return A(t)&&d(a)&&t>=a&&r.push({messages:[y(v.errorExclusiveMaximum,{exclusiveMaximum:a})],path:n,constrain:"exclusiveMaximum"}),r}function Y(i,t,e,s,n){const r=[],a=ue(e);return A(t)&&d(a)&&t<=a&&r.push({messages:[y(v.errorExclusiveMinimum,{exclusiveMinimum:a})],path:n,constrain:"exclusiveMinimum"}),r}function Z(i,t,e,s,n){const r=[],a=q(e);let o=i.validateFormat;if(f(e,"validateFormat")&&(o=e.options.validateFormat),d(a)&&M(t)&&o){let c;a==="email"&&(c=new RegExp(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i)),a==="url"&&(c=new RegExp(/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu)),a==="uuid"&&(c=new RegExp(/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i)),d(c)&&!c.test(t)&&r.push({messages:[y(v.errorFormat,{format:a})],path:n,constrain:"format"})}return r}function tt(i,t,e,s,n){const r=[],a=zt(e),o=Mt(e);if(L(t)&&d(a)){const c=d(o)?o.length:0;a===!1&&t.length>0&&t.length>c&&r.push({messages:[v.errorItems],path:n,constrain:"items"})}return r}function et(i,t,e,s,n){const r=[],a=Jt(e);return L(t)&&d(a)&&t.length>a&&r.push({messages:[y(v.errorMaxItems,{maxItems:a})],path:n,constrain:"maxItems"}),r}function st(i,t,e,s,n){const r=[],a=fe(e);return M(t)&&d(a)&&(t=t.replace(/[\uDCA9]/g,""),t.length>a&&r.push({messages:[y(v.errorMaxLength,{maxLength:a})],path:n,constrain:"maxLength"})),r}function it(i,t,e,s,n){const r=[],a=ge(e);return m(t)&&d(a)&&Object.keys(t).length>a&&r.push({messages:[y(v.errorMaxProperties,{maxProperties:a})],path:n,constrain:"maxProperties"}),r}function nt(i,t,e,s,n){const r=[],a=ve(e);return A(t)&&d(a)&&t{const l=new S({refParser:i.refParser,schema:c,data:t}),h=l.getErrors();l.destroy(),h.length===0&&o++}),o!==1&&r.push({messages:[y(v.errorOneOf,{counter:o})],path:n,constrain:"oneOf"})}return r}function dt(i,t,e,s,n){const r=[],a=xe(e);return M(t)&&d(a)&&!new RegExp(a).test(t)&&r.push({messages:[y(v.errorPattern,{pattern:a})],path:n,constrain:"pattern"}),r}function ht(i,t,e,s){let n=[];const r=kt(e);return m(t)&&d(r)&&Object.keys(t).forEach(a=>{Object.keys(r).forEach(o=>{if(new RegExp(o).test(a)){const l=r[o],h=new S({refParser:i.refParser,schema:l,data:t[a]}),u=h.getErrors().map(p=>({messages:p.messages,path:s+"/"+a,constrain:"patternProperties"}));n=[...n,...u],h.destroy()}})}),n}function ut(i,t,e,s,n){const r=[],a=Wt(e);if(m(t)&&d(a)){const o=[],c=Object.keys(t);a.forEach(h=>{c.includes(h)||o.push(h)}),o.length>0&&r.push({messages:[y(v.errorRequired,{required:o.join(", ")})],path:n,constrain:"required"})}return r}function pt(i,t,e,s,n){const r=[],a=V(e);if(a==="any")return r;if(d(a)){const o={string:l=>M(l),number:l=>A(l),integer:l=>B(l),boolean:l=>P(l),array:l=>L(l),object:l=>m(l),null:l=>Pt(l)};let c=!0;L(a)?c=a.some(l=>o[l](t)):c=o[a](t),c||r.push({messages:[y(v.errorType,{type:a,valueType:ie(t)})],path:n,constrain:"type"})}return r}function mt(i,t,e,s,n){const r=[],a=pe(e);return A(t)&&d(a)&&t>a&&r.push({messages:[y(v.errorMaximum,{maximum:a})],path:n,constrain:"maximum"}),r}function ft(i,t,e,s,n){const r=[],a=we(e);if(L(t)&&d(a)&&a===!0){const o=[];let c=!1;for(let h=0;hg===p),c)break;o.push(p)}c&&r.push({messages:[v.errorUniqueItems],path:n,constrain:"uniqueItems"})}return r}function gt(i,t,e,s,n){let r=[];const a=At(e),o=kt(e),c=Vt(e);if(m(t)&&d(a)){const l=d(c)?c:{},h=a,u=o;l&&Object.keys(t).forEach(p=>{let g=!1;if(d(u)&&Object.keys(u).forEach(b=>{g=new RegExp(b).test(p)}),!g&&h===!1&&!N(l,p)&&r.push({messages:[y(v.errorAdditionalProperties,{property:p})],path:n,constrain:"additionalProperties"}),!g&&m(h)&&!N(l,p)){const b=new S({refParser:i.refParser,schema:h,data:t[p]}),E=b.getErrors().map(C=>({messages:C.messages,path:p,constrain:"additionalProperties"}));r=[...r,...E],b.destroy()}})}return r}const Se={additionalProperties:gt,allOf:G,anyOf:W,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,required:ut,type:pt,uniqueItems:ft};function vt(i,t,e,s,n){const r=[],a=oe(e);return d(a)&&Ot(t,a)&&r.push({messages:[y(v.errorConst,{const:JSON.stringify(a)})],path:n,constrain:"const"}),r}function bt(i,t,e,s,n){const r=[],a=ce(e),o=be(e),c=me(e);if(L(t)&&d(a)){let l=0;t.forEach(u=>{const p=new S({refParser:i.refParser,schema:a,data:u});p.getErrors().length===0&&l++,p.destroy()});const h=l===0;d(o)?lc&&r.push({messages:[y(v.errorMaxContains,{counter:l,maxContains:c})],path:n,constrain:"maxContains"})}return r}function yt(i,t,e,s,n){const r=[],a=Kt(e);if(m(t)&&d(a)){let o=[];Object.keys(a).forEach(l=>{d(t[l])&&(o=a[l].filter(u=>!N(t,u)))}),o.length>0&&r.push({messages:[y(v.errorDependentRequired,{dependentRequired:o.join(", ")})],path:n,constrain:"dependentRequired"})}return r}function Ct(i,t,e){let s=[];const n=de(e);return m(t)&&d(n)&&Object.keys(n).forEach(r=>{if(d(t[r])){const a=n[r],o=new S({refParser:i.refParser,schema:a,data:t}),c=o.getErrors();o.destroy(),s=[...s,...c]}}),s}function Et(i,t,e){const s=[],n=Tt(e),r=Rt(e),a=jt(e);if(d(n)){if(H(r)&&H(a))return s;const o=new S({refParser:i.refParser,schema:n,data:t}),c=o.getErrors();o.destroy();let l=[],h=[];if(d(r)){const u=new S({refParser:i.refParser,schema:r,data:t});l=u.getErrors(),u.destroy()}if(d(a)){const u=new S({refParser:i.refParser,schema:a,data:t});h=u.getErrors(),u.destroy()}if(n===!0)return l;if(n===!1)return h;if(c.length===0)return l;if(c.length>0)return h}return s}function Lt(i,t,e,s,n){const r=[],a=Mt(e);return L(t)&&d(a)&&a.forEach((o,c)=>{const l=t[c];if(d(l)){const h=new S({refParser:i.refParser,schema:o,data:l}),u=h.getErrors();h.destroy(),u.length>0&&r.push({messages:[y(v.errorPrefixItems,{index:c})],path:n,constrain:"prefixItems"})}}),r}const Oe={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,required:ut,type:pt,uniqueItems:ft},Pe={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,required:ut,type:pt,uniqueItems:ft};function Qt(i,t,e,s,n){let r=[];const a=Ie(e),o=kt(e),c=Vt(e),l=$t(e),h=$(e),u=J(e);if(m(t)&&d(a)){let p=d(c)?c:{};const g=a,b=o;[l,h,u].forEach(C=>{d(C)&&C.forEach(x=>{d(x.properties)&&(p={...p,...x.properties})})}),p&&Object.keys(t).forEach(C=>{let x=!1;if(d(b)&&Object.keys(b).forEach(D=>{x=new RegExp(D).test(C)}),!x&&g===!1&&!N(p,C)&&r.push({messages:[y(v.errorUnevaluatedProperties,{property:C})],path:n,constrain:"unevaluatedProperties"}),!x&&m(g)&&!N(p,C)){const D=new S({refParser:i.refParser,schema:g,data:t[C]}),R=D.getErrors().map(T=>({messages:T.messages,path:C,constrain:"unevaluatedProperties"}));r=[...r,...R],D.destroy()}})}return r}const Ae={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,required:ut,type:pt,unevaluatedProperties:Qt,uniqueItems:ft};function je(i,t,e,s,n){const r=[],a=ae(e);return m(t)&&d(a)&&Object.keys(t).forEach(o=>{new S({refParser:i.refParser,schema:a,data:o}).getErrors().length>0&&r.push({messages:[y(v.errorPropertyNames,{propertyName:o})],path:n,constrain:"propertyNames"})}),r}const Xt={additionalProperties:gt,allOf:G,anyOf:W,const:vt,contains:bt,dependentRequired:yt,dependentSchemas:Ct,enum:Q,exclusiveMaximum:X,exclusiveMinimum:Y,format:Z,if:Et,items:tt,maximum:mt,maxItems:et,maxLength:st,maxProperties:it,minimum:nt,minItems:rt,minLength:_,minProperties:at,multipleOf:ot,not:ct,oneOf:lt,pattern:dt,patternProperties:ht,prefixItems:Lt,propertyNames:je,required:ut,type:pt,unevaluatedProperties:Qt,uniqueItems:ft};class Te{constructor(t={}){this.refParser=t.refParser,this.validateFormat=t.validateFormat?t.validateFormat:!1,this.draft=Xt,this.jsonSchemaDrafts={"http://json-schema.org/draft-04/schema#":Se,"http://json-schema.org/draft-06/schema#":Oe,"http://json-schema.org/draft-07/schema#":Pe,"https://json-schema.org/draft/2019-09/schema":Ae,"https://json-schema.org/draft/2020-12/schema":Xt}}getErrors(t,e,s,n){let r=[];const a=f(e,"messages"),o=O(e);return P(o)&&o===!0?r:P(o)&&o===!1?[{messages:d(a)?a:["invalid"],path:n}]:(Object.keys(this.draft).forEach(c=>{if(N(o,c)){const l=this.draft[c],h=l(this,t,e,s,n);h&&(r=[...r,...h])}}),r.length>0&&a&&(r=[{messages:a,path:n}]),r)}}class Yt{constructor(){this.listeners=[]}on(t,e){this.listeners.push({name:t,callback:e})}emit(t,e=void 0){this.listeners.filter(n=>n.name===t).forEach(n=>{n.callback(e)})}destroy(){Object.keys(this).forEach(t=>{delete this[t]})}}class F extends Yt{constructor(t){super(),this.jedi=t.jedi,this.path=t.path||this.jedi.rootName,this.schema=t.schema,this.value=d(t.value)?t.value:void 0,this.isActive=!0,this.parent=t.parent||null,this.children=[],this.ui=null,this.init()}init(){this.register(),this.setInitialValue(),this.prepare(),this.setDefaultValue(),this.jedi.options.isEditor&&this.setUI(),this.on("change",()=>{this.parent&&this.parent.onChildChange()})}setUI(){}getKey(){return this.path.split(this.jedi.pathSeparator).pop()}register(){this.jedi.register(this)}unregister(){this.jedi.unregister(this)}setInitialValue(){if(H(this.value)){let t;const e=V(this.schema);e==="boolean"&&(t=!1),e==="number"&&(t=0),e==="integer"&&(t=0),e==="string"&&(t=""),e==="array"&&(t=[]),e==="object"&&(t={}),e==="null"&&(t=null),this.value=t}}setDefaultValue(){const t=le(this.schema);d(t)&&this.setValue(t,!1)}getValue(){return this.value}setValue(t,e=!0){this.value=t,this.emit("set-value",t),e&&this.emit("change")}onChildChange(){}getErrors(){if(!this.isActive)return[];const t=this.jedi.validator.getErrors(this.getValue(),this.schema,this.getKey(),this.path);return Ht(t)}prepare(){}activate(){this.isActive===!1&&(this.isActive=!0,this.emit("change"))}deactivate(){this.isActive===!0&&(this.isActive=!1,this.emit("change"))}isReadOnly(){let t=!1;return _t(this.schema)===!0&&(t=!0),this.parent&&_t(this.parent.schema)===!0&&(t=!0),t}destroy(){this.listeners=[],this.children.forEach(t=>{t.destroy()}),this.unregister(),this.ui&&this.ui.destroy(),Object.keys(this).forEach(t=>{delete this[t]}),super.destroy()}}const ke={properties:"glyphicon glyphicon-list",delete:"glyphicon glyphicon-trash",add:"glyphicon glyphicon-plus",moveUp:"glyphicon glyphicon-arrow-up",moveDown:"glyphicon glyphicon-arrow-down"},Me={properties:"bi bi-card-list",delete:"bi bi-trash2",add:"bi bi-plus",moveUp:"bi bi-arrow-up",moveDown:"bi bi-arrow-down"},Ve={properties:"icon-list",delete:"icon-trash",add:"icon-plus",moveUp:"icon-arrow-up",moveDown:"icon-arrow-down"},Re={properties:"fa fa-list",delete:"fa fa-trash-o",add:"fa fa-plus",moveUp:"fa fa-arrow-up",moveDown:"fa fa-arrow-down"},Be={properties:"fas fa-list",delete:"fas fa-trash",add:"fas fa-plus",moveUp:"fas fa-arrow-up",moveDown:"fas fa-arrow-down"},qe={properties:"fa-solid fa-list",delete:"fa-solid fa-trash",add:"fa-solid fa-plus",moveUp:"fa-solid fa-arrow-up",moveDown:"fa-solid fa-arrow-down"};class xt{constructor(t=null){this.icons=t,this.useToggleEvents=!0,this.init()}init(){this.useToggleEvents=!0}getIcon(t){const e=document.createElement("i"),s=this.icons[t].split(" ");return s.length>0&&s.forEach(n=>{e.classList.add(n)}),e}getEditorContainer(){const t=document.createElement("div");return t.classList.add("jedi-editor-container"),t}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("jedi-editor-fieldset"),t}getLegend(t){const e=document.createElement("legend"),s=document.createElement("span");return e.classList.add("jedi-editor-legend"),s.classList.add("jedi-editor-legend-text"),e.setAttribute("aria-labelledby","#legend-"+t.id),s.textContent=t.textContent,s.setAttribute("id","#legend-"+t.id),e.appendChild(s),e}getCard(){const t=document.createElement("div");return t.classList.add("jedi-editor-card"),t}getCardHeader(){const t=document.createElement("div");return t.classList.add("jedi-editor-card-header"),t}getCardBody(){const t=document.createElement("div");return t.classList.add("jedi-editor-card-body"),t}getActionsSlot(){const t=document.createElement("div");return t.classList.add("jedi-actions-slot"),t}getArrayActionsSlot(){const t=this.getBtnGroup();return t.classList.add("jedi-array-actions-slot"),t}getChildrenSlot(){const t=document.createElement("div");return t.classList.add("jedi-children-slot"),t}getMessagesSlot(t={}){const e=document.createElement("div");return e.classList.add("jedi-messages-slot"),e.setAttribute("aria-atomic","false"),e.setAttribute("aria-live","polite"),t.id&&e.setAttribute("id",t.id),e}getControlSlot(){const t=document.createElement("div");return t.classList.add("jedi-control-slot"),t}getPropertiesSlot(t){const e=document.createElement("div");return e.classList.add("jedi-properties-slot"),e.setAttribute("id",t.id),this.useToggleEvents&&(e.style.display="none"),e}getPropertiesAriaLive(){const t=document.createElement("div");return t.classList.add("jedi-properties-aria-live"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t}getAriaLiveMessage(t){const e=document.createElement("p");return e.classList.add("jedi-aria-live-message"),e.textContent=t,this.visuallyHidden(e),e}getPropertiesToggle(t){const e=this.getButton(t);return e.classList.add("jedi-properties-toggle"),this.useToggleEvents&&e.addEventListener("click",()=>{t.propertiesContainer.hasAttribute("style")?this.visuallyVisible(t.propertiesContainer):this.visuallyHidden(t.propertiesContainer)}),e}getPropertiesActivators(){const t=document.createElement("div");return t.classList.add("jedi-properties-activators"),t}getBtnGroup(){const t=document.createElement("span");return t.classList.add("jedi-btn-group"),t.style.display="initial",t}getButton(t){const e=document.createElement("button");e.classList.add("jedi-btn"),e.setAttribute("type","button"),t.value&&(e.value=t.value),t.id&&e.setAttribute("id",t.id);const s=document.createElement("span");if(s.textContent=t.textContent,this.icons&&t.icon){const n=this.getIcon(t.icon);n.setAttribute("title",t.textContent),e.appendChild(n),this.visuallyHidden(s)}return e.appendChild(s),e}getArrayBtnAdd(){const t=this.getButton({textContent:"Add item into",icon:"add"});return t.classList.add("jedi-array-add"),t}getAddPropertyButton(){const t=this.getButton({textContent:"Add property"});return t.classList.add("jedi-add-property-btn"),t}getDeleteItemBtn(){const t=this.getButton({textContent:"Delete item",icon:"delete"});return t.classList.add("jedi-array-delete"),t}getMoveUpItemBtn(){const t=this.getButton({textContent:"Move up",icon:"moveUp"});return t.classList.add("jedi-array-move-up"),t}getMoveDownItemBtn(){const t=this.getButton({textContent:"Move down",icon:"moveDown"});return t.classList.add("jedi-array-move-down"),t}getDescription(t={}){const e=document.createElement("small");return e.classList.add("jedi-description"),t.textContent&&(e.textContent=t.textContent),t.id&&e.setAttribute("id",t.id),e}getObjectControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=this.getCardBody(),a=this.getPropertiesAriaLive(),o=this.getDescription({textContent:t.description}),c=this.getMessagesSlot(),l=this.getChildrenSlot(),h=this.getPropertiesSlot({id:"properties-slot-"+t.id}),u=this.getPropertiesToggle({textContent:t.title+" properties",id:"properties-slot-toggle-"+t.id,icon:"properties",propertiesContainer:h}),p=this.getPropertiesActivators(),g=this.getInputControl({type:"text",id:"jedi-add-property-input-"+t.id,label:"Property"}),b=this.getAddPropertyButton(),E=this.getFieldset(),C=this.getLegend({textContent:t.title,id:t.id});return b.classList.add("jedi-object-add"),e.appendChild(E),E.appendChild(C),E.appendChild(r),r.appendChild(o),r.appendChild(c),C.appendChild(s),s.appendChild(n),r.appendChild(h),r.appendChild(l),t.addProperty&&(h.appendChild(g.container),h.appendChild(b)),t.editableProperties&&(s.appendChild(u),h.appendChild(a),h.appendChild(p)),{container:e,body:r,actions:s,messages:c,childrenSlot:l,propertiesToggle:u,propertiesContainer:h,addPropertyControl:g,addPropertyBtn:b,ariaLive:a,propertiesActivators:p,arrayActions:n}}getArrayControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=this.getCardBody(),a=this.getDescription({textContent:t.description}),o=this.getMessagesSlot(),c=this.getChildrenSlot(),l=this.getBtnGroup(),h=this.getArrayBtnAdd(),u=this.getFieldset(),p=this.getLegend({textContent:t.title,id:t.id});return e.appendChild(u),u.appendChild(p),u.appendChild(r),r.appendChild(a),r.appendChild(o),p.appendChild(s),s.appendChild(l),l.appendChild(h),s.appendChild(n),r.appendChild(c),{container:e,body:r,actions:s,messages:o,childrenSlot:c,btnGroup:l,addBtn:h,arrayActions:n}}getMultipleControl(t){const e=document.createElement("div"),s=this.getCard(),n=this.getActionsSlot(),r=this.getArrayActionsSlot(),a=this.getCardHeader({textContent:t.title,srOnly:t.srOnly}),o=this.getCardBody(),c=this.getDescription({textContent:t.description}),l=this.getMessagesSlot(),h=this.getChildrenSlot(),u=this.getSwitcher({values:t.switcherOptionValues,titles:t.switcherOptionsLabels,id:t.id+"-switcher",label:t.id+"-switcher",srOnly:!0,readOnly:t.readOnly});return u.container.classList.add("jedi-switcher"),e.appendChild(c),e.appendChild(s),s.appendChild(a),s.appendChild(o),a.appendChild(n),n.appendChild(r),n.appendChild(u.container),o.appendChild(l),o.appendChild(h),{container:e,card:s,header:a,body:o,actions:n,messages:l,childrenSlot:h,switcher:u,arrayActions:r}}getNullControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("label");r.setAttribute("for",t.id);const a=document.createElement("span");a.textContent=t.label,t.srOnly&&this.visuallyHidden(r);const o=t.id+"-description",c=this.getDescription({textContent:t.description,id:o}),l=this.getMessagesSlot();return e.appendChild(r),e.appendChild(c),e.appendChild(l),e.appendChild(s),s.appendChild(n),r.appendChild(a),{container:e,label:r,labelText:a,description:c,messages:l,actions:s,arrayActions:n}}getTextareaControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("textarea");r.setAttribute("id",t.id),r.style.width="100%";const a=document.createElement("label");a.setAttribute("for",t.id);const o=document.createElement("span");o.textContent=t.label,t.srOnly&&this.visuallyHidden(a);const c=t.id+"-description",l=this.getDescription({textContent:t.description,id:c}),h=t.id+"-messages",u=this.getMessagesSlot({id:h}),p=h+" "+c;return r.setAttribute("aria-describedby",p),e.appendChild(a),e.appendChild(r),e.appendChild(l),e.appendChild(u),e.appendChild(s),s.appendChild(n),a.appendChild(o),{container:e,input:r,label:a,labelText:o,description:l,messages:u,actions:s,arrayActions:n}}getInputControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("input");r.setAttribute("type",t.type),r.setAttribute("id",t.id),r.style.width="100%";const a=document.createElement("label");a.setAttribute("for",t.id);const o=document.createElement("span");o.textContent=t.label,t.srOnly&&this.visuallyHidden(a);const c=t.id+"-description",l=this.getDescription({textContent:t.description,id:c}),h=t.id+"-messages",u=this.getMessagesSlot({id:h}),p=h+" "+c;return r.setAttribute("aria-describedby",p),e.appendChild(a),e.appendChild(r),e.appendChild(l),e.appendChild(u),e.appendChild(s),s.appendChild(n),a.appendChild(o),{container:e,input:r,label:a,labelText:o,description:l,messages:u,actions:s,arrayActions:n}}getRadiosControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=this.getFieldset(),a=this.getCardBody(),o=this.getLegend({textContent:t.label,id:t.id}),c=t.id+"-messages",l=this.getMessagesSlot({id:c}),h=t.id+"-description",u=this.getDescription({textContent:t.description,id:h});t.srOnly&&this.visuallyHidden(o);const p=[],g=[],b=[],E=[];return t.values.forEach((C,x)=>{const D=document.createElement("div");p.push(D);const R=document.createElement("input");R.setAttribute("type","radio"),R.setAttribute("id",t.id+"-"+x),R.setAttribute("value",C),g.push(R);const T=c+" "+h;R.setAttribute("aria-describedby",T);const It=document.createElement("label");It.setAttribute("for",t.id+"-"+x);const ee=document.createElement("span");E.push(ee),t.titles&&t.titles[x]&&(ee.textContent=t.titles[x]),b.push(It)}),e.appendChild(r),e.appendChild(s),r.appendChild(o),r.appendChild(a),s.appendChild(n),p.forEach((C,x)=>{a.appendChild(p[x]),C.appendChild(g[x]),C.appendChild(b[x]),b[x].appendChild(E[x])}),r.appendChild(u),r.appendChild(l),{container:e,fieldset:r,legend:o,body:a,radios:g,labels:b,labelTexts:E,radioControls:p,description:u,messages:l,actions:s,arrayActions:n}}getCheckboxControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("div"),a=document.createElement("input");a.setAttribute("type","checkbox"),a.setAttribute("id",t.id);const o=document.createElement("label");o.setAttribute("for",t.id);const c=document.createElement("span");c.textContent=t.label,t.srOnly&&this.visuallyHidden(o);const l=t.id+"-description",h=this.getDescription({textContent:t.description,id:l}),u=t.id+"-messages",p=this.getMessagesSlot({id:u}),g=u+" "+l;return a.setAttribute("aria-describedby",g),e.appendChild(r),e.appendChild(s),s.appendChild(n),r.appendChild(a),r.appendChild(o),o.appendChild(c),r.appendChild(h),r.appendChild(p),{container:e,formGroup:r,input:a,label:o,labelText:c,description:h,messages:p,actions:s,arrayActions:n}}getSelectControl(t){const e=document.createElement("div"),s=this.getActionsSlot(),n=this.getArrayActionsSlot(),r=document.createElement("select");r.setAttribute("id",t.id),r.style.width="100%",t.values.forEach((g,b)=>{const E=document.createElement("option");E.setAttribute("value",g),t.titles&&t.titles[b]&&(E.textContent=t.titles[b]),r.appendChild(E)});const a=document.createElement("label");a.setAttribute("for",t.id);const o=document.createElement("span");o.textContent=t.label,t.srOnly&&this.visuallyHidden(a);const c=t.id+"-description",l=this.getDescription({textContent:t.description,id:c}),h=t.id+"-messages",u=this.getMessagesSlot({id:h}),p=h+" "+c;return r.setAttribute("aria-describedby",p),e.appendChild(a),e.appendChild(r),a.appendChild(o),e.appendChild(l),e.appendChild(u),e.appendChild(s),s.appendChild(n),{container:e,input:r,label:a,labelText:o,description:l,messages:u,actions:s,arrayActions:n}}getSwitcher(t){return this.getSelectControl(t)}getAlert(t){return this.getInvalidFeedback(t)}getInvalidFeedback(t){const e=document.createElement("div"),s=document.createElement("span"),n=document.createElement("span");return s.textContent=t.message,n.textContent="⚠ ",n.classList.add("jedi-error-message"),n.setAttribute("aria-hidden","true"),e.classList.add("jedi-error-message"),e.appendChild(n),e.appendChild(s),e}getRow(){const t=document.createElement("div");return t.classList.add("jedi-row"),t}getCol(t,e,s){const n=document.createElement("div");return n.classList.add("jedi-col-xs-"+t),n.classList.add("jedi-col-md-"+e),s&&n.classList.add("jedi-col-md-offset-"+s),n}getTabList(){const t=document.createElement("ul");return t.classList.add("jedi-nav-list"),t}getTab(t){const e=document.createElement("li"),s=document.createElement("a");return s.classList.add("jedi-nav-link"),s.setAttribute("href","#"+t.id),s.textContent=t.title,e.appendChild(s),{list:e,link:s}}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-content"),t}setTabPaneAttributes(t,e,s){t.setAttribute("id",s),t.classList.add("jedi-tab-pane")}visuallyHidden(t){t.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;")}visuallyVisible(t){t.removeAttribute("style")}}class Ne extends xt{init(){this.useToggleEvents=!1}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("panel"),t.classList.add("panel-default"),t}getLegend(t){const e=super.getLegend(t);return e.classList.add("h5"),e.classList.add("panel-heading"),e.classList.add("pull-left"),e.setAttribute("style","margin: 0; display: flex; justify-content: space-between; align-items: center;"),e}getCard(){const t=super.getCard();return t.classList.add("panel"),t.classList.add("panel-default"),t}getCardHeader(t){const e=super.getCardHeader(t);return e.classList.add("panel-heading"),e.classList.add("text-right"),e}getCardBody(){const t=super.getCardBody();return t.classList.add("panel-body"),t.style.clear="both",t}getPropertiesToggle(t){const e=this.getButton(t);return e.setAttribute("data-toggle","collapse"),e.setAttribute("data-target","#"+t.propertiesContainer.id),e.classList.add("jedi-properties-toggle"),e}getPropertiesSlot(t){const e=super.getPropertiesSlot(t);return e.classList.add("collapse"),e.setAttribute("id",t.id),e}getBtnGroup(){const t=super.getBtnGroup();return t.classList.add("btn-group"),t}getButton(t){const e=super.getButton(t);return e.classList.add("btn"),e.classList.add("btn-xs"),e.classList.add("btn-default"),e}getDescription(t){const e=super.getDescription(t);return e.classList.add("text-muted"),e}getTextareaControl(t){const e=super.getTextareaControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getInputControl(t){const e=super.getInputControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getRadiosControl(t){const e=super.getRadiosControl(t),{body:s,radios:n,labels:r,labelTexts:a,radioControls:o,description:c,messages:l}=e;return o.forEach((h,u)=>{h.classList.add("radio"),s.appendChild(o[u]),h.appendChild(r[u]),r[u].appendChild(n[u]),r[u].appendChild(a[u])}),s.appendChild(c),s.appendChild(l),e}getCheckboxControl(t){const e=super.getCheckboxControl(t),{container:s,formGroup:n,input:r,label:a,labelText:o,description:c,messages:l}=e;return n.classList.add("checkbox"),s.appendChild(n),n.appendChild(a),a.appendChild(r),a.appendChild(o),n.appendChild(c),n.appendChild(l),e}getSelectControl(t){const e=super.getSelectControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getSwitcher(t){const e=super.getSwitcher(t),{container:s,input:n}=e;return s.classList.remove("form-group"),n.classList.remove("form-control"),e}getAlert(t){const e=super.getAlert(t);return e.classList.add("alert"),e.classList.add("alert-danger"),e}getInvalidFeedback(t){const e=super.getInvalidFeedback(t);return e.classList.add("text-danger"),e}getRow(){const t=super.getRow();return t.classList.add("row"),t}getCol(t,e,s){const n=super.getRow();return n.classList.add("col-xs-"+t),n.classList.add("col-md-"+e),s&&n.classList.add("col-md-offset-"+s),n}getTabList(t){const e=super.getTabList(t);return e.classList.add("nav"),t.type==="tabs"?e.classList.add("nav-tabs"):e.classList.add("nav-pills"),e.classList.add("nav-stacked"),t.stacked===!1&&e.classList.remove("nav-stacked"),e}getTab(t){const e=super.getTab(t);return t.active&&e.list.classList.add("active"),e.link.setAttribute("data-toggle","tab"),e}setTabPaneAttributes(t,e,s){super.setTabPaneAttributes(t,e,s),t.classList.add("tab-pane"),e&&(t.classList.add("in"),t.classList.add("active"))}visuallyHidden(t){t.classList.add("sr-only")}visuallyVisible(t){t.classList.remove("sr-only")}}class De extends xt{init(){this.useToggleEvents=!1}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("card"),t.classList.add("mb-3"),t}getLegend(t){const e=super.getLegend(t);return e.classList.add("h6"),e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-between"),e.classList.add("align-items-center"),e.classList.add("float-left"),e.classList.add("py-2"),e}getCard(){const t=super.getCard();return t.classList.add("card"),t.classList.add("mb-3"),t}getCardHeader(t){const e=super.getCardHeader(t);return e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-end"),e.classList.add("align-items-center"),e.classList.add("py-1"),e}getCardBody(){const t=super.getCardBody();return t.classList.add("card-body"),t}getPropertiesSlot(t){const e=super.getPropertiesSlot(t);return e.classList.add("collapse"),e.setAttribute("id",t.id),e}getPropertiesToggle(t){const e=this.getButton(t);return e.setAttribute("data-toggle","collapse"),e.setAttribute("data-target","#"+t.propertiesContainer.id),e.classList.add("jedi-properties-toggle"),e}getBtnGroup(){const t=super.getBtnGroup();return t.classList.add("btn-group"),t}getButton(t){const e=super.getButton(t);return e.classList.add("btn"),e.classList.add("btn-sm"),e}getDescription(t){const e=super.getDescription(t);return e.classList.add("text-muted"),e}getTextareaControl(t){const e=super.getTextareaControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getInputControl(t){const e=super.getInputControl(t),{container:s,input:n,label:r}=e;return s.classList.add("form-group"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getRadiosControl(t){const e=super.getRadiosControl(t),{container:s,body:n,radios:r,labels:a,labelTexts:o,radioControls:c,description:l,messages:h}=e;return s.classList.add("form-group"),c.forEach((u,p)=>{u.classList.add("form-check"),r[p].classList.add("form-check-input"),a[p].classList.add("form-check-label"),n.appendChild(c[p]),u.appendChild(r[p]),u.appendChild(a[p]),a[p].appendChild(o[p])}),n.appendChild(l),n.appendChild(h),e}getCheckboxControl(t){const e=super.getCheckboxControl(t),{container:s,formGroup:n,input:r,label:a,description:o,messages:c}=e;return n.classList.add("form-group"),n.classList.add("form-check"),r.classList.add("form-check-input"),a.classList.add("form-check-label"),s.appendChild(n),n.appendChild(r),n.appendChild(a),n.appendChild(o),n.appendChild(c),e}getSelectControl(t){const e=super.getSelectControl(t),{container:s,input:n}=e;return s.classList.add("form-group"),n.classList.add("form-control"),e}getSwitcher(t){const e=super.getSwitcher(t),{container:s,input:n}=e;return s.classList.remove("form-group"),n.classList.remove("form-control"),e}getAlert(t){const e=super.getAlert(t);return e.classList.add("alert"),e.classList.add("alert-danger"),e}getInvalidFeedback(t){const e=super.getInvalidFeedback(t);return e.classList.add("text-danger"),e.classList.add("form-text"),e.classList.add("d-block"),e}getColumnClass(t,e){return"col-"+t+"-"+e}getRow(){const t=super.getRow();return t.classList.add("row"),t}getCol(t,e,s){const n=super.getRow(t,e,s);return n.classList.add("col-"+t),n.classList.add("col-md-"+e),s&&n.classList.add("offset-md-"+s),n}getTabList(t){const e=super.getTabList();return e.classList.add("nav"),t.type==="tabs"?e.classList.add("nav-tabs"):e.classList.add("nav-pills"),e.classList.add("flex-column"),t.stacked===!1&&e.classList.remove("flex-column"),e}getTab(t){const e=super.getTab(t);return e.list.classList.add("nav-item"),e.link.classList.add("nav-link"),e.link.setAttribute("data-toggle","tab"),t.active&&e.link.classList.add("active"),e}setTabPaneAttributes(t,e,s){super.setTabPaneAttributes(t,e,s),t.classList.add("tab-pane"),e&&t.classList.add("active")}visuallyHidden(t){t.classList.add("sr-only")}visuallyVisible(t){t.classList.remove("sr-only")}}class Fe extends xt{init(){this.useToggleEvents=!1}getFieldset(){const t=document.createElement("fieldset");return t.classList.add("card"),t.classList.add("mb-3"),t}getLegend(t){const e=super.getLegend(t);return e.classList.add("h6"),e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-between"),e.classList.add("align-items-center"),e.classList.add("py-2"),e}getCard(){const t=super.getCard();return t.classList.add("card"),t.classList.add("mb-3"),t}getCardHeader(t){const e=super.getCardHeader(t);return e.classList.add("card-header"),e.classList.add("d-flex"),e.classList.add("justify-content-end"),e.classList.add("align-items-center"),e.classList.add("py-1"),e}getCardBody(){const t=super.getCardBody();return t.classList.add("card-body"),t}getPropertiesSlot(t){const e=super.getPropertiesSlot(t);return e.classList.add("collapse"),e.setAttribute("id",t.id),e}getControlSlot(){const t=super.getControlSlot();return t.classList.add("mb-3"),t}getPropertiesToggle(t){const e=this.getButton(t);return e.setAttribute("data-bs-toggle","collapse"),e.setAttribute("data-bs-target","#"+t.propertiesContainer.id),e.classList.add("jedi-properties-toggle"),e}getBtnGroup(){const t=super.getBtnGroup();return t.classList.add("btn-group"),t}getButton(t){const e=super.getButton(t);return e.classList.add("btn"),e.classList.add("btn-sm"),e}getDescription(t){const e=super.getDescription(t);return e.classList.add("text-muted"),e}getTextareaControl(t){const e=super.getTextareaControl(t),{container:s,input:n,label:r}=e;return s.classList.add("mb-3"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getInputControl(t){const e=super.getInputControl(t),{container:s,input:n,label:r}=e;return s.classList.add("mb-3"),n.classList.add("form-control"),t.srOnly&&this.visuallyHidden(r),e}getRadiosControl(t){const e=super.getRadiosControl(t),{container:s,body:n,radios:r,labels:a,labelTexts:o,radioControls:c,description:l,messages:h}=e;return s.classList.add("mb-3"),c.forEach((u,p)=>{u.classList.add("form-check"),r[p].classList.add("form-check-input"),a[p].classList.add("form-check-label"),n.appendChild(c[p]),u.appendChild(r[p]),u.appendChild(a[p]),a[p].appendChild(o[p])}),n.appendChild(l),n.appendChild(h),e}getCheckboxControl(t){const e=super.getCheckboxControl(t),{container:s,formGroup:n,input:r,label:a,description:o,messages:c}=e;return s.classList.add("mb-3"),n.classList.add("form-check"),r.classList.add("form-check-input"),a.classList.add("form-check-label"),t.srOnly&&this.visuallyHidden(a),s.appendChild(n),n.appendChild(r),n.appendChild(a),n.appendChild(o),n.appendChild(c),e}getSelectControl(t){const e=super.getSelectControl(t),{container:s,input:n}=e;return s.classList.add("mb-3"),n.classList.add("form-select"),e}getSwitcher(t){const e=super.getSwitcher(t),{container:s,input:n,label:r}=e;return s.classList.remove("mb-3"),n.classList.remove("form-select"),this.visuallyHidden(r),e}getAlert(t){const e=super.getAlert(t);return e.classList.add("alert"),e.classList.add("alert-danger"),e}getInvalidFeedback(t){const e=super.getInvalidFeedback(t);return e.classList.add("text-danger"),e.classList.add("d-block"),e.classList.add("form-text"),e.classList.add("form-text"),e}getRow(){const t=super.getRow();return t.classList.add("row"),t}getCol(t,e,s){const n=super.getRow(t,e,s);return n.classList.add("col-"+t),n.classList.add("col-md-"+e),s&&n.classList.add("offset-md-"+s),n}getTabList(t){const e=super.getTabList(t);return e.classList.add("nav"),t.type==="tabs"?e.classList.add("nav-tabs"):e.classList.add("nav-pills"),e.classList.add("flex-column"),t.stacked===!1&&e.classList.remove("flex-column"),e}getTab(t){const e=super.getTab(t);return e.list.classList.add("nav-item"),e.link.classList.add("nav-link"),e.link.setAttribute("data-bs-toggle","tab"),t.active&&e.link.classList.add("active"),e}setTabPaneAttributes(t,e,s){super.setTabPaneAttributes(t,e,s),t.classList.add("tab-pane"),e&&t.classList.add("active")}visuallyHidden(t){t.classList.add("visually-hidden")}visuallyVisible(t){t.classList.remove("visually-hidden")}}class U{constructor(t){if(this.instance=t,this.theme=null,this.control=null,this.disabled=!1,this.readOnly=this.instance.isReadOnly(),this.init(),this.build(),this.coerceValue(),this.addEventListeners(),this.setContainerAttributes(),this.refreshUI(),this.instance.jedi.options.showErrors==="always"||f(this.instance.schema,"showErrors")==="always"){const s=this.instance.getErrors();this.showValidationErrors(s)}this.instance.on("set-value",()=>{this.refreshUI();const s=this.instance.getErrors();this.showValidationErrors(s)}),this.instance.on("change",()=>{this.refreshUI();const s=this.instance.getErrors();this.showValidationErrors(s)})}init(){let t=null;if(d(this.instance.jedi.options.iconLib))switch(this.instance.jedi.options.iconLib){case"glyphicons":t=ke;break;case"bootstrap-icons":t=Me;break;case"fontawesome3":t=Ve;break;case"fontawesome4":t=Re;break;case"fontawesome5":t=Be;break;case"fontawesome6":t=qe;break}switch(this.instance.jedi.options.theme){case"bootstrap3":this.theme=new Ne(t);break;case"bootstrap4":this.theme=new De(t);break;case"bootstrap5":this.theme=new Fe(t);break;default:this.theme=new xt(t)}}setContainerAttributes(){this.control.container.setAttribute("data-path",this.instance.path),this.control.container.setAttribute("data-type",V(this.instance.schema))}build(){}coerceValue(){const t=k(this.instance.schema);d(t)&&!t.includes(this.instance.getValue())&&d(t[0])&&this.instance.setValue(t[0],!1)}addEventListeners(){}showValidationErrors(t){if(this.instance.jedi.options.showErrors==="never"||f(this.instance.schema,"showErrors")==="never")return;this.control.messages.innerHTML="";const s=I(this.instance.schema)||this.instance.getKey();t.forEach(n=>{n.messages.forEach(r=>{const a=this.getInvalidFeedback({message:s+": "+r});this.control.messages.appendChild(a)})})}getInvalidFeedback(t){return this.theme.getInvalidFeedback(t)}disable(){this.disabled=!0,this.refreshUI()}enable(){this.disabled=!1,this.refreshUI()}refreshUI(){this.refreshInteractiveElements()}refreshInteractiveElements(){this.control.container.querySelectorAll("button, input, select, textarea").forEach(e=>{this.disabled||this.readOnly?e.setAttribute("disabled",""):e.removeAttribute("disabled","")})}sanitize(t){return t}destroy(){this.control.container&&this.control.container.parentNode&&this.control.container.parentNode.removeChild(this.control.container),Object.keys(this).forEach(t=>{delete this[t]})}}class Zt extends U{build(){this.control=this.theme.getMultipleControl({title:"Options",srOnly:f(this.instance.schema,"hideTitle"),id:w(this.instance.path),description:j(this.instance.schema),switcherOptionValues:this.instance.switcherOptionValues,switcherOptionsLabels:this.instance.switcherOptionsLabels})}addEventListeners(){this.control.switcher.input.addEventListener("change",()=>{const t=Number(this.control.switcher.input.value);this.instance.switchInstance(t)})}refreshUI(){this.refreshInteractiveElements(),this.control.childrenSlot.innerHTML="",this.control.childrenSlot.appendChild(this.instance.activeInstance.ui.control.container),this.control.switcher.input.value=this.instance.index,this.disabled||this.instance.isReadOnly()?this.instance.activeInstance.ui.disable():this.instance.activeInstance.ui.enable()}getInvalidFeedback(t){return this.theme.getAlert(t)}}class Ue extends F{setUI(){this.ui=new Zt(this)}prepare(){this.instances=[],this.activeInstance=null,this.activeInstanceChanged=!0,this.index=0,this.schemas=[],this.switcherOptionValues=[],this.switcherOptionsLabels=[],this.ifThenElseShemas=[],this.traverseSchema(this.schema),delete this.schema.if,delete this.schema.then,delete this.schema.else;let t=0;this.ifThenElseShemas.forEach(r=>{d(r.then)&&(this.schemas.push(z({},O(this.schema),r.then)),this.switcherOptionValues.push(t),this.switcherOptionsLabels.push(JSON.stringify(r.then)),t++),d(r.else)&&(this.schemas.push(z({},O(this.schema),r.else)),this.switcherOptionValues.push(t),this.switcherOptionsLabels.push(JSON.stringify(r.else)),t++)});const e=O(this.schema);delete e.if,delete e.then,delete e.else;const s=this.jedi.createInstance({jedi:this.jedi,schema:e,path:this.path,parent:this.parent});this.schemas.forEach(r=>{const a=this.jedi.createInstance({jedi:this.jedi,schema:r,path:this.path,parent:this.parent});a.unregister(),a.on("change",()=>{const o=this.activeInstance.getValue();this.getFittestIndex(o)!==this.index?this.setValue(o):(this.value=this.activeInstance.getValue(),this.emit("change"))}),this.instances.push(a),this.register()}),this.on("set-value",r=>{this.instances.forEach(c=>{const l=c.getValue();let h=r;m(l)&&m(h)&&(h=Ut(l,h)),c.setValue(h,!1)});const a=this.getFittestIndex(r);a!==this.index&&(this.switchInstance(a),this.emit("change"))}),this.value=s.getValue(),s.destroy();const n=this.getFittestIndex(this.value);this.switchInstance(n)}switchInstance(t){this.index=t,this.activeInstance=this.instances[this.index],this.value=this.activeInstance.getValue(),this.emit("change")}traverseSchema(t){const e=Tt(t);if(d(e)){const s=Rt(t),n=jt(t);this.ifThenElseShemas.push({if:e,then:d(s)?s:{}}),this.ifThenElseShemas.push({if:e,else:d(n)?n:{}})}}getFittestIndex(t){let e=this.index;return this.ifThenElseShemas.forEach((s,n)=>{const r=new S({schema:s.if,data:t}),a=r.getErrors();r.destroy(),a.length===0&&s.then&&(e=n),a.length>0&&s.else&&(e=n)}),e}destroy(){this.instances.forEach(t=>{t.destroy()}),super.destroy()}getAllOfCombinations(t){const e=[],s=(r,a)=>({...r,...a}),n=(r,a)=>{if(a.length===0){e.push(r);return}const o=a[0];n(s(r,o),a.slice(1)),n(r,a.slice(1))};for(let r=0;rObject.keys(r).length-Object.keys(a).length),e}}class He extends F{setUI(){this.ui=new Zt(this)}prepare(){this.instances=[],this.activeInstance=null,this.activeInstanceChanged=!0,this.lastIndex=0,this.index=0,this.schemas=[],this.switcherOptionValues=[],this.switcherOptionsLabels=[],this.on("set-value",()=>{this.onSetValue()});const t=V(this.schema);if(d($(this.schema))||d(J(this.schema))){const s=d($(this.schema))?$(this.schema):J(this.schema),n=O(this.schema);delete n.anyOf,delete n.oneOf,delete n.options,s.forEach((r,a)=>{r={...n,...r},this.jedi.refParser&&(r=this.jedi.refParser.expand(r));let o="Option-"+(a+1);const c=f(r,"switcherTitle"),l=I(r);d(l)&&(o=l),d(c)&&(o=c),this.switcherOptionValues.push(a),this.switcherOptionsLabels.push(o),this.schemas.push(r)})}else if(L(t))t.forEach((s,n)=>{const r=z(this.schema),a={...r,type:s,title:s[0].toUpperCase()+s.slice(1)};d(r.title)&&(a.title=r.title),this.switcherOptionValues.push(n),this.switcherOptionsLabels.push(s.charAt(0).toUpperCase()+s.slice(1)),this.schemas.push(a)});else if(t==="any"||!t){const s=O(this.schema);this.schemas=[{...s,type:"object"},{...s,type:"array"},{...s,type:"string"},{...s,type:"number"},{...s,type:"integer"},{...s,type:"boolean"},{...s,type:"null"}],this.schemas.forEach((n,r)=>{this.switcherOptionValues.push(r)}),this.switcherOptionsLabels=["Object","Array","String","Number","Integer","Boolean","Null"]}this.schemas.forEach(s=>{const n=this.jedi.createInstance({jedi:this.jedi,schema:s,path:this.path,parent:this.parent,value:O(this.value)});d(this.value)&&n.setValue(this.value,!1),n.unregister(),n.on("change",()=>{this.activeInstanceChanged=!0,this.setValue(this.activeInstance.getValue())}),this.instances.push(n),this.register()});const e=d(this.if)?this.getIfIndex(this.value):this.getFittestIndex(this.value);this.switchInstance(e,this.value)}switchInstance(t,e){this.lastIndex=this.index,this.index=t,this.activeInstance=this.instances[t],d(e)&&this.activeInstance.setValue(e,!1),this.setValue(this.activeInstance.getValue())}onSetValue(){if(Ot(this.activeInstance.getValue(),this.value)||this.activeInstanceChanged){this.activeInstanceChanged=!1;const t=d(this.if)?this.getIfIndex(this.value):this.getFittestIndex(this.value);this.switchInstance(t,this.value)}}reassignValues(){const t=this.instances[this.lastIndex].getValue(),e=this.activeInstance.getValue();if(m(t)&&m(e)){const s=Ut(e,t);this.activeInstance.setValue(s,!1)}}getIfIndex(t){const e=new S({schema:this.if,data:t}),s=e.getErrors();return e.destroy(),s.length===0?0:1}getFittestIndex(t){let e=0,s,n;for(const r of this.instances){const a=this.jedi.validator.getErrors(t,r.schema,r.getKey(),r.path);(H(s)||H(n))&&(s=e,n=a),a.length{t.destroy()}),super.destroy()}}class Bt extends U{build(){this.control=this.theme.getCheckboxControl({id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.checked)})}sanitize(t){return!!t}refreshUI(){this.refreshInteractiveElements(),this.control.input.checked=this.instance.getValue()}}class $e extends Bt{build(){this.control=this.theme.getRadiosControl({values:["false","true"],titles:f(this.instance.schema,"enumTitles")||["false","true"],id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)})}addEventListeners(){this.control.radios.forEach(t=>{t.addEventListener("change",()=>{const e=t.value==="true";this.instance.setValue(e)})})}refreshUI(){this.refreshInteractiveElements(),this.control.radios.forEach(t=>{const e=t.value==="true";t.checked=e===this.instance.getValue()})}}class Ke extends Bt{build(){this.control=this.theme.getSelectControl({values:["false","true"],titles:f(this.instance.schema,"enumTitles")||["false","true"],id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{const t=this.control.input.value==="true";this.instance.setValue(t)})}refreshUI(){this.refreshInteractiveElements(),this.control.input.value=this.instance.getValue()===!0?"true":"false"}}class ze extends F{setUI(){const t=V(this.schema),e=q(this.schema);t==="boolean"&&e==="radio"?this.ui=new $e(this):t==="boolean"&&e==="select"?this.ui=new Ke(this):t==="boolean"&&(this.ui=new Bt(this))}}class qt extends U{build(){this.propertyActivators={};const t=this.instance.schema.options||{};let e=!0;const s=At(this.instance.schema);d(s)&&s===!1&&(e=!1);let n=!1;d(this.instance.jedi.options.editableProperties)&&(n=this.instance.jedi.options.editableProperties),d(t.editableProperties)&&(n=t.editableProperties),this.control=this.theme.getObjectControl({title:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),id:w(this.instance.path),description:j(this.instance.schema),editableProperties:n,addProperty:e})}addEventListeners(){this.control.addPropertyBtn.addEventListener("click",()=>{const t=this.control.addPropertyControl.input.value.split(" ").join("");if(t.length===0||d(this.instance.value[t]))return;let n={};const r=At(this.instance.schema);d(r)&&(n=r);const a=this.instance.createChild(n,t);a.activate(),this.instance.properties[t]={schema:n},this.instance.setValue(this.instance.value),this.control.addPropertyControl.input.value="";const o=this.control.ariaLive;o.innerHTML="";const c=I(a.schema),l=d(c)?c:t,h=this.theme.getAriaLiveMessage();h.textContent=l+" field was added to the form",o.appendChild(h)})}sanitize(t){return m(t)?t:{}}getInvalidFeedback(t){return this.theme.getAlert(t)}refreshPropertiesSlot(){const t=f(this.instance.schema,"editableProperties");(St(this.instance.jedi.options.editableProperties,!0)||St(t,!0))&&Object.keys(this.instance.properties).forEach(e=>{const s=this.instance.isRequired(e),n=this.instance.isDependentRequired(e),r=!s&&!n,a=this.propertyActivators[e],o=this.control.ariaLive,c=this.instance.properties[e].schema,l=I(c),h=this.instance.path+this.instance.jedi.pathSeparator+e,u=w(h)+"-activator",p=d(l)?l:e;if(r&&!a){const b=this.theme.getCheckboxControl({id:u,label:p,srOnly:!1}),E=b.input;this.propertyActivators[e]=E,E.addEventListener("change",()=>{o.innerHTML="";const C=this.theme.getAriaLiveMessage();E.checked?(this.instance.getChild(e)||this.instance.createChild(c,e),this.instance.getChild(e).activate(),C.textContent=p+" field was added to the form",o.appendChild(C)):(this.instance.getChild(e).deactivate(),C.textContent=p+" field was removed from the form",o.appendChild(C))}),this.control.propertiesActivators.appendChild(b.container)}const g=this.propertyActivators[e];g&&(g.disabled=this.disabled,g.checked=N(this.instance.getValue(),e))})}refreshEditors(){this.instance.children.forEach(t=>{t.isActive?(t.ui.control.container.parentNode===null&&this.control.childrenSlot.appendChild(t.ui.control.container),this.disabled||this.instance.isReadOnly()?t.ui.disable():t.ui.enable()):t.ui.control.container.parentNode&&t.ui.control.container.parentNode.removeChild(t.ui.control.container)})}refreshUI(){this.refreshInteractiveElements(),this.refreshPropertiesSlot(),this.refreshEditors()}}class Je extends qt{refreshEditors(){for(;this.control.childrenSlot.firstChild;)this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild);let t=this.theme.getRow();this.control.childrenSlot.appendChild(t),this.instance.children.forEach(e=>{if(e.isActive){const s=f(e.schema,"columns")||12,n=f(e.schema,"offset")||0,r=this.theme.getCol(12,s,n);f(e.schema,"newRow")===!0&&(t=this.theme.getRow(),this.control.childrenSlot.appendChild(t)),t.appendChild(r),r.appendChild(e.ui.control.container),this.disabled||this.instance.isReadOnly()?e.ui.disable():e.ui.enable()}})}}class Ge extends qt{init(){super.init(),this.activeTabIndex=0}refreshEditors(){for(;this.control.childrenSlot.firstChild;)this.control.childrenSlot.removeChild(this.control.childrenSlot.lastChild);const t=this.instance.schema["x-control-cols"],e=this.instance.schema["x-control-stacked"],s=this.instance.schema["x-control-variant"],n=this.theme.getRow(),r=d(t)?t:3,a=this.theme.getCol(12,r),o=this.theme.getCol(12,12-r),c=this.theme.getTabContent(),l=this.theme.getTabList({stacked:d(e)?e:!1,type:d(s)?s:"pils"});this.control.childrenSlot.appendChild(n),n.appendChild(a),n.appendChild(o),a.appendChild(l),o.appendChild(c),this.instance.children.forEach((h,u)=>{if(h.isActive){const p=u===this.activeTabIndex,g=w(h.path),b=I(h.schema),E=this.theme.getTab({title:d(b)?b:h.getKey(),id:g,active:p});E.list.addEventListener("click",()=>{this.activeTabIndex=u}),this.theme.setTabPaneAttributes(h.ui.control.container,p,g),l.appendChild(E.list),c.appendChild(h.ui.control.container),this.disabled||this.instance.isReadOnly()?h.ui.disable():h.ui.enable()}})}}class _e extends F{setUI(){const t=V(this.schema),e=q(this.schema),s=this.schema["x-control"];t==="object"&&e==="grid"?this.ui=new Je(this):t==="object"&&s==="nav"?this.ui=new Ge(this):this.ui=new qt(this)}prepare(){this.properties={};const t=Vt(this.schema);d(t)&&Object.keys(t).forEach(e=>{const s=t[e];this.properties[e]={schema:s};let n=!0;const r=f(this.schema,"deactivateNonRequired"),a=f(s,"deactivateNonRequired");this.isNotRequired(e)&&d(r)&&r===!0&&(n=!1),this.isNotRequired(e)&&d(a)&&a===!0&&(n=!1),n&&this.createChild(s,e)}),this.refreshInstances(),this.on("set-value",()=>{this.refreshInstances()})}isRequired(t){const e=Wt(this.schema);return d(e)&&e.includes(t)}isDependentRequired(t){const e=Kt(this.schema);if(d(e)){let s=[];return Object.keys(e).forEach(n=>{d(this.value[n])&&(s=e[n].filter(a=>!N(this.value,a)))}),s.includes(t)}return!1}createChild(t,e,s){const n=this.jedi.createInstance({jedi:this.jedi,schema:t,path:this.path+this.jedi.pathSeparator+e,parent:this,value:O(s)});this.children.push(n),this.value[e]=n.getValue();const r=f(this.schema,"deactivateNonRequired");return this.isNotRequired(e)&&d(r)&&r===!0&&n.deactivate(),n}isNotRequired(t){return!this.isRequired(t)&&!this.isDependentRequired(t)}deleteChild(t){for(let e=this.children.length-1;e>=0;e--){const s=this.children[e];s.getKey()===t&&(s.destroy(),this.children.splice(e,1),this.onChildChange())}}getChild(t){return this.children.find(e=>t===e.getKey().split(this.jedi.pathSeparator).pop())}onChildChange(){const t={};this.children.forEach(e=>{e.isActive&&(t[e.getKey()]=e.getValue())}),this.setValue(t)}refreshInstances(){const t=this.getValue();if(m(t)){Object.keys(t).forEach(e=>{const s=this.getChild(e);if(s){s.activate();const n=s.getValue(),r=t[s.getKey()];Ot(n,r)&&s.setValue(r,!1)}else this.createChild({},e,t[e])});for(let e=this.children.length-1;e>=0;e--){const s=this.children[e],n=s.getKey();H(t[n])&&(this.getChild(n)?s.deactivate():this.deleteChild(n))}}}}class te extends U{build(){this.control=this.theme.getArrayControl({title:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),id:w(this.instance.path),description:j(this.instance.schema)})}addEventListeners(){this.control.addBtn.addEventListener("click",()=>{this.instance.addItem()})}getInvalidFeedback(t){return this.theme.getAlert(t)}sanitize(t){return L(t)?t:[]}refreshUI(){this.refreshInteractiveElements();const t=Jt(this.instance.schema),e=Gt(this.instance.schema);d(t)&&t===this.instance.value.length&&this.control.addBtn.setAttribute("disabled",""),this.control.childrenSlot.innerHTML="",this.instance.children.forEach(s=>{const n=Number(s.getKey()),r=this.theme.getDeleteItemBtn(),a=this.theme.getMoveUpItemBtn(),o=this.theme.getMoveDownItemBtn();s.ui.control.arrayActions.innerHTML="",s.ui.control.arrayActions.appendChild(r),s.ui.control.arrayActions.appendChild(a),s.ui.control.arrayActions.appendChild(o),this.control.childrenSlot.appendChild(s.ui.control.container),r.addEventListener("click",()=>{const c=Number(s.path.split(this.instance.jedi.pathSeparator).pop());this.instance.deleteItem(c)}),a.addEventListener("click",()=>{const c=n-1;this.instance.move(n,c)}),o.addEventListener("click",()=>{const c=n+1;this.instance.move(n,c)}),this.disabled||this.instance.isReadOnly()?s.ui.disable():s.ui.enable(),d(e)&&this.instance.value.length<=e&&r.setAttribute("disabled","")})}}class We extends te{init(){super.init(),this.activeTabIndex=0}addEventListeners(){this.control.addBtn.addEventListener("click",()=>{this.activeTabIndex=this.instance.value.length,this.instance.addItem()})}refreshUI(){this.refreshInteractiveElements(),this.control.childrenSlot.innerHTML="";const t=f(this.instance.schema,"navCols"),e=f(this.instance.schema,"navStacked"),s=f(this.instance.schema,"navType"),n=this.theme.getRow(),r=d(t)?t:3,a=this.theme.getCol(12,r),o=this.theme.getCol(12,12-r),c=this.theme.getTabContent(),l=this.theme.getTabList({stacked:d(e)?e:!1,type:d(s)?s:"pils"});this.control.childrenSlot.appendChild(n),n.appendChild(a),n.appendChild(o),a.appendChild(l),o.appendChild(c),this.instance.children.forEach((h,u)=>{const p=this.theme.getDeleteItemBtn(),g=this.theme.getMoveUpItemBtn(),b=this.theme.getMoveDownItemBtn();h.ui.control.arrayActions.innerHTML="",h.ui.control.arrayActions.appendChild(p),h.ui.control.arrayActions.appendChild(g),h.ui.control.arrayActions.appendChild(b),this.control.childrenSlot.appendChild(h.ui.control.container);let E;const C=f(this.instance.schema,"itemTemplate");if(C){const T=C,It={i0:u,i1:u+1,value:h.getValue()};E=y(T,It)}else{const T=I(h.schema);E=d(T)?T+" "+(u+1):h.getKey()}p.addEventListener("click",()=>{this.activeTabIndex=re(u-1,0,this.instance.value.length-1),this.instance.deleteItem(u)}),g.addEventListener("click",()=>{const T=u-1;this.activeTabIndex=T,this.instance.move(u,T)}),b.addEventListener("click",()=>{const T=u+1;this.activeTabIndex=T,this.instance.move(u,T)});const x=u===this.activeTabIndex,D=w(h.path),R=this.theme.getTab({title:E,id:D,active:x});R.list.addEventListener("click",()=>{this.activeTabIndex=u}),this.theme.setTabPaneAttributes(h.ui.control.container,x,D),l.appendChild(R.list),c.appendChild(h.ui.control.container),this.disabled||this.instance.isReadOnly()?h.ui.disable():h.ui.enable(),u===0&&g.setAttribute("disabled",""),this.instance.value.length-1===u&&b.setAttribute("disabled","")})}}class Qe extends F{setUI(){const t=V(this.schema),e=q(this.schema);t==="array"&&e==="nav"?this.ui=new We(this):this.ui=new te(this)}prepare(){this.refreshChildren(),this.on("set-value",()=>{this.refreshChildren()})}createItemInstance(t){let e;const s=this.children.length,n=zt(this.schema),r=Mt(this.schema);e=d(n)?n:{},d(r)&&d(r[s])&&(e=r[s]);const o=this.jedi.createInstance({jedi:this.jedi,schema:e,path:this.path+this.jedi.pathSeparator+s,parent:this,value:O(t)});return d(t)&&o.setValue(t,!1),o}move(t,e){const s=O(this.getValue()),n=s[t];s.splice(t,1),s.splice(e,0,n),this.setValue(s)}addItem(){const t=this.createItemInstance(),e=O(this.getValue());e.push(t.getValue()),t.destroy(),this.setValue(e)}deleteItem(t){const s=O(this.getValue()).filter((n,r)=>r!==t);this.setValue(s)}onChildChange(){const t=[];this.children.forEach(e=>{t.push(e.getValue())}),this.setValue(t)}refreshChildren(){this.children=[];const t=this.getValue();L(t)&&t.forEach(e=>{const s=this.createItemInstance(e);this.children.push(s)})}}class Nt extends U{build(){const t=["hidden","color","date","datetime-local","email","number","month","password","search","time","tel","text","textarea","url","week"],e=q(this.instance.schema);this.control=this.theme.getInputControl({type:t.includes(e)?e:"text",id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||e==="hidden",description:j(this.instance.schema)}),e==="color"&&this.instance.value.length===0&&this.instance.setValue("#000000",!1)}addEventListeners(){this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.value)})}sanitize(t){return String(t)}refreshUI(){this.refreshInteractiveElements(),this.control.input.value=this.instance.getValue()}}class Xe extends Nt{build(){this.control=this.theme.getRadiosControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)})}addEventListeners(){this.control.radios.forEach(t=>{t.addEventListener("change",()=>{this.instance.setValue(t.value)})})}refreshUI(){this.refreshInteractiveElements(),this.control.radios.forEach(t=>{t.checked=t.value===this.instance.getValue()})}}class Ye extends Nt{build(){this.control=this.theme.getSelectControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)}),this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.value)})}}class Ze extends U{build(){this.control=this.theme.getTextareaControl({id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||q(this.instance.schema)==="hidden",description:j(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{this.instance.setValue(this.control.input.value)})}sanitize(t){return String(t)}refreshUI(){this.refreshInteractiveElements(),this.control.input.value=this.instance.getValue()}}class ts extends F{setUI(){const t=V(this.schema),e=k(this.schema),s=q(this.schema);t==="string"&&d(e)&&s==="radio"?this.ui=new Xe(this):t==="string"&&s==="textarea"?this.ui=new Ze(this):t==="string"&&d(e)?this.ui=new Ye(this):t==="string"&&(this.ui=new Nt(this))}}class Dt extends U{build(){this.control=this.theme.getInputControl({type:"number",id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||q(this.instance.schema)==="hidden",description:j(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{const t=this.sanitize(this.control.input.value);this.instance.setValue(t)})}sanitize(t){return V(this.instance.schema)==="integer"?Math.floor(Number(t)):Number(t)}refreshUI(){this.refreshInteractiveElements();const t=this.instance.getValue();A(t)&&(this.control.input.value=this.instance.getValue())}}class es extends Dt{build(){this.control=this.theme.getRadiosControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)})}addEventListeners(){this.control.radios.forEach(t=>{t.addEventListener("change",()=>{const e=this.sanitize(t.value);this.instance.setValue(e)})})}refreshUI(){this.refreshInteractiveElements(),this.control.radios.forEach(t=>{t.checked=Number(t.value)===Number(this.instance.getValue())})}}class ss extends Dt{build(){this.control=this.theme.getSelectControl({values:k(this.instance.schema),titles:f(this.instance.schema,"enumTitles")||k(this.instance.schema),id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle"),description:j(this.instance.schema)})}addEventListeners(){this.control.input.addEventListener("change",()=>{const t=this.sanitize(this.control.input.value);this.instance.setValue(t)})}}class is extends F{setUI(){const t=V(this.schema),e=k(this.schema),s=q(this.schema),n=t==="number"||t==="integer";n&&d(e)&&s==="radio"?this.ui=new es(this):n&&d(e)?this.ui=new ss(this):n&&(this.ui=new Dt(this))}}class ns extends U{build(){this.control=this.theme.getNullControl({id:w(this.instance.path),label:I(this.instance.schema)||this.instance.getKey(),srOnly:f(this.instance.schema,"hideTitle")||q(this.instance.schema)==="hidden",description:j(this.instance.schema)})}sanitize(){return null}}class rs extends F{setUI(){this.ui=new ns(this)}}class as extends Yt{constructor(t){super(),this.options=Object.assign({container:null,refParser:null,isEditor:!1,editableProperties:!1,schema:{},showErrors:"change",data:void 0,validateFormat:!1},t),this.rootName="#",this.pathSeparator="/",this.instances={},this.root=null,this.theme=null,this.validator=null,this.schema={},this.refParser=this.options.refParser?this.options.refParser:null,this.init()}init(){this.schema=this.options.schema,this.validator=new Te({refParser:this.refParser,validateFormat:this.options.validateFormat}),this.root=this.createInstance({jedi:this,schema:this.options.schema,path:this.rootName}),d(this.options.data)&&this.root.setValue(this.options.data,!1),this.options.isEditor&&this.options.container&&(this.container=this.options.container,this.appendHiddenInput(),this.container.appendChild(this.root.ui.control.container),this.container.classList.add("jedi-ready")),this.bindEventListeners()}bindEventListeners(){this.root&&this.root.on("change",()=>{this.emit("change")}),this.hiddenInput&&this.on("change",()=>{this.hiddenInput.value=JSON.stringify(this.getValue())})}appendHiddenInput(){const t=this.root.ui.theme.getInputControl({type:"hidden",id:"jedi-hidden-input"});this.hiddenInput=t.input,this.hiddenInput.setAttribute("name","json"),this.hiddenInput.removeAttribute("aria-describedby"),this.container.appendChild(this.hiddenInput),this.hiddenInput.value=JSON.stringify(this.getValue())}register(t){this.instances[t.path]=t}unregister(t){this.instances[t.path]=null,delete this.instances[t.path]}createInstance(t){this.refParser&&(t.schema=this.refParser.expand(t.schema,t.path));const e=V(t.schema),s=J(t.schema),n=$(t.schema),r=Tt(t.schema),a=Rt(t.schema),o=jt(t.schema);if(d(n)||d(s)||e==="any"||L(e)||H(e))return new He(t);if(d(r)&&(d(a)||d(o)))return new Ue(t);if(e==="object")return new _e(t);if(e==="array")return new Qe(t);if(e==="string")return new ts(t);if(e==="number"||e==="integer")return new is(t);if(e==="boolean")return new ze(t);if(e==="null")return new rs(t)}getValue(){return this.root.getValue()}setValue(){this.root.setValue(...arguments)}getInstance(t){return this.instances[t]}disable(){this.root.ui.disable()}enable(){this.root.ui.enable()}getErrors(){let t=[];return Object.keys(this.instances).forEach(e=>{const s=this.instances[e];t=[...t,...s.getErrors()]}),t}destroy(){this.root.destroy(),this.options.isEditor&&(this.container.innerHTML=""),Object.keys(this).forEach(t=>{delete this[t]})}}const S=as;class os{constructor(){this.refs={}}async dereference(t){await this.traverseExternal(t),this.traverseLocal(t)}async traverseExternal(t,e="#"){if(!(typeof t!="object"||t===null))for(const[s,n]of Object.entries(t)){const r=e?`${e}/${s}`:`/${s}`;if(this.hasRef(t)){const a=t.$ref;if(this.refs[a])return;if(this.refs[a]=null,this.hasExternalRef(t)){const o=await this.resolveExternal(t);await this.traverseExternal(o,r)}}this.refs[e]=t,await this.traverseExternal(n,r)}}traverseLocal(t,e="#"){if(!(typeof t!="object"||t===null))for(const[s,n]of Object.entries(t)){const r=e?`${e}/${s}`:`/${s}`;if(this.hasRef(t)){const a=t.$ref;if(this.refs[a])return;if(!this.hasExternalRef(t)){const o=this.resolveLocal(t);this.traverseLocal(o,r)}}this.traverseLocal(n,r)}}async resolveExternal(t){const e=t.$ref,s=await this.load(e);return this.refs[e]=s,s}resolveLocal(t){const e=t.$ref;let s=null;return this.refs[e]&&(s=this.refs[e],this.refs[e]=s),s}hasRef(t){return typeof t.$ref<"u"}hasExternalRef(t){const e=t.$ref;return typeof e!="string"?!1:e.startsWith("http")||e.startsWith("https")}isCircularRef(t){const e=`"$ref":"${t}"`,s=this.refs[t];return JSON.stringify(s).includes(e)}isObject(t){return t!==null&&typeof t=="object"}expand(t){const e=JSON.parse(JSON.stringify(t));if(this.isObject(e)&&"$ref"in e){const s=e.$ref;return delete e.$ref,Object.assign({},this.refs[s],e)}return e}async load(t){try{const e=await fetch(t);if(!e.ok)throw new Error("Network response was not ok");return await e.json()}catch(e){throw console.error("Error loading",t,e),e}}}return{Jedi:S,RefParser:os}}); diff --git a/docs/js/jedi.js b/docs/js/jedi.js index c72c515..1940f9c 100644 --- a/docs/js/jedi.js +++ b/docs/js/jedi.js @@ -4963,7 +4963,9 @@ class Theme { * @private */ getFieldset () { - return document.createElement('fieldset') + const html = document.createElement('fieldset') + html.classList.add('jedi-editor-fieldset') + return html } /** @@ -4973,6 +4975,8 @@ class Theme { getLegend (config) { const legend = document.createElement('legend') const legendText = document.createElement('span') + legend.classList.add('jedi-editor-legend') + legendText.classList.add('jedi-editor-legend-text') legend.setAttribute('aria-labelledby', '#legend-' + config.id) legendText.textContent = config.textContent legendText.setAttribute('id', '#legend-' + config.id) @@ -4985,7 +4989,9 @@ class Theme { * @private */ getCard () { - return document.createElement('div') + const html = document.createElement('div') + html.classList.add('jedi-editor-card') + return html } /** @@ -4993,7 +4999,9 @@ class Theme { * @private */ getCardHeader () { - return document.createElement('div') + const html = document.createElement('div') + html.classList.add('jedi-editor-card-header') + return html } /** @@ -5001,7 +5009,9 @@ class Theme { * @private */ getCardBody () { - return document.createElement('div') + const html = document.createElement('div') + html.classList.add('jedi-editor-card-body') + return html } /** @@ -5030,7 +5040,7 @@ class Theme { */ getChildrenSlot () { const html = document.createElement('div') - html.classList.add('jedi-child-editors-slot') + html.classList.add('jedi-children-slot') return html } @@ -5038,11 +5048,16 @@ class Theme { * Wrapper for error messages * @private */ - getMessagesSlot () { + getMessagesSlot (config = {}) { const html = document.createElement('div') html.classList.add('jedi-messages-slot') html.setAttribute('aria-atomic', 'false') html.setAttribute('aria-live', 'polite') + + if (config.id) { + html.setAttribute('id', config.id) + } + return html } @@ -5078,6 +5093,7 @@ class Theme { */ getPropertiesAriaLive () { const html = document.createElement('div') + html.classList.add('jedi-properties-aria-live') html.setAttribute('role', 'status') html.setAttribute('aria-live', 'polite') return html @@ -5089,6 +5105,7 @@ class Theme { */ getAriaLiveMessage (message) { const html = document.createElement('p') + html.classList.add('jedi-aria-live-message') html.textContent = message this.visuallyHidden(html) return html @@ -5121,7 +5138,7 @@ class Theme { */ getPropertiesActivators () { const html = document.createElement('div') - html.classList.add('jedi-properties-container') + html.classList.add('jedi-properties-activators') return html } @@ -5131,6 +5148,7 @@ class Theme { */ getBtnGroup () { const html = document.createElement('span') + html.classList.add('jedi-btn-group') html.style.display = 'initial' return html } @@ -5141,6 +5159,8 @@ class Theme { */ getButton (config) { const button = document.createElement('button') + button.classList.add('jedi-btn') + button.setAttribute('type', 'button') if (config.value) { @@ -5236,9 +5256,18 @@ class Theme { * Wrapper for the editor description * @private */ - getDescription (config) { + getDescription (config = {}) { const description = document.createElement('small') - description.textContent = config.textContent + description.classList.add('jedi-description') + + if (config.textContent) { + description.textContent = config.textContent + } + + if (config.id) { + description.setAttribute('id', config.id) + } + return description } @@ -5437,27 +5466,6 @@ class Theme { } } - /** - * Control for NullEditor - * @private - */ - getCircularControl () { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - const description = document.createElement('div') - const messages = this.getMessagesSlot() - - description.textContent = 'CIRCULAR' - - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - - return { container, description, messages, actions, arrayActions } - } - /** * Control for NullEditor * @private @@ -5478,12 +5486,10 @@ class Theme { } const descriptionId = config.id + '-description' - const description = document.createElement('div') - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) const messages = this.getMessagesSlot() @@ -5520,17 +5526,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -5570,17 +5575,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -5605,18 +5609,22 @@ class Theme { const actions = this.getActionsSlot() const arrayActions = this.getArrayActionsSlot() const fieldset = this.getFieldset() - const messages = this.getMessagesSlot() const body = this.getCardBody() const legend = this.getLegend({ - id: config.label + textContent: config.label, + id: config.id }) const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) if (config.srOnly) { this.visuallyHidden(legend) @@ -5653,14 +5661,6 @@ class Theme { labels.push(label) }) - if (config.description) { - description.textContent = config.description - } - - if (config.label) { - legend.textContent = config.label - } - container.appendChild(fieldset) container.appendChild(actions) fieldset.appendChild(legend) @@ -5705,17 +5705,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -5766,17 +5765,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -5816,9 +5814,9 @@ class Theme { getInvalidFeedback (config) { const html = document.createElement('div') const invalidFeedbackText = document.createElement('span') - const invalidFeedbackIcon = document.createElement('small') + const invalidFeedbackIcon = document.createElement('span') invalidFeedbackText.textContent = config.message - invalidFeedbackIcon.textContent = '❌ ' + invalidFeedbackIcon.textContent = '⚠ ' invalidFeedbackIcon.classList.add('jedi-error-message') invalidFeedbackIcon.setAttribute('aria-hidden', 'true') html.classList.add('jedi-error-message') @@ -8312,4 +8310,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWb0M7QUFDZ0Q7QUFDZDs7QUFFdEU7QUFDQTtBQUNBO0FBQ0E7QUFDQSw2QkFBNkIsaURBQVc7QUFDeEM7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7O0FBRUE7QUFDQTtBQUNBOztBQUVBLG9CQUFvQixtRUFBZTtBQUNuQyx1QkFBdUIsbUVBQWU7QUFDdEMsb0JBQW9CLG1FQUFlOztBQUVuQztBQUNBLGlCQUFpQix3REFBSztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsd0RBQUs7QUFDcEIsWUFBWSx3REFBSztBQUNqQixLQUFLOztBQUVMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQT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SB0aGlzLmluc3RhbmNlLmdldEVycm9ycygpXG4gICAgICB0aGlzLnNob3dWYWxpZGF0aW9uRXJyb3JzKGVycm9ycylcbiAgICB9XG5cbiAgICB0aGlzLmluc3RhbmNlLm9uKCdzZXQtdmFsdWUnLCAoKSA9PiB7XG4gICAgICB0aGlzLnJlZnJlc2hVSSgpXG4gICAgICBjb25zdCBlcnJvcnMgPSB0aGlzLmluc3RhbmNlLmdldEVycm9ycygpXG4gICAgICB0aGlzLnNob3dWYWxpZGF0aW9uRXJyb3JzKGVycm9ycylcbiAgICB9KVxuXG4gICAgdGhpcy5pbnN0YW5jZS5vbignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgdGhpcy5yZWZyZXNoVUkoKVxuICAgICAgY29uc3QgZXJyb3JzID0gdGhpcy5pbnN0YW5jZS5nZXRFcnJvcnMoKVxuICAgICAgdGhpcy5zaG93VmFsaWRhdGlvbkVycm9ycyhlcnJvcnMpXG4gICAgfSlcbiAgfVxuXG4gIC8qKlxuICAgKiBJbml0aWFsaXplcyB0aGUgZWRpdG9yXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYW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gICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICBzck9ubHk6IGZhbHNlXG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGNvbnN0IGNoZWNrYm94ID0gY2hlY2tib3hDb250cm9sLmlucHV0XG4gICAgICAgICAgdGhpcy5wcm9wZXJ0eUFjdGl2YXRvcnNbcHJvcGVydHldID0gY2hlY2tib3hcblxuICAgICAgICAgIGNoZWNrYm94LmFkZEV2ZW50TGlzdGVuZXIoJ2NoYW5nZScsICgpID0+IHtcbiAgICAgICAgICAgIGFyaWFMaXZlLmlubmVySFRNTCA9ICcnXG4gICAgICAgICAgICBjb25zdCBhcmlhTGl2ZU1lc3NhZ2UgPSB0aGlzLnRoZW1lLmdldEFyaWFMaXZlTWVzc2FnZSgpXG5cbiAgICAgICAgICAgIGlmIChjaGVja2JveC5jaGVja2VkKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGNoaWxkID0gdGhpcy5pbnN0YW5jZS5nZXRDaGlsZChwcm9wZXJ0eSlcblxuICAgICAgICAgICAgICBpZiAoIWNoaWxkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnN0YW5jZS5jcmVhdGVDaGlsZChzY2hlbWEsIHByb3BlcnR5KVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdGhpcy5pbnN0YW5jZS5nZXRDaGlsZChwcm9wZXJ0eSkuYWN0aXZhdGUoKVxuICAgICAgICAgICAgICBhcmlhTGl2ZU1lc3NhZ2UudGV4dENvbnRlbnQgPSBsYWJlbCArICcgZmllbGQgd2FzIGFkZGVkIHRvIHRoZSBmb3JtJ1xuICAgICAgICAgICAgICBhcmlhTGl2ZS5hcHBlbmRDaGlsZChhcmlhTGl2ZU1lc3NhZ2UpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KS5kZWFjdGl2YXRlKClcbiAgICAgICAgICAgICAgYXJpYUxpdmVNZXNzYWdlLnRleHRDb250ZW50ID0gbGFiZWwgKyAnIGZpZWxkIHdhcyByZW1vdmVkIGZyb20gdGhlIGZvcm0nXG4gICAgICAgICAgICAgIGFyaWFMaXZlLmFwcGVuZENoaWxkKGFyaWFMaXZlTWVzc2FnZSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2hpbGQoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCB8fCB0aGlzLmluc3RhbmNlLmlzUmVhZE9ubHkoKSkge1xuICAgICAgICAgIGNoaWxkLnVpLmRpc2FibGUoKVxuICAgICAgICB9IGVsc2Uge1xuICA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Wluc0Vycm9ycyA9IGNvbnRhaW5zRWRpdG9yLmdldEVycm9ycygpXG5cbiAgICAgIGlmIChjb250YWluc0Vycm9ycy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgY291bnRlcisrXG4gICAgICB9XG5cbiAgICAgIGNvbnRhaW5zRWRpdG9yLmRlc3Ryb3koKVxuICAgIH0pXG5cbiAgICBjb25zdCBjb250YWluc0ludmFsaWQgPSAoY291bnRlciA9PT0gMClcblxuICAgIGlmIChpc1NldChtaW5Db250YWlucykpIHtcbiAgICAgIGNvbnN0IG1pbkNvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyIDwgbWluQ29udGFpbnMpXG5cbiAgICAgIGlmIChtaW5Db250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvck1pbkNvbnRhaW5zLCB7XG4gICAgICAgICAgICAgIGNvdW50ZXI6IGNvdW50ZXIsXG4gICAgICAgICAgICAgIG1pbkNvbnRhaW5zOiBtaW5Db250YWluc1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICBdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnbWluQ29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChjb250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbaTE4bi5lcnJvckNvbnRhaW5zXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ2NvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChpc1NldChtYXhDb250YWlucykpIHtcbiAgICAgIGNvbnN0IG1heENvbnRhaW5zSW52YWxpZC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5rZXlzKHZhbHVlKS5sZW5ndGhcbiAgICBjb25zdCBpbnZhbGlkID0gKHByb3BlcnRpZXNDb3VudCA8IG1pblByb3BlcnRpZXMpXG5cbiAgICBpZiAoaW52YWxpZCkge1xuICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWluUHJvcGVydGllcywge1xuICAgICAgICAgICAgbWluUHJvcGVydGllczogbWluUHJvcGVydGllc1xuICAgICAgICAgIH0pXG4gICAgICAgIF0sXG4gICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgIGNvbnN0cmFpbjogJ21pblByb3BlcnRpZXMnXG4gICAgICB9KVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBlcnJvcnNcbn1cbiIsImltcG9ydCB7IGNvbXBpbGVUZW1wbGF0ZSwgaXNOdW1iZXIsIGlzU2V0IH0gZnJvbSAnLi4vLi4vaGVscGVycy91dGlscy5qcydcbmltcG9ydCB7IGdldFNjaGVtYU1pbmltdW0gfSBmcm9tICcuLi8uLi9oZWxwZXJzL3NjaGVtYS5qcydcbmltcG9ydCB7IGkxOG4gfSBmcm9tICcuLi8uLi9pMThuLmpzJ1xuXG5leHBvcnQgZnVuY3Rpb24gbWluaW11bSAodmFsaWRhdG9yLCB2YWx1ZSwgc2NoZW1hLCBrZXksIHBhdGgpIHtcbiAgY29uc3QgZXJyb3JzID0gW11cbiAgY29uc3QgbWluaW11bSA9IGdldFNjaGVtYU1pbmltdW0oc2NoZW1hKVxuXG4gIGlmIChpc051bWJlcih2YWx1ZSkgJiYgaXNTZXQobWluaW11bSkpIHtcbiAgICBjb25zdCBpbnZhbGlkID0gKHZhbHVlIDwgbWluaW11bSlcblxuICAgIGlmIChpbnZhbGlkKSB7XG4gICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgY29tcGlsZVRlbXBsYXRlKG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0eSAmJiB1bmV2YWx1YXRlZFByb3BlcnRpZXMgPT09IGZhbHNlICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JVbmV2YWx1YXRlZFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAndW5ldmFsdWF0ZWRQcm9wZXJ0aWVzJ1xuICAgICAgICAgIH0pXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWRlZmluZWRJblBhdHRlcm5Qcm9wZXJ0eSAmJiBpc09iamVjdCh1bmV2YWx1YXRlZFByb3BlcnRpZXMpICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgY29uc3QgZWRpdG9yID0gbmV3IEplZGkoe1xuICAgICAgICAgICAgcmVmUGFyc2VyOiB2YWxpZGF0b3IucmVmUGFyc2VyLFxuICAgICAgICAgICAgc2NoZW1hOiB1bmV2YWx1YXRlZFByb3BlcnRpZXMsXG4gICAgICAgICAgICBkYXRhOiB2YWx1ZVtwcm9wZXJ0eV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgdW5ldmFsdWF0ZWRQcm9wZXJ0aWVzRXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG1lc3NhZ2VzOiBlcnJvci5tZXNzYWdlcyxcbiAgICAgICAgICAgICAgcGF0aDogcHJvcGVydHksXG4gICAgICAgICAgICAgIGNvbnN0cmFpbjogJ3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ZSAnYm9vdHN0cmFwLWljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGJvb3RzdHJhcEljb25zXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWUzJzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lM1xuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNCc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTRcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTUnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU1XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU2JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNlxuICAgICAgICAgIGJyZWFrXG4gICAgICB9XG4gICAgfVxuXG4gICAgc3dpdGNoICh0aGlzLmluc3RhbmNlLmplZGkub3B0aW9ucy50aGVtZSkge1xuICAgICAgY2FzZSAnYm9vdHN0cmFwMyc6XG4gICAgICAgIHRoaXMudGhlbWUgPSBuZXcgVGhlbWVCb290c3RyYXAzKGljb25zKVxuICAgICAgICBicmVha1xuICAgICAgY2FzZSAnYm9vdHN0cmFwNCc6XG4gICAgICAgIHRoaXMudGhlbWUgPSBuZXcgVGhlbWVCb290c3RyYXA0KGljb25zKVxuICAgICAgICBicmVha1xuICAgICAgY2FzZSAnYm9vdHN0cmFwNSc6XG4gICAgICAgIHRoaXMudGhlbWUgPSBuZXcgVGhlbWVCb290c3RyYXA1KGljb25zKVxuICAgICAgICBicmVha1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZShpY29ucylcbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogU2V0cyBjb250YWluZXIgYXR0cmlidXRlcyBsaWtlIGRhdGEtcGF0aCBhbmQgZGF0YS10eXBlXG4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pZykge1xuICAgIGNvbnN0IGNvbnRyb2wgPSBzdXBlci5nZXRUZXh0YXJlYUNvbnRyb2woY29uZmlnKVxuICAgIGNvbnN0IHsgY29udGFpbmVyLCBpbnB1dCwgbGFiZWwgfSA9IGNvbnRyb2xcbiAgICBjb250YWluZXIuY2xhc3NMaXN0LmFkZCgnZm9ybS1ncm91cCcpXG4gICAgaW5wdXQuY2xhc3NMaXN0LmFkZCgnZm9ybS1jb250cm9sJylcblxuICAgIGlmIChjb25maWcuc3JPbmx5KSB7XG4gICAgICB0aGlzLnZpc3VhbGx5SGlkZGVuKGxhYmVsKVxuICAgIH1cblxuICAgIHJldHVybiBjb250cm9sXG4gIH1cblxuICBnZXRJbnB1dENvbnRyb2wgKGNvbmZpZykge1xuICAgIGNvbnN0IGNvbnRyb2wgPSBzdXBlci5nZXRJbnB1dENvbnRyb2woY29uZmlnKVxuICAgIGNvbnN0IHsgY29udGFpbmVyLCBpbnB1dCwgbGFiZWwgfSA9IGNvbnRyb2xcbiAgICBjb250YWluZXIuY2xhc3NMaXN0LmFkZCgnZm9ybS1ncm91cCcpXG4gICAgaW5wdXQuY2xhc3NMaXN0LmFkZCgnZm9ybS1jb250cm9sJylcblxuICAgIGlmIChjb25maWcuc3JPbmx5KSB7XG4gICAgICB0aGlzLnZpc3VhbGx5SGlkZGVuKGxhYmVsKVxuICAgIH1cblxuICAgIHJldHVybiBjb250cm9sXG4gIH1cblxuICBnZXRSYWRpb3NDb250cm9sIChjb25maWcpIHtcbiAgICBjb25zdCBjb250cm9sID0gc3VwZXIuZ2V0UmFkaW9zQ29udHJvbChjb25maWcpXG4gICAgY29uc3QgeyBib2R5LCByYWRpb3MsIGxhYmVscywgbGFiZWxUZXh0cywgcmFkaW9Db250cm9scywgZGVzY3JpcHRpb24sIG1lc3NhZ2VzIH0gPSBjb250cm9sXG5cbiAgICByYWRpb0NvbnRyb2xzLmZvckVhY2goKHJhZGlvQ29udHJvbCwgaW5kZXgpID0+IHtcbiAgICAgIH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oKHtcbiAgICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yQWRkaXRpb25hbFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAnYWRkaXRpb25hbFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KGFkZGl0aW9uYWxQcm9wZXJ0aWVzKSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogYWRkaXRpb25hbFByb3BlcnRpZXMsXG4gICAgICAgICAgICBkYXRhOiB2YWx1ZVtwcm9wZXJ0eV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgYWRkaXRpb25hbFByb3BlcnR5RXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG1lc3NhZ2VzOiBlcnJvci5tZXNzYWdlcyxcbiAgICAgICAgICAgICAgcGF0aDogcHJvcGVydHksXG4gICAgICAgICAgICAgIGNvbnN0cmFpbjogJ2FkZGl0aW9uYWxQcm9wZXJ0aWVzJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBlcnJvcnMgPSBbLi4uZXJyb3JzLCAuLi5hZGRpdGlvbmFsUHJv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G4gICAgaWYgKGlzU2V0KG1pbkNvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWluQ29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPCBtaW5Db250YWlucylcblxuICAgICAgaWYgKG1pbkNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWluQ29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWluQ29udGFpbnM6IG1pbkNvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtaW5Db250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtpMThuLmVycm9yQ29udGFpbnNdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnY29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGlzU2V0KG1heENvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWF4Q29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPiBtYXhDb250YWlucylcblxuICAgICAgaWYgKG1heENvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWF4Q29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWF4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JzY2hlbWEpID0+IHtcbiAgICAgICAgICBpZiAoaXNTZXQoc3Vic2NoZW1hWydwcm9wZXJ0aWVzJ10pKSB7XG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0geyAuLi5wcm9wZXJ0aWVzLCAuLi5zdWJzY2hlbWFbJ3Byb3BlcnRpZXMnXSB9XG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0pXG5cbiAgICBpZiAocHJvcGVydGllcykge1xuICAgICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIHVuZXZhbHVhdGVkUHJvcGVydGllcyA9PT0gZmFsc2UgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg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ZGkgZnJvbSAnLi9qZWRpLmpzJ1xuaW1wb3J0IFJlZlBhcnNlciBmcm9tICcuL3JlZi1wYXJzZXIvcmVmLXBhcnNlci5qcydcblxuZXhwb3J0IGRlZmF1bHQge1xuICBKZWRpLFxuICBSZWZQYXJzZXJcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/src/themes/theme.js b/src/themes/theme.js index ff21ebd..e751da9 100644 --- a/src/themes/theme.js +++ b/src/themes/theme.js @@ -48,7 +48,9 @@ class Theme { * @private */ getFieldset () { - return document.createElement('fieldset') + const html = document.createElement('fieldset') + html.classList.add('jedi-editor-fieldset') + return html } /** @@ -58,6 +60,8 @@ class Theme { getLegend (config) { const legend = document.createElement('legend') const legendText = document.createElement('span') + legend.classList.add('jedi-editor-legend') + legendText.classList.add('jedi-editor-legend-text') legend.setAttribute('aria-labelledby', '#legend-' + config.id) legendText.textContent = config.textContent legendText.setAttribute('id', '#legend-' + config.id) @@ -70,7 +74,9 @@ class Theme { * @private */ getCard () { - return document.createElement('div') + const html = document.createElement('div') + html.classList.add('jedi-editor-card') + return html } /** @@ -78,7 +84,9 @@ class Theme { * @private */ getCardHeader () { - return document.createElement('div') + const html = document.createElement('div') + html.classList.add('jedi-editor-card-header') + return html } /** @@ -86,7 +94,9 @@ class Theme { * @private */ getCardBody () { - return document.createElement('div') + const html = document.createElement('div') + html.classList.add('jedi-editor-card-body') + return html } /** @@ -115,7 +125,7 @@ class Theme { */ getChildrenSlot () { const html = document.createElement('div') - html.classList.add('jedi-child-editors-slot') + html.classList.add('jedi-children-slot') return html } @@ -123,11 +133,16 @@ class Theme { * Wrapper for error messages * @private */ - getMessagesSlot () { + getMessagesSlot (config = {}) { const html = document.createElement('div') html.classList.add('jedi-messages-slot') html.setAttribute('aria-atomic', 'false') html.setAttribute('aria-live', 'polite') + + if (config.id) { + html.setAttribute('id', config.id) + } + return html } @@ -163,6 +178,7 @@ class Theme { */ getPropertiesAriaLive () { const html = document.createElement('div') + html.classList.add('jedi-properties-aria-live') html.setAttribute('role', 'status') html.setAttribute('aria-live', 'polite') return html @@ -174,6 +190,7 @@ class Theme { */ getAriaLiveMessage (message) { const html = document.createElement('p') + html.classList.add('jedi-aria-live-message') html.textContent = message this.visuallyHidden(html) return html @@ -206,7 +223,7 @@ class Theme { */ getPropertiesActivators () { const html = document.createElement('div') - html.classList.add('jedi-properties-container') + html.classList.add('jedi-properties-activators') return html } @@ -216,6 +233,7 @@ class Theme { */ getBtnGroup () { const html = document.createElement('span') + html.classList.add('jedi-btn-group') html.style.display = 'initial' return html } @@ -226,6 +244,8 @@ class Theme { */ getButton (config) { const button = document.createElement('button') + button.classList.add('jedi-btn') + button.setAttribute('type', 'button') if (config.value) { @@ -321,9 +341,18 @@ class Theme { * Wrapper for the editor description * @private */ - getDescription (config) { + getDescription (config = {}) { const description = document.createElement('small') - description.textContent = config.textContent + description.classList.add('jedi-description') + + if (config.textContent) { + description.textContent = config.textContent + } + + if (config.id) { + description.setAttribute('id', config.id) + } + return description } @@ -522,27 +551,6 @@ class Theme { } } - /** - * Control for NullEditor - * @private - */ - getCircularControl () { - const container = document.createElement('div') - const actions = this.getActionsSlot() - const arrayActions = this.getArrayActionsSlot() - const description = document.createElement('div') - const messages = this.getMessagesSlot() - - description.textContent = 'CIRCULAR' - - container.appendChild(description) - container.appendChild(messages) - container.appendChild(actions) - actions.appendChild(arrayActions) - - return { container, description, messages, actions, arrayActions } - } - /** * Control for NullEditor * @private @@ -563,12 +571,10 @@ class Theme { } const descriptionId = config.id + '-description' - const description = document.createElement('div') - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) const messages = this.getMessagesSlot() @@ -605,17 +611,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -655,17 +660,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -690,18 +694,22 @@ class Theme { const actions = this.getActionsSlot() const arrayActions = this.getArrayActionsSlot() const fieldset = this.getFieldset() - const messages = this.getMessagesSlot() const body = this.getCardBody() const legend = this.getLegend({ - id: config.label + textContent: config.label, + id: config.id }) const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) if (config.srOnly) { this.visuallyHidden(legend) @@ -738,14 +746,6 @@ class Theme { labels.push(label) }) - if (config.description) { - description.textContent = config.description - } - - if (config.label) { - legend.textContent = config.label - } - container.appendChild(fieldset) container.appendChild(actions) fieldset.appendChild(legend) @@ -790,17 +790,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -851,17 +850,16 @@ class Theme { this.visuallyHidden(label) } - const description = document.createElement('div') const descriptionId = config.id + '-description' - description.setAttribute('id', descriptionId) - - if (config.description) { - description.textContent = config.description - } + const description = this.getDescription({ + textContent: config.description, + id: descriptionId + }) - const messages = this.getMessagesSlot() const messagesId = config.id + '-messages' - messages.setAttribute('id', messagesId) + const messages = this.getMessagesSlot({ + id: messagesId + }) const describedBy = messagesId + ' ' + descriptionId input.setAttribute('aria-describedby', describedBy) @@ -901,9 +899,9 @@ class Theme { getInvalidFeedback (config) { const html = document.createElement('div') const invalidFeedbackText = document.createElement('span') - const invalidFeedbackIcon = document.createElement('small') + const invalidFeedbackIcon = document.createElement('span') invalidFeedbackText.textContent = config.message - invalidFeedbackIcon.textContent = '❌ ' + invalidFeedbackIcon.textContent = '⚠ ' invalidFeedbackIcon.classList.add('jedi-error-message') invalidFeedbackIcon.setAttribute('aria-hidden', 'true') html.classList.add('jedi-error-message') diff --git a/todo.md b/todo.md index 49f4a1d..2f60c57 100644 --- a/todo.md +++ b/todo.md @@ -1,5 +1,7 @@ ## Todo +- better elements class names +- refactor label sr-only - move actions on top of cards - multiple in fieldsets - ionic theme