umwd-components 0.1.355 → 0.1.357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index4.js +6 -0
- package/dist/_virtual/index5.js +6 -0
- package/dist/_virtual/index6.js +6 -0
- package/dist/_virtual/index7.js +6 -0
- package/dist/_virtual/sax.js +6 -0
- package/dist/_virtual/string_decoder.js +6 -0
- package/dist/node_modules/base64-js/index.js +6 -0
- package/dist/node_modules/buffer/index.js +12 -0
- package/dist/node_modules/ieee754/index.js +7 -0
- package/dist/node_modules/safe-buffer/index.js +7 -0
- package/dist/node_modules/sax/lib/sax.js +7 -0
- package/dist/node_modules/string_decoder/lib/string_decoder.js +6 -0
- package/dist/node_modules/xml-js/lib/array-helper.js +6 -0
- package/dist/node_modules/xml-js/lib/index.js +6 -0
- package/dist/node_modules/xml-js/lib/js2xml.js +6 -0
- package/dist/node_modules/xml-js/lib/json2xml.js +6 -0
- package/dist/node_modules/xml-js/lib/options-helper.js +6 -0
- package/dist/node_modules/xml-js/lib/xml2js.js +6 -0
- package/dist/node_modules/xml-js/lib/xml2json.js +6 -0
- package/dist/src/components/e-commerce/checkout/CheckoutForm.js +1 -1
- package/dist/src/components/e-commerce/customer/BusinessCredentials.js +1 -1
- package/dist/src/components/e-commerce/customer/CustomerProfileEditForm.js +1 -1
- package/dist/src/context/e-commerce/checkout/CheckoutContext.js +1 -1
- package/dist/src/lib/eoriValidate.js +6 -0
- package/dist/src/lib/vatValidate.js +6 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/e-commerce/customer/BusinessCredentials.d.ts +1 -1
- package/dist/types/lib/eoriValidate.d.ts +21 -0
- package/dist/types/lib/vatValidate.d.ts +27 -0
- package/dist/types/types/e-commerce/BusinessCredentialsProps.d.ts +1 -0
- package/package.json +3 -2
- package/src/components/e-commerce/checkout/CheckoutForm.tsx +3 -9
- package/src/components/e-commerce/customer/BusinessCredentials.tsx +65 -5
- package/src/components/e-commerce/customer/CustomerProfileEditForm.tsx +16 -20
- package/src/context/e-commerce/checkout/CheckoutContext.tsx +9 -5
- package/src/lib/eoriValidate.ts +58 -0
- package/src/lib/vatValidate.ts +97 -0
- package/src/types/e-commerce/BusinessCredentialsProps.ts +1 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__exports as r}from"../../_virtual/index7.js";var t;function e(){if(t)return r;t=1,r.byteLength=function(r){var t=i(r),e=t[0],n=t[1];return 3*(e+n)/4-n},r.toByteArray=function(r){var t,e,a=i(r),u=a[0],h=a[1],c=new o(function(r,t,e){return 3*(t+e)/4-e}(0,u,h)),f=0,d=h>0?u-4:u;for(e=0;e<d;e+=4)t=n[r.charCodeAt(e)]<<18|n[r.charCodeAt(e+1)]<<12|n[r.charCodeAt(e+2)]<<6|n[r.charCodeAt(e+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;2===h&&(t=n[r.charCodeAt(e)]<<2|n[r.charCodeAt(e+1)]>>4,c[f++]=255&t);1===h&&(t=n[r.charCodeAt(e)]<<10|n[r.charCodeAt(e+1)]<<4|n[r.charCodeAt(e+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t);return c},r.fromByteArray=function(r){for(var t,n=r.length,o=n%3,a=[],u=16383,i=0,c=n-o;i<c;i+=u)a.push(h(r,i,i+u>c?c:i+u));1===o?(t=r[n-1],a.push(e[t>>2]+e[t<<4&63]+"==")):2===o&&(t=(r[n-2]<<8)+r[n-1],a.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"="));return a.join("")};for(var e=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)e[u]=a[u],n[a.charCodeAt(u)]=u;function i(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function h(r,t,n){for(var o,a,u=[],i=t;i<n;i+=3)o=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(255&r[i+2]),u.push(e[(a=o)>>18&63]+e[a>>12&63]+e[a>>6&63]+e[63&a]);return u.join("")}return n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63,r}export{e as __require};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__exports as t}from"../../_virtual/index5.js";import{__require as r}from"../base64-js/index.js";import{__require as e}from"../ieee754/index.js";
|
|
7
|
+
/*!
|
|
8
|
+
* The buffer module from node.js, for the browser.
|
|
9
|
+
*
|
|
10
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
11
|
+
* @license MIT
|
|
12
|
+
*/var n;function i(){return n||(n=1,function(t){var n=r(),i=e(),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},t.INSPECT_MAX_BYTES=50;var f=2147483647;function u(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=new Uint8Array(t);return Object.setPrototypeOf(r,s.prototype),r}function s(t,r,e){if("number"==typeof t){if("string"==typeof r)throw new TypeError('The "string" argument must be of type string. Received type number');return p(t)}return h(t,r,e)}function h(t,r,e){if("string"==typeof t)return function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=0|g(t,r),n=u(e),i=n.write(t,r);i!==e&&(n=n.slice(0,i));return n}(t,r);if(ArrayBuffer.isView(t))return function(t){if(F(t,Uint8Array)){var r=new Uint8Array(t);return l(r.buffer,r.byteOffset,r.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return l(t,r,e);if("undefined"!=typeof SharedArrayBuffer&&(F(t,SharedArrayBuffer)||t&&F(t.buffer,SharedArrayBuffer)))return l(t,r,e);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,r,e);var i=function(t){if(s.isBuffer(t)){var r=0|y(t.length),e=u(r);return 0===e.length||t.copy(e,0,0,r),e}if(void 0!==t.length)return"number"!=typeof t.length||N(t.length)?u(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),r,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function p(t){return a(t),u(t<0?0:0|y(t))}function c(t){for(var r=t.length<0?0:0|y(t.length),e=u(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e),Object.setPrototypeOf(n,s.prototype),n}function y(t){if(t>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function g(t,r){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var e=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===e)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return q(t).length;default:if(i)return n?-1:z(t).length;r=(""+r).toLowerCase(),i=!0}}function w(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,r,e);case"utf8":case"utf-8":return I(this,r,e);case"ascii":return S(this,r,e);case"latin1":case"binary":return O(this,r,e);case"base64":return T(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function v(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),N(e=+e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:b(t,r,e,n,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):b(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,r,e,n,i){var o,f=1,u=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;f=2,u/=2,s/=2,e/=2}function h(t,r){return 1===f?t[r]:t.readUInt16BE(r*f)}if(i){var a=-1;for(o=e;o<u;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*f}else-1!==a&&(o-=o-a),a=-1}else for(e+s>u&&(e=u-s),o=e;o>=0;o--){for(var p=!0,c=0;c<s;c++)if(h(t,o+c)!==h(r,c)){p=!1;break}if(p)return o}return-1}function m(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;n>o/2&&(n=o/2);for(var f=0;f<n;++f){var u=parseInt(r.substr(2*f,2),16);if(N(u))return f;t[e+f]=u}return f}function E(t,r,e,n){return D(z(r,t.length-e),t,e,n)}function B(t,r,e,n){return D(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function A(t,r,e,n){return D(q(r),t,e,n)}function U(t,r,e,n){return D(function(t,r){for(var e,n,i,o=[],f=0;f<t.length&&!((r-=2)<0);++f)n=(e=t.charCodeAt(f))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function T(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function I(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,f,u,s,h=t[i],a=null,p=h>239?4:h>223?3:h>191?2:1;if(i+p<=e)switch(p){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],f=t[i+2],128==(192&o)&&128==(192&f)&&(s=(15&h)<<12|(63&o)<<6|63&f)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],f=t[i+2],u=t[i+3],128==(192&o)&&128==(192&f)&&128==(192&u)&&(s=(15&h)<<18|(63&o)<<12|(63&f)<<6|63&u)>65535&&s<1114112&&(a=s)}null===a?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=p}return function(t){var r=t.length;if(r<=L)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=L));return e}(n)}t.kMaxLength=f,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(t,r),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,r,e){return h(t,r,e)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,r,e){return function(t,r,e){return a(t),t<=0?u(t):void 0!==r?"string"==typeof e?u(t).fill(r,e):u(t).fill(r):u(t)}(t,r,e)},s.allocUnsafe=function(t){return p(t)},s.allocUnsafeSlow=function(t){return p(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,r){if(F(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),F(r,Uint8Array)&&(r=s.from(r,r.offset,r.byteLength)),!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},s.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}},s.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=s.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(F(o,Uint8Array))i+o.length>n.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},s.byteLength=g,s.prototype._isBuffer=!0,s.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 r=0;r<t;r+=2)d(this,r,r+1);return this},s.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 r=0;r<t;r+=4)d(this,r,r+3),d(this,r+1,r+2);return this},s.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 r=0;r<t;r+=8)d(this,r,r+7),d(this,r+1,r+6),d(this,r+2,r+5),d(this,r+3,r+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?I(this,0,t):w.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var r="",e=t.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(t,r,e,n,i){if(F(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),f=(e>>>=0)-(r>>>=0),u=Math.min(o,f),h=this.slice(n,i),a=t.slice(r,e),p=0;p<u;++p)if(h[p]!==a[p]){o=h[p],f=a[p];break}return o<f?-1:f<o?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return v(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return v(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,r,e);case"utf8":case"utf-8":return E(this,t,r,e);case"ascii":case"latin1":case"binary":return B(this,t,r,e);case"base64":return A(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function S(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function R(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Y[t[o]];return i}function x(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function C(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function _(t,r,e,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function P(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function k(t,r,e,n,o){return r=+r,e>>>=0,o||P(t,0,e,4),i.write(t,r,e,n,23,4),e+4}function j(t,r,e,n,o){return r=+r,e>>>=0,o||P(t,0,e,8),i.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e=this.length;(t=~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):r>e&&(r=e),r<t&&(r=t);var n=this.subarray(t,r);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,r,e){t>>>=0,r>>>=0,e||C(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||C(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,r){return t>>>=0,r||C(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,r){return t>>>=0,r||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,r){return t>>>=0,r||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,r){return t>>>=0,r||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,r){return t>>>=0,r||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t>>>=0,r>>>=0,e||C(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||C(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},s.prototype.readInt8=function(t,r){return t>>>=0,r||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){t>>>=0,r||C(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){t>>>=0,r||C(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return t>>>=0,r||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return t>>>=0,r||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return t>>>=0,r||C(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return t>>>=0,r||C(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return t>>>=0,r||C(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return t>>>=0,r||C(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||_(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||_(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,1,255,0),this[r]=255&t,r+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var i=Math.pow(2,8*e-1);_(this,t,r,e,i-1,-i)}var o=0,f=1,u=0;for(this[r]=255&t;++o<e&&(f*=256);)t<0&&0===u&&0!==this[r+o-1]&&(u=1),this[r+o]=(t/f>>0)-u&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var i=Math.pow(2,8*e-1);_(this,t,r,e,i-1,-i)}var o=e-1,f=1,u=0;for(this[r+o]=255&t;--o>=0&&(f*=256);)t<0&&0===u&&0!==this[r+o+1]&&(u=1),this[r+o]=(t/f>>0)-u&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,4,2147483647,-2147483648),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r>>>=0,e||_(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},s.prototype.writeFloatLE=function(t,r,e){return k(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return k(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return j(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return j(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i=n-e;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(r,e,n):Uint8Array.prototype.set.call(t,this.subarray(e,n),r),i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var f=s.isBuffer(t)?t:s.from(t,n),u=f.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<e-r;++o)this[o+r]=f[o%u]}return this};var M=/[^+/0-9A-Za-z-_]/g;function z(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],f=0;f<n;++f){if((e=t.charCodeAt(f))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function F(t,r){return t instanceof r||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===r.name}function N(t){return t!=t}var Y=function(){for(var t="0123456789abcdef",r=new Array(256),e=0;e<16;++e)for(var n=16*e,i=0;i<16;++i)r[n+i]=t[e]+t[i];return r}()}(t)),t}export{i as __require};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__exports as a}from"../../_virtual/index6.js";
|
|
7
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var t;function o(){return t||(t=1,a.read=function(a,t,o,r,h){var M,e,i=8*h-r-1,p=(1<<i)-1,f=p>>1,n=-7,w=o?h-1:0,s=o?-1:1,u=a[t+w];for(w+=s,M=u&(1<<-n)-1,u>>=-n,n+=i;n>0;M=256*M+a[t+w],w+=s,n-=8);for(e=M&(1<<-n)-1,M>>=-n,n+=r;n>0;e=256*e+a[t+w],w+=s,n-=8);if(0===M)M=1-f;else{if(M===p)return e?NaN:1/0*(u?-1:1);e+=Math.pow(2,r),M-=f}return(u?-1:1)*e*Math.pow(2,M-r)},a.write=function(a,t,o,r,h,M){var e,i,p,f=8*M-h-1,n=(1<<f)-1,w=n>>1,s=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:M-1,N=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,e=n):(e=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-e))<1&&(e--,p*=2),(t+=e+w>=1?s/p:s*Math.pow(2,1-w))*p>=2&&(e++,p/=2),e+w>=n?(i=0,e=n):e+w>=1?(i=(t*p-1)*Math.pow(2,h),e+=w):(i=t*Math.pow(2,w-1)*Math.pow(2,h),e=0));h>=8;a[o+u]=255&i,u+=N,i/=256,h-=8);for(e=e<<h|i,f+=h;f>0;a[o+u]=255&e,u+=N,e/=256,f-=8);a[o+u-N]|=128*_}),a}export{o as __require};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__module as r}from"../../_virtual/index4.js";import{__require as e}from"../buffer/index.js";
|
|
7
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var o;function n(){return o||(o=1,function(r,o){var n=e(),t=n.Buffer;function u(r,e){for(var o in r)e[o]=r[o]}function f(r,e,o){return t(r,e,o)}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?r.exports=n:(u(n,o),o.Buffer=f),f.prototype=Object.create(t.prototype),u(t,f),f.from=function(r,e,o){if("number"==typeof r)throw new TypeError("Argument must not be a number");return t(r,e,o)},f.alloc=function(r,e,o){if("number"!=typeof r)throw new TypeError("Argument must be a number");var n=t(r);return void 0!==e?"string"==typeof o?n.fill(e,o):n.fill(e):n.fill(0),n},f.allocUnsafe=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return t(r)},f.allocUnsafeSlow=function(r){if("number"!=typeof r)throw new TypeError("Argument must be a number");return n.SlowBuffer(r)}}(r,r.exports)),r.exports}export{n as __require};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__exports as t}from"../../../_virtual/sax.js";import{__require as e}from"../../string_decoder/lib/string_decoder.js";!function(t){t.parser=function(t,e){return new n(t,e)},t.SAXParser=n,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var a,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function n(e,a){if(!(this instanceof n))return new n(e,a);var i=this;!function(t){for(var e=0,a=r.length;e<a;e++)t[r[e]]=""}(i),i.q=i.c="",i.bufferCheckPosition=t.MAX_BUFFER_LENGTH,i.opt=a||{},i.opt.lowercase=i.opt.lowercase||i.opt.lowercasetags,i.looseCase=i.opt.lowercase?"toLowerCase":"toUpperCase",i.tags=[],i.closed=i.closedRoot=i.sawRoot=!1,i.tag=i.error=null,i.strict=!!e,i.noscript=!(!e&&!i.opt.noscript),i.state=C.BEGIN,i.strictEntities=i.opt.strictEntities,i.ENTITIES=i.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),i.attribList=[],i.opt.xmlns&&(i.ns=Object.create(T)),void 0===i.opt.unquotedAttributeValues&&(i.opt.unquotedAttributeValues=!e),i.trackPosition=!1!==i.opt.position,i.trackPosition&&(i.position=i.line=i.column=0),O(i,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e=[];for(var a in t)t.hasOwnProperty(a)&&e.push(a);return e}),n.prototype={end:function(){P(this)},write:function(e){var a=this;if(this.error)throw this.error;if(a.closed)return y(a,"Cannot write after close. Assign an onready handler.");if(null===e)return P(a);"object"==typeof e&&(e=e.toString());for(var n=0,i="";i=V(e,n++),a.c=i,i;)switch(a.trackPosition&&(a.position++,"\n"===i?(a.line++,a.column=0):a.column++),a.state){case C.BEGIN:if(a.state=C.BEGIN_WHITESPACE,"\ufeff"===i)continue;G(a,i);continue;case C.BEGIN_WHITESPACE:G(a,i);continue;case C.TEXT:if(a.sawRoot&&!a.closedRoot){for(var o=n-1;i&&"<"!==i&&"&"!==i;)(i=V(e,n++))&&a.trackPosition&&(a.position++,"\n"===i?(a.line++,a.column=0):a.column++);a.textNode+=e.substring(o,n-1)}"<"!==i||a.sawRoot&&a.closedRoot&&!a.strict?(N(i)||a.sawRoot&&!a.closedRoot||R(a,"Text data outside of root node."),"&"===i?a.state=C.TEXT_ENTITY:a.textNode+=i):(a.state=C.OPEN_WAKA,a.startTagPosition=a.position);continue;case C.SCRIPT:"<"===i?a.state=C.SCRIPT_ENDING:a.script+=i;continue;case C.SCRIPT_ENDING:"/"===i?a.state=C.CLOSE_TAG:(a.script+="<"+i,a.state=C.SCRIPT);continue;case C.OPEN_WAKA:if("!"===i)a.state=C.SGML_DECL,a.sgmlDecl="";else if(N(i));else if(g(E,i))a.state=C.OPEN_TAG,a.tagName=i;else if("/"===i)a.state=C.CLOSE_TAG,a.tagName="";else if("?"===i)a.state=C.PROC_INST,a.procInstName=a.procInstBody="";else{if(R(a,"Unencoded <"),a.startTagPosition+1<a.position){var u=a.position-a.startTagPosition;i=new Array(u).join(" ")+i}a.textNode+="<"+i,a.state=C.TEXT}continue;case C.SGML_DECL:if(a.sgmlDecl+i==="--"){a.state=C.COMMENT,a.comment="",a.sgmlDecl="";continue}a.doctype&&!0!==a.doctype&&a.sgmlDecl?(a.state=C.DOCTYPE_DTD,a.doctype+="<!"+a.sgmlDecl+i,a.sgmlDecl=""):(a.sgmlDecl+i).toUpperCase()===s?(S(a,"onopencdata"),a.state=C.CDATA,a.sgmlDecl="",a.cdata=""):(a.sgmlDecl+i).toUpperCase()===c?(a.state=C.DOCTYPE,(a.doctype||a.sawRoot)&&R(a,"Inappropriately located doctype declaration"),a.doctype="",a.sgmlDecl=""):">"===i?(S(a,"onsgmldeclaration",a.sgmlDecl),a.sgmlDecl="",a.state=C.TEXT):d(i)?(a.state=C.SGML_DECL_QUOTED,a.sgmlDecl+=i):a.sgmlDecl+=i;continue;case C.SGML_DECL_QUOTED:i===a.q&&(a.state=C.SGML_DECL,a.q=""),a.sgmlDecl+=i;continue;case C.DOCTYPE:">"===i?(a.state=C.TEXT,S(a,"ondoctype",a.doctype),a.doctype=!0):(a.doctype+=i,"["===i?a.state=C.DOCTYPE_DTD:d(i)&&(a.state=C.DOCTYPE_QUOTED,a.q=i));continue;case C.DOCTYPE_QUOTED:a.doctype+=i,i===a.q&&(a.q="",a.state=C.DOCTYPE);continue;case C.DOCTYPE_DTD:"]"===i?(a.doctype+=i,a.state=C.DOCTYPE):"<"===i?(a.state=C.OPEN_WAKA,a.startTagPosition=a.position):d(i)?(a.doctype+=i,a.state=C.DOCTYPE_DTD_QUOTED,a.q=i):a.doctype+=i;continue;case C.DOCTYPE_DTD_QUOTED:a.doctype+=i,i===a.q&&(a.state=C.DOCTYPE_DTD,a.q="");continue;case C.COMMENT:"-"===i?a.state=C.COMMENT_ENDING:a.comment+=i;continue;case C.COMMENT_ENDING:"-"===i?(a.state=C.COMMENT_ENDED,a.comment=v(a.opt,a.comment),a.comment&&S(a,"oncomment",a.comment),a.comment=""):(a.comment+="-"+i,a.state=C.COMMENT);continue;case C.COMMENT_ENDED:">"!==i?(R(a,"Malformed comment"),a.comment+="--"+i,a.state=C.COMMENT):a.doctype&&!0!==a.doctype?a.state=C.DOCTYPE_DTD:a.state=C.TEXT;continue;case C.CDATA:"]"===i?a.state=C.CDATA_ENDING:a.cdata+=i;continue;case C.CDATA_ENDING:"]"===i?a.state=C.CDATA_ENDING_2:(a.cdata+="]"+i,a.state=C.CDATA);continue;case C.CDATA_ENDING_2:">"===i?(a.cdata&&S(a,"oncdata",a.cdata),S(a,"onclosecdata"),a.cdata="",a.state=C.TEXT):"]"===i?a.cdata+="]":(a.cdata+="]]"+i,a.state=C.CDATA);continue;case C.PROC_INST:"?"===i?a.state=C.PROC_INST_ENDING:N(i)?a.state=C.PROC_INST_BODY:a.procInstName+=i;continue;case C.PROC_INST_BODY:if(!a.procInstBody&&N(i))continue;"?"===i?a.state=C.PROC_INST_ENDING:a.procInstBody+=i;continue;case C.PROC_INST_ENDING:">"===i?(S(a,"onprocessinginstruction",{name:a.procInstName,body:a.procInstBody}),a.procInstName=a.procInstBody="",a.state=C.TEXT):(a.procInstBody+="?"+i,a.state=C.PROC_INST_BODY);continue;case C.OPEN_TAG:g(p,i)?a.tagName+=i:(L(a),">"===i?w(a):"/"===i?a.state=C.OPEN_TAG_SLASH:(N(i)||R(a,"Invalid character in tag name"),a.state=C.ATTRIB));continue;case C.OPEN_TAG_SLASH:">"===i?(w(a,!0),x(a)):(R(a,"Forward-slash in opening tag not followed by >"),a.state=C.ATTRIB);continue;case C.ATTRIB:if(N(i))continue;">"===i?w(a):"/"===i?a.state=C.OPEN_TAG_SLASH:g(E,i)?(a.attribName=i,a.attribValue="",a.state=C.ATTRIB_NAME):R(a,"Invalid attribute name");continue;case C.ATTRIB_NAME:"="===i?a.state=C.ATTRIB_VALUE:">"===i?(R(a,"Attribute without value"),a.attribValue=a.attribName,U(a),w(a)):N(i)?a.state=C.ATTRIB_NAME_SAW_WHITE:g(p,i)?a.attribName+=i:R(a,"Invalid attribute name");continue;case C.ATTRIB_NAME_SAW_WHITE:if("="===i)a.state=C.ATTRIB_VALUE;else{if(N(i))continue;R(a,"Attribute without value"),a.tag.attributes[a.attribName]="",a.attribValue="",S(a,"onattribute",{name:a.attribName,value:""}),a.attribName="",">"===i?w(a):g(E,i)?(a.attribName=i,a.state=C.ATTRIB_NAME):(R(a,"Invalid attribute name"),a.state=C.ATTRIB)}continue;case C.ATTRIB_VALUE:if(N(i))continue;d(i)?(a.q=i,a.state=C.ATTRIB_VALUE_QUOTED):(a.opt.unquotedAttributeValues||y(a,"Unquoted attribute value"),a.state=C.ATTRIB_VALUE_UNQUOTED,a.attribValue=i);continue;case C.ATTRIB_VALUE_QUOTED:if(i!==a.q){"&"===i?a.state=C.ATTRIB_VALUE_ENTITY_Q:a.attribValue+=i;continue}U(a),a.q="",a.state=C.ATTRIB_VALUE_CLOSED;continue;case C.ATTRIB_VALUE_CLOSED:N(i)?a.state=C.ATTRIB:">"===i?w(a):"/"===i?a.state=C.OPEN_TAG_SLASH:g(E,i)?(R(a,"No whitespace between attributes"),a.attribName=i,a.attribValue="",a.state=C.ATTRIB_NAME):R(a,"Invalid attribute name");continue;case C.ATTRIB_VALUE_UNQUOTED:if(!f(i)){"&"===i?a.state=C.ATTRIB_VALUE_ENTITY_U:a.attribValue+=i;continue}U(a),">"===i?w(a):a.state=C.ATTRIB;continue;case C.CLOSE_TAG:if(a.tagName)">"===i?x(a):g(p,i)?a.tagName+=i:a.script?(a.script+="</"+a.tagName,a.tagName="",a.state=C.SCRIPT):(N(i)||R(a,"Invalid tagname in closing tag"),a.state=C.CLOSE_TAG_SAW_WHITE);else{if(N(i))continue;A(E,i)?a.script?(a.script+="</"+i,a.state=C.SCRIPT):R(a,"Invalid tagname in closing tag."):a.tagName=i}continue;case C.CLOSE_TAG_SAW_WHITE:if(N(i))continue;">"===i?x(a):R(a,"Invalid characters in closing tag");continue;case C.TEXT_ENTITY:case C.ATTRIB_VALUE_ENTITY_Q:case C.ATTRIB_VALUE_ENTITY_U:var l,T;switch(a.state){case C.TEXT_ENTITY:l=C.TEXT,T="textNode";break;case C.ATTRIB_VALUE_ENTITY_Q:l=C.ATTRIB_VALUE_QUOTED,T="attribValue";break;case C.ATTRIB_VALUE_ENTITY_U:l=C.ATTRIB_VALUE_UNQUOTED,T="attribValue"}if(";"===i){var I=M(a);a.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(I)?(a.entity="",a.state=l,a.write(I)):(a[T]+=I,a.entity="",a.state=l)}else g(a.entity.length?_:m,i)?a.entity+=i:(R(a,"Invalid character in entity name"),a[T]+="&"+a.entity+i,a.entity="",a.state=l);continue;default:throw new Error(a,"Unknown state: "+a.state)}return a.position>=a.bufferCheckPosition&&function(e){for(var a=Math.max(t.MAX_BUFFER_LENGTH,10),n=0,i=0,o=r.length;i<o;i++){var s=e[r[i]].length;if(s>a)switch(r[i]){case"textNode":F(e);break;case"cdata":S(e,"oncdata",e.cdata),e.cdata="";break;case"script":S(e,"onscript",e.script),e.script="";break;default:y(e,"Max buffer length exceeded: "+r[i])}n=Math.max(n,s)}var c=t.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=c+e.position}(a),a}
|
|
7
|
+
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;F(t=this),""!==t.cdata&&(S(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(S(t,"onscript",t.script),t.script="")}};try{a=require("stream").Stream}catch(t){a=function(){}}a||(a=function(){});var i=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function o(t,e){if(!(this instanceof o))return new o(t,e);a.apply(this),this._parser=new n(t,e),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(t){r.emit("error",t),r._parser.error=null},this._decoder=null,i.forEach((function(t){Object.defineProperty(r,"on"+t,{get:function(){return r._parser["on"+t]},set:function(e){if(!e)return r.removeAllListeners(t),r._parser["on"+t]=e,e;r.on(t,e)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(a.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var a=e().StringDecoder;this._decoder=new a("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,e){var r=this;return r._parser["on"+t]||-1===i.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),a.prototype.on.call(r,t,e)};var s="[CDATA[",c="DOCTYPE",u="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/2000/xmlns/",T={xml:u,xmlns:l},E=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function N(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function d(t){return'"'===t||"'"===t}function f(t){return">"===t||N(t)}function g(t,e){return t.test(e)}function A(t,e){return!g(t,e)}var I,D,b,C=0;for(var h in t.STATE={BEGIN:C++,BEGIN_WHITESPACE:C++,TEXT:C++,TEXT_ENTITY:C++,OPEN_WAKA:C++,SGML_DECL:C++,SGML_DECL_QUOTED:C++,DOCTYPE:C++,DOCTYPE_QUOTED:C++,DOCTYPE_DTD:C++,DOCTYPE_DTD_QUOTED:C++,COMMENT_STARTING:C++,COMMENT:C++,COMMENT_ENDING:C++,COMMENT_ENDED:C++,CDATA:C++,CDATA_ENDING:C++,CDATA_ENDING_2:C++,PROC_INST:C++,PROC_INST_BODY:C++,PROC_INST_ENDING:C++,OPEN_TAG:C++,OPEN_TAG_SLASH:C++,ATTRIB:C++,ATTRIB_NAME:C++,ATTRIB_NAME_SAW_WHITE:C++,ATTRIB_VALUE:C++,ATTRIB_VALUE_QUOTED:C++,ATTRIB_VALUE_CLOSED:C++,ATTRIB_VALUE_UNQUOTED:C++,ATTRIB_VALUE_ENTITY_Q:C++,ATTRIB_VALUE_ENTITY_U:C++,CLOSE_TAG:C++,CLOSE_TAG_SAW_WHITE:C++,SCRIPT:C++,SCRIPT_ENDING:C++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var a=t.ENTITIES[e],r="number"==typeof a?String.fromCharCode(a):a;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[h]]=h;function O(t,e,a){t[e]&&t[e](a)}function S(t,e,a){t.textNode&&F(t),O(t,e,a)}function F(t){t.textNode=v(t.opt,t.textNode),t.textNode&&O(t,"ontext",t.textNode),t.textNode=""}function v(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function y(t,e){return F(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,O(t,"onerror",e),t}function P(t){return t.sawRoot&&!t.closedRoot&&R(t,"Unclosed root tag"),t.state!==C.BEGIN&&t.state!==C.BEGIN_WHITESPACE&&t.state!==C.TEXT&&y(t,"Unexpected end"),F(t),t.c="",t.closed=!0,O(t,"onend"),n.call(t,t.strict,t.opt),t}function R(t,e){if("object"!=typeof t||!(t instanceof n))throw new Error("bad call to strictFail");t.strict&&y(t,e)}function L(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,a=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(a.ns=e.ns),t.attribList.length=0,S(t,"onopentagstart",a)}function B(t,e){var a=t.indexOf(":")<0?["",t]:t.split(":"),r=a[0],n=a[1];return e&&"xmlns"===t&&(r="xmlns",n=""),{prefix:r,local:n}}function U(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=B(t.attribName,!0),a=e.prefix,r=e.local;if("xmlns"===a)if("xml"===r&&t.attribValue!==u)R(t,"xml: prefix must be bound to "+u+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==l)R(t,"xmlns: prefix must be bound to "+l+"\nActual: "+t.attribValue);else{var n=t.tag,i=t.tags[t.tags.length-1]||t;n.ns===i.ns&&(n.ns=Object.create(i.ns)),n.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,S(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function w(t,e){if(t.opt.xmlns){var a=t.tag,r=B(t.tagName);a.prefix=r.prefix,a.local=r.local,a.uri=a.ns[r.prefix]||"",a.prefix&&!a.uri&&(R(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),a.uri=r.prefix);var n=t.tags[t.tags.length-1]||t;a.ns&&n.ns!==a.ns&&Object.keys(a.ns).forEach((function(e){S(t,"onopennamespace",{prefix:e,uri:a.ns[e]})}));for(var i=0,o=t.attribList.length;i<o;i++){var s=t.attribList[i],c=s[0],u=s[1],l=B(c,!0),T=l.prefix,E=l.local,p=""===T?"":a.ns[T]||"",m={name:c,value:u,prefix:T,local:E,uri:p};T&&"xmlns"!==T&&!p&&(R(t,"Unbound namespace prefix: "+JSON.stringify(T)),m.uri=T),t.tag.attributes[c]=m,S(t,"onattribute",m)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),S(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=C.TEXT:t.state=C.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function x(t){if(!t.tagName)return R(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=C.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=C.SCRIPT);S(t,"onscript",t.script),t.script=""}var e=t.tags.length,a=t.tagName;t.strict||(a=a[t.looseCase]());for(var r=a;e--&&t.tags[e].name!==r;)R(t,"Unexpected close tag");if(e<0)return R(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=C.TEXT);t.tagName=a;for(var n=t.tags.length;n-- >e;){var i=t.tag=t.tags.pop();t.tagName=t.tag.name,S(t,"onclosetag",t.tagName);var o={};for(var s in i.ns)o[s]=i.ns[s];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&i.ns!==c.ns&&Object.keys(i.ns).forEach((function(e){var a=i.ns[e];S(t,"onclosenamespace",{prefix:e,uri:a})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=C.TEXT}function M(t){var e,a=t.entity,r=a.toLowerCase(),n="";return t.ENTITIES[a]?t.ENTITIES[a]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(a=r).charAt(0)&&("x"===a.charAt(1)?(a=a.slice(2),n=(e=parseInt(a,16)).toString(16)):(a=a.slice(1),n=(e=parseInt(a,10)).toString(10))),a=a.replace(/^0+/,""),isNaN(e)||n.toLowerCase()!==a?(R(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function G(t,e){"<"===e?(t.state=C.OPEN_WAKA,t.startTagPosition=t.position):N(e)||(R(t,"Non-whitespace before first tag."),t.textNode=e,t.state=C.TEXT)}function V(t,e){var a="";return e<t.length&&(a=t.charAt(e)),a}C=t.STATE,String.fromCodePoint||(I=String.fromCharCode,D=Math.floor,b=function(){var t,e,a=[],r=-1,n=arguments.length;if(!n)return"";for(var i="";++r<n;){var o=Number(arguments[r]);if(!isFinite(o)||o<0||o>1114111||D(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?a.push(o):(t=55296+((o-=65536)>>10),e=o%1024+56320,a.push(t,e)),(r+1===n||a.length>16384)&&(i+=I.apply(null,a),a.length=0)}return i},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:b,configurable:!0,writable:!0}):String.fromCodePoint=b)}(t);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__exports as t}from"../../../_virtual/string_decoder.js";import{__require as e}from"../../safe-buffer/index.js";var s;function i(){if(s)return t;s=1;var i=e().Buffer,r=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=l,this.end=u,e=4;break;case"utf8":this.fillLast=h,e=4;break;case"base64":this.text=o,this.end=f,e=3;break;default:return this.write=c,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function h(t){var e=this.lastTotal-this.lastNeed,s=function(t,e,s){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==s?s:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var s=t.toString("utf16le",e);if(s){var i=s.charCodeAt(s.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,s)}return e}function o(t,e){var s=(t.length-e)%3;return 0===s?t.toString("base64",e):(this.lastNeed=3-s,this.lastTotal=3,1===s?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-s))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}return t.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,s;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s<t.length?e?e+this.text(t,s):this.text(t,s):e||""},a.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},a.prototype.text=function(t,e){var s=function(t,e,s){var i=e.length-1;if(i<s)return 0;var r=n(e[i]);if(r>=0)return r>0&&(t.lastNeed=r-1),r;if(--i<s||-2===r)return 0;if(r=n(e[i]),r>=0)return r>0&&(t.lastNeed=r-2),r;if(--i<s||-2===r)return 0;if(r=n(e[i]),r>=0)return r>0&&(2===r?r=0:t.lastNeed=r-3),r;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=s;var i=t.length-(s-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},a.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},t}export{i as __require};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{getDefaultExportFromCjs as m}from"../../../_virtual/_commonjsHelpers.js";import{x as s}from"./xml2js.js";import{x as o}from"./xml2json.js";import{j}from"./js2xml.js";import{j as r}from"./json2xml.js";var l=m({xml2js:s,xml2json:o,js2xml:j,json2xml:r});export{l as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{o as e}from"./options-helper.js";import{a as t}from"./array-helper.js";var n,r,s=e,a=t.isArray;function i(e,t,n){return(!n&&e.spaces?"\n":"")+Array(t+1).join(e.spaces)}function u(e,t,s){if(t.ignoreAttributes)return"";"attributesFn"in t&&(e=t.attributesFn(e,r,n));var a,u,c,o,l=[];for(a in e)e.hasOwnProperty(a)&&null!==e[a]&&void 0!==e[a]&&(o=t.noQuotesForNativeAttributes&&"string"!=typeof e[a]?"":'"',u=(u=""+e[a]).replace(/"/g,"""),c="attributeNameFn"in t?t.attributeNameFn(a,u,r,n):a,l.push(t.spaces&&t.indentAttributes?i(t,s+1,!1):" "),l.push(c+"="+o+("attributeValueFn"in t?t.attributeValueFn(u,a,r,n):u)+o));return e&&Object.keys(e).length&&t.spaces&&t.indentAttributes&&l.push(i(t,s,!1)),l.join("")}function c(e,t,s){return n=e,r="xml",t.ignoreDeclaration?"":"<?xml"+u(e[t.attributesKey],t,s)+"?>"}function o(e,t,s){if(t.ignoreInstruction)return"";var a;for(a in e)if(e.hasOwnProperty(a))break;var i="instructionNameFn"in t?t.instructionNameFn(a,e[a],r,n):a;if("object"==typeof e[a])return n=e,r=i,"<?"+i+u(e[a][t.attributesKey],t,s)+"?>";var c=e[a]?e[a]:"";return"instructionFn"in t&&(c=t.instructionFn(c,a,r,n)),"<?"+i+(c?" "+c:"")+"?>"}function l(e,t){return t.ignoreComment?"":"\x3c!--"+("commentFn"in t?t.commentFn(e,r,n):e)+"--\x3e"}function p(e,t){return t.ignoreCdata?"":"<![CDATA["+("cdataFn"in t?t.cdataFn(e,r,n):e.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function m(e,t){return t.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in t?t.doctypeFn(e,r,n):e)+">"}function y(e,t){return t.ignoreText?"":(e=(e=(e=""+e).replace(/&/g,"&")).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),"textFn"in t?t.textFn(e,r,n):e)}function f(e,t,s,a){return e.reduce((function(e,c){var x=i(t,s,a&&!e);switch(c.type){case"element":return e+x+function(e,t,s){n=e,r=e.name;var a=[],i="elementNameFn"in t?t.elementNameFn(e.name,e):e.name;a.push("<"+i),e[t.attributesKey]&&a.push(u(e[t.attributesKey],t,s));var c=e[t.elementsKey]&&e[t.elementsKey].length||e[t.attributesKey]&&"preserve"===e[t.attributesKey]["xml:space"];return c||(c="fullTagEmptyElementFn"in t?t.fullTagEmptyElementFn(e.name,e):t.fullTagEmptyElement),c?(a.push(">"),e[t.elementsKey]&&e[t.elementsKey].length&&(a.push(f(e[t.elementsKey],t,s+1)),n=e,r=e.name),a.push(t.spaces&&function(e,t){var n;if(e.elements&&e.elements.length)for(n=0;n<e.elements.length;++n)switch(e.elements[n][t.typeKey]){case"text":if(t.indentText)return!0;break;case"cdata":if(t.indentCdata)return!0;break;case"instruction":if(t.indentInstruction)return!0;break;default:return!0}return!1}(e,t)?"\n"+Array(s+1).join(t.spaces):""),a.push("</"+i+">")):a.push("/>"),a.join("")}(c,t,s);case"comment":return e+x+l(c[t.commentKey],t);case"doctype":return e+x+m(c[t.doctypeKey],t);case"cdata":return e+(t.indentCdata?x:"")+p(c[t.cdataKey],t);case"text":return e+(t.indentText?x:"")+y(c[t.textKey],t);case"instruction":var E={};return E[c[t.nameKey]]=c[t.attributesKey]?c:c[t.instructionKey],e+(t.indentInstruction?x:"")+o(E,t,s)}}),"")}function x(e,t,n){var r;for(r in e)if(e.hasOwnProperty(r))switch(r){case t.parentKey:case t.attributesKey:break;case t.textKey:if(t.indentText||n)return!0;break;case t.cdataKey:if(t.indentCdata||n)return!0;break;case t.instructionKey:if(t.indentInstruction||n)return!0;break;case t.doctypeKey:case t.commentKey:default:return!0}return!1}function E(e,t,s,a,c){n=e,r=t;var o="elementNameFn"in s?s.elementNameFn(t,e):t;if(null==e||""===e)return"fullTagEmptyElementFn"in s&&s.fullTagEmptyElementFn(t,e)||s.fullTagEmptyElement?"<"+o+"></"+o+">":"<"+o+"/>";var l=[];if(t){if(l.push("<"+o),"object"!=typeof e)return l.push(">"+y(e,s)+"</"+o+">"),l.join("");e[s.attributesKey]&&l.push(u(e[s.attributesKey],s,a));var p=x(e,s,!0)||e[s.attributesKey]&&"preserve"===e[s.attributesKey]["xml:space"];if(p||(p="fullTagEmptyElementFn"in s?s.fullTagEmptyElementFn(t,e):s.fullTagEmptyElement),!p)return l.push("/>"),l.join("");l.push(">")}return l.push(h(e,s,a+1,!1)),n=e,r=t,t&&l.push((c?i(s,a,!1):"")+"</"+o+">"),l.join("")}function h(e,t,n,r){var s,u,f,h=[];for(u in e)if(e.hasOwnProperty(u))for(f=a(e[u])?e[u]:[e[u]],s=0;s<f.length;++s){switch(u){case t.declarationKey:h.push(c(f[s],t,n));break;case t.instructionKey:h.push((t.indentInstruction?i(t,n,r):"")+o(f[s],t,n));break;case t.attributesKey:case t.parentKey:break;case t.textKey:h.push((t.indentText?i(t,n,r):"")+y(f[s],t));break;case t.cdataKey:h.push((t.indentCdata?i(t,n,r):"")+p(f[s],t));break;case t.doctypeKey:h.push(i(t,n,r)+m(f[s],t));break;case t.commentKey:h.push(i(t,n,r)+l(f[s],t));break;default:h.push(i(t,n,r)+E(f[s],u,t,n,x(f[s],t)))}r=r&&!h.length}return h.join("")}var g=function(e,t){t=function(e){var t=s.copyOptions(e);return s.ensureFlagExists("ignoreDeclaration",t),s.ensureFlagExists("ignoreInstruction",t),s.ensureFlagExists("ignoreAttributes",t),s.ensureFlagExists("ignoreText",t),s.ensureFlagExists("ignoreComment",t),s.ensureFlagExists("ignoreCdata",t),s.ensureFlagExists("ignoreDoctype",t),s.ensureFlagExists("compact",t),s.ensureFlagExists("indentText",t),s.ensureFlagExists("indentCdata",t),s.ensureFlagExists("indentAttributes",t),s.ensureFlagExists("indentInstruction",t),s.ensureFlagExists("fullTagEmptyElement",t),s.ensureFlagExists("noQuotesForNativeAttributes",t),s.ensureSpacesExists(t),"number"==typeof t.spaces&&(t.spaces=Array(t.spaces+1).join(" ")),s.ensureKeyExists("declaration",t),s.ensureKeyExists("instruction",t),s.ensureKeyExists("attributes",t),s.ensureKeyExists("text",t),s.ensureKeyExists("comment",t),s.ensureKeyExists("cdata",t),s.ensureKeyExists("doctype",t),s.ensureKeyExists("type",t),s.ensureKeyExists("name",t),s.ensureKeyExists("elements",t),s.checkFnExists("doctype",t),s.checkFnExists("instruction",t),s.checkFnExists("cdata",t),s.checkFnExists("comment",t),s.checkFnExists("text",t),s.checkFnExists("instructionName",t),s.checkFnExists("elementName",t),s.checkFnExists("attributeName",t),s.checkFnExists("attributeValue",t),s.checkFnExists("attributes",t),s.checkFnExists("fullTagEmptyElement",t),t}(t);var a=[];return n=e,r="_root_",t.compact?a.push(h(e,t,0,!0)):(e[t.declarationKey]&&a.push(c(e[t.declarationKey],t,0)),e[t.elementsKey]&&e[t.elementsKey].length&&a.push(f(e[t.elementsKey],t,0,!a.length))),a.join("")};export{g as j};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{j as r}from"./js2xml.js";var t=r,e=function(r,e){r instanceof Buffer&&(r=r.toString());var n=null;if("string"==typeof r)try{n=JSON.parse(r)}catch(r){throw new Error("The JSON structure is invalid")}else n=r;return t(n,e)};export{e as j};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{a as s}from"./array-helper.js";var r=s.isArray,n={copyOptions:function(s){var r,n={};for(r in s)s.hasOwnProperty(r)&&(n[r]=s[r]);return n},ensureFlagExists:function(s,r){s in r&&"boolean"==typeof r[s]||(r[s]=!1)},ensureSpacesExists:function(s){(!("spaces"in s)||"number"!=typeof s.spaces&&"string"!=typeof s.spaces)&&(s.spaces=0)},ensureAlwaysArrayExists:function(s){"alwaysArray"in s&&("boolean"==typeof s.alwaysArray||r(s.alwaysArray))||(s.alwaysArray=!1)},ensureKeyExists:function(s,r){s+"Key"in r&&"string"==typeof r[s+"Key"]||(r[s+"Key"]=r.compact?"_"+s:s)},checkFnExists:function(s,r){return s+"Fn"in r}};export{n as o};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import"../../sax/lib/sax.js";import{o as e}from"./options-helper.js";import{a as t}from"./array-helper.js";import{__exports as n}from"../../../_virtual/sax.js";var s,i,r=n,a=e,o=t.isArray;function u(e){var t=Number(e);if(!isNaN(t))return t;var n=e.toLowerCase();return"true"===n||"false"!==n&&e}function c(e,t){var n;if(s.compact){if(!i[s[e+"Key"]]&&(o(s.alwaysArray)?-1!==s.alwaysArray.indexOf(s[e+"Key"]):s.alwaysArray)&&(i[s[e+"Key"]]=[]),i[s[e+"Key"]]&&!o(i[s[e+"Key"]])&&(i[s[e+"Key"]]=[i[s[e+"Key"]]]),e+"Fn"in s&&"string"==typeof t&&(t=s[e+"Fn"](t,i)),"instruction"===e&&("instructionFn"in s||"instructionNameFn"in s))for(n in t)if(t.hasOwnProperty(n))if("instructionFn"in s)t[n]=s.instructionFn(t[n],n,i);else{var r=t[n];delete t[n],t[s.instructionNameFn(n,r,i)]=r}o(i[s[e+"Key"]])?i[s[e+"Key"]].push(t):i[s[e+"Key"]]=t}else{i[s.elementsKey]||(i[s.elementsKey]=[]);var a={};if(a[s.typeKey]=e,"instruction"===e){for(n in t)if(t.hasOwnProperty(n))break;a[s.nameKey]="instructionNameFn"in s?s.instructionNameFn(n,t,i):n,s.instructionHasAttributes?(a[s.attributesKey]=t[n][s.attributesKey],"instructionFn"in s&&(a[s.attributesKey]=s.instructionFn(a[s.attributesKey],n,i))):("instructionFn"in s&&(t[n]=s.instructionFn(t[n],n,i)),a[s.instructionKey]=t[n])}else e+"Fn"in s&&(t=s[e+"Fn"](t,i)),a[s[e+"Key"]]=t;s.addParent&&(a[s.parentKey]=i),i[s.elementsKey].push(a)}}function y(e){var t;if("attributesFn"in s&&e&&(e=s.attributesFn(e,i)),(s.trim||"attributeValueFn"in s||"attributeNameFn"in s||s.nativeTypeAttributes)&&e)for(t in e)if(e.hasOwnProperty(t)&&(s.trim&&(e[t]=e[t].trim()),s.nativeTypeAttributes&&(e[t]=u(e[t])),"attributeValueFn"in s&&(e[t]=s.attributeValueFn(e[t],t,i)),"attributeNameFn"in s)){var n=e[t];delete e[t],e[s.attributeNameFn(t,e[t],i)]=n}return e}function l(e){var t={};if(e.body&&("xml"===e.name.toLowerCase()||s.instructionHasAttributes)){for(var n,r=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(n=r.exec(e.body));)t[n[1]]=n[2]||n[3]||n[4];t=y(t)}if("xml"===e.name.toLowerCase()){if(s.ignoreDeclaration)return;i[s.declarationKey]={},Object.keys(t).length&&(i[s.declarationKey][s.attributesKey]=t),s.addParent&&(i[s.declarationKey][s.parentKey]=i)}else{if(s.ignoreInstruction)return;s.trim&&(e.body=e.body.trim());var a={};s.instructionHasAttributes&&Object.keys(t).length?(a[e.name]={},a[e.name][s.attributesKey]=t):a[e.name]=e.body,c("instruction",a)}}function m(e,t){var n;if("object"==typeof e&&(t=e.attributes,e=e.name),t=y(t),"elementNameFn"in s&&(e=s.elementNameFn(e,i)),s.compact){var r;if(n={},!s.ignoreAttributes&&t&&Object.keys(t).length)for(r in n[s.attributesKey]={},t)t.hasOwnProperty(r)&&(n[s.attributesKey][r]=t[r]);!(e in i)&&(o(s.alwaysArray)?-1!==s.alwaysArray.indexOf(e):s.alwaysArray)&&(i[e]=[]),i[e]&&!o(i[e])&&(i[e]=[i[e]]),o(i[e])?i[e].push(n):i[e]=n}else i[s.elementsKey]||(i[s.elementsKey]=[]),(n={})[s.typeKey]="element",n[s.nameKey]=e,!s.ignoreAttributes&&t&&Object.keys(t).length&&(n[s.attributesKey]=t),s.alwaysChildren&&(n[s.elementsKey]=[]),i[s.elementsKey].push(n);n[s.parentKey]=i,i=n}function p(e){s.ignoreText||(e.trim()||s.captureSpacesBetweenElements)&&(s.trim&&(e=e.trim()),s.nativeType&&(e=u(e)),s.sanitize&&(e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")),c("text",e))}function x(e){s.ignoreComment||(s.trim&&(e=e.trim()),c("comment",e))}function K(e){var t=i[s.parentKey];s.addParent||delete i[s.parentKey],i=t}function F(e){s.ignoreCdata||(s.trim&&(e=e.trim()),c("cdata",e))}function b(e){s.ignoreDoctype||(e=e.replace(/^ /,""),s.trim&&(e=e.trim()),c("doctype",e))}function g(e){e.note=e}var f=function(e,t){var n=r.parser(!0,{}),o={};if(i=o,s=function(e){return s=a.copyOptions(e),a.ensureFlagExists("ignoreDeclaration",s),a.ensureFlagExists("ignoreInstruction",s),a.ensureFlagExists("ignoreAttributes",s),a.ensureFlagExists("ignoreText",s),a.ensureFlagExists("ignoreComment",s),a.ensureFlagExists("ignoreCdata",s),a.ensureFlagExists("ignoreDoctype",s),a.ensureFlagExists("compact",s),a.ensureFlagExists("alwaysChildren",s),a.ensureFlagExists("addParent",s),a.ensureFlagExists("trim",s),a.ensureFlagExists("nativeType",s),a.ensureFlagExists("nativeTypeAttributes",s),a.ensureFlagExists("sanitize",s),a.ensureFlagExists("instructionHasAttributes",s),a.ensureFlagExists("captureSpacesBetweenElements",s),a.ensureAlwaysArrayExists(s),a.ensureKeyExists("declaration",s),a.ensureKeyExists("instruction",s),a.ensureKeyExists("attributes",s),a.ensureKeyExists("text",s),a.ensureKeyExists("comment",s),a.ensureKeyExists("cdata",s),a.ensureKeyExists("doctype",s),a.ensureKeyExists("type",s),a.ensureKeyExists("name",s),a.ensureKeyExists("elements",s),a.ensureKeyExists("parent",s),a.checkFnExists("doctype",s),a.checkFnExists("instruction",s),a.checkFnExists("cdata",s),a.checkFnExists("comment",s),a.checkFnExists("text",s),a.checkFnExists("instructionName",s),a.checkFnExists("elementName",s),a.checkFnExists("attributeName",s),a.checkFnExists("attributeValue",s),a.checkFnExists("attributes",s),s}(t),n.opt={strictEntities:!0},n.onopentag=m,n.ontext=p,n.oncomment=x,n.onclosetag=K,n.onerror=g,n.oncdata=F,n.ondoctype=b,n.onprocessinginstruction=l,n.write(e).close(),o[s.elementsKey]){var u=o[s.elementsKey];delete o[s.elementsKey],o[s.elementsKey]=u,delete o.text}return o};export{f as x};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{o as r}from"./options-helper.js";import{x as n}from"./xml2js.js";var a=r,t=n;var e=function(r,n){var e,s,p;return e=function(r){var n=a.copyOptions(r);return a.ensureSpacesExists(n),n}(n),s=t(r,e),p="compact"in e&&e.compact?"_parent":"parent",("addParent"in e&&e.addParent?JSON.stringify(s,(function(r,n){return r===p?"_":n}),e.spaces):JSON.stringify(s,null,e.spaces)).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};export{e as x};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import n from"@mui/material/Typography";import r from"@mui/material/Container";import l from"@mui/material/Stack";import a from"@mui/material/Grid";import i from"@mui/material/Paper";import o from"@mui/material/Box";import m from"@mui/material/Button";import c from"@mui/material/Stepper";import s from"@mui/material/Step";import u from"@mui/material/StepLabel";import p from"@mui/material/MobileStepper";import d from"@mui/material/useMediaQuery";import{useTheme as E}from"@mui/material/styles";import x,{useState as b,useEffect as f}from"react";import g from"next/link";import{useSearchParams as v}from"next/navigation";import{useSession as k}from"../../../context/auth/SessionContext.js";import h from"@mui/icons-material/KeyboardArrowLeft";import C from"@mui/icons-material/KeyboardArrowRight";import y from"./Step1.js";import B from"./Step2.js";import S from"./Step3.js";import j from"./Step4.js";import A from"./Step5.js";import{
|
|
7
|
+
import{extends as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__read as t}from"../../../../node_modules/tslib/tslib.es6.js";import n from"@mui/material/Typography";import r from"@mui/material/Container";import l from"@mui/material/Stack";import a from"@mui/material/Grid";import i from"@mui/material/Paper";import o from"@mui/material/Box";import m from"@mui/material/Button";import c from"@mui/material/Stepper";import s from"@mui/material/Step";import u from"@mui/material/StepLabel";import p from"@mui/material/MobileStepper";import d from"@mui/material/useMediaQuery";import{useTheme as E}from"@mui/material/styles";import x,{useState as b,useEffect as f}from"react";import g from"next/link";import{useSearchParams as v}from"next/navigation";import{useSession as k}from"../../../context/auth/SessionContext.js";import h from"@mui/icons-material/KeyboardArrowLeft";import C from"@mui/icons-material/KeyboardArrowRight";import y from"./Step1.js";import B from"./Step2.js";import S from"./Step3.js";import j from"./Step4.js";import A from"./Step5.js";import{useCheckout as w}from"../../../context/e-commerce/checkout/CheckoutContext.js";function z(z){var P=z.shopUrl,N=void 0===P?"/shop":P,H=E(),I=d(H.breakpoints.down("sm")),L=w(),_=L.state,F=L.runAllChecks,K=t(b(0),2),M=K[0],T=K[1],D=function(){T((function(e){return e+1}))},G=function(){T((function(e){return e-1}))},O=k(),Q=O.loading;O.error;var R=O.user,U=v();f((function(){null!==U&&(U.get("order")&&T(4))}),[U]),f((function(){F()}),[R]);var q=!_.itemsInCart,J=!_.customerProfileComplete,V=[{label:"Login or register",children:x.createElement(y,null),backButton:x.createElement(m,{variant:I?"text":"outlined",disabled:0===M,onClick:G,sx:{mr:1}},"Back",I&&x.createElement(h,null)),nextButton:x.createElement(m,{variant:I?"text":"contained",onClick:D,sx:{ml:1},disabled:!R||q,size:I?"small":"large"},"Next",I&&x.createElement(C,null))},{label:"Provide us with your address",children:x.createElement(B,null),backButton:x.createElement(m,{size:I?"small":"large",onClick:G,disabled:0===M,variant:I?"text":"outlined"},"Back",I&&x.createElement(h,null)),nextButton:x.createElement(m,{size:I?"small":"large",variant:I?"text":"contained",onClick:function(){D()},disabled:!R||q||J},"Next",I&&x.createElement(C,null))},{label:"Set up mailing options",children:x.createElement(S,null),backButton:x.createElement(m,{size:I?"small":"large",variant:I?"text":"outlined",onClick:G,disabled:0===M},"Back",I&&x.createElement(h,null)),nextButton:x.createElement(m,{size:I?"small":"large",variant:I?"text":"contained",onClick:function(){D()},disabled:!R||q||J},"Next",I&&x.createElement(C,null))},{label:"Confirm and make a payment",children:x.createElement(j,null),nextButton:x.createElement(x.Fragment,null,x.createElement(m,{size:I?"small":"large",variant:I?"text":"contained",onClick:function(){D()},disabled:!0},"Next",I&&x.createElement(C,null))),backButton:x.createElement(m,{size:I?"small":"large",variant:I?"text":"outlined",onClick:G,disabled:0===M},"Back",I&&x.createElement(h,null))},{label:"Done!",children:x.createElement(A,null)}];return x.createElement(r,{sx:{py:2,minHeight:"100vh"}},x.createElement(a,{container:!0,spacing:2,sx:{py:3,minHeight:"60vh"}},x.createElement(a,{item:!0,xs:12,component:i},x.createElement(n,{variant:"body1",align:"center"},"items in cart: ",_.itemsInCart.toString()),x.createElement(n,{variant:"body1",align:"center"},"customerProfileComplete: ",_.customerProfileComplete.toString()),x.createElement(n,{variant:"body1",align:"center"},"companyAddressComplete: ",_.companyAddressComplete.toString()),x.createElement(n,{variant:"body1",align:"center"},"deliveryAddressComplete: ",_.deliveryAddressComplete.toString()),x.createElement(n,{variant:"body1",align:"center"},"billingAddressComplete: ",_.billingAddressComplete.toString()),x.createElement(n,{variant:"body1",align:"center"},"businessCredentailsComplete:"," ",_.businessCredentailsComplete.toString()),x.createElement(m,{onClick:function(){console.log("run all checks"),console.log("state",_),F()}},"run all checks")),x.createElement(a,{item:!0,xs:12},x.createElement(n,{variant:"h4",align:"center"},"Check Out")),q&&4!=M&&x.createElement(a,{item:!0,xs:12},x.createElement(o,{sx:{color:"red",border:"2px solid red",p:2}},x.createElement(n,{variant:"h5"},"No products in cart"),x.createElement(n,{variant:"body1"},"There are no products selected to order, please visit the shop befor continuing"))),x.createElement(a,{item:!0,xs:12},x.createElement(o,{width:"100%"},x.createElement(i,{sx:{p:2,mb:2,display:{xs:"block",sm:"none"}}},x.createElement(l,{direction:"row",spacing:2,alignItems:"center"},x.createElement(n,{variant:"body2"},"".concat(M+1," / ").concat(V.length)),x.createElement(n,null,"".concat(V[M].label)))),x.createElement(i,{sx:{px:2,pt:2,mb:2,display:{xs:"none",sm:"block"}}},x.createElement(c,{activeStep:M},V.map((function(t,n){var r={};return x.createElement(s,e({key:n},{},{sx:{pb:"20px"}}),x.createElement(u,r,t.label))})))),!Q&&x.createElement(x.Fragment,null,V[M].children,x.createElement(i,{sx:{p:2,mt:2,display:{xs:"none",sm:"block"}}},x.createElement(l,{direction:"row",spacing:2},V[M].backButton,x.createElement(m,{variant:"outlined",sx:{ml:1}},x.createElement(g,{href:N},"continue shopping")),x.createElement(o,{sx:{flex:"1 1 auto"}}),V[M].nextButton))))),x.createElement(a,{item:!0,xs:12},x.createElement(p,{sx:{display:{xs:"flex",sm:"none"}},variant:"text",steps:V.length,position:"static",activeStep:M,nextButton:V[M].nextButton,backButton:V[M].backButton}))))}export{z as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import e from"@mui/material/Typography";import
|
|
6
|
+
import e from"react";import n from"@mui/material/Typography";import a from"@mui/material/Stack";import t from"@mui/material/Box";import o from"@mui/material/TextField";import m from"@mui/material/Button";import r from"@mui/icons-material/BusinessCenter";import{vatValidate as i}from"../../../lib/vatValidate.js";import{eoriValidate as c}from"../../../lib/eoriValidate.js";function l(o){var l=o.data,u=l.company_name,p=l.business_entity_name,d=l.coc_number,b=l.vat_number,s=l.eori_number;return e.createElement(a,{spacing:2,direction:"row"},e.createElement(r,null),e.createElement(t,null,e.createElement(n,{variant:"h6",component:"p"},u),e.createElement(n,{variant:"body2",component:"p"},p),e.createElement(n,{variant:"body2",component:"p"},d),e.createElement(n,{variant:"body2",component:"p"},b),e.createElement(m,{variant:"contained",color:"primary",onClick:function(){console.log(i(b))}},"validate"),e.createElement(n,{variant:"body2",component:"p"},s),e.createElement(m,{variant:"contained",color:"primary",onClick:function(){console.log(c(s))}},"validate")))}function u(n){var t=n.data,c=n.componentName,l=n.componentReference,u=t||{},p=u.id,d=u.company_name,b=u.business_entity_name,s=u.coc_number,_=u.vat_number,E=u.eori_number;return e.createElement(a,{spacing:1,direction:"row"},e.createElement(r,null),e.createElement(a,{spacing:1,sx:{flex:1}},e.createElement("input",{id:"component_name",type:"hidden",name:"".concat(c,".__component"),value:l}),p&&e.createElement("input",{id:"component_id",type:"hidden",name:"".concat(c,".id"),value:p}),e.createElement(o,{id:"company_name",name:"".concat(c,".company_name"),label:"Company Name",defaultValue:d}),e.createElement(o,{id:"business_entity_name",name:"".concat(c,".business_entity_name"),label:"Business Entity Name",defaultValue:b}),e.createElement(o,{id:"coc_number",name:"".concat(c,".coc_number"),label:"CoC Number",defaultValue:s}),e.createElement(o,{id:"vat_number",name:"".concat(c,".vat_number"),label:"VAT Number",defaultValue:_}),e.createElement(m,{variant:"contained",color:"primary",onClick:function(){_&&console.log(i(_))}},"validate"),e.createElement(o,{id:"eori_number",name:"".concat(c,".eori_number"),label:"EORI Number",defaultValue:E}),e.createElement(m,{variant:"contained",color:"primary",onClick:function(){E&&console.log(i(E))}},"validate")))}export{u as BusinessCredentialsFields,l as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Divider";import
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import r from"@mui/material/Divider";import t from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import n from"@mui/material/Alert";import l from"@mui/material/TextField";import i from"@mui/material/Typography";import{AddressFields as o}from"../../common/Address.js";import{SubmitButton as s}from"../../SubmitButton.js";import{useFormState as d}from"react-dom";import{updateCustomerProfileAction as c}from"../../../data/actions/profile-actions.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{BusinessCredentialsFields as u}from"./BusinessCredentials.js";import{useSession as f}from"../../../context/auth/SessionContext.js";import E,{useEffect as v}from"react";var _={zodErrors:null,strapiErrors:null,data:null,message:null};function g(g){var b=g.data,h=b.id;b.uuid,b.customer_number;var y=b.first_name,x=b.last_name,j=b.email,N=b.phone,A=b.company_address,B=b.delivery_address,S=b.billing_address,C=b.business_credentials,R=e(d(c,_),2),V=R[0],T=R[1],D=f().refreshSession;return v((function(){!V.strapiErrors&&V.message&&D()}),[V]),E.createElement(a,{component:t,sx:{p:2}},E.createElement("form",{action:T},E.createElement(m,{spacing:2},E.createElement("input",{type:"hidden",name:"id",value:h}),E.createElement(l,{id:"first_name",name:"first_name",label:"First Name",defaultValue:y}),E.createElement(l,{id:"last_name",name:"last_name",label:"Last Name",defaultValue:x}),E.createElement(l,{id:"email",name:"email",label:"Email",defaultValue:j}),E.createElement(l,{id:"phone",name:"phone",label:"Phone",defaultValue:N}),E.createElement(i,{variant:"h6"},"Company Address"),E.createElement(r,null),E.createElement(o,{componentName:"company_address",componentReference:"common.address",data:A}),E.createElement(i,{variant:"h6"},"Delivery Address"),E.createElement(r,null),E.createElement(o,{componentName:"delivery_address",componentReference:"common.address",data:B}),E.createElement(i,{variant:"h6"},"Billing Address"),E.createElement(r,null),E.createElement(o,{componentName:"billing_address",componentReference:"common.address",data:S}),E.createElement(i,{variant:"h6"},"Business Credentials"),E.createElement(r,null),E.createElement(u,{componentName:"business_credentials",componentReference:"business.credentials",data:C}),E.createElement(m,{direction:"row-reverse",spacing:2,alignItems:"center",sx:{py:1}},E.createElement(s,{text:"save changes",loadingText:"loading"}),E.createElement(p,{error:null==V?void 0:V.strapiErrors}),(null==V?void 0:V.message)&&E.createElement(n,{severity:"error"},null==V?void 0:V.message)))))}export{g as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__assign as o}from"../../../../node_modules/tslib/tslib.es6.js";import
|
|
7
|
+
import{__read as e,__assign as o}from"../../../../node_modules/tslib/tslib.es6.js";import l,{useReducer as r,useContext as s,createContext as t}from"react";import{isCustomerProfileComplete as i}from"../../../lib/isCustomerProfileComplete.js";import{isAddressComplete as d}from"../../../lib/isAddressComplete.js";import{areBusinessCredentailsComplete as m}from"../../../lib/areBusinessCredentialsComplete.js";import{useClientSideCart as n}from"../../../components/e-commerce/cart/hooks.js";import{useSession as p}from"../../auth/SessionContext.js";var a={itemsInCart:!1,customerProfileComplete:!1,companyAddressComplete:!1,deliveryAddressComplete:!1,billingAddressComplete:!1,businessCredentailsComplete:!1},u=t({state:a,runAllChecks:function(){}}),C=function(e,l){if("UPDATE_CONFIRMATIONS"===l.type){var r=l.payload.itemsInCart,s=l.payload.customerProfileComplete,t=l.payload.companyAddressComplete,i=l.payload.deliveryAddressComplete,d=l.payload.billingAddressComplete,m=l.payload.businessCredentailsComplete;return o(o({},e),{itemsInCart:r,customerProfileComplete:s,companyAddressComplete:t,deliveryAddressComplete:i,billingAddressComplete:d,businessCredentailsComplete:m})}return e},c=function(o){var s=o.children,t=e(r(C,a),2),c=t[0],v=t[1],f=p(),y=f.user;f.loading,f.error;var A=n(),b={state:c,runAllChecks:function(){var e,o,l,r,s=A.state.items.length>0,t=i(null==y?void 0:y.customer_profile),n=d(null===(e=null==y?void 0:y.customer_profile)||void 0===e?void 0:e.company_address),p=d(null===(o=null==y?void 0:y.customer_profile)||void 0===o?void 0:o.delivery_address),a=d(null===(l=null==y?void 0:y.customer_profile)||void 0===l?void 0:l.billing_address),u=m(null===(r=null==y?void 0:y.customer_profile)||void 0===r?void 0:r.business_credentials);v({type:"UPDATE_CONFIRMATIONS",payload:{itemsInCart:s,customerProfileComplete:t,companyAddressComplete:n,deliveryAddressComplete:p,billingAddressComplete:a,businessCredentailsComplete:u}})}};return l.createElement(u.Provider,{value:b},s)},v=function(){return s(u)};export{c as CheckoutProvider,v as useCheckout};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__awaiter as e,__generator as t}from"../../node_modules/tslib/tslib.es6.js";import o from"../../node_modules/axios/lib/axios.js";import s from"../../node_modules/xml-js/lib/index.js";function r(r){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return r=r.replace(/\s/g,""),"https://ec.europa.eu/taxation_customs/dds2/eos/validation/services/validation",e='<?xml version="1.0" encoding="utf-8"?>\r\n<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\r\n<soap:Body>\r\n <ev:validateEORI xmlns:ev="http://eori.ws.eos.dds.s/">\r\n <ev:eori>'.concat(r,"</ev:eori>\r\n </ev:validateEORI>\r\n </soap:Body>\r\n </soap:Envelope>"),[4,o({method:"post",maxBodyLength:1/0,url:"https://ec.europa.eu/taxation_customs/dds2/eos/validation/services/validation",headers:{"Content-Type":"text/xml",SOAPAction:'"#POST"'},data:e}).then((function(e){var t,o,r,n,i,a,l,u,d=s.xml2json(e.data,{compact:!0,spaces:4}),v=JSON.parse(d)["S:Envelope"]["S:Body"]["ns0:validateEORIResponse"];return"1"===(null===(t=v.return.result.status)||void 0===t?void 0:t._text)?{error:"Not a valid EORI number"}:{eori:(null===(o=v.return.result.eori)||void 0===o?void 0:o._text)||"",status:null===(r=v.return.result.status)||void 0===r?void 0:r._text,statusDescr:null===(n=v.return.result.statusDescr)||void 0===n?void 0:n._text,name:(null===(i=v.return.result.name)||void 0===i?void 0:i._text)||"",streetName:(null===(a=v.return.result.street)||void 0===a?void 0:a._text)||"",postalCode:(null===(l=v.return.result.postalCode)||void 0===l?void 0:l._text)||"",cityName:(null===(u=v.return.result.cityName)||void 0===u?void 0:u._text)||""}})).catch((function(e){return console.error(e),{error:"Something seems wrong with the service"}}))];case 1:return[2,t.sent()]}}))}))}export{r as eoriValidate};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* UMWD-Components
|
|
3
|
+
* @copyright Jelle Paulus
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/
|
|
6
|
+
import{__awaiter as e,__generator as t}from"../../node_modules/tslib/tslib.es6.js";import n from"../../node_modules/axios/lib/axios.js";import s from"../../node_modules/xml-js/lib/index.js";function r(r){return e(this,void 0,void 0,(function(){var e,o,a;return t(this,(function(t){switch(t.label){case 0:return r=r.replace(/\s/g,""),e=r.slice(0,2),o=r.slice(2),"https://ec.europa.eu/taxation_customs/vies/services/checkVatService",a='<?xml version="1.0" encoding="utf-8"?>\r\n<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">\r\n <soap:Body>\r\n <m:checkVat xmlns:m="urn:ec.europa.eu:taxud:vies:services:checkVat:types">\r\n <m:countryCode>'.concat(e,"</m:countryCode>\r\n <m:vatNumber>").concat(o,"</m:vatNumber>\r\n </m:checkVat>\r\n </soap:Body>\r\n</soap:Envelope>"),[4,n({method:"post",maxBodyLength:1/0,url:"https://ec.europa.eu/taxation_customs/vies/services/checkVatService",headers:{"Content-Type":"text/xml",SOAPAction:'"#POST"'},data:a}).then((function(e){var t=s.xml2json(e.data,{compact:!0,spaces:4}),n=JSON.parse(t)["env:Envelope"]["env:Body"]["ns2:checkVatResponse"];if("false"===n["ns2:valid"]._text)return{error:"Not a valid VAT number"};return function(){var e,t=n["ns2:address"]._text.replace(/^\s+|\s+$/g,""),s=t.replace(/\r?\n|\r|\n/g," ");if("NL"===n["ns2:countryCode"]._text){var r=t.split(/\r?\n|\r|\n/g),o=r[r.length-1],a=o.split(" ")[0],c=o.split(" ")[1],i=r[0],u=i.split(" ")[i.split(" ").length-1],m=(e=i.split(/\d+/).find((function(e){return""!==e.trim()})))?e.trim():"",l=u-0;return{countryCode:n["ns2:countryCode"]._text,vatNumber:n["ns2:vatNumber"]._text,requestDate:n["ns2:requestDate"]._text,valid:n["ns2:valid"]._text,name:n["ns2:name"]._text,address:s,postalCode:a,cityName:c,streetName:m,houseNumber:l}}return{countryCode:n["ns2:countryCode"]._text,vatNumber:n["ns2:vatNumber"]._text,requestDate:n["ns2:requestDate"]._text,valid:n["ns2:valid"]._text,name:n["ns2:name"]._text,address:s}}()})).catch((function(e){return console.error(e),{error:"It’s a bit busy at the moment, please try again"}}))];case 1:return[2,t.sent()]}}))}))}export{r as vatValidate};
|