@itentialopensource/binding-schema
Version:
A schema extension for JSON schema that builds upon hyper schema to dynamically bind data into a JSON schema document.
2 lines (1 loc) • 39.6 kB
JavaScript
;var t,r=(t=require("axios"))&&"object"==typeof t&&"default"in t?t.default:t;function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,r){return t(r={exports:{}},r.exports),r.exports}var o=e(n((function(t){function r(t,r,e,n,o,u,i){try{var a=t[u](i),c=a.value}catch(t){return void e(t)}a.done?r(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,u){var i=t.apply(e,n);function a(t){r(i,o,u,a,c,"next",t)}function c(t){r(i,o,u,a,c,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0}))),u=n((function(t){var r=function(t){var r=Object.prototype,e=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",i=n.toStringTag||"@@toStringTag";function a(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{a({},"")}catch(t){a=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var o=r&&r.prototype instanceof l?r:l,u=Object.create(o.prototype),i=new O(n||[]);return u._invoke=function(t,r,e){var n="suspendedStart";return function(o,u){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw u;return _()}for(e.method=o,e.arg=u;;){var i=e.delegate;if(i){var a=x(i,e);if(a){if(a===f)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=s(t,r,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,i),u}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==r&&e.call(g,o)&&(d=g);var v=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(r){a(t,r,(function(t){return this._invoke(r,t)}))}))}function b(t,r){var n;this._invoke=function(o,u){function i(){return new r((function(n,i){!function n(o,u,i,a){var c=s(t[o],t,u);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&e.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,i,a)}),(function(t){n("throw",t,i,a)})):r.resolve(l).then((function(t){f.value=t,i(f)}),(function(t){return n("throw",t,i,a)}))}a(c.arg)}(o,u,n,i)}))}return n=n?n.then(i,i):i()}}function x(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,x(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;var o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function w(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function j(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,u=function r(){for(;++n<t.length;)if(e.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return u.next=u}}return{next:_}}function _(){return{value:void 0,done:!0}}return p.prototype=v.constructor=h,h.constructor=p,p.displayName=a(h,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a(t,i,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[u]=function(){return this},t.AsyncIterator=b,t.async=function(r,e,n,o,u){void 0===u&&(u=Promise);var i=new b(c(r,e,n,o),u);return t.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},m(v),a(v,i,"Generator"),v[o]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!t)for(var r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e,n){return i.type="throw",i.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],i=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var a=e.call(u,"catchLoc"),c=e.call(u,"finallyLoc");if(a&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(a){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(t,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var i=u?u.completion:{};return i.type=t,i.arg=r,u?(this.method="next",this.next=u.finallyLoc,f):this.complete(i)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),f},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),f}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:S(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}})),i=n((function(t){t.exports=function(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n},t.exports.default=t.exports,t.exports.__esModule=!0}));e(i);var a=n((function(t){t.exports=function(t){if(Array.isArray(t))return i(t)},t.exports.default=t.exports,t.exports.__esModule=!0}));e(a);var c=n((function(t){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0}));e(c);var s=n((function(t){t.exports=function(t,r){if(t){if("string"==typeof t)return i(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(t,r):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0}));e(s);var f=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0}));e(f);var l=e(n((function(t){t.exports=function(t){return a(t)||c(t)||s(t)||f()},t.exports.default=t.exports,t.exports.__esModule=!0}))),p=n((function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0}));e(p);var h=n((function(t){t.exports=function(t,r){var e=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=e){var n,o,u=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(u.push(n.value),!r||u.length!==r);i=!0);}catch(t){a=!0,o=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw o}}return u}},t.exports.default=t.exports,t.exports.__esModule=!0}));e(h);var d=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0}));e(d);var y=e(n((function(t){t.exports=function(t,r){return p(t)||h(t,r)||s(t,r)||d()},t.exports.default=t.exports,t.exports.__esModule=!0}))),g=e(n((function(t){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0}))),v=e(n((function(t){t.exports=function(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t},t.exports.default=t.exports,t.exports.__esModule=!0}))),m=n((function(t,r){function e(t){return"object"!=typeof t||"toString"in t?t:Object.prototype.toString.call(t).slice(8,-1)}Object.defineProperty(r,"__esModule",{value:!0});var n="object"==typeof process&&"production"===process.env.NODE_ENV;function o(t,r){if(!t){if(n)throw new Error("Invariant failed");throw new Error(r())}}r.invariant=o;var u=Object.prototype.hasOwnProperty,i=Array.prototype.splice,a=Object.prototype.toString;function c(t){return a.call(t).slice(8,-1)}var s=Object.assign||function(t,r){return f(r).forEach((function(e){u.call(r,e)&&(t[e]=r[e])})),t},f="function"==typeof Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.keys(t)};function l(t){return Array.isArray(t)?s(t.constructor(t.length),t):"Map"===c(t)?new Map(t):"Set"===c(t)?new Set(t):t&&"object"==typeof t?s(Object.create(Object.getPrototypeOf(t)),t):t}var p=function(){function t(){this.commands=s({},h),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(t,r){return t===r},this.update.newContext=function(){return(new t).update}}return Object.defineProperty(t.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(t){this.update.isEquals=t},enumerable:!0,configurable:!0}),t.prototype.extend=function(t,r){this.commands[t]=r},t.prototype.update=function(t,r){var e=this,n="function"==typeof r?{$apply:r}:r;Array.isArray(t)&&Array.isArray(n)||o(!Array.isArray(n),(function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."})),o("object"==typeof n&&null!==n,(function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the following commands: "+Object.keys(e.commands).join(", ")+"."}));var i=t;return f(n).forEach((function(r){if(u.call(e.commands,r)){var o=t===i;i=e.commands[r](n[r],i,n,t),o&&e.isEquals(i,t)&&(i=t)}else{var a="Map"===c(t)?e.update(t.get(r),n[r]):e.update(t[r],n[r]),s="Map"===c(i)?i.get(r):i[r];e.isEquals(a,s)&&(void 0!==a||u.call(t,r))||(i===t&&(i=l(t)),"Map"===c(i)?i.set(r,a):i[r]=a)}})),i},t}();r.Context=p;var h={$push:function(t,r,e){return y(r,e,"$push"),t.length?r.concat(t):r},$unshift:function(t,r,e){return y(r,e,"$unshift"),t.length?t.concat(r):r},$splice:function(t,r,n,u){return function(t,r){o(Array.isArray(t),(function(){return"Expected $splice target to be an array; got "+e(t)})),v(r.$splice)}(r,n),t.forEach((function(t){v(t),r===u&&t.length&&(r=l(u)),i.apply(r,t)})),r},$set:function(t,r,e){return function(t){o(1===Object.keys(t).length,(function(){return"Cannot have more than one key in an object with $set"}))}(e),t},$toggle:function(t,r){g(t,"$toggle");var e=t.length?l(r):r;return t.forEach((function(t){e[t]=!r[t]})),e},$unset:function(t,r,e,n){return g(t,"$unset"),t.forEach((function(t){Object.hasOwnProperty.call(r,t)&&(r===n&&(r=l(n)),delete r[t])})),r},$add:function(t,r,e,n){return m(r,"$add"),g(t,"$add"),"Map"===c(r)?t.forEach((function(t){var e=t[0],o=t[1];r===n&&r.get(e)!==o&&(r=l(n)),r.set(e,o)})):t.forEach((function(t){r!==n||r.has(t)||(r=l(n)),r.add(t)})),r},$remove:function(t,r,e,n){return m(r,"$remove"),g(t,"$remove"),t.forEach((function(t){r===n&&r.has(t)&&(r=l(n)),r.delete(t)})),r},$merge:function(t,r,n,u){var i,a;return i=r,o((a=t)&&"object"==typeof a,(function(){return"update(): $merge expects a spec of type 'object'; got "+e(a)})),o(i&&"object"==typeof i,(function(){return"update(): $merge expects a target of type 'object'; got "+e(i)})),f(t).forEach((function(e){t[e]!==r[e]&&(r===u&&(r=l(u)),r[e]=t[e])})),r},$apply:function(t,r){var n;return o("function"==typeof(n=t),(function(){return"update(): expected spec of $apply to be a function; got "+e(n)+"."})),t(r)}},d=new p;function y(t,r,n){o(Array.isArray(t),(function(){return"update(): expected target of "+e(n)+" to be an array; got "+e(t)+"."})),g(r[n],n)}function g(t,r){o(Array.isArray(t),(function(){return"update(): expected spec of "+e(r)+" to be an array; got "+e(t)+". Did you forget to wrap your parameter in an array?"}))}function v(t){o(Array.isArray(t),(function(){return"update(): expected spec of $splice to be an array of arrays; got "+e(t)+". Did you forget to wrap your parameters in an array?"}))}function m(t,r){var n=c(t);o("Map"===n||"Set"===n,(function(){return"update(): "+e(r)+" expects a target of type Set or Map; got "+e(n)}))}r.isEquals=d.update.isEquals,r.extend=d.extend,r.default=d.update,r.default.default=t.exports=s(r.default,r)})),b=e(m);m.invariant,m.Context,m.isEquals,m.extend;function x(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function w(t){return function r(e){return 0===arguments.length||x(e)?r:t.apply(this,arguments)}}function j(t){return function r(e,n){switch(arguments.length){case 0:return r;case 1:return x(e)?r:w((function(r){return t(e,r)}));default:return x(e)&&x(n)?r:x(e)?w((function(r){return t(r,n)})):x(n)?w((function(r){return t(e,r)})):t(e,n)}}}function O(t,r){switch(t){case 0:return function(){return r.apply(this,arguments)};case 1:return function(t){return r.apply(this,arguments)};case 2:return function(t,e){return r.apply(this,arguments)};case 3:return function(t,e,n){return r.apply(this,arguments)};case 4:return function(t,e,n,o){return r.apply(this,arguments)};case 5:return function(t,e,n,o,u){return r.apply(this,arguments)};case 6:return function(t,e,n,o,u,i){return r.apply(this,arguments)};case 7:return function(t,e,n,o,u,i,a){return r.apply(this,arguments)};case 8:return function(t,e,n,o,u,i,a,c){return r.apply(this,arguments)};case 9:return function(t,e,n,o,u,i,a,c,s){return r.apply(this,arguments)};case 10:return function(t,e,n,o,u,i,a,c,s,f){return r.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}var S=j((function(t,r){return 1===t?w(r):O(t,function t(r,e,n){return function(){for(var o=[],u=0,i=r,a=0;a<e.length||u<arguments.length;){var c;a<e.length&&(!x(e[a])||u>=arguments.length)?c=e[a]:(c=arguments[u],u+=1),o[a]=c,x(c)||(i-=1),a+=1}return i<=0?n.apply(this,o):O(i,t(r,o,n))}}(t,[],r))}));function _(t){return function r(e,n,o){switch(arguments.length){case 0:return r;case 1:return x(e)?r:j((function(r,n){return t(e,r,n)}));case 2:return x(e)&&x(n)?r:x(e)?j((function(r,e){return t(r,n,e)})):x(n)?j((function(r,n){return t(e,r,n)})):w((function(r){return t(e,n,r)}));default:return x(e)&&x(n)&&x(o)?r:x(e)&&x(n)?j((function(r,e){return t(r,e,o)})):x(e)&&x(o)?j((function(r,e){return t(r,n,e)})):x(n)&&x(o)?j((function(r,n){return t(e,r,n)})):x(e)?w((function(r){return t(r,n,o)})):x(n)?w((function(r){return t(e,r,o)})):x(o)?w((function(r){return t(e,n,r)})):t(e,n,o)}}}var E=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)};function A(t){return null!=t&&"function"==typeof t["@@transducer/step"]}function P(t,r,e){return function(){if(0===arguments.length)return e();var n=arguments[arguments.length-1];if(!E(n)){for(var o=0;o<t.length;){if("function"==typeof n[t[o]])return n[t[o]].apply(n,Array.prototype.slice.call(arguments,0,-1));o+=1}if(A(n)){var u=r.apply(null,Array.prototype.slice.call(arguments,0,-1));return u(n)}}return e.apply(this,arguments)}}function k(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var $={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function T(t,r){for(var e=0,n=r.length,o=Array(n);e<n;)o[e]=t(r[e]),e+=1;return o}function M(t){return"[object String]"===Object.prototype.toString.call(t)}var L=w((function(t){return!!E(t)||!!t&&("object"==typeof t&&(!M(t)&&(0===t.length||t.length>0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))})),q=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,r){return this.f(t,r)},t}();var N=j((function(t,r){return O(t.length,(function(){return t.apply(r,arguments)}))}));function C(t,r,e){for(var n=e.next();!n.done;){if((r=t["@@transducer/step"](r,n.value))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}n=e.next()}return t["@@transducer/result"](r)}function I(t,r,e,n){return t["@@transducer/result"](e[n](N(t["@@transducer/step"],t),r))}var F="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function D(t,r,e){if("function"==typeof t&&(t=function(t){return new q(t)}(t)),L(e))return function(t,r,e){for(var n=0,o=e.length;n<o;){if((r=t["@@transducer/step"](r,e[n]))&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}n+=1}return t["@@transducer/result"](r)}(t,r,e);if("function"==typeof e["fantasy-land/reduce"])return I(t,r,e,"fantasy-land/reduce");if(null!=e[F])return C(t,r,e[F]());if("function"==typeof e.next)return C(t,r,e);if("function"==typeof e.reduce)return I(t,r,e,"reduce");throw new TypeError("reduce: list must be array or iterable")}var U=function(){function t(t,r){this.xf=r,this.f=t}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=$.result,t.prototype["@@transducer/step"]=function(t,r){return this.xf["@@transducer/step"](t,this.f(r))},t}(),G=j((function(t,r){return new U(t,r)}));function z(t,r){return Object.prototype.hasOwnProperty.call(r,t)}var R=Object.prototype.toString,B=function(){return"[object Arguments]"===R.call(arguments)?function(t){return"[object Arguments]"===R.call(t)}:function(t){return z("callee",t)}}(),Y=!{toString:null}.propertyIsEnumerable("toString"),V=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],W=function(){return arguments.propertyIsEnumerable("length")}(),K=function(t,r){for(var e=0;e<t.length;){if(t[e]===r)return!0;e+=1}return!1},H="function"!=typeof Object.keys||W?w((function(t){if(Object(t)!==t)return[];var r,e,n=[],o=W&&B(t);for(r in t)!z(r,t)||o&&"length"===r||(n[n.length]=r);if(Y)for(e=V.length-1;e>=0;)z(r=V[e],t)&&!K(n,r)&&(n[n.length]=r),e-=1;return n})):w((function(t){return Object(t)!==t?[]:Object.keys(t)})),J=j(P(["fantasy-land/map","map"],G,(function(t,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return S(r.length,(function(){return t.call(this,r.apply(this,arguments))}));case"[object Object]":return D((function(e,n){return e[n]=t(r[n]),e}),{},H(r));default:return T(t,r)}}))),X=Number.isInteger||function(t){return t<<0===t},Z=j((function(t,r){var e=t<0?r.length+t:t;return M(r)?r.charAt(e):r[e]})),Q=j((function(t,r){if(null!=r)return X(t)?Z(t,r):r[t]})),tt=_(D);var rt=w((function(t){return null==t})),et=_((function t(r,e,n){if(0===r.length)return e;var o=r[0];if(r.length>1){var u=!rt(n)&&z(o,n)?n[o]:X(r[1])?[]:{};e=t(Array.prototype.slice.call(r,1),e,u)}return function(t,r,e){if(X(t)&&E(e)){var n=[].concat(e);return n[t]=r,n}var o={};for(var u in e)o[u]=e[u];return o[t]=r,o}(o,e,n)}));function nt(t){var r=Object.prototype.toString.call(t);return"[object Function]"===r||"[object AsyncFunction]"===r||"[object GeneratorFunction]"===r||"[object AsyncGeneratorFunction]"===r}var ot=function(t){var r=function(t){return{"@@transducer/init":$.init,"@@transducer/result":function(r){return t["@@transducer/result"](r)},"@@transducer/step":function(r,e){var n=t["@@transducer/step"](r,e);return n["@@transducer/reduced"]?{"@@transducer/value":n,"@@transducer/reduced":!0}:n}}}(t);return{"@@transducer/init":$.init,"@@transducer/result":function(t){return r["@@transducer/result"](t)},"@@transducer/step":function(t,e){return L(e)?D(r,t,e):D(r,t,[e])}}},ut=j(P(["fantasy-land/chain","chain"],j((function(t,r){return J(t,ot(r))})),(function(t,r){return"function"==typeof r?function(e){return t(r(e))(e)}:(e=!1,function t(r){for(var n,o,u,i=[],a=0,c=r.length;a<c;){if(L(r[a]))for(u=0,o=(n=e?t(r[a]):r[a]).length;u<o;)i[i.length]=n[u],u+=1;else i[i.length]=r[a];a+=1}return i})(J(t,r));var e})));var it=w((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function at(t,r){return function(){return r.call(this,t.apply(this,arguments))}}function ct(t,r){return function(){var e=arguments.length;if(0===e)return r();var n=arguments[e-1];return E(n)||"function"!=typeof n[t]?r.apply(this,arguments):n[t].apply(n,Array.prototype.slice.call(arguments,0,e-1))}}var st=_(ct("slice",(function(t,r,e){return Array.prototype.slice.call(e,t,r)}))),ft=w(ct("tail",st(1,1/0)));function lt(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return O(arguments[0].length,tt(at,arguments[0],ft(arguments)))}var pt=Z(0);function ht(t){return t}var dt=w(ht);function yt(t){for(var r,e=[];!(r=t.next()).done;)e.push(r.value);return e}function gt(t,r,e){for(var n=0,o=e.length;n<o;){if(t(r,e[n]))return!0;n+=1}return!1}var vt="function"==typeof Object.is?Object.is:function(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r};function mt(t,r,e,n){var o=yt(t);function u(t,r){return bt(t,r,e.slice(),n.slice())}return!gt((function(t,r){return!gt(u,r,t)}),yt(r),o)}function bt(t,r,e,n){if(vt(t,r))return!0;var o,u,i=it(t);if(i!==it(r))return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof r["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](r)&&"function"==typeof r["fantasy-land/equals"]&&r["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof r.equals)return"function"==typeof t.equals&&t.equals(r)&&"function"==typeof r.equals&&r.equals(t);switch(i){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(o=t.constructor,null==(u=String(o).match(/^function (\w*)/))?"":u[1]))return t===r;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof r||!vt(t.valueOf(),r.valueOf()))return!1;break;case"Date":if(!vt(t.valueOf(),r.valueOf()))return!1;break;case"Error":return t.name===r.name&&t.message===r.message;case"RegExp":if(t.source!==r.source||t.global!==r.global||t.ignoreCase!==r.ignoreCase||t.multiline!==r.multiline||t.sticky!==r.sticky||t.unicode!==r.unicode)return!1}for(var a=e.length-1;a>=0;){if(e[a]===t)return n[a]===r;a-=1}switch(i){case"Map":return t.size===r.size&&mt(t.entries(),r.entries(),e.concat([t]),n.concat([r]));case"Set":return t.size===r.size&&mt(t.values(),r.values(),e.concat([t]),n.concat([r]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=H(t);if(c.length!==H(r).length)return!1;var s=e.concat([t]),f=n.concat([r]);for(a=c.length-1;a>=0;){var l=c[a];if(!z(l,r)||!bt(r[l],t[l],s,f))return!1;a-=1}return!0}var xt=j((function(t,r){return bt(t,r,[],[])}));function wt(t,r){return function(t,r,e){var n,o;if("function"==typeof t.indexOf)switch(typeof r){case"number":if(0===r){for(n=1/r;e<t.length;){if(0===(o=t[e])&&1/o===n)return e;e+=1}return-1}if(r!=r){for(;e<t.length;){if("number"==typeof(o=t[e])&&o!=o)return e;e+=1}return-1}return t.indexOf(r,e);case"string":case"boolean":case"function":case"undefined":return t.indexOf(r,e);case"object":if(null===r)return t.indexOf(r,e)}for(;e<t.length;){if(xt(t[e],r))return e;e+=1}return-1}(r,t,0)>=0}function jt(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var Ot=function(t){return(t<10?"0":"")+t},St="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+Ot(t.getUTCMonth()+1)+"-"+Ot(t.getUTCDate())+"T"+Ot(t.getUTCHours())+":"+Ot(t.getUTCMinutes())+":"+Ot(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function _t(t){return"[object Object]"===Object.prototype.toString.call(t)}var Et=function(){function t(t,r){this.xf=r,this.f=t}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=$.result,t.prototype["@@transducer/step"]=function(t,r){return this.f(r)?this.xf["@@transducer/step"](t,r):t},t}(),At=j(P(["fantasy-land/filter","filter"],j((function(t,r){return new Et(t,r)})),(function(t,r){return _t(r)?D((function(e,n){return t(r[n])&&(e[n]=r[n]),e}),{},H(r)):function(t,r){for(var e=0,n=r.length,o=[];e<n;)t(r[e])&&(o[o.length]=r[e]),e+=1;return o}(t,r)}))),Pt=j((function(t,r){return At((e=t,function(){return!e.apply(this,arguments)}),r);var e}));var kt=w((function(t){return function t(r,e){var n=function(n){var o=e.concat([r]);return wt(n,o)?"<Circular>":t(n,o)},o=function(t,r){return T((function(r){return jt(r)+": "+n(t[r])}),r.slice().sort())};switch(Object.prototype.toString.call(r)){case"[object Arguments]":return"(function() { return arguments; }("+T(n,r).join(", ")+"))";case"[object Array]":return"["+T(n,r).concat(o(r,Pt((function(t){return/^\d+$/.test(t)}),H(r)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof r?"new Boolean("+n(r.valueOf())+")":r.toString();case"[object Date]":return"new Date("+(isNaN(r.valueOf())?n(NaN):jt(St(r)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof r?"new Number("+n(r.valueOf())+")":1/r==-1/0?"-0":r.toString(10);case"[object String]":return"object"==typeof r?"new String("+n(r.valueOf())+")":jt(r);case"[object Undefined]":return"undefined";default:if("function"==typeof r.toString){var u=r.toString();if("[object Object]"!==u)return u}return"{"+o(r,H(r)).join(", ")+"}"}}(t,[])})),$t=j((function(t,r){if(E(t)){if(E(r))return t.concat(r);throw new TypeError(kt(r)+" is not an array")}if(M(t)){if(M(r))return t+r;throw new TypeError(kt(r)+" is not a string")}if(null!=t&&nt(t["fantasy-land/concat"]))return t["fantasy-land/concat"](r);if(null!=t&&nt(t.concat))return t.concat(r);throw new TypeError(kt(t)+' does not have a method named "concat" or "fantasy-land/concat"')})),Tt=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return t.prototype.add=function(t){return!Mt(t,!0,this)},t.prototype.has=function(t){return Mt(t,!1,this)},t}();function Mt(t,r,e){var n,o=typeof t;switch(o){case"string":case"number":return 0===t&&1/t==-1/0?!!e._items["-0"]||(r&&(e._items["-0"]=!0),!1):null!==e._nativeSet?r?(n=e._nativeSet.size,e._nativeSet.add(t),e._nativeSet.size===n):e._nativeSet.has(t):o in e._items?t in e._items[o]||(r&&(e._items[o][t]=!0),!1):(r&&(e._items[o]={},e._items[o][t]=!0),!1);case"boolean":if(o in e._items){var u=t?1:0;return!!e._items[o][u]||(r&&(e._items[o][u]=!0),!1)}return r&&(e._items[o]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==e._nativeSet?r?(n=e._nativeSet.size,e._nativeSet.add(t),e._nativeSet.size===n):e._nativeSet.has(t):o in e._items?!!wt(t,e._items[o])||(r&&e._items[o].push(t),!1):(r&&(e._items[o]=[t]),!1);case"undefined":return!!e._items[o]||(r&&(e._items[o]=!0),!1);case"object":if(null===t)return!!e._items.null||(r&&(e._items.null=!0),!1);default:return(o=Object.prototype.toString.call(t))in e._items?!!wt(t,e._items[o])||(r&&e._items[o].push(t),!1):(r&&(e._items[o]=[t]),!1)}}var Lt=function(){function t(t,r){this.xf=r,this.n=t,this.i=0}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=$.result,t.prototype["@@transducer/step"]=function(t,r){this.i+=1;var e=0===this.n?t:this.xf["@@transducer/step"](t,r);return this.n>=0&&this.i>=this.n?k(e):e},t}(),qt=j(P(["take"],j((function(t,r){return new Lt(t,r)})),(function(t,r){return st(0,t<0?1/0:t,r)})));function Nt(t,r){return qt(t<r.length?r.length-t:0,r)}var Ct=function(){function t(t,r){this.xf=r,this.pos=0,this.full=!1,this.acc=new Array(t)}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,r){return this.full&&(t=this.xf["@@transducer/step"](t,this.acc[this.pos])),this.store(r),t},t.prototype.store=function(t){this.acc[this.pos]=t,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},t}(),It=j(P([],j((function(t,r){return new Ct(t,r)})),Nt)),Ft=Z(-1),Dt=function(){function t(t,r){this.xf=r,this.f=t,this.found=!1}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,void 0)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,r){return this.f(r)&&(this.found=!0,t=k(this.xf["@@transducer/step"](t,r))),t},t}(),Ut=j(P(["find"],j((function(t,r){return new Dt(t,r)})),(function(t,r){for(var e=0,n=r.length;e<n;){if(t(r[e]))return r[e];e+=1}}))),Gt=function(){function t(t,r){this.xf=r,this.f=t,this.idx=-1,this.found=!1}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=function(t){return this.found||(t=this.xf["@@transducer/step"](t,-1)),this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,r){return this.idx+=1,this.f(r)&&(this.found=!0,t=k(this.xf["@@transducer/step"](t,this.idx))),t},t}(),zt=j(P([],j((function(t,r){return new Gt(t,r)})),(function(t,r){for(var e=0,n=r.length;e<n;){if(t(r[e]))return e;e+=1}return-1}))),Rt=w((function(t){for(var r={},e=0;e<t.length;)r[t[e][0]]=t[e][1],e+=1;return r})),Bt=j((function(t,r){if(0===t.length||rt(r))return!1;for(var e=r,n=0;n<t.length;){if(rt(e)||!z(t[n],e))return!1;e=e[t[n]],n+=1}return!0})),Yt=j((function(t,r){return Bt([t],r)})),Vt=function(){function t(t,r){this.xf=r,this.f=t,this.set=new Tt}return t.prototype["@@transducer/init"]=$.init,t.prototype["@@transducer/result"]=$.result,t.prototype["@@transducer/step"]=function(t,r){return this.set.add(this.f(r))?this.xf["@@transducer/step"](t,r):t},t}(),Wt=j(P([],j((function(t,r){return new Vt(t,r)})),(function(t,r){for(var e,n,o=new Tt,u=[],i=0;i<r.length;)e=t(n=r[i]),o.add(e)&&u.push(n),i+=1;return u})))(dt),Kt=j((function(t,r){return S(t+1,(function(){var e=arguments[t];if(null!=e&&nt(e[r]))return e[r].apply(e,Array.prototype.slice.call(arguments,0,t));throw new TypeError(kt(e)+' does not have a method named "'+r+'"')}))})),Ht=j((function(t,r){return function(e){return function(n){return J((function(t){return r(t,n)}),e(t(n)))}}})),Jt=j((function(t,r){return t.map((function(t){for(var e,n=r,o=0;o<t.length;){if(null==n)return;e=t[o],n=X(e)?Z(e,n):n[e],o+=1}return n}))})),Xt=j((function(t,r){return Jt([t],r)[0]})),Zt=w((function(t){return Ht(Xt(t),et(t))})),Qt=_((function(t,r,e){var n,o={};for(n in r)z(n,r)&&(o[n]=z(n,e)?t(n,r[n],e[n]):r[n]);for(n in e)z(n,e)&&!z(n,o)&&(o[n]=e[n]);return o})),tr=_((function t(r,e,n){return Qt((function(e,n,o){return _t(n)&&_t(o)?t(r,n,o):r(e,n,o)}),e,n)})),rr=_((function(t,r,e){return xt(r,Q(t,e))})),er=Kt(1,"split");var nr=j((function(t,r){if(e=t,"[object RegExp]"!==Object.prototype.toString.call(e))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+kt(t));var e;return function(t){return new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":""))}(t).test(r)})),or=w((function(t){var r=[];for(var e in t)z(e,t)&&(r[r.length]=[e,t[e]]);return r})),ur=function(t){return{value:t,"fantasy-land/map":function(){return this}}},ir=j((function(t,r){return t(ur)(r).value})),ar=j((function(t,r){for(var e=[],n=0,o=Math.min(t.length,r.length);n<o;)e[n]=[t[n],r[n]],n+=1;return e})),cr={flattenObj:function(t){return Rt(function t(r){return ut((function(r){var e=y(r,2),n=e[0],o=e[1];return"Object"===it(o)||"Array"===it(o)?J((function(t){var r=y(t,2),e=r[0],o=r[1];return["".concat(n,".").concat(e),o]}),t(o)):[[n,o]]}),or(r))}(t))},pathSplit:lt(er("/"),At((function(t){return t.length>0}))),mapToPaths:function(t){return J((function(t){return t.split(".")}),H(t))},mapToLenses:function(t){return J((function(t){return Zt(t)}),t)},mapToViews:function(t,r){return J((function(t){return ir(t,r)}),t)},mergeDeepWithKeyAll:function(t,r){return tt((function(r,e){return tr(t,r,e)}),{},r)}};function sr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function fr(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?sr(Object(e),!0).forEach((function(r){v(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):sr(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var lr,pr=/^binding:.*/,hr=["anyOf","allOf","oneOf"],dr=[],yr=function(t){return function(){var e=o(u.mark((function e(n){var o,i,a,c,s,f,l,p;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t["binding:source"].transformation){e.next=8;break}return e.next=3,r.post("/transformations/".concat(t["binding:source"].transformation),Array.isArray(n)?{incoming:{root:n}}:{incoming:n}).catch((function(t){return t}));case 3:if(o=e.sent,Array.isArray(o.data)||"object"!==g(o.data)){e.next=7;break}return i=y(Object.entries(o.data)[0],2),a=i[1],e.abrupt("return",a);case 7:return e.abrupt("return",o.data);case 8:if(c=cr.pathSplit(t["binding:source"].propertyPointer),s=Zt(c),f=ir(s,n),!t["binding:target"]||"/enum"!==t["binding:target"].propertyPointer&&"/enumNames"!==t["binding:target"].propertyPointer||f||(f=[]),t["binding:source"].keyPointer&&"/"!==t["binding:source"].keyPointer){e.next=14;break}return e.abrupt("return",f);case 14:return l=cr.pathSplit(t["binding:source"].keyPointer),p=Zt(l),e.abrupt("return",J((function(t){return ir(p,t)}),f));case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},gr={uniqPaths:lt(cr.flattenObj,cr.mapToPaths,(function(t){return At((function(t){return zt(nr(pr))(t)>-1}),t)}),(function(t){return J((function(t){var r=zt(nr(pr))(t);return It(t.length-r,t)}),t)}),Wt),configs:function(t,r){return cr.mapToViews(cr.mapToLenses(t),r)},requests:function(t){return J((function(t){return e=(r=t)["binding:method"],n=r["binding:body"],o=r["binding:hyperSchema"],u=cr.pathSplit(r["binding:link"].$ref),i=ir(Zt(u),o),a=Ut(rr("rel",r["binding:link"].rel),i),fr(fr({method:e,timeout:r["binding:timeout"],baseURL:o.base,url:a.href},n&&{data:n}),{},{headers:{"Content-Type":a.targetMediaType}});var r,e,n,o,u,i,a}),t)},responses:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.filter((function(t){return!t.url.includes(":")}));return Promise.all(J((function(t){return r.request(t).then((function(t){return new Promise((function(r){r(t)}))})).catch((function(t){return new Promise((function(r){console.error("Error: ".concat(JSON.stringify(t))),r({type:"error",message:t.message})}))}))}),e))},sources:(lr=o(u.mark((function t(r,e,n){var o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.length){t.next=2;break}return t.abrupt("return",[]);case 2:return(o=ar(r,e)).forEach((function(t,r){var e=pt(t);if(Yt("type",e)&&"error"===e.type){var o=et([n[r]],e.message,{});dr.push(o)}})),o=At((function(t){var r=pt(t);return!(Yt("type",r)&&"error"===r.type)||void 0!==r}),o),t.abrupt("return",Promise.all(J((function(t){var r=pt(t),e=Ft(t);return yr(e)(r.data)}),o)));case 7:case"end":return t.stop()}}),t)}))),function(t,r,e){return lr.apply(this,arguments)}),targetPaths:function(t,r){var e=ar(t,r);return J((function(t){var r=pt(t),e=Ft(t),n=cr.pathSplit(e["binding:target"].propertyPointer);return[].concat(l(r),l(n))}),e)},insertToSchema:function(t,r,e){var n={};t.forEach((function(t,r){var e="";t.forEach((function(r,n){var o=hr.includes(t[n-1]||"");(!Number(r)&&0!==Number(r)||o)&&(e+=r+(n!==t.length-1?",":""))})),Object.prototype.hasOwnProperty.call(n,e)&&n[e].targets?n[e].targets.push(r):n[e]={targets:[r],targetPath:e.split(",")}}));var o=Object.values(n).map((function(t){var e=t.targets.flatMap((function(t){return r&&r.length>0?r[t]:[]}));if(t.targets.length>1){var n=l(new Set(e));return et(t.targetPath,{$set:n},{})}return et(t.targetPath,{$set:e},{})})),u=cr.mergeDeepWithKeyAll($t,o.filter((function(t){return null!=t})));return{boundSchema:b(e,u),errors:dr}}},vr={compose:function(t){var r=arguments;return o(u.mark((function e(){var n,o,i,a,c,s,f;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},o=gr.uniqPaths(t),i=gr.configs(o,t),a=gr.targetPaths(o,i),c=gr.requests(i),e.next=7,gr.responses(c);case 7:return s=e.sent,e.next=10,gr.sources(s,i,o);case 10:return f=e.sent,e.abrupt("return",gr.insertToSchema(a,f,n).boundSchema);case 12:case"end":return e.stop()}}),e)})))()},composeAll:function(t){var r=arguments;return o(u.mark((function e(){var n,o,i,a,c,s,f;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},o=gr.uniqPaths(t),i=gr.configs(o,t),a=gr.targetPaths(o,i),c=gr.requests(i),e.next=7,gr.responses(c);case 7:return s=e.sent,e.next=10,gr.sources(s,i,o);case 10:return f=e.sent,e.abrupt("return",gr.insertToSchema(a,f,n));case 12:case"end":return e.stop()}}),e)})))()}};module.exports=vr;