react-jsonschema-form-pagination
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.JSONSchemaForm=e(require("react")):t.JSONSchemaForm=e(t.React)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=6)}([function(e,r){e.exports=t},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(){return!1}function i(t,e){return e&&e[t]&&e[t][v]?e[t][v][0]:b}function u(t,e){var r=Object.keys(t.properties).map(function(t){return i(t,e)});return Array.from(new Set(r))}function a(t){var e=(0,g.default)(t);return Object.keys(e).forEach(function(t){var r=e[t][v];r&&r.length>1?r.shift():delete e[t][v]}),e}function f(t,e,r){r.required.includes(e)&&t.required.push(e),t.properties[e]=r.properties[e]}function s(t,e,r){var n=Object.assign({},(0,g.default)(e),{required:[],properties:{}});return Object.keys(e.properties).filter(function(e){return i(e,r)===t}).forEach(function(t){return f(n,t,e)}),n}function c(t,e,r){var n=u(t,e),o=a(e),i=n.reduce(function(n,i){var u=s(i,t,e);return n[i]=i!==b?c(u,o,r):u,n},{}),f=n.map(function(t){var e=r.find(function(e){return e.tabID===t});return e||{tabID:t,name:t}});return new m(f,o,i)}function l(t){var e=(0,g.default)(t);return Object.keys(e).forEach(function(t){e[t]&&e[t][v]&&!Array.isArray(e[t][v])&&(e[t][v]=[e[t][v]])}),e}function h(t){var e=(0,g.default)(t);return e.required||(e.required=[]),e}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];return c(h(t),l(e),r)}Object.defineProperty(e,"__esModule",{value:!0}),e.UI_TAB_ID=e.GENERIC_TAB=void 0;var y=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.isDevelopment=o,e.splitInLayers=p;var d=r(14),g=function(t){return t&&t.__esModule?t:{default:t}}(d),b=e.GENERIC_TAB="default",v=e.UI_TAB_ID="ui:tabID",m=function(){function t(e,r,o){n(this,t),w.call(this),this.tabs=e,this.uiSchema=r,this.conf=o,this.defaultTab={tabs:e,schema:o[b],uiSchema:r},this.activeTab=this.chooseActive(e)}return y(t,[{key:"chooseActive",value:function(t){var e=t.filter(function(t){return t.tabID!=b});return e.length>0?e[0].tabID:b}}]),t}(),w=function(){var t=this;this.doUpdateActiveTabs=function(e,r){return r===e.length?t.activeTab!==b&&(e.push(t.activeTab),t.conf[t.activeTab].doUpdateActiveTabs(e,r+1)):(t.activeTab=e[r],t.conf[e[r]].doUpdateActiveTabs(e,r+1)),e},this.updateActiveTabs=function(e){return t.doUpdateActiveTabs(e,0)},this.toSubForms=function(e){var r=[],n=e[0];if(r.push(Object.assign({},t.defaultTab,{activeTab:n})),0===e.length)return r;if(n!==b){var o=t.conf[n],i=e.slice(1);o.toSubForms(i).forEach(function(t){return r.push(t)})}return r}}},function(t,e,r){"use strict";"function"==typeof Symbol&&Symbol.iterator;t.exports=r(7)()},function(t,e,r){"use strict";function n(t){return null===t||void 0===t}function o(t){return!(!t||"object"!==(void 0===t?"undefined":u(t))||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,r){var i,l;if(n(t)||n(e))return!1;if(t.prototype!==e.prototype)return!1;if(s(t))return!!s(e)&&(t=a.call(t),e=a.call(e),c(t,e,r));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}try{var h=f(t),p=f(e)}catch(t){return!1}if(h.length!=p.length)return!1;for(h.sort(),p.sort(),i=h.length-1;i>=0;i--)if(h[i]!=p[i])return!1;for(i=h.length-1;i>=0;i--)if(l=h[i],!c(t[l],e[l],r))return!1;return(void 0===t?"undefined":u(t))===(void 0===e?"undefined":u(e))}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=Array.prototype.slice,f=r(11),s=r(12),c=t.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=(void 0===t?"undefined":u(t))&&"object"!=(void 0===e?"undefined":u(e))?r.strict?t===e:t==e:i(t,e,r))}},function(t,e,r){"use strict";(function(t){function n(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(n()<e)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=i.prototype):(null===t&&(t=new i(e)),t.length=e),t}function i(t,e,r){if(!(i.TYPED_ARRAY_SUPPORT||this instanceof i))return new i(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?h(t,e,r,n):"string"==typeof e?c(t,e,r):p(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e,r,n){return a(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function s(t,e){if(a(e),t=o(t,e<0?0:0|y(e)),!i.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function c(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!i.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(e,r);t=o(t,n);var u=t.write(e,r);return u!==n&&(t=t.slice(0,u)),t}function l(t,e){var r=e.length<0?0:0|y(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),i.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=i.prototype):t=l(t,e),t}function p(t,e){if(i.isBuffer(e)){var r=0|y(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||X(e.length)?o(t,0):l(t,e);if("Buffer"===e.type&&$(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(t){if(t>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(n)return V(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return j(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return R(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,o){function i(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,f/=2,r/=2}var s;if(o){var c=-1;for(s=r;s<a;s++)if(i(t,s)===i(e,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===f)return c*u}else-1!==c&&(s-=s-c),c=-1}else for(r+f>a&&(r=a-f),s=r;s>=0;s--){for(var l=!0,h=0;h<f;h++)if(i(t,s+h)!==i(e,h)){l=!1;break}if(l)return s}return-1}function E(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function _(t,e,r,n){return K(V(e,t.length-r),t,r,n)}function A(t,e,r,n){return K(G(e),t,r,n)}function T(t,e,r,n){return A(t,e,r,n)}function S(t,e,r,n){return K(W(e),t,r,n)}function O(t,e,r,n){return K(J(e,t.length-r),t,r,n)}function R(t,e,r){return 0===e&&r===t.length?H.fromByteArray(t):H.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],u=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a<=r){var f,s,c,l;switch(a){case 1:i<128&&(u=i);break;case 2:f=t[o+1],128==(192&f)&&(l=(31&i)<<6|63&f)>127&&(u=l);break;case 3:f=t[o+1],s=t[o+2],128==(192&f)&&128==(192&s)&&(l=(15&i)<<12|(63&f)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:f=t[o+1],s=t[o+2],c=t[o+3],128==(192&f)&&128==(192&s)&&128==(192&c)&&(l=(15&i)<<18|(63&f)<<12|(63&s)<<6|63&c)>65535&&l<1114112&&(u=l)}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=a}return D(n)}function D(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return r}function j(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=z(t[i]);return o}function U(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,o,u){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<u)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function Y(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function M(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return o||k(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||k(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function F(t){if(t=q(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function J(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function W(t){return H.toByteArray(F(t))}function K(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t){return t!==t}/*! | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.JSONSchemaForm=e(require("react")):t.JSONSchemaForm=e(t.React)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=7)}([function(t,e,r){"use strict";function n(){return!1}function o(t){return!t||!t.properties||0===Object.keys(t.properties).length}function i(t,e){return e&&e[t]&&e[t][d]?e[t][d][0]:y}function u(t,e){var r=Object.keys(t.properties).map(function(t){return i(t,e)}),n=Object.keys(e).map(function(t){return i(t,e)}),o=r.concat(n).concat([y]);return Array.from(new Set(o))}function a(t){Object.keys(t).forEach(function(e){t[e]&&t[e][d]&&!Array.isArray(t[e][d])&&(t[e][d]=[t[e][d]])})}function f(t){t[v]||(t[v]={}),Object.keys(t[v]).forEach(function(e){var r=t[v][e];Array.isArray(r)||(t[v][e]=[r])})}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,p.default)(t);return a(e),f(e),e}function c(t){t.required||(t.required=[])}function l(t){var e=(0,p.default)(t);return c(e),e}Object.defineProperty(e,"__esModule",{value:!0}),e.toError=e.UI_TAB_ALIAS=e.UI_TAB_ID=e.GENERIC_TAB=void 0,e.isDevelopment=n,e.isEmptySchema=o,e.findLayer=i,e.listLayers=u,e.normalizeUiSchema=s,e.normalizeSchema=l;var h=r(2),p=function(t){return t&&t.__esModule?t:{default:t}}(h),y=e.GENERIC_TAB="default",d=e.UI_TAB_ID="ui:tabID",v=e.UI_TAB_ALIAS="ui:tabAlias";e.toError=function(t){console.error(t)}},function(e,r){e.exports=t},function(t,e,r){"use strict";t.exports=r(16)},function(t,e,r){"use strict";"function"==typeof Symbol&&Symbol.iterator;t.exports=r(9)()},function(t,e,r){"use strict";function n(t){return null===t||void 0===t}function o(t){return!(!t||"object"!==(void 0===t?"undefined":u(t))||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,r){var i,l;if(n(t)||n(e))return!1;if(t.prototype!==e.prototype)return!1;if(s(t))return!!s(e)&&(t=a.call(t),e=a.call(e),c(t,e,r));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}try{var h=f(t),p=f(e)}catch(t){return!1}if(h.length!=p.length)return!1;for(h.sort(),p.sort(),i=h.length-1;i>=0;i--)if(h[i]!=p[i])return!1;for(i=h.length-1;i>=0;i--)if(l=h[i],!c(t[l],e[l],r))return!1;return(void 0===t?"undefined":u(t))===(void 0===e?"undefined":u(e))}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=Array.prototype.slice,f=r(13),s=r(14),c=t.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=(void 0===t?"undefined":u(t))&&"object"!=(void 0===e?"undefined":u(e))?r.strict?t===e:t==e:i(t,e,r))}},function(t,e,r){"use strict";(function(t){function n(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(n()<e)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=i.prototype):(null===t&&(t=new i(e)),t.length=e),t}function i(t,e,r){if(!(i.TYPED_ARRAY_SUPPORT||this instanceof i))return new i(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?h(t,e,r,n):"string"==typeof e?c(t,e,r):p(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e,r,n){return a(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function s(t,e){if(a(e),t=o(t,e<0?0:0|y(e)),!i.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function c(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!i.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r);t=o(t,n);var u=t.write(e,r);return u!==n&&(t=t.slice(0,u)),t}function l(t,e){var r=e.length<0?0:0|y(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),i.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=i.prototype):t=l(t,e),t}function p(t,e){if(i.isBuffer(e)){var r=0|y(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||X(e.length)?o(t,0):l(t,e);if("Buffer"===e.type&&$(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(t){if(t>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),i.alloc(+t)}function v(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return j(this,e,r);case"base64":return R(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,o){function i(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,f/=2,r/=2}var s;if(o){var c=-1;for(s=r;s<a;s++)if(i(t,s)===i(e,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===f)return c*u}else-1!==c&&(s-=s-c),c=-1}else for(r+f>a&&(r=a-f),s=r;s>=0;s--){for(var l=!0,h=0;h<f;h++)if(i(t,s+h)!==i(e,h)){l=!1;break}if(l)return s}return-1}function _(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function E(t,e,r,n){return K(G(e,t.length-r),t,r,n)}function A(t,e,r,n){return K(V(e),t,r,n)}function T(t,e,r,n){return A(t,e,r,n)}function S(t,e,r,n){return K(W(e),t,r,n)}function O(t,e,r,n){return K(J(e,t.length-r),t,r,n)}function R(t,e,r){return 0===e&&r===t.length?H.fromByteArray(t):H.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],u=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a<=r){var f,s,c,l;switch(a){case 1:i<128&&(u=i);break;case 2:f=t[o+1],128==(192&f)&&(l=(31&i)<<6|63&f)>127&&(u=l);break;case 3:f=t[o+1],s=t[o+2],128==(192&f)&&128==(192&s)&&(l=(15&i)<<12|(63&f)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:f=t[o+1],s=t[o+2],c=t[o+3],128==(192&f)&&128==(192&s)&&128==(192&c)&&(l=(15&i)<<18|(63&f)<<12|(63&s)<<6|63&c)>65535&&l<1114112&&(u=l)}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=a}return D(n)}function D(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return r}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function j(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=q(t[i]);return o}function U(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,o,u){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<u)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function x(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function k(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Y(t,e,r,n,o){return o||L(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||L(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function F(t){if(t=z(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function J(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function W(t){return H.toByteArray(F(t))}function K(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t){return t!==t}/*! | ||
* The buffer module from node.js, for the browser. | ||
@@ -7,3 +7,3 @@ * | ||
*/ | ||
var H=r(18),Z=r(19),$=r(20);e.Buffer=i,e.SlowBuffer=d,e.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=n(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,r){return u(null,t,e,r)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,r){return f(null,t,e,r)},i.allocUnsafe=function(t){return s(null,t)},i.allocUnsafeSlow=function(t){return s(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,u=Math.min(r,n);o<u;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];if(!i.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},i.byteLength=g,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},i.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):b.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var u=o-n,a=r-e,f=Math.min(u,a),s=this.slice(n,o),c=t.slice(e,r),l=0;l<f;++l)if(s[l]!==c[l]){u=s[l],a=c[l];break}return u<a?-1:a<u?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return A(this,t,e,r);case"latin1":case"binary":return T(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n;if(i.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=i.prototype;else{var o=e-t;n=new i(o,void 0);for(var u=0;u<o;++u)n[u]=this[u+t]}return n},i.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},i.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},i.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),Z.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),Z.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),Z.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),Z.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){x(this,t,e,r,Math.pow(2,8*r)-1,0)}var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){x(this,t,e,r,Math.pow(2,8*r)-1,0)}var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Y(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Y(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):M(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);x(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Y(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Y(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):M(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):M(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,u=n-r;if(this===t&&r<e&&e<n)for(o=u-1;o>=0;--o)t[o+e]=this[o+r];else if(u<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+u),e);return u},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var u;if("number"==typeof t)for(u=e;u<r;++u)this[u]=t;else{var a=i.isBuffer(t)?t:V(new i(t,n).toString()),f=a.length;for(u=0;u<r-e;++u)this[u+e]=a[u%f]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,r(17))},function(t,e,r){"use strict";(function(t){function r(t,e){if("[object Array]"!==o.call(t))throw new TypeError("array must be an Array");var r=void 0,n=void 0,i=void 0;for(r=0,n=t.length;r<n;++r)if((i=t[r])===e||i!==i&&e!==e)return r;return-1}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.__esModule=!0;var o=Object.prototype.toString,i=void 0!==t?function(e){return t.isBuffer(e)}:function(){return!1},u="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e=void 0===t?"undefined":n(t);if(null===t||"function"!==e&&"object"!==e)throw new TypeError("obj must be an Object");var r=[],o=void 0;for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(o);return r},a="function"==typeof Symbol?function(t){return Object.getOwnPropertySymbols(t)}:function(){return[]};e.getKeys=u,e.getSymbols=a,e.indexOf=r,e.isBuffer=i}).call(e,r(4).Buffer)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=(0,b.default)(t),r=function(t){function r(t){o(this,r);var e=i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));n.call(e);var u=e.props,a=u.formData,f=u.tabData,s=u.schema,c=u.uiSchema;e.layers=(0,v.splitInLayers)(s,c,f);var l=e.layers.updateActiveTabs([],0);return e.state={formData:a,activeTabs:l},e}return u(r,t),s(r,[{key:"componentWillReceiveProps",value:function(t){var e=t.tabData,r=t.schema,n=t.uiSchema,o=t.formData;(0,d.default)({tabData:e,schema:r,uiSchema:n},{tabData:this.props.tabData,schema:this.props.schema,uiSchema:this.props.uiSchema})||(this.layers=(0,v.splitInLayers)(r,n,e)),this.sameData(o)||(this.formData=o,this.setState({formData:o}))}},{key:"shouldComponentUpdate",value:function(t,e){if(!(0,d.default)(e.activeTabs,this.state.activeTabs))return!0;var r=(0,d.default)(Object.assign({},this.props,{formData:{}}),Object.assign({},t,{formData:{}}));if(!r)return!0;var n=(0,d.default)(Object.assign({},this.state,{formData:this.formData}),e);if(!n)return!0;var o=this.sameData(t.formData);return!r||!n||!o}},{key:"render",value:function(){var t=this,r=this.layers.toSubForms(this.state.activeTabs);return l.default.createElement("div",null,r.map(function(r,n){var o=Object.assign({},t.props,r,{formData:t.formData});return l.default.createElement(e,f({key:n},o,{onChange:t.handleOnChange,onTabChange:t.handleTabChange(n)}))}))}}]),r}(c.Component),n=function(){var t=this;this.sameData=function(e){return(0,d.default)(t.props.formData,e)||(0,d.default)(t.formData,e)},this.handleTabChange=function(e){return function(r){var n=r.tabID,o=t.state.activeTabs.slice(0,e+1);o[e]=n,t.layers.updateActiveTabs(o),t.setState({activeTabs:o})}},this.handleOnChange=function(e){t.formData=e.formData,t.setState({formData:e.formData}),t.props.onChange&&t.props.onChange(e)}};return(0,v.isDevelopment)()&&(r.propTypes={tabData:p.default.array.isRequired}),r}Object.defineProperty(e,"__esModule",{value:!0});var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.default=a;var c=r(0),l=n(c),h=r(2),p=n(h),y=r(3),d=n(y),g=r(13),b=n(g),v=r(1)},function(t,e,r){"use strict";var n=r(8),o=r(9),i=r(10);t.exports=function(){function t(t,e,r,n,u,a){a!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return r.checkPropTypes=n,r.PropTypes=r,r}},function(t,e,r){"use strict";function n(t){return function(){return t}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,r){"use strict";function n(t,e,r,n,i,u,a,f){if(o(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,u,a,f],l=0;s=new Error(e.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(t){};t.exports=n},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,r){"use strict";function n(t){var e=[];for(var r in t)e.push(r);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e,r){"use strict";function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function o(t){return t&&"object"==(void 0===t?"undefined":i(t))&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=u?n:o,e.supported=n,e.unsupported=o},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),f=r(0),s=n(f),c=r(3),l=n(c),h=r(2),p=n(h),y=r(1),d=r(21),g=n(d),b=function(t){var e=function(t){function e(t){o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.call(n);var u=n.props.formData;return n.state={formData:u},n}return u(e,t),a(e,[{key:"componentWillReceiveProps",value:function(t){var e=t.formData;this.sameData(e)||(this.formData=e,this.setState({formData:e}))}},{key:"shouldComponentUpdate",value:function(t,e){var r=(0,l.default)(Object.assign({},this.props,{formData:{}}),Object.assign({},t,{formData:{}})),n=(0,l.default)(Object.assign({},this.state,{formData:this.formData}),e),o=this.sameData(t.formData);return!r||!n||!o}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement("div",{className:"row"},this.renderForm()),s.default.createElement("div",{className:"row"},s.default.createElement("div",{className:"col-md-12 form-group field field-object"},this.renderTabs())))}}]),e}(f.Component),r=function(){var e=this;this.sameData=function(t){return(0,l.default)(e.props.formData,t)||(0,l.default)(e.formData,t)},this.handleOnChange=function(t){e.formData=t.formData,e.setState({formData:t.formData}),e.props.onChange&&e.props.onChange(t)},this.renderForm=function(){if(e.props.schema){var r=e.state.formData,n=Object.assign({},e.props,{formData:r,onChange:e.handleOnChange});return s.default.createElement(t,n,s.default.createElement("div",null))}return s.default.createElement("div",null)},this.renderTabs=function(){var t=e.props,r=t.tabs,n=t.activeTab,o=t.onTabChange;return s.default.createElement(g.default,{tabs:r,activeTab:n,onTabChange:o})}};return(0,y.isDevelopment)()&&(e.propTypes={tabs:p.default.array}),e};e.default=b},function(t,e,r){"use strict";t.exports=r(15)},function(t,e,r){"use strict";function n(t){}function o(t){var e=arguments.length<=1||void 0===arguments[1]?n:arguments[1];if(null===t)return null;var r=(0,a.copyValue)(t);if(null!==r)return r;var o=(0,a.copyCollection)(t,e),u=null!==o?o:t;return i(t,e,u,[t],[u])}function i(t,e,r,n,o){if(null===t)return null;var s=(0,a.copyValue)(t);if(null!==s)return s;var c=(0,f.getKeys)(t).concat((0,f.getSymbols)(t)),l=void 0,h=void 0,p=void 0,y=void 0,d=void 0,g=void 0,b=void 0,v=void 0;for(l=0,h=c.length;l<h;++l)p=c[l],y=t[p],d=(0,f.indexOf)(n,y),g=void 0,b=void 0,v=void 0,-1===d?(g=(0,a.copy)(y,e),b=null!==g?g:y,null!==y&&/^(?:function|object)$/.test(void 0===y?"undefined":u(y))&&(n.push(y),o.push(b))):v=o[d],r[p]=v||i(y,e,b,n,o);return r}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.__esModule=!0;var a=r(16),f=r(5);e.default=o,t.exports=e.default},function(t,e,r){"use strict";(function(t){function n(t,e){var r=i(t);return null!==r?r:o(t,e)}function o(e,r){if("function"!=typeof r)throw new TypeError("customizer is must be a Function");if("function"==typeof e){var n=String(e);return/^\s*function\s*\S*\([^\)]*\)\s*{\s*\[native code\]\s*}/.test(n)?e:new Function("return "+String(n))()}var o=f.call(e);if("[object Array]"===o)return[];if("[object Object]"===o&&e.constructor===Object)return{};if("[object Date]"===o)return new Date(e.getTime());if("[object RegExp]"===o){var i=String(e),u=i.lastIndexOf("/");return new RegExp(i.slice(1,u),i.slice(u+1))}if((0,a.isBuffer)(e)){var s=new t(e.length);return e.copy(s),s}var c=r(e);return void 0!==c?c:null}function i(t){var e=void 0===t?"undefined":u(t);return null!==t&&"object"!==e&&"function"!==e?t:null}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.__esModule=!0,e.copyValue=e.copyCollection=e.copy=void 0;var a=r(5),f=Object.prototype.toString;e.copy=n,e.copyCollection=o,e.copyValue=i}).call(e,r(4).Buffer)},function(t,e,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}t.exports=n},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-n(t)}function i(t){var e,r,o,i,u,a=t.length;i=n(t),u=new l(3*a/4-i),r=i>0?a-4:a;var f=0;for(e=0;e<r;e+=4)o=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],u[f++]=o>>16&255,u[f++]=o>>8&255,u[f++]=255&o;return 2===i?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,u[f++]=255&o):1===i&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,u[f++]=o>>8&255,u[f++]=255&o),u}function u(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function a(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(u(n));return o.join("")}function f(t){for(var e,r=t.length,n=r%3,o="",i=[],u=0,f=r-n;u<f;u+=16383)i.push(a(t,u,u+16383>f?f:u+16383));return 1===n?(e=t[r-1],o+=s[e>>2],o+=s[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=s[e>>10],o+=s[e>>4&63],o+=s[e<<2&63],o+="="),i.push(o),i.join("")}e.byteLength=o,e.toByteArray=i,e.fromByteArray=f;for(var s=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=h.length;p<y;++p)s[p]=h[p],c[h.charCodeAt(p)]=p;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(t,e,r){"use strict";e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,f=(1<<a)-1,s=f>>1,c=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[e+l],l+=h,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=n;c>0;u=256*u+t[e+l],l+=h,c-=8);if(0===i)i=1-s;else{if(i===f)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=s}return(p?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,a,f,s=8*i-o-1,c=(1<<s)-1,l=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=c):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),e+=u+l>=1?h/f:h*Math.pow(2,1-l),e*f>=2&&(u++,f/=2),u+l>=c?(a=0,u=c):u+l>=1?(a=(e*f-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=y,a/=256,o-=8);for(u=u<<o|a,s+=o;s>0;t[r+p]=255&u,p+=y,u/=256,s-=8);t[r+p-y]|=128*d}},function(t,e,r){"use strict";var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t){var e=t.activeTab,r=t.tabs,n=t.onTabChange,o=r.filter(function(t){return t.tabID!==s.GENERIC_TAB});return o.length>0?u.default.createElement("ul",{className:"nav nav-pills"},o.map(function(t,r){return u.default.createElement(f.default,{key:r,data:t,isActive:e===t.tabID,handleClick:function(){return n(t)}})})):u.default.createElement("div",null)}Object.defineProperty(e,"__esModule",{value:!0});var i=r(0),u=n(i),a=r(22),f=n(a),s=r(1);e.default=o},function(t,e,r){"use strict";function n(t){var e=t.handleClick,r=t.isActive,n=t.data.name;return i.default.createElement("li",{onClick:e,className:r?"active":null},i.default.createElement("a",null,n))}Object.defineProperty(e,"__esModule",{value:!0});var o=r(0),i=function(t){return t&&t.__esModule?t:{default:t}}(o);e.default=n}])}); | ||
var H=r(19),Z=r(20),$=r(21);e.Buffer=i,e.SlowBuffer=d,e.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=n(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,r){return u(null,t,e,r)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,r){return f(null,t,e,r)},i.allocUnsafe=function(t){return s(null,t)},i.allocUnsafeSlow=function(t){return s(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,u=Math.min(r,n);o<u;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!$(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];if(!i.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},i.byteLength=v,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},i.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):b.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var u=o-n,a=r-e,f=Math.min(u,a),s=this.slice(n,o),c=t.slice(e,r),l=0;l<f;++l)if(s[l]!==c[l]){u=s[l],a=c[l];break}return u<a?-1:a<u?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return A(this,t,e,r);case"latin1":case"binary":return T(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n;if(i.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=i.prototype;else{var o=e-t;n=new i(o,void 0);for(var u=0;u<o;++u)n[u]=this[u+t]}return n},i.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},i.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},i.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||C(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),Z.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),Z.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),Z.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),Z.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){M(this,t,e,r,Math.pow(2,8*r)-1,0)}var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){M(this,t,e,r,Math.pow(2,8*r)-1,0)}var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):x(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):x(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);M(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):x(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):x(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,r){return Y(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return Y(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,u=n-r;if(this===t&&r<e&&e<n)for(o=u-1;o>=0;--o)t[o+e]=this[o+r];else if(u<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+u),e);return u},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var u;if("number"==typeof t)for(u=e;u<r;++u)this[u]=t;else{var a=i.isBuffer(t)?t:G(new i(t,n).toString()),f=a.length;for(u=0;u<r-e;++u)this[u+e]=a[u%f]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,r(18))},function(t,e,r){"use strict";(function(t){function r(t,e){if("[object Array]"!==o.call(t))throw new TypeError("array must be an Array");var r=void 0,n=void 0,i=void 0;for(r=0,n=t.length;r<n;++r)if((i=t[r])===e||i!==i&&e!==e)return r;return-1}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.__esModule=!0;var o=Object.prototype.toString,i=void 0!==t?function(e){return t.isBuffer(e)}:function(){return!1},u="function"==typeof Object.keys?function(t){return Object.keys(t)}:function(t){var e=void 0===t?"undefined":n(t);if(null===t||"function"!==e&&"object"!==e)throw new TypeError("obj must be an Object");var r=[],o=void 0;for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(o);return r},a="function"==typeof Symbol?function(t){return Object.getOwnPropertySymbols(t)}:function(){return[]};e.getKeys=u,e.getSymbols=a,e.indexOf=r,e.isBuffer=i}).call(e,r(5).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8),o=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=o.default},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=(0,b.default)(t),r=function(t){function r(t){o(this,r);var e=i(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));n.call(e);var u=e.props,a=u.formData,f=u.tabData,s=u.schema,c=u.uiSchema;e.layers=(0,w.default)(s,c,f);var l=e.layers.updateActiveTabs([],0);return e.state={formData:a,activeTabs:l},e}return u(r,t),s(r,[{key:"componentWillReceiveProps",value:function(t){if(!this.sameLayers(t)){var e=t.schema,r=t.uiSchema,n=t.tabData;this.layers=(0,w.default)(e,r,n)}this.sameData(t.formData)||(this.formData=t.formData,this.setState({formData:t.formData}))}},{key:"shouldComponentUpdate",value:function(t,e){if(!(0,d.default)(e.activeTabs,this.state.activeTabs))return!0;var r=(0,d.default)(Object.assign({},this.props,{formData:{}}),Object.assign({},t,{formData:{}}));if(!r)return!0;var n=(0,d.default)(Object.assign({},this.state,{formData:this.formData}),e);if(!n)return!0;var o=this.sameData(t.formData);return!r||!n||!o}},{key:"render",value:function(){var t=this,r=this.layers.toSubForms(this.state.activeTabs);return l.default.createElement("div",null,r.map(function(r,n){var o=Object.assign({},t.props,r,{formData:t.formData});return l.default.createElement(e,f({key:n},o,{onChange:t.handleOnChange,onTabChange:t.handleTabChange(n)}))}))}}]),r}(c.Component),n=function(){var t=this;this.sameData=function(e){return(0,d.default)(t.props.formData,e)||(0,d.default)(t.formData,e)},this.sameLayers=function(e){var r=function(t){return{tabData:t.tabData,schema:t.schema,uiSchema:t.uiSchema}};return(0,d.default)(r(e),r(t.props))},this.handleTabChange=function(e){return function(r){var n=t.state.activeTabs.slice(0,e+1);n[e]=r,t.layers.updateActiveTabs(n),t.setState({activeTabs:n})}},this.handleOnChange=function(e){t.formData=e.formData,t.setState({formData:e.formData}),t.props.onChange&&t.props.onChange(e)}};return(0,g.isDevelopment)()&&(r.propTypes={tabData:p.default.array.isRequired}),r}Object.defineProperty(e,"__esModule",{value:!0});var f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();e.default=a;var c=r(1),l=n(c),h=r(3),p=n(h),y=r(4),d=n(y),v=r(15),b=n(v),g=r(0),m=r(23),w=n(m)},function(t,e,r){"use strict";var n=r(10),o=r(11),i=r(12);t.exports=function(){function t(t,e,r,n,u,a){a!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return r.checkPropTypes=n,r.PropTypes=r,r}},function(t,e,r){"use strict";function n(t){return function(){return t}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,r){"use strict";function n(t,e,r,n,i,u,a,f){if(o(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,u,a,f],l=0;s=new Error(e.replace(/%s/g,function(){return c[l++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}}var o=function(t){};t.exports=n},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,r){"use strict";function n(t){var e=[];for(var r in t)e.push(r);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e,r){"use strict";function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function o(t){return t&&"object"==(void 0===t?"undefined":i(t))&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=u?n:o,e.supported=n,e.unsupported=o},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),f=r(1),s=n(f),c=r(4),l=n(c),h=r(3),p=n(h),y=r(0),d=r(22),v=n(d),b=function(t){var e=function(t){function e(t){o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));r.call(n);var u=n.props.formData;return n.state={formData:u},n}return u(e,t),a(e,[{key:"componentWillReceiveProps",value:function(t){var e=t.formData;this.sameData(e)||(this.formData=e,this.setState({formData:e}))}},{key:"shouldComponentUpdate",value:function(t,e){var r=(0,l.default)(Object.assign({},this.props,{formData:{}}),Object.assign({},t,{formData:{}})),n=(0,l.default)(Object.assign({},this.state,{formData:this.formData}),e),o=this.sameData(t.formData);return!r||!n||!o}},{key:"render",value:function(){return s.default.createElement("div",null,s.default.createElement("div",{className:"row"},this.renderForm()),s.default.createElement("div",{className:"row"},s.default.createElement("div",{className:"col-md-12 form-group field field-object"},this.renderTabs())))}}]),e}(f.Component),r=function(){var e=this;this.sameData=function(t){return(0,l.default)(e.props.formData,t)||(0,l.default)(e.formData,t)},this.handleOnChange=function(t){e.formData=t.formData,e.setState({formData:t.formData}),e.props.onChange&&e.props.onChange(t)},this.renderForm=function(){if(e.props.schema){var r=e.state.formData,n=Object.assign({},e.props,{formData:r,onChange:e.handleOnChange});return s.default.createElement(t,n,s.default.createElement("div",null))}return s.default.createElement("div",null)},this.renderTabs=function(){var t=e.props,r=t.tabs,n=t.activeTab,o=t.onTabChange;return s.default.createElement(v.default,{tabs:r,activeTab:n,onTabChange:o})}};return(0,y.isDevelopment)()&&(e.propTypes={tabs:p.default.array}),e};e.default=b},function(t,e,r){"use strict";function n(t){}function o(t){var e=arguments.length<=1||void 0===arguments[1]?n:arguments[1];if(null===t)return null;var r=(0,a.copyValue)(t);if(null!==r)return r;var o=(0,a.copyCollection)(t,e),u=null!==o?o:t;return i(t,e,u,[t],[u])}function i(t,e,r,n,o){if(null===t)return null;var s=(0,a.copyValue)(t);if(null!==s)return s;var c=(0,f.getKeys)(t).concat((0,f.getSymbols)(t)),l=void 0,h=void 0,p=void 0,y=void 0,d=void 0,v=void 0,b=void 0,g=void 0;for(l=0,h=c.length;l<h;++l)p=c[l],y=t[p],d=(0,f.indexOf)(n,y),v=void 0,b=void 0,g=void 0,-1===d?(v=(0,a.copy)(y,e),b=null!==v?v:y,null!==y&&/^(?:function|object)$/.test(void 0===y?"undefined":u(y))&&(n.push(y),o.push(b))):g=o[d],r[p]=g||i(y,e,b,n,o);return r}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.__esModule=!0;var a=r(17),f=r(6);e.default=o,t.exports=e.default},function(t,e,r){"use strict";(function(t){function n(t,e){var r=i(t);return null!==r?r:o(t,e)}function o(e,r){if("function"!=typeof r)throw new TypeError("customizer is must be a Function");if("function"==typeof e){var n=String(e);return/^\s*function\s*\S*\([^\)]*\)\s*{\s*\[native code\]\s*}/.test(n)?e:new Function("return "+String(n))()}var o=f.call(e);if("[object Array]"===o)return[];if("[object Object]"===o&&e.constructor===Object)return{};if("[object Date]"===o)return new Date(e.getTime());if("[object RegExp]"===o){var i=String(e),u=i.lastIndexOf("/");return new RegExp(i.slice(1,u),i.slice(u+1))}if((0,a.isBuffer)(e)){var s=new t(e.length);return e.copy(s),s}var c=r(e);return void 0!==c?c:null}function i(t){var e=void 0===t?"undefined":u(t);return null!==t&&"object"!==e&&"function"!==e?t:null}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.__esModule=!0,e.copyValue=e.copyCollection=e.copy=void 0;var a=r(6),f=Object.prototype.toString;e.copy=n,e.copyCollection=o,e.copyValue=i}).call(e,r(5).Buffer)},function(t,e,r){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(n=window)}t.exports=n},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-n(t)}function i(t){var e,r,o,i,u,a=t.length;i=n(t),u=new l(3*a/4-i),r=i>0?a-4:a;var f=0;for(e=0;e<r;e+=4)o=c[t.charCodeAt(e)]<<18|c[t.charCodeAt(e+1)]<<12|c[t.charCodeAt(e+2)]<<6|c[t.charCodeAt(e+3)],u[f++]=o>>16&255,u[f++]=o>>8&255,u[f++]=255&o;return 2===i?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,u[f++]=255&o):1===i&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,u[f++]=o>>8&255,u[f++]=255&o),u}function u(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function a(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(u(n));return o.join("")}function f(t){for(var e,r=t.length,n=r%3,o="",i=[],u=0,f=r-n;u<f;u+=16383)i.push(a(t,u,u+16383>f?f:u+16383));return 1===n?(e=t[r-1],o+=s[e>>2],o+=s[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=s[e>>10],o+=s[e>>4&63],o+=s[e<<2&63],o+="="),i.push(o),i.join("")}e.byteLength=o,e.toByteArray=i,e.fromByteArray=f;for(var s=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=h.length;p<y;++p)s[p]=h[p],c[h.charCodeAt(p)]=p;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},function(t,e,r){"use strict";e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,f=(1<<a)-1,s=f>>1,c=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-c)-1,p>>=-c,c+=a;c>0;i=256*i+t[e+l],l+=h,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=n;c>0;u=256*u+t[e+l],l+=h,c-=8);if(0===i)i=1-s;else{if(i===f)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=s}return(p?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,a,f,s=8*i-o-1,c=(1<<s)-1,l=c>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=c):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),e+=u+l>=1?h/f:h*Math.pow(2,1-l),e*f>=2&&(u++,f/=2),u+l>=c?(a=0,u=c):u+l>=1?(a=(e*f-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=y,a/=256,o-=8);for(u=u<<o|a,s+=o;s>0;t[r+p]=255&u,p+=y,u/=256,s-=8);t[r+p-y]|=128*d}},function(t,e,r){"use strict";var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,r){"use strict";function n(t){var e=t.handleClick,r=t.isActive,n=t.name;return u.default.createElement("li",{onClick:e,className:r?"active":null},u.default.createElement("a",null,n))}function o(t){var e=t.activeTab,r=t.tabs,o=t.onTabChange,i=r.filter(function(t){return t.tabID!==a.GENERIC_TAB});return i.length>0?u.default.createElement("ul",{className:"nav nav-pills"},i.map(function(t,r){var i=t.tabID,a=t.name;return u.default.createElement(n,{key:r,name:a||i,isActive:e===i,handleClick:function(){return o(i)}})})):u.default.createElement("div",null)}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),u=function(t){return t&&t.__esModule?t:{default:t}}(i),a=r(0);e.default=o},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e,r){var n=(0,u.listLayers)(t,e),i=n.reduce(function(n,i){var a=(0,c.default)(i,t,e),s=(0,f.default)(i,e);return i===u.GENERIC_TAB?n[i]={schema:a,uiSchema:s}:(0,u.isEmptySchema)(a)||(n[i]=o(a,s,r)),n},{}),a=Object.keys(i).map(function(t){var e=r.find(function(e){return e.tabID===t});return e||{tabID:t}});return new h.default(a,i)}function i(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return o((0,u.normalizeSchema)(t),(0,u.normalizeUiSchema)(e),r)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var u=r(0),a=r(24),f=n(a),s=r(25),c=n(s),l=r(26),h=n(l)},function(t,e,r){"use strict";function n(t){Object.keys(t).forEach(function(e){var r=t[e][s.UI_TAB_ID];r&&r.length>1?r.shift():delete t[e][s.UI_TAB_ID]})}function o(t,e){return Object.keys(e[s.UI_TAB_ALIAS]).reduce(function(r,n){var o=e[s.UI_TAB_ALIAS][n].filter(function(r){return(0,s.findLayer)(r,e)===t});return 1==o.length?r.push({field:n,alias:o[0]}):0!==o.length&&(0,s.toError)(n+" has too many aliases "+o+" for the "+t),r},[])}function i(t,e){o(t,e).forEach(function(t){var r=t.field,n=t.alias;e[r]=e[n]})}function u(t,e){var r=(0,f.default)(e);return i(t,r),n(r),r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var a=r(2),f=function(t){return t&&t.__esModule?t:{default:t}}(a),s=r(0)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2),o=function(t){return t&&t.__esModule?t:{default:t}}(n),i=r(0),u=function(t,e,r){return e[i.UI_TAB_ALIAS][t]&&e[i.UI_TAB_ALIAS][t].some(function(t){return(0,i.findLayer)(t,e)===r})},a=function(t,e){return function(r){return(0,i.findLayer)(r,t)===e||u(r,t,e)}},f=function(t,e){return function(r){e.required.includes(r)&&t.required.push(r),t.properties[r]=e.properties[r]}},s=function(t,e,r){var n=Object.assign({},(0,o.default)(e),{required:[],properties:{}});return Object.keys(e.properties).filter(a(r,t)).forEach(f(n,e)),n};e.default=s},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(0),u=function(){function t(e,r){n(this,t),a.call(this),this.tabs=e,this.conf=r,this.defaultTab=Object.assign({},{tabs:e},r[i.GENERIC_TAB]),this.activeTab=this.chooseActive(e)}return o(t,[{key:"chooseActive",value:function(t){var e=t.filter(function(t){return t.tabID!=i.GENERIC_TAB});return e.length>0?e[0].tabID:i.GENERIC_TAB}}]),t}(),a=function(){var t=this;this.doUpdateActiveTabs=function(e,r){return r===e.length?t.activeTab!==i.GENERIC_TAB&&(e.push(t.activeTab),t.conf[t.activeTab].doUpdateActiveTabs(e,r+1)):(t.activeTab=e[r],t.conf[e[r]].doUpdateActiveTabs(e,r+1)),e},this.updateActiveTabs=function(e){return t.doUpdateActiveTabs(e,0)},this.toSubForms=function(e){var r=[],n=e[0]?e[0]:i.GENERIC_TAB;if(r.push(Object.assign({},t.defaultTab,{activeTab:n})),n===i.GENERIC_TAB)return r;var o=t.conf[n],u=e.slice(1);return o.toSubForms(u).forEach(function(t){return r.push(t)}),r}};e.default=u}])}); | ||
//# sourceMappingURL=form-with-pagination.js.map |
@@ -23,5 +23,5 @@ "use strict"; | ||
var _tabs = require("./components/tabs"); | ||
var _Tabs = require("./Tabs"); | ||
var _tabs2 = _interopRequireDefault(_tabs); | ||
var _Tabs2 = _interopRequireDefault(_Tabs); | ||
@@ -137,3 +137,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
return _react2.default.createElement(_tabs2.default, { tabs: tabs, activeTab: activeTab, onTabChange: onTabChange }); | ||
return _react2.default.createElement(_Tabs2.default, { tabs: tabs, activeTab: activeTab, onTabChange: onTabChange }); | ||
}; | ||
@@ -140,0 +140,0 @@ }; |
157
lib/index.js
@@ -7,159 +7,8 @@ "use strict"; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _applyPagination = require("./applyPagination"); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _applyPagination2 = _interopRequireDefault(_applyPagination); | ||
exports.default = applyPagination; | ||
var _react = require("react"); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require("prop-types"); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _deepEqual = require("deep-equal"); | ||
var _deepEqual2 = _interopRequireDefault(_deepEqual); | ||
var _FormWithTabs = require("./FormWithTabs"); | ||
var _FormWithTabs2 = _interopRequireDefault(_FormWithTabs); | ||
var _utils = require("./utils"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function applyPagination(FormComponent) { | ||
var FormWithTabs = (0, _FormWithTabs2.default)(FormComponent); | ||
var FormWithPagination = function (_Component) { | ||
_inherits(FormWithPagination, _Component); | ||
function FormWithPagination(props) { | ||
_classCallCheck(this, FormWithPagination); | ||
var _this = _possibleConstructorReturn(this, (FormWithPagination.__proto__ || Object.getPrototypeOf(FormWithPagination)).call(this, props)); | ||
_initialiseProps.call(_this); | ||
var _this$props = _this.props, | ||
formData = _this$props.formData, | ||
tabData = _this$props.tabData, | ||
schema = _this$props.schema, | ||
uiSchema = _this$props.uiSchema; | ||
_this.layers = (0, _utils.splitInLayers)(schema, uiSchema, tabData); | ||
var activeTabs = _this.layers.updateActiveTabs([], 0); | ||
_this.state = { formData: formData, activeTabs: activeTabs }; | ||
return _this; | ||
} | ||
_createClass(FormWithPagination, [{ | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(_ref) { | ||
var tabData = _ref.tabData, | ||
schema = _ref.schema, | ||
uiSchema = _ref.uiSchema, | ||
formData = _ref.formData; | ||
if (!(0, _deepEqual2.default)({ tabData: tabData, schema: schema, uiSchema: uiSchema }, { | ||
tabData: this.props.tabData, | ||
schema: this.props.schema, | ||
uiSchema: this.props.uiSchema | ||
})) { | ||
this.layers = (0, _utils.splitInLayers)(schema, uiSchema, tabData); | ||
} | ||
if (!this.sameData(formData)) { | ||
this.formData = formData; | ||
this.setState({ formData: formData }); | ||
} | ||
} | ||
}, { | ||
key: "shouldComponentUpdate", | ||
value: function shouldComponentUpdate(nextProps, nextState) { | ||
var sameActive = (0, _deepEqual2.default)(nextState.activeTabs, this.state.activeTabs); | ||
if (!sameActive) { | ||
return true; | ||
} | ||
var sameProps = (0, _deepEqual2.default)(Object.assign({}, this.props, { formData: {} }), Object.assign({}, nextProps, { formData: {} })); | ||
if (!sameProps) { | ||
return true; | ||
} | ||
var sameState = (0, _deepEqual2.default)(Object.assign({}, this.state, { formData: this.formData }), nextState); | ||
if (!sameState) { | ||
return true; | ||
} | ||
var sameData = this.sameData(nextProps.formData); | ||
return !sameProps || !sameState || !sameData; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _this2 = this; | ||
var subForms = this.layers.toSubForms(this.state.activeTabs); | ||
return _react2.default.createElement( | ||
"div", | ||
null, | ||
subForms.map(function (conf, i) { | ||
var allConf = Object.assign({}, _this2.props, conf, { | ||
formData: _this2.formData | ||
}); | ||
return _react2.default.createElement(FormWithTabs, _extends({ | ||
key: i | ||
}, allConf, { | ||
onChange: _this2.handleOnChange, | ||
onTabChange: _this2.handleTabChange(i) | ||
})); | ||
}) | ||
); | ||
} | ||
}]); | ||
return FormWithPagination; | ||
}(_react.Component); | ||
var _initialiseProps = function _initialiseProps() { | ||
var _this3 = this; | ||
this.sameData = function (formData) { | ||
return (0, _deepEqual2.default)(_this3.props.formData, formData) || (0, _deepEqual2.default)(_this3.formData, formData); | ||
}; | ||
this.handleTabChange = function (index) { | ||
return function (_ref2) { | ||
var tabID = _ref2.tabID; | ||
var activeTabs = _this3.state.activeTabs.slice(0, index + 1); | ||
activeTabs[index] = tabID; | ||
_this3.layers.updateActiveTabs(activeTabs); | ||
_this3.setState({ activeTabs: activeTabs }); | ||
}; | ||
}; | ||
this.handleOnChange = function (state) { | ||
_this3.formData = state.formData; | ||
_this3.setState({ formData: state.formData }); | ||
if (_this3.props.onChange) { | ||
_this3.props.onChange(state); | ||
} | ||
}; | ||
}; | ||
if ((0, _utils.isDevelopment)()) { | ||
FormWithPagination.propTypes = { | ||
tabData: _propTypes2.default.array.isRequired | ||
}; | ||
} | ||
return FormWithPagination; | ||
} | ||
exports.default = _applyPagination2.default; |
183
lib/utils.js
@@ -6,8 +6,9 @@ "use strict"; | ||
}); | ||
exports.UI_TAB_ID = exports.GENERIC_TAB = undefined; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
exports.toError = exports.UI_TAB_ALIAS = exports.UI_TAB_ID = exports.GENERIC_TAB = undefined; | ||
exports.isDevelopment = isDevelopment; | ||
exports.splitInLayers = splitInLayers; | ||
exports.isEmptySchema = isEmptySchema; | ||
exports.findLayer = findLayer; | ||
exports.listLayers = listLayers; | ||
exports.normalizeUiSchema = normalizeUiSchema; | ||
exports.normalizeSchema = normalizeSchema; | ||
@@ -20,6 +21,5 @@ var _deepcopy = require("deepcopy"); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var GENERIC_TAB = exports.GENERIC_TAB = "default"; | ||
var UI_TAB_ID = exports.UI_TAB_ID = "ui:tabID"; | ||
var UI_TAB_ALIAS = exports.UI_TAB_ALIAS = "ui:tabAlias"; | ||
@@ -30,68 +30,14 @@ function isDevelopment() { | ||
var Layer = function () { | ||
function Layer(tabs, uiSchema, conf) { | ||
_classCallCheck(this, Layer); | ||
_initialiseProps.call(this); | ||
this.tabs = tabs; | ||
this.uiSchema = uiSchema; | ||
this.conf = conf; | ||
this.defaultTab = { tabs: tabs, schema: conf[GENERIC_TAB], uiSchema: uiSchema }; | ||
this.activeTab = this.chooseActive(tabs); | ||
var toError = exports.toError = function toError(message) { | ||
if (isDevelopment()) { | ||
throw new ReferenceError(message); | ||
} else { | ||
console.error(message); | ||
} | ||
}; | ||
_createClass(Layer, [{ | ||
key: "chooseActive", | ||
value: function chooseActive(tabs) { | ||
var nonDefaultTabs = tabs.filter(function (_ref) { | ||
var tabID = _ref.tabID; | ||
return tabID != GENERIC_TAB; | ||
}); | ||
return nonDefaultTabs.length > 0 ? nonDefaultTabs[0].tabID : GENERIC_TAB; | ||
} | ||
}]); | ||
function isEmptySchema(schema) { | ||
return !schema || !schema.properties || Object.keys(schema.properties).length === 0; | ||
} | ||
return Layer; | ||
}(); | ||
var _initialiseProps = function _initialiseProps() { | ||
var _this = this; | ||
this.doUpdateActiveTabs = function (activeTabs, i) { | ||
if (i === activeTabs.length) { | ||
if (_this.activeTab !== GENERIC_TAB) { | ||
activeTabs.push(_this.activeTab); | ||
_this.conf[_this.activeTab].doUpdateActiveTabs(activeTabs, i + 1); | ||
} | ||
} else { | ||
_this.activeTab = activeTabs[i]; | ||
_this.conf[activeTabs[i]].doUpdateActiveTabs(activeTabs, i + 1); | ||
} | ||
return activeTabs; | ||
}; | ||
this.updateActiveTabs = function (activeTabs) { | ||
return _this.doUpdateActiveTabs(activeTabs, 0); | ||
}; | ||
this.toSubForms = function (activeTabs) { | ||
var agg = []; | ||
var tab = activeTabs[0]; | ||
agg.push(Object.assign({}, _this.defaultTab, { activeTab: tab })); | ||
if (activeTabs.length === 0) { | ||
return agg; | ||
} | ||
if (tab !== GENERIC_TAB) { | ||
var nextConf = _this.conf[tab]; | ||
var nextTabs = activeTabs.slice(1); | ||
var nestedTabs = nextConf.toSubForms(nextTabs); | ||
nestedTabs.forEach(function (conf) { | ||
return agg.push(conf); | ||
}); | ||
} | ||
return agg; | ||
}; | ||
}; | ||
function findLayer(field, uiSchema) { | ||
@@ -102,90 +48,53 @@ return uiSchema && uiSchema[field] && uiSchema[field][UI_TAB_ID] ? uiSchema[field][UI_TAB_ID][0] : GENERIC_TAB; | ||
function listLayers(schema, uiSchema) { | ||
var layers = Object.keys(schema.properties).map(function (field) { | ||
var schemaLayers = Object.keys(schema.properties).map(function (field) { | ||
return findLayer(field, uiSchema); | ||
}); | ||
return Array.from(new Set(layers)); | ||
} | ||
function removeLayerFromUi(uiSchema) { | ||
var cleanedUiSchema = (0, _deepcopy2.default)(uiSchema); | ||
Object.keys(cleanedUiSchema).forEach(function (field) { | ||
var uiTab = cleanedUiSchema[field][UI_TAB_ID]; | ||
if (uiTab && uiTab.length > 1) { | ||
uiTab.shift(); | ||
} else { | ||
delete cleanedUiSchema[field][UI_TAB_ID]; | ||
} | ||
var uiSchemaLayers = Object.keys(uiSchema).map(function (uiField) { | ||
return findLayer(uiField, uiSchema); | ||
}); | ||
return cleanedUiSchema; | ||
} | ||
function copyField(schema, field, origSchema) { | ||
if (origSchema.required.includes(field)) { | ||
schema.required.push(field); | ||
} | ||
schema.properties[field] = origSchema.properties[field]; | ||
var allLayers = schemaLayers.concat(uiSchemaLayers).concat([GENERIC_TAB]); | ||
return Array.from(new Set(allLayers)); | ||
} | ||
function extractSchemaForLayer(layer, origSchema, uiSchema) { | ||
var schema = Object.assign({}, (0, _deepcopy2.default)(origSchema), { | ||
required: [], | ||
properties: {} | ||
function normalizeTabs(uiSchema) { | ||
Object.keys(uiSchema).forEach(function (field) { | ||
if (uiSchema[field] && uiSchema[field][UI_TAB_ID] && !Array.isArray(uiSchema[field][UI_TAB_ID])) { | ||
uiSchema[field][UI_TAB_ID] = [uiSchema[field][UI_TAB_ID]]; | ||
} | ||
}); | ||
Object.keys(origSchema.properties).filter(function (field) { | ||
var sameLayer = findLayer(field, uiSchema) === layer; | ||
return sameLayer; | ||
}).forEach(function (field) { | ||
return copyField(schema, field, origSchema); | ||
}); | ||
return schema; | ||
} | ||
function doSplitInLayers(origSchema, origUiSchema, tabData) { | ||
var layers = listLayers(origSchema, origUiSchema); | ||
var uiSchema = removeLayerFromUi(origUiSchema); | ||
var conf = layers.reduce(function (conf, layer) { | ||
var schema = extractSchemaForLayer(layer, origSchema, origUiSchema); | ||
if (layer !== GENERIC_TAB) { | ||
conf[layer] = doSplitInLayers(schema, uiSchema, tabData); | ||
} else { | ||
conf[layer] = schema; | ||
function normalizeAliases(uiSchema) { | ||
if (!uiSchema[UI_TAB_ALIAS]) { | ||
uiSchema[UI_TAB_ALIAS] = {}; | ||
} | ||
Object.keys(uiSchema[UI_TAB_ALIAS]).forEach(function (field) { | ||
var fieldAliases = uiSchema[UI_TAB_ALIAS][field]; | ||
if (!Array.isArray(fieldAliases)) { | ||
uiSchema[UI_TAB_ALIAS][field] = [fieldAliases]; | ||
} | ||
return conf; | ||
}, {}); | ||
var tabs = layers.map(function (layer) { | ||
var tab = tabData.find(function (_ref2) { | ||
var tabID = _ref2.tabID; | ||
return tabID === layer; | ||
}); | ||
return tab ? tab : { tabID: layer, name: layer }; | ||
}); | ||
return new Layer(tabs, uiSchema, conf); | ||
} | ||
function normalizeUiSchema(uiSchema) { | ||
function normalizeUiSchema() { | ||
var uiSchema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var normUiSchema = (0, _deepcopy2.default)(uiSchema); | ||
Object.keys(normUiSchema).forEach(function (field) { | ||
if (normUiSchema[field] && normUiSchema[field][UI_TAB_ID] && !Array.isArray(normUiSchema[field][UI_TAB_ID])) { | ||
normUiSchema[field][UI_TAB_ID] = [normUiSchema[field][UI_TAB_ID]]; | ||
} | ||
}); | ||
normalizeTabs(normUiSchema); | ||
normalizeAliases(normUiSchema); | ||
return normUiSchema; | ||
} | ||
function normalizeRequired(schema) { | ||
if (!schema.required) { | ||
schema.required = []; | ||
} | ||
} | ||
function normalizeSchema(schema) { | ||
var normSchema = (0, _deepcopy2.default)(schema); | ||
if (!normSchema.required) { | ||
normSchema.required = []; | ||
} | ||
normalizeRequired(normSchema); | ||
return normSchema; | ||
} | ||
function splitInLayers(schema) { | ||
var uiSchema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var tabData = arguments[2]; | ||
return doSplitInLayers(normalizeSchema(schema), normalizeUiSchema(uiSchema), tabData); | ||
} |
@@ -6,3 +6,3 @@ { | ||
"author": "zboldyga@gmail.com", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"scripts": { | ||
@@ -25,3 +25,4 @@ "build:lib": "rimraf lib && cross-env NODE_ENV=production babel -d lib/ src/", | ||
"verbose": true, | ||
"collectCoverage": true | ||
"collectCoverage": true, | ||
"collectCoverageFrom": [ "src/**/*.{js,jsx}" ] | ||
}, | ||
@@ -70,7 +71,8 @@ "prettierOptions": "--jsx-bracket-same-line --trailing-comma es5 --semi", | ||
"codemirror": "^5.28.0", | ||
"cross-env": "^5.0.3", | ||
"coveralls": "^2.13.1", | ||
"cross-env": "^5.0.5", | ||
"css-loader": "^0.28.4", | ||
"eslint": "^4.3.0", | ||
"eslint": "^4.4.1", | ||
"eslint-plugin-jest": "^20.0.3", | ||
"eslint-plugin-react": "^7.1.0", | ||
"eslint-plugin-react": "^7.2.1", | ||
"eslint-plugin-standard": "^3.0.1", | ||
@@ -80,3 +82,3 @@ "estraverse": "^4.2.0", | ||
"exit-hook": "^1.1.1", | ||
"express": "^4.15.3", | ||
"express": "^4.15.4", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
@@ -89,5 +91,4 @@ "gh-pages": "^1.0.0", | ||
"jsdom": "^11.1.0", | ||
"json-rules-engine": "^2.0.2", | ||
"json-rules-engine-simplified": "^0.1.5", | ||
"lint-staged": "^4.0.2", | ||
"json-rules-engine-simplified": "^0.1.9", | ||
"lint-staged": "^4.0.3", | ||
"prettier": "^1.5.3", | ||
@@ -98,12 +99,12 @@ "react": "^15.6.1", | ||
"react-dom": "^15.6.1", | ||
"react-jsonschema-form-conditionals": "^0.2.13", | ||
"react-jsonschema-form-conditionals": "^0.2.14", | ||
"react-test-renderer": "^15.6.1", | ||
"react-transform-catch-errors": "^1.0.2", | ||
"react-transform-hmr": "^1.0.4", | ||
"regenerator-runtime": "^0.10.5", | ||
"regenerator-runtime": "^0.11.0", | ||
"rimraf": "^2.6.1", | ||
"sinon": "^3.0.0", | ||
"sinon": "^3.2.0", | ||
"style-loader": "^0.18.2", | ||
"webpack": "^3.4.1", | ||
"webpack-dev-server": "^2.6.1", | ||
"webpack": "^3.5.4", | ||
"webpack-dev-server": "^2.7.1", | ||
"webpack-hot-middleware": "^2.18.2" | ||
@@ -110,0 +111,0 @@ }, |
238
README.md
# react-jsonschema-form-pagination | ||
## Usage | ||
[![Build Status](https://travis-ci.org/RxNT/react-jsonschema-form-pagination.svg?branch=master)](https://travis-ci.org/RxNT/react-jsonschema-form-pagination) | ||
[![Coverage Status](https://coveralls.io/repos/github/RxNT/react-jsonschema-form-pagination/badge.svg)](https://coveralls.io/github/RxNT/react-jsonschema-form-pagination) | ||
[![npm version](https://badge.fury.io/js/react-jsonschema-form-pagination.svg)](https://badge.fury.io/js/react-jsonschema-form-pagination) | ||
FormWithPagination is a wrapper for Mozilla's JSON Schema Form that allows a schema to be displayed into multiple Bootstrap tabs. This allows users to see a subset of the schema on each tab. | ||
## Features | ||
Use this project as you would use Mozilla's JSON Schema Form (see their documentation), but to leverage the tab features just provide these extra parameters: | ||
- Separation of huge schemas into tabs | ||
- Nested tabs - you can have any number of tabs nested inside your form | ||
- Repeated fields - you can use the same field in multiple tabs, filling it only once | ||
- Does not conflict with other extensions of Mozilla project | ||
- In the uiSchema object, use the new ui:tabID property to associate each field with a tab. | ||
## Installation | ||
```jsx | ||
const uiSchema = { | ||
"ui:tabID": "TAB_ID_HERE", | ||
}; | ||
``` | ||
- Pass in an additional tabData array in props, alongside uiSchema, schema, etc. | ||
Install `react-jsonschema-form-pagination` by running: | ||
```js | ||
const tabData = [ | ||
{ | ||
tabID: "0", | ||
name: "Tab 1", | ||
}, | ||
{ | ||
tabID: "1", | ||
name: "Tab 2", | ||
}, | ||
{ | ||
tabID: "2", | ||
name: "Tab 3", | ||
}, | ||
]; | ||
```bash | ||
npm install --s react-jsonschema-form-pagination | ||
``` | ||
### Example: | ||
In this example each field is placed into a separate tab. | ||
## Usage | ||
```jsx | ||
FormWithPagination is a wrapper for Mozilla's JSON Schema Form that allows a schema to be displayed into multiple Bootstrap tabs. This allows users to see a subset of the schema on each tab. | ||
import FormWithPagination from "react-jsonschema-form-pagination"; | ||
Use this project as you would use Mozilla's JSON Schema Form (see their documentation), but to leverage the tab features just provide these extra parameters: | ||
let schema = { | ||
- In the `uiSchema` object, use the new `ui:tabID` and `ui:tabAliases` property to associate each field with a tab | ||
- Pass in an additional `tabData` array in props, if you want to customize tab naming | ||
To show case use of the pagination project, we'll be using following `schema` as a base | ||
```js | ||
const schema = { | ||
title: "A registration form", | ||
@@ -47,51 +38,39 @@ description: "A simple form example.", | ||
properties: { | ||
firstName: { | ||
type: "string", | ||
title: "First name" | ||
}, | ||
lastName: { | ||
type: "string", | ||
title: "Last name" | ||
}, | ||
age: { | ||
type: "integer", | ||
title: "Age", | ||
} | ||
firstName: { type: "string" }, | ||
lastName: { type: "string" }, | ||
age: { type: "integer" }, | ||
phone: { type: "string" }, | ||
nickName: { type: "string" } | ||
} | ||
} | ||
}; | ||
``` | ||
### One level of tabs | ||
Let's say we have only 1 level of tabs `main` and `other`. We can do it like this: | ||
```js | ||
import applyPagination from "react-jsonschema-form-pagination"; | ||
import Form from "react-jsonschema-form"; | ||
const uiSchema = { | ||
firstName: { | ||
classNames: "col-md-4 col-xs-4 success", | ||
"ui:autofocus": true, | ||
"ui:emptyValue": "", | ||
"ui:tabID": "0" | ||
"ui:tabID": "main" | ||
}, | ||
lastName: { | ||
classNames: "col-md-4 col-xs-4", | ||
"ui:tabID": "1" | ||
"ui:tabID": "main" | ||
}, | ||
age: { | ||
classNames: "col-md-4 col-xs-4", | ||
"ui:widget": "updown", | ||
"ui:title": "Age of person", | ||
"ui:tabID": "2" | ||
} | ||
}; | ||
let tabData = [ | ||
{ | ||
tabID: "0", | ||
name: "Tab 1", | ||
"ui:tabID": "main" | ||
}, | ||
{ | ||
tabID: "1", | ||
name: "Tab 2", | ||
phone: { | ||
"ui:tabID": "main" | ||
}, | ||
{ | ||
tabID: "2", | ||
name: "Tab 3", | ||
nickName: { | ||
"ui:tabID": "other" | ||
}, | ||
]; | ||
}; | ||
let FormWithPagination = applyPagination(Form); | ||
render(( | ||
@@ -101,5 +80,128 @@ <FormWithPagination | ||
uiSchema={uiSchema} | ||
tabData={tabData} | ||
/> | ||
), document.getElementById("app")); | ||
``` | ||
When rendered this configuration will show 2 tabs | ||
- `main` tab with `firstName`, `lastName`, `age` and `phone` fields | ||
- `other` tab with `nickName` field | ||
### Multi tabs levels | ||
Let's say we now want to have `main` tab divided in 2 more tabs `general`(`lastName` and `age`) and `other` ( with `phone`). | ||
This is how `uiSchema` should look like in order to do that : | ||
```js | ||
const uiSchema = { | ||
firstName: { | ||
"ui:tabID": "main" | ||
}, | ||
lastName: { | ||
"ui:tabID": [ "main", "general" ] | ||
}, | ||
age: { | ||
"ui:tabID": [ "main", "general" ] | ||
}, | ||
phone: { | ||
"ui:tabID": [ "main", "other" ] | ||
}, | ||
nickName: { | ||
"ui:tabID": "other" | ||
} | ||
}; | ||
``` | ||
When rendered this configuration will show 2 tabs | ||
- `main` tab with `firstName`, and 2 sub tabs | ||
- `general` with `lastName` and `age` fields | ||
- `other` with `phone` field | ||
- `other` tab with `nickName` field | ||
### Default level | ||
When you don't specify `ui:tabID`, the field will be shown above the tabs. | ||
For example, if we go back to single level example, but we want to always see `firstName` shown above the tab navigation. | ||
Here is how we can do this: | ||
```js | ||
const uiSchema = { | ||
firstName: {}, | ||
lastName: { | ||
"ui:tabID": "main" | ||
}, | ||
age: { | ||
"ui:tabID": "main" | ||
}, | ||
phone: { | ||
"ui:tabID": "main" | ||
}, | ||
nickName: { | ||
"ui:tabID": "other" | ||
}, | ||
}; | ||
``` | ||
When rendered this configuration will show 2 tabs and `firstName` above the fields | ||
- `main` tab with `lastName`, `age` and `phone` fields | ||
- `other` tab with `nickName` field | ||
### Field aliases in different tabs | ||
One of the requirements for this project was to support same field on different tabs, in order to do that you can specify field alias | ||
in `uiSchema`. Field `alias` is basically a field UI configuration, that will be used instead of original field in specified tab. | ||
Aliases can be nested as regular fields. | ||
For example, if we want to show `firstName` in both tabs `main` and `other`. | ||
```js | ||
const uiSchema = { | ||
firstName: { | ||
"ui:tabID": "main" | ||
}, | ||
firsNameAlias: { | ||
"ui:tabID": "other" | ||
}, | ||
lastName: { | ||
"ui:tabID": "main" | ||
}, | ||
age: { | ||
"ui:tabID": "main" | ||
}, | ||
phone: { | ||
"ui:tabID": "main" | ||
}, | ||
nickName: { | ||
"ui:tabID": "other" | ||
}, | ||
"ui:tabAlias": { | ||
firstName: "firsNameAlias" | ||
} | ||
}; | ||
``` | ||
With this configuration pagination will put `firstName` in both `main` and `other` tabs. | ||
`ui:tabAlias` is a simple object with | ||
- keys - as original schema field names | ||
- values - an alias name or an array of alias names | ||
You can specify either single alias or as many aliases as you want with an array. | ||
### Configure tab names | ||
Tab falls back to string name of the tab, but you can override it with `tabData` property | ||
## Contribute | ||
- Issue Tracker: github.com/RxNT/react-jsonschema-form-pagination/issues | ||
- Source Code: github.com/RxNT/react-jsonschema-form-pagination | ||
## Support | ||
If you are having issues, please let us know. | ||
## License | ||
The project is licensed under the Apache-2.0 license. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
351110
14
728
206
4