}; } return lc(lc({}, t), i); } mergeAllOf(e, t, n) { var r; if (e['x-circular-ref']) return e; if (void 0 === (e = this.hoistOneOfs(e, n)).allOf) return e; let o = cc(lc({}, e), { 'x-parentRefs': [], allOf: void 0, title: e.title || ls(t) }); void 0 !== o.properties && 'object' == typeof o.properties && (o.properties = lc({}, o.properties)), void 0 !== o.items && 'object' == typeof o.items && (o.items = lc({}, o.items)); const i = (function (e, t) { const n = new Set(); return e.filter(e => { const t = e.$ref; return !t || (t && !n.has(t) && n.add(t)); }); })( e.allOf .map(e => { var t; const { resolved: r, refsStack: i } = this.deref(e, n, !0), a = e.$ref || void 0, s = this.mergeAllOf(r, a, i); if (!s['x-circular-ref'] || !s.allOf) return ( a && (null == (t = o['x-parentRefs']) || t.push(...(s['x-parentRefs'] || []), a)), { $ref: a, refsStack: pc(i, a), schema: s } ); }) .filter(e => void 0 !== e) ); for (const { schema: e, refsStack: n } of i) { const i = e, { type: a, enum: s, properties: l, items: c, required: u, title: p, description: d, readOnly: f, writeOnly: h, oneOf: m, anyOf: g, 'x-circular-ref': y } = i, v = uc(i, [ 'type', 'enum', 'properties', 'items', 'required', 'title', 'description', 'readOnly', 'writeOnly', 'oneOf', 'anyOf', 'x-circular-ref' ]); if ( (o.type !== a && void 0 !== o.type && void 0 !== a && console.warn( \`Incompatible types in allOf at "\${t}": "\${o.type}" and "\${a}"\` ), void 0 !== a && (Array.isArray(a) && Array.isArray(o.type) ? (o.type = [...a, ...o.type]) : (o.type = a)), void 0 !== s && (Array.isArray(s) && Array.isArray(o.enum) ? (o.enum = Array.from(new Set([...s, ...o.enum]))) : (o.enum = s)), void 0 !== l && 'object' == typeof l) ) { o.properties = o.properties || {}; for (const e in l) { const i = dc( n, null == (r = l[e]) ? void 0 : r['x-refsStack'] ); if (o.properties[e]) { if (!y) { const n = this.mergeAllOf( { allOf: [ o.properties[e], cc(lc({}, l[e]), { 'x-refsStack': i }) ], 'x-refsStack': i }, t + '/properties/' + e, i ); o.properties[e] = n; } } else o.properties[e] = cc(lc({}, l[e]), { 'x-refsStack': i }); } } if (void 0 !== c && !y) { const r = 'boolean' == typeof o.items ? {} : Object.assign({}, o.items), i = 'boolean' == typeof e.items ? {} : Object.assign({}, e.items); o.items = this.mergeAllOf({ allOf: [r, i] }, t + '/items', n); } void 0 !== m && (o.oneOf = m), void 0 !== g && (o.anyOf = g), void 0 !== u && (o.required = [...(o.required || []), ...u]), (o = lc( cc(lc({}, o), { title: o.title || p, description: o.description || d, readOnly: void 0 !== o.readOnly ? o.readOnly : f, writeOnly: void 0 !== o.writeOnly ? o.writeOnly : h, 'x-circular-ref': o['x-circular-ref'] || y }), v )); } return o; } findDerived(e) { const t = {}, n = (this.spec.components && this.spec.components.schemas) || {}; for (const r in n) { const { resolved: o } = this.deref(n[r]); void 0 !== o.allOf && o.allOf.find( t => void 0 !== t.$ref && e.indexOf(t.$ref) > -1 ) && (t['#/components/schemas/' + r] = [ o['x-discriminator-value'] || r ]); } return t; } hoistOneOfs(e, t) { if (void 0 === e.allOf) return e; const n = e.allOf; for (let e = 0; e < n.length; e++) { const r = n[e]; if (Array.isArray(r.oneOf)) { const o = n.slice(0, e), i = n.slice(e + 1); return { oneOf: r.oneOf.map(e => ({ allOf: [...o, e, ...i], 'x-refsStack': t })) }; } } return e; } } var hc = Object.defineProperty, mc = Object.defineProperties, gc = Object.getOwnPropertyDescriptor, yc = Object.getOwnPropertyDescriptors, vc = Object.getOwnPropertySymbols, bc = Object.prototype.hasOwnProperty, wc = Object.prototype.propertyIsEnumerable, xc = (e, t, n) => t in e ? hc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : (e[t] = n), kc = (e, t) => { for (var n in t || (t = {})) bc.call(t, n) && xc(e, n, t[n]); if (vc) for (var n of vc(t)) wc.call(t, n) && xc(e, n, t[n]); return e; }, _c = (e, t) => mc(e, yc(t)), Oc = (e, t, n, r) => { for ( var o, i = r > 1 ? void 0 : r ? gc(t, n) : t, a = e.length - 1; a >= 0; a-- ) (o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i); return r && i && hc(t, n, i), i; }; const Sc = class { constructor(e, t, n, r, o = !1, i = []) { (this.options = r), (this.refsStack = i), (this.typePrefix = ''), (this.isCircular = !1), (this.activeOneOf = 0), tn(this), (this.pointer = t.$ref || n || ''); const { resolved: a, refsStack: s } = e.deref(t, i, !0); (this.refsStack = pc(s, this.pointer)), (this.rawSchema = a), (this.schema = e.mergeAllOf( this.rawSchema, this.pointer, this.refsStack )), this.init(e, o), r.showExtensions && (this.extensions = gs(this.schema, r.showExtensions)); } activateOneOf(e) { this.activeOneOf = e; } hasType(e) { return this.type === e || (io(this.type) && this.type.includes(e)); } init(e, t) { var n, r, o, i, a, s, l, c; const u = this.schema; if ( ((this.isCircular = !!u['x-circular-ref']), (this.title = u.title || (ss(this.pointer) && Da.baseName(this.pointer)) || ''), (this.description = u.description || ''), (this.type = u.type || (function (e) { if (void 0 !== e.type && !io(e.type)) return e.type; const t = Object.keys(Ja); for (const n of t) { const t = Ja[n]; if (void 0 !== e[n]) return t; } return 'any'; })(u)), (this.format = u.format), (this.enum = u.enum || []), (this.example = u.example), (this.examples = u.examples), (this.deprecated = !!u.deprecated), (this.pattern = u.pattern), (this.externalDocs = u.externalDocs), (this.constraints = us(u)), (this.displayFormat = this.format), (this.isPrimitive = Za(u, this.type)), (this.default = u.default), (this.readOnly = !!u.readOnly), (this.writeOnly = !!u.writeOnly), (this.const = u.const || ''), (this.contentEncoding = u.contentEncoding), (this.contentMediaType = u.contentMediaType), (this.minItems = u.minItems), (this.maxItems = u.maxItems), (u.nullable || u['x-nullable']) && (io(this.type) && !this.type.some(e => null === e || 'null' === e) ? (this.type = [...this.type, 'null']) : io(this.type) || (null === this.type && 'null' === this.type) || (this.type = [this.type, 'null'])), (this.displayType = io(this.type) ? this.type.map(e => (null === e ? 'null' : e)).join(' or ') : this.type), !this.isCircular) ) if ((u.if && u.then) || (u.if && u.else)) this.initConditionalOperators(u, e); else if (t || void 0 === Ac(u)) { if ( (t && io(u.oneOf) && u.oneOf.find(e => e.$ref === this.pointer) && delete u.oneOf, void 0 !== u.oneOf) ) return ( this.initOneOf(u.oneOf, e), (this.oneOfType = 'One of'), void ( void 0 !== u.anyOf && console.warn( \`oneOf and anyOf are not supported on the same level. Skipping anyOf at \${this.pointer}\` ) ) ); if (void 0 !== u.anyOf) return ( this.initOneOf(u.anyOf, e), void (this.oneOfType = 'Any of') ); if (this.hasType('object')) this.fields = Pc( e, u, this.pointer, this.options, this.refsStack ); else if ( this.hasType('array') && (io(u.items) || io(u.prefixItems) ? (this.fields = Pc( e, u, this.pointer, this.options, this.refsStack )) : u.items && (this.items = new Sc( e, u.items, this.pointer + '/items', this.options, !1, this.refsStack )), (this.displayType = u.prefixItems || io(u.items) ? 'items' : ( (null == (n = this.items) ? void 0 : n.displayType) || this.displayType ) .split(' or ') .map(e => e.replace( /^(string|object|number|integer|array|boolean)s?( ?.*)/, '$1s$2' ) ) .join(' or ')), (this.displayFormat = (null == (r = this.items) ? void 0 : r.format) || ''), (this.typePrefix = (null == (o = this.items) ? void 0 : o.typePrefix) || '' + lo('arrayOf')), (this.title = this.title || (null == (i = this.items) ? void 0 : i.title) || ''), (this.isPrimitive = void 0 !== (null == (a = this.items) ? void 0 : a.isPrimitive) ? null == (s = this.items) ? void 0 : s.isPrimitive : this.isPrimitive), void 0 === this.example && void 0 !== (null == (l = this.items) ? void 0 : l.example) && (this.example = [this.items.example]), (null == (c = this.items) ? void 0 : c.isPrimitive) && (this.enum = this.items.enum), io(this.type)) ) { const e = this.type.filter(e => 'array' !== e); e.length && (this.displayType += \` or \${e.join(' or ')}\`); } this.enum.length && this.options.sortEnumValuesAlphabetically && this.enum.sort(); } else this.initDiscriminator(u, e); } initOneOf(e, t) { if ( ((this.oneOf = e.map((e, n) => { const { resolved: r, refsStack: o } = t.deref( e, this.refsStack, !0 ), i = t.mergeAllOf(r, this.pointer + '/oneOf/' + n, o), a = ss(e.$ref) && !i.title ? Da.baseName(e.$ref) : \`\${i.title || ''}\${ (i.const && JSON.stringify(i.const)) || '' }\`; return new Sc( t, _c(kc({}, i), { title: a, allOf: [ _c(kc({}, this.schema), { oneOf: void 0, anyOf: void 0 }) ], discriminator: r.allOf ? void 0 : i.discriminator }), e.$ref || this.pointer + '/oneOf/' + n, this.options, !1, o ); })), this.options.simpleOneOfTypeLabel) ) { const e = (function (e) { const t = new Set(); return ( (function e(n) { for (const r of n.oneOf || []) r.oneOf ? e(r) : r.type && t.add(r.type); })(e), Array.from(t.values()) ); })(this); this.displayType = e.join(' or '); } else this.displayType = this.oneOf .map(e => { let t = e.typePrefix + (e.title ? \`\${e.title} (\${e.displayType})\` : e.displayType); return t.indexOf(' or ') > -1 && (t = \`(\${t})\`), t; }) .join(' or '); } initDiscriminator(e, t) { const n = Ac(e); this.discriminatorProp = n.propertyName; const r = t.findDerived([ ...(this.schema['x-parentRefs'] || []), this.pointer ]); if (e.oneOf) for (const t of e.oneOf) { if (void 0 === t.$ref) continue; const e = Da.baseName(t.$ref); r[t.$ref] = e; } const o = n.mapping || {}; let i = n['x-explicitMappingOnly'] || !1; 0 === Object.keys(o).length && (i = !1); const a = {}; for (const e in o) { const t = o[e]; io(a[t]) ? a[t].push(e) : (a[t] = [e]); } const s = kc(i ? {} : kc({}, r), a); let l = []; for (const e of Object.keys(s)) { const t = s[e]; if (io(t)) for (const n of t) l.push({ $ref: e, name: n }); else l.push({ $ref: e, name: t }); } const c = Object.keys(o); 0 !== c.length && (l = l.sort((e, t) => { const n = c.indexOf(e.name), r = c.indexOf(t.name); return n < 0 && r < 0 ? e.name.localeCompare(t.name) : n < 0 ? 1 : r < 0 ? -1 : n - r; })), (this.oneOf = l.map(({ $ref: e, name: n }) => { const r = new Sc( t, { $ref: e }, e, this.options, !0, this.refsStack.slice(0, -1) ); return (r.title = n), r; })); } initConditionalOperators(e, t) { const n = e, { if: r, else: o = {}, then: i = {} } = n, a = ((e, t) => { var n = {}; for (var r in e) bc.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]); if (null != e && vc) for (var r of vc(e)) t.indexOf(r) < 0 && wc.call(e, r) && (n[r] = e[r]); return n; })(n, ['if', 'else', 'then']), s = [ { allOf: [a, i, r], title: (r && r['x-displayName']) || (null == r ? void 0 : r.title) || 'case 1' }, { allOf: [a, o], title: (o && o['x-displayName']) || (null == o ? void 0 : o.title) || 'case 2' } ]; (this.oneOf = s.map( (e, n) => new Sc( t, kc({}, e), this.pointer + '/oneOf/' + n, this.options, !1, this.refsStack ) )), (this.oneOfType = 'One of'); } }; let Ec = Sc; function Pc(e, t, n, r, o) { const i = t.properties || t.prefixItems || t.items || {}, a = t.patternProperties || {}, s = t.additionalProperties || t.unevaluatedProperties, l = t.prefixItems ? t.items : t.additionalItems, c = t.default; let u = Object.keys(i || []).map(a => { let s = i[a]; s || (console.warn( \`Field "\${a}" is invalid, skipping.\\n Field must be an object but got \${typeof s} at "\${n}"\` ), (s = {})); const l = void 0 !== t.required && t.required.indexOf(a) > -1; return new Nc( e, { name: t.properties ? a : \`[\${a}]\`, required: l, schema: _c(kc({}, s), { default: void 0 === s.default && c ? c[a] : s.default }) }, n + '/properties/' + a, r, o ); }); return ( r.sortPropsAlphabetically && (u = ds(u, 'name')), r.requiredPropsFirst && (u = ps(u, r.sortPropsAlphabetically ? void 0 : t.required)), u.push( ...Object.keys(a).map(t => { let i = a[t]; return ( i || (console.warn( \`Field "\${t}" is invalid, skipping.\\n Field must be an object but got \${typeof i} at "\${n}"\` ), (i = {})), new Nc( e, { name: t, required: !1, schema: i, kind: 'patternProperties' }, \`\${n}/patternProperties/\${t}\`, r, o ) ); }) ), ('object' != typeof s && !0 !== s) || u.push( new Nc( e, { name: ( ('object' == typeof s && s['x-additionalPropertiesName']) || 'property name' ).concat('*'), required: !1, schema: !0 === s ? {} : s, kind: 'additionalProperties' }, n + '/additionalProperties', r, o ) ), u.push( ...(function ({ parser: e, schema: t = !1, fieldsCount: n, $ref: r, options: o, refsStack: i }) { return ao(t) ? t ? [ new Nc( e, { name: \`[\${n}...]\`, schema: {} }, \`\${r}/additionalItems\`, o, i ) ] : [] : io(t) ? [ ...t.map( (t, a) => new Nc( e, { name: \`[\${n + a}]\`, schema: t }, \`\${r}/additionalItems\`, o, i ) ) ] : eo(t) ? [ new Nc( e, { name: \`[\${n}...]\`, schema: t }, \`\${r}/additionalItems\`, o, i ) ] : []; })({ parser: e, schema: l, fieldsCount: u.length, $ref: n, options: r, refsStack: o }) ), u ); } function Ac(e) { return e.discriminator || e['x-discriminator']; } Oc([Ae], Ec.prototype, 'activeOneOf', 2), Oc([Pt], Ec.prototype, 'activateOneOf', 1); const $c = {}; class Cc { constructor(e, t, n, r) { this.mime = n; const { resolved: o } = e.deref(t); (this.value = o.value), (this.summary = o.summary), (this.description = o.description), o.externalValue && (this.externalValueUrl = new URL( o.externalValue, e.specUrl ).href), 'application/x-www-form-urlencoded' === n && this.value && 'object' == typeof this.value && (this.value = (function (e, t = {}) { if (io(e)) throw new Error( 'Payload must have fields: ' + e.toString() ); return Object.keys(e) .map(n => { const r = e[n], { style: o = 'form', explode: i = !0 } = t[n] || {}; switch (o) { case 'form': return rs(n, i, r); case 'spaceDelimited': return ts(r, n, '%20'); case 'pipeDelimited': return ts(r, n, '|'); case 'deepObject': return ns(r, n); default: return ( console.warn( 'Incorrect or unsupported encoding style: ' + o ), '' ); } }) .join('&'); })(this.value, r)); } getExternalValue(e) { return this.externalValueUrl ? (this.externalValueUrl in $c || ($c[this.externalValueUrl] = fetch( this.externalValueUrl ).then(t => t.text().then(n => { if (!t.ok) return Promise.reject(new Error(n)); if (!es(e)) return n; try { return JSON.parse(n); } catch (e) { return n; } }) )), $c[this.externalValueUrl]) : Promise.resolve(void 0); } } var Rc = Object.defineProperty, jc = Object.getOwnPropertyDescriptor, Tc = (e, t, n, r) => { for ( var o, i = r > 1 ? void 0 : r ? jc(t, n) : t, a = e.length - 1; a >= 0; a-- ) (o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i); return r && i && Rc(t, n, i), i; }; const Ic = { path: { style: 'simple', explode: !1 }, query: { style: 'form', explode: !0 }, header: { style: 'simple', explode: !1 }, cookie: { style: 'form', explode: !0 } }; class Nc { constructor(e, t, n, r, o) { var i, a, s, l, c; (this.expanded = void 0), tn(this); const { resolved: u } = e.deref(t); (this.kind = t.kind || 'field'), (this.name = t.name || u.name), (this.in = u.in), (this.required = !!u.required); let p = u.schema, d = ''; if ( (!p && u.in && u.content && ((d = Object.keys(u.content)[0]), (p = u.content[d] && u.content[d].schema)), (this.schema = new Ec(e, p || {}, n, r, !1, o)), (this.description = void 0 === u.description ? this.schema.description || '' : u.description), (this.example = u.example || this.schema.example), void 0 !== u.examples || void 0 !== this.schema.examples) ) { const t = u.examples || this.schema.examples; this.examples = io(t) ? t : Qr(t, (t, n) => new Cc(e, t, n, u.encoding)); } d ? (this.serializationMime = d) : u.style ? (this.style = u.style) : this.in && (this.style = null != (a = null == (i = Ic[this.in]) ? void 0 : i.style) ? a : 'form'), void 0 === u.explode && this.in ? (this.explode = null == (l = null == (s = Ic[this.in]) ? void 0 : s.explode) || l) : (this.explode = !!u.explode), (this.deprecated = void 0 === u.deprecated ? !!this.schema.deprecated : u.deprecated), r.showExtensions && (this.extensions = gs(u, r.showExtensions)), (this.const = (null == (c = this.schema) ? void 0 : c.const) || (null == u ? void 0 : u.const) || ''); } toggle() { this.expanded = !this.expanded; } collapse() { this.expanded = !1; } expand() { this.expanded = !0; } } function Dc(e) { return e < 10 ? '0' + e : e; } function Lc(e, t) { return t > e.length ? e.repeat(Math.trunc(t / e.length) + 1).substring(0, t) : e; } function Mc(...e) { const t = e => e && 'object' == typeof e; return e.reduce( (e, n) => ( Object.keys(n || {}).forEach(r => { const o = e[r], i = n[r]; t(o) && t(i) ? (e[r] = Mc(o, i)) : (e[r] = i); }), e ), Array.isArray(e[e.length - 1]) ? [] : {} ); } function Fc(e) { return { value: 'object' === e ? {} : 'array' === e ? [] : void 0 }; } function zc(e, t) { t && e.pop(); } Tc([Ae], Nc.prototype, 'expanded', 2), Tc([Pt], Nc.prototype, 'toggle', 1), Tc([Pt], Nc.prototype, 'collapse', 1), Tc([Pt], Nc.prototype, 'expand', 1); const Uc = { multipleOf: 'number', maximum: 'number', exclusiveMaximum: 'number', minimum: 'number', exclusiveMinimum: 'number', maxLength: 'string', minLength: 'string', pattern: 'string', items: 'array', maxItems: 'array', minItems: 'array', uniqueItems: 'array', additionalItems: 'array', maxProperties: 'object', minProperties: 'object', required: 'object', additionalProperties: 'object', properties: 'object', patternProperties: 'object', dependencies: 'object' }; function Vc(e) { if (void 0 !== e.type) return Array.isArray(e.type) ? 0 === e.type.length ? null : e.type[0] : e.type; const t = Object.keys(Uc); for (var n = 0; n < t.length; n++) { let r = t[n], o = Uc[r]; if (void 0 !== e[r]) return o; } return null; } let Bc = {}, qc = []; function Wc(e) { let t; return ( void 0 !== e.const ? (t = e.const) : void 0 !== e.examples && e.examples.length ? (t = e.examples[0]) : void 0 !== e.enum && e.enum.length ? (t = e.enum[0]) : void 0 !== e.default && (t = e.default), t ); } function Hc(e) { const t = Wc(e); if (void 0 !== t) return { value: t, readOnly: e.readOnly, writeOnly: e.writeOnly, type: null }; } function Yc(e, t, n, r) { if (r) { if (qc.includes(e)) return Fc(Vc(e)); qc.push(e); } if (r && r.depth > t.maxSampleDepth) return zc(qc, r), Fc(Vc(e)); if (e.$ref) { if (!n) throw new Error( 'Your schema contains $ref. You must provide full specification in the third parameter.' ); let o = decodeURIComponent(e.$ref); o.startsWith('#') && (o = o.substring(1)); const i = Ia().get(n, o); let a; return ( !0 !== Bc[o] ? ((Bc[o] = !0), (a = Yc(i, t, n, r)), (Bc[o] = !1)) : (a = Fc(Vc(i))), zc(qc, r), a ); } if (void 0 !== e.example) return ( zc(qc, r), { value: e.example, readOnly: e.readOnly, writeOnly: e.writeOnly, type: e.type } ); if (void 0 !== e.allOf) return ( zc(qc, r), Hc(e) || (function (e, t, n, r, o) { let i = Yc(e, n, r); const a = []; for (let e of t) { const { type: t, readOnly: s, writeOnly: l, value: c } = Yc({ type: i.type, ...e }, n, r, o); i.type && t && t !== i.type && (console.warn( "allOf: schemas with different types can't be merged" ), (i.type = t)), (i.type = i.type || t), (i.readOnly = i.readOnly || s), (i.writeOnly = i.writeOnly || l), null != c && a.push(c); } if ('object' === i.type) return ( (i.value = Mc( i.value || {}, ...a.filter(e => 'object' == typeof e) )), i ); { 'array' === i.type && (n.quiet || console.warn( 'OpenAPI Sampler: found allOf with "array" type. Result may be incorrect' )); const e = a[a.length - 1]; return (i.value = null != e ? e : i.value), i; } })({ ...e, allOf: void 0 }, e.allOf, t, n, r) ); if (e.oneOf && e.oneOf.length) return ( e.anyOf && (t.quiet || console.warn( 'oneOf and anyOf are not supported on the same level. Skipping anyOf' )), zc(qc, r), a( e, Object.assign( { readOnly: e.readOnly, writeOnly: e.writeOnly }, e.oneOf[0] ) ) ); if (e.anyOf && e.anyOf.length) return ( zc(qc, r), a( e, Object.assign( { readOnly: e.readOnly, writeOnly: e.writeOnly }, e.anyOf[0] ) ) ); if (e.if && e.then) { zc(qc, r); const { if: o, then: i, ...a } = e; return Yc(Mc(a, o, i), t, n, r); } let o = Wc(e), i = null; if (void 0 === o) { (o = null), (i = e.type), Array.isArray(i) && e.type.length > 0 && (i = e.type[0]), i || (i = Vc(e)); let a = Jc[i]; a && (o = a(e, t, n, r)); } return ( zc(qc, r), { value: o, readOnly: e.readOnly, writeOnly: e.writeOnly, type: i } ); function a(e, o) { const i = Hc(e); if (void 0 !== i) return i; const a = Yc({ ...e, oneOf: void 0, anyOf: void 0 }, t, n, r), s = Yc(o, t, n, r); if ('object' == typeof a.value && 'object' == typeof s.value) { const e = Mc(a.value, s.value); return { ...s, value: e }; } return s; } } function Kc(e) { let t = 0; if ( 'boolean' == typeof e.exclusiveMinimum || 'boolean' == typeof e.exclusiveMaximum ) { if (e.maximum && e.minimum) return ( (t = e.exclusiveMinimum ? Math.floor(e.minimum) + 1 : e.minimum), ((e.exclusiveMaximum && t >= e.maximum) || (!e.exclusiveMaximum && t > e.maximum)) && (t = (e.maximum + e.minimum) / 2), t ); if (e.minimum) return e.exclusiveMinimum ? Math.floor(e.minimum) + 1 : e.minimum; if (e.maximum) return e.exclusiveMaximum ? e.maximum > 0 ? 0 : Math.floor(e.maximum) - 1 : e.maximum > 0 ? 0 : e.maximum; } else { if (e.minimum) return e.minimum; e.exclusiveMinimum ? ((t = Math.floor(e.exclusiveMinimum) + 1), t === e.exclusiveMaximum && (t = (t + Math.floor(e.exclusiveMaximum) - 1) / 2)) : e.exclusiveMaximum ? (t = Math.floor(e.exclusiveMaximum) - 1) : e.maximum && (t = e.maximum); } return t; } function Gc({ min: e, max: t, omitTime: n, omitDate: r }) { let o = (function (e, t, n, r) { var o = n ? '' : e.getUTCFullYear() + '-' + Dc(e.getUTCMonth() + 1) + '-' + Dc(e.getUTCDate()); return ( t || (o += 'T' + Dc(e.getUTCHours()) + ':' + Dc(e.getUTCMinutes()) + ':' + Dc(e.getUTCSeconds()) + 'Z'), o ); })(new Date('2019-08-24T14:15:22.123Z'), n, r); return ( o.length < e && console.warn( \`Using minLength = \${e} is incorrect with format "date-time"\` ), t && o.length > t && console.warn( \`Using maxLength = \${t} is incorrect with format "date-time"\` ), o ); } function Qc(e, t) { let n = Lc('string', e); return t && n.length > t && (n = n.substring(0, t)), n; } const Xc = { email: function () { return 'user@example.com'; }, 'idn-email': function () { return '\u043F\u043E\u0448\u0442\u0430@\u0443\u043A\u0440.\u043D\u0435\u0442'; }, password: function (e, t) { let n = 'pa$$word'; return ( e > n.length && ((n += '_'), (n += Lc('qwerty!@#$%^123456', e - n.length).substring( 0, e - n.length ))), n ); }, 'date-time': function (e, t) { return Gc({ min: e, max: t, omitTime: !1, omitDate: !1 }); }, date: function (e, t) { return Gc({ min: e, max: t, omitTime: !0, omitDate: !1 }); }, time: function (e, t) { return Gc({ min: e, max: t, omitTime: !1, omitDate: !0 }).slice(1); }, ipv4: function () { return '192.168.0.1'; }, ipv6: function () { return '2001:0db8:85a3:0000:0000:8a2e:0370:7334'; }, hostname: function () { return 'example.com'; }, 'idn-hostname': function () { return '\u043F\u0440\u0438\u043A\u043B\u0430\u0434.\u0443\u043A\u0440'; }, iri: function () { return 'http://example.com'; }, 'iri-reference': function () { return '../\u0441\u043B\u043E\u0432\u043D\u0438\u043A'; }, uri: function () { return 'http://example.com'; }, 'uri-reference': function () { return '../dictionary'; }, 'uri-template': function () { return 'http://example.com/{endpoint}'; }, uuid: function (e, t, n) { return ( (r = (function (e) { var t = 0; if (0 == e.length) return t; for (var n = 0; n < e.length; n++) (t = (t << 5) - t + e.charCodeAt(n)), (t &= t); return t; })(n || 'id')), (o = (function (e, t, n, r) { return function () { var o = ((e |= 0) - (((t |= 0) << 27) | (t >>> 5))) | 0; return ( (e = t ^ (((n |= 0) << 17) | (n >>> 15))), (t = (n + (r |= 0)) | 0), (n = (r + o) | 0), ((r = (e + o) | 0) >>> 0) / 4294967296 ); }; })(r, r, r, r)), 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, e => { var t = (16 * o()) % 16 | 0; return ('x' == e ? t : (3 & t) | 8).toString(16); }) ); var r, o; }, default: Qc, 'json-pointer': function () { return '/json/pointer'; }, 'relative-json-pointer': function () { return '1/relative/json/pointer'; }, regex: function () { return '/regex/'; } }; var Jc = {}; const Zc = { skipReadOnly: !1, maxSampleDepth: 15 }; function eu(e, t, n) { let r = Object.assign({}, Zc, t); return (Bc = {}), (qc = []), Yc(e, r, n).value; } function tu(e, t) { Jc[e] = t; } tu('array', function (e, t = {}, n, r) { const o = (r && r.depth) || 1; let i = Math.min( null != e.maxItems ? e.maxItems : 1 / 0, e.minItems || 1 ); const a = e.prefixItems || e.items || e.contains; Array.isArray(a) && (i = Math.max(i, a.length)); let s = []; if (!a) return s; for (let e = 0; e < i; e++) { let r = ((l = e), Array.isArray(a) ? a[l] || {} : a || {}), { value: i } = Yc(r, t, n, { depth: o + 1 }); s.push(i); } var l; return s; }), tu('boolean', function (e) { return !0; }), tu('integer', Kc), tu('number', Kc), tu('object', function (e, t = {}, n, r) { let o = {}; const i = (r && r.depth) || 1; if (e && 'object' == typeof e.properties) { let r = (Array.isArray(e.required) ? e.required : []).reduce( (e, t) => ((e[t] = !0), e), {} ); Object.keys(e.properties).forEach(a => { if (t.skipNonRequired && !r.hasOwnProperty(a)) return; const s = Yc(e.properties[a], t, n, { propertyName: a, depth: i + 1 }); (t.skipReadOnly && s.readOnly) || (t.skipWriteOnly && s.writeOnly) || (o[a] = s.value); }); } if (e && 'object' == typeof e.additionalProperties) { const r = e.additionalProperties['x-additionalPropertiesName'] || 'property'; (o[\`\${String(r)}1\`] = Yc(e.additionalProperties, t, n, { depth: i + 1 }).value), (o[\`\${String(r)}2\`] = Yc(e.additionalProperties, t, n, { depth: i + 1 }).value); } return o; }), tu('string', function (e, t, n, r) { let o = e.format || 'default', i = Xc[o] || Qc, a = r && r.propertyName; return i(0 | e.minLength, e.maxLength, a); }); class nu { constructor(e, t, n, r, o) { (this.name = t), (this.isRequestType = n), (this.schema = r.schema && new Ec(e, r.schema, '', o)), (this.onlyRequiredInSamples = o.onlyRequiredInSamples), (this.generatedPayloadSamplesMaxDepth = o.generatedPayloadSamplesMaxDepth), void 0 !== r.examples ? (this.examples = Qr( r.examples, n => new Cc(e, n, t, r.encoding) )) : void 0 !== r.example ? (this.examples = { default: new Cc( e, { value: e.deref(r.example).resolved }, t, r.encoding ) }) : es(t) && this.generateExample(e, r); } generateExample(e, t) { const n = { skipReadOnly: this.isRequestType, skipWriteOnly: !this.isRequestType, skipNonRequired: this.isRequestType && this.onlyRequiredInSamples, maxSampleDepth: this.generatedPayloadSamplesMaxDepth }; if (this.schema && this.schema.oneOf) { this.examples = {}; for (const r of this.schema.oneOf) { const o = eu(r.rawSchema, n, e.spec); this.schema.discriminatorProp && 'object' == typeof o && o && (o[this.schema.discriminatorProp] = r.title), (this.examples[r.title] = new Cc( e, { value: o }, this.name, t.encoding )); } } else this.schema && (this.examples = { default: new Cc( e, { value: eu(t.schema, n, e.spec) }, this.name, t.encoding ) }); } } var ru = Object.defineProperty, ou = Object.getOwnPropertyDescriptor, iu = (e, t, n, r) => { for ( var o, i = r > 1 ? void 0 : r ? ou(t, n) : t, a = e.length - 1; a >= 0; a-- ) (o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i); return r && i && ru(t, n, i), i; }; class au { constructor(e, t, n, r) { (this.isRequestType = n), (this.activeMimeIdx = 0), tn(this), r.unstable_ignoreMimeParameters && (t = (function (e) { const t = {}; return ( Object.keys(e).forEach(n => { const r = e[n], o = n.split(';')[0].trim(); t[o] ? (t[o] = Ha(Ha({}, t[o]), r)) : (t[o] = r); }), t ); })(t)), (this.mediaTypes = Object.keys(t).map(o => { const i = t[o]; return new nu(e, o, n, i, r); })); } activate(e) { this.activeMimeIdx = e; } get active() { return this.mediaTypes[this.activeMimeIdx]; } get hasSample() { return this.mediaTypes.filter(e => !!e.examples).length > 0; } } iu([Ae], au.prototype, 'activeMimeIdx', 2), iu([Pt], au.prototype, 'activate', 1), iu([je], au.prototype, 'active', 1); class su { constructor({ parser: e, infoOrRef: t, options: n, isEvent: r }) { const o = !r, { resolved: i } = e.deref(t); (this.description = i.description || ''), (this.required = !!i.required); const a = (function (e) { let t = e.content; const n = e['x-examples'], r = e['x-example']; if (n) { t = Ha({}, t); for (const e of Object.keys(n)) { const r = n[e]; t[e] = Ya(Ha({}, t[e]), { examples: r }); } } else if (r) { t = Ha({}, t); for (const e of Object.keys(r)) { const n = r[e]; t[e] = Ya(Ha({}, t[e]), { example: n }); } } return t; })(i); void 0 !== a && (this.content = new au(e, a, o, n)); } } var lu = Object.defineProperty, cu = Object.defineProperties, uu = Object.getOwnPropertyDescriptor, pu = Object.getOwnPropertyDescriptors, du = Object.getOwnPropertySymbols, fu = Object.prototype.hasOwnProperty, hu = Object.prototype.propertyIsEnumerable, mu = (e, t, n) => t in e ? lu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : (e[t] = n), gu = (e, t, n, r) => { for ( var o, i = r > 1 ? void 0 : r ? uu(t, n) : t, a = e.length - 1; a >= 0; a-- ) (o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i); return r && i && lu(t, n, i), i; }; class yu { constructor({ parser: e, code: t, defaultAsError: n, infoOrRef: r, options: o, isEvent: i }) { (this.expanded = !1), (this.headers = []), tn(this), (this.expanded = 'all' === o.expandResponses || o.expandResponses[t]); const { resolved: a } = e.deref(r); (this.code = t), void 0 !== a.content && (this.content = new au(e, a.content, i, o)), void 0 !== a['x-summary'] ? ((this.summary = a['x-summary']), (this.description = a.description || '')) : ((this.summary = a.description || ''), (this.description = '')), (this.type = Ga(t, n)); const s = a.headers; void 0 !== s && (this.headers = Object.keys(s).map(t => { const n = s[t]; return new Nc( e, ((e, t) => cu(e, pu(t)))( ((e, t) => { for (var n in t || (t = {})) fu.call(t, n) && mu(e, n, t[n]); if (du) for (var n of du(t)) hu.call(t, n) && mu(e, n, t[n]); return e; })({}, n), { name: t } ), '', o ); })), o.showExtensions && (this.extensions = gs(a, o.showExtensions)); } toggle() { this.expanded = !this.expanded; } } gu([Ae], yu.prototype, 'expanded', 2), gu([Pt], yu.prototype, 'toggle', 1); var vu = Object.defineProperty, bu = Object.getOwnPropertyDescriptor, wu = (e, t, n, r) => { for ( var o, i = r > 1 ? void 0 : r ? bu(t, n) : t, a = e.length - 1; a >= 0; a-- ) (o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i); return r && i && vu(t, n, i), i; }; function xu(e) { return 'payload' === e.lang && e.requestBodyContent; } let ku = !1; class _u { constructor(e, t, n, r, o = !1) { var i; (this.parser = e), (this.operationSpec = t), (this.options = r), (this.type = 'operation'), (this.items = []), (this.ready = !0), (this.active = !1), (this.expanded = !1), tn(this), (this.pointer = t.pointer), (this.description = t.description), (this.parent = n), (this.externalDocs = t.externalDocs), (this.deprecated = !!t.deprecated), (this.httpVerb = t.httpVerb), (this.deprecated = !!t.deprecated), (this.operationId = t.operationId), (this.path = t.pathName), (this.isCallback = o), (this.isWebhook = t.isWebhook), (this.isEvent = this.isCallback || this.isWebhook), (this.name = (i = t).summary || i.operationId || (i.description && i.description.substring(0, 50)) || i.pathName || ''), (this.sidebarLabel = r.sideNavStyle === co.IdOnly ? this.operationId || this.path : r.sideNavStyle === co.PathOnly ? this.path : this.name), this.isCallback ? ((this.security = (t.security || []).map(t => new Vl(t, e))), (this.servers = fs('', t.servers || t.pathServers || []))) : ((this.operationHash = t.operationId && 'operation/' + t.operationId), (this.id = void 0 !== t.operationId ? (n ? n.id + '/' : '') + this.operationHash : void 0 !== n ? n.id + this.pointer : this.pointer), (this.security = (t.security || e.spec.security || []).map( t => new Vl(t, e) )), (this.servers = fs( e.specUrl, t.servers || t.pathServers || e.spec.servers || [] ))), r.showExtensions && (this.extensions = gs(t, r.showExtensions)); } activate() { this.active = !0; } deactivate() { this.active = !1; } toggle() { this.expanded = !this.expanded; } expand() { this.parent && this.parent.expand(); } collapse() {} get requestBody() { return ( this.operationSpec.requestBody && new su({ parser: this.parser, infoOrRef: this.operationSpec.requestBody, options: this.options, isEvent: this.isEvent }) ); } get codeSamples() { let e = this.operationSpec['x-codeSamples'] || this.operationSpec['x-code-samples'] || []; this.operationSpec['x-code-samples'] && !ku && ((ku = !0), console.warn( '"x-code-samples" is deprecated. Use "x-codeSamples" instead' )); const t = this.requestBody && this.requestBody.content; if (t && t.hasSample) { const n = Math.min(e.length, this.options.payloadSampleIdx); e = [ ...e.slice(0, n), { lang: 'payload', label: 'Payload', source: '', requestBodyContent: t }, ...e.slice(n) ]; } return e; } get parameters() { const e = (function (e, t = [], n = []) { const r = {}; return ( n.forEach(t => { ({ resolved: t } = e.deref(t)), (r[t.name + '_' + t.in] = !0); }), (t = t.filter( t => (({ resolved: t } = e.deref(t)), !r[t.name + '_' + t.in]) )).concat(n) ); })( this.parser, this.operationSpec.pathParameters, this.operationSpec.parameters ).map(e => new Nc(this.parser, e, this.pointer, this.options)); return this.options.sortPropsAlphabetically ? ds(e, 'name') : this.options.requiredPropsFirst ? ps(e) : e; } get responses() { let e = !1; return Object.keys(this.operationSpec.responses || []) .filter(t => { return ( 'default' === t || ('success' === Ga(t) && (e = !0), 'default' === (n = t) || Jr(n) || Ka(n)) ); var n; }) .map( t => new yu({ parser: this.parser, code: t, defaultAsError: e, infoOrRef: this.operationSpec.responses[t], options: this.options, isEvent: this.isEvent }) ); } get callbacks() { return Object.keys(this.operationSpec.callbacks || []).map( e => new ec( this.parser, e, this.operationSpec.callbacks[e], this.pointer, this.options ) ); } } wu([Ae], _u.prototype, 'ready', 2), wu([Ae], _u.prototype, 'active', 2), wu([Ae], _u.prototype, 'expanded', 2), wu([Pt], _u.prototype, 'activate', 1), wu([Pt], _u.prototype, 'deactivate', 1), wu([Pt], _u.prototype, 'toggle', 1), wu([$s], _u.prototype, 'requestBody', 1), wu([$s], _u.prototype, 'codeSamples', 1), wu([$s], _u.prototype, 'parameters', 1), wu([$s], _u.prototype, 'responses', 1), wu([$s], _u.prototype, 'callbacks', 1); const Ou = ga.div\` width: calc(100% - \${e => e.theme.rightPanel.width}); padding: 0 \${e => e.theme.spacing.sectionHorizontal}px; \${({ compact: e, theme: t }) => ma('medium', !0)\` width: 100%; padding: \${\`\${e ? 0 : t.spacing.sectionVertical}px \${ t.spacing.sectionHorizontal }px\`}; \`}; \`, Su = ga.div.attrs(e => ({ [gf]: e.id }))\` padding: \${e => e.theme.spacing.sectionVertical}px 0; &:last-child { min-height: calc(100vh + 1px); } & > &:last-child { min-height: initial; } \${ma('medium', !0)\` padding: 0; \`} \${e => e.underlined ? "\\n position: relative;\\n\\n &:not(:last-of-type):after {\\n position: absolute;\\n bottom: 0;\\n width: 100%;\\n display: block;\\n content: '';\\n border-bottom: 1px solid rgba(0, 0, 0, 0.2);\\n }\\n " : ''} \`, Eu = ga.div\` width: \${e => e.theme.rightPanel.width}; color: \${({ theme: e }) => e.rightPanel.textColor}; background-color: \${e => e.theme.rightPanel.backgroundColor}; padding: 0 \${e => e.theme.spacing.sectionHorizontal}px; \${ma('medium', !0)\` width: 100%; padding: \${e => \`\${e.theme.spacing.sectionVertical}px \${e.theme.spacing.sectionHorizontal}px\`}; \`}; \`, Pu = ga(Eu)\` background-color: \${e => e.theme.rightPanel.backgroundColor}; \`, Au = ga.div\` display: flex; width: 100%; padding: 0; \${ma('medium', !0)\` flex-direction: column; \`}; \`, $u = { 1: '1.85714em', 2: '1.57143em', 3: '1.27em' }, Cu = e => pa\` font-family: \${({ theme: e }) => e.typography.headings.fontFamily}; font-weight: \${({ theme: e }) => e.typography.headings.fontWeight}; font-size: \${$u[e]}; line-height: \${({ theme: e }) => e.typography.headings.lineHeight}; \`, Ru = ga.h1\` \${Cu(1)}; color: \${({ theme: e }) => e.colors.text.primary}; \${ya('H1')}; \`, ju = ga.h2\` \${Cu(2)}; color: \${({ theme: e }) => e.colors.text.primary}; margin: 0 0 20px; \${ya('H2')}; \`, Tu = (ga.h2\`