@bigbinary/neeto-site-blocks 1.2.10 → 1.2.12
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/index.cjs.js +132 -81
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +132 -81
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -23450,6 +23450,29 @@ function requireFollowRedirects () {
|
|
|
23450
23450
|
var assert = require$$4__default["default"];
|
|
23451
23451
|
var debug = requireDebug();
|
|
23452
23452
|
|
|
23453
|
+
// Whether to use the native URL object or the legacy url module
|
|
23454
|
+
var useNativeURL = false;
|
|
23455
|
+
try {
|
|
23456
|
+
assert(new URL());
|
|
23457
|
+
}
|
|
23458
|
+
catch (error) {
|
|
23459
|
+
useNativeURL = error.code === "ERR_INVALID_URL";
|
|
23460
|
+
}
|
|
23461
|
+
|
|
23462
|
+
// URL fields to preserve in copy operations
|
|
23463
|
+
var preservedUrlFields = [
|
|
23464
|
+
"auth",
|
|
23465
|
+
"host",
|
|
23466
|
+
"hostname",
|
|
23467
|
+
"href",
|
|
23468
|
+
"path",
|
|
23469
|
+
"pathname",
|
|
23470
|
+
"port",
|
|
23471
|
+
"protocol",
|
|
23472
|
+
"query",
|
|
23473
|
+
"search",
|
|
23474
|
+
];
|
|
23475
|
+
|
|
23453
23476
|
// Create handlers that pass events from native requests
|
|
23454
23477
|
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
23455
23478
|
var eventHandlers = Object.create(null);
|
|
@@ -23459,19 +23482,20 @@ function requireFollowRedirects () {
|
|
|
23459
23482
|
};
|
|
23460
23483
|
});
|
|
23461
23484
|
|
|
23485
|
+
// Error types with codes
|
|
23462
23486
|
var InvalidUrlError = createErrorType(
|
|
23463
23487
|
"ERR_INVALID_URL",
|
|
23464
23488
|
"Invalid URL",
|
|
23465
23489
|
TypeError
|
|
23466
23490
|
);
|
|
23467
|
-
// Error types with codes
|
|
23468
23491
|
var RedirectionError = createErrorType(
|
|
23469
23492
|
"ERR_FR_REDIRECTION_FAILURE",
|
|
23470
23493
|
"Redirected request failed"
|
|
23471
23494
|
);
|
|
23472
23495
|
var TooManyRedirectsError = createErrorType(
|
|
23473
23496
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
23474
|
-
"Maximum number of redirects exceeded"
|
|
23497
|
+
"Maximum number of redirects exceeded",
|
|
23498
|
+
RedirectionError
|
|
23475
23499
|
);
|
|
23476
23500
|
var MaxBodyLengthExceededError = createErrorType(
|
|
23477
23501
|
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
@@ -23482,6 +23506,9 @@ function requireFollowRedirects () {
|
|
|
23482
23506
|
"write after end"
|
|
23483
23507
|
);
|
|
23484
23508
|
|
|
23509
|
+
// istanbul ignore next
|
|
23510
|
+
var destroy = Writable.prototype.destroy || noop;
|
|
23511
|
+
|
|
23485
23512
|
// An HTTP(S) request that can be redirected
|
|
23486
23513
|
function RedirectableRequest(options, responseCallback) {
|
|
23487
23514
|
// Initialize the request
|
|
@@ -23503,7 +23530,13 @@ function requireFollowRedirects () {
|
|
|
23503
23530
|
// React to responses of native requests
|
|
23504
23531
|
var self = this;
|
|
23505
23532
|
this._onNativeResponse = function (response) {
|
|
23506
|
-
|
|
23533
|
+
try {
|
|
23534
|
+
self._processResponse(response);
|
|
23535
|
+
}
|
|
23536
|
+
catch (cause) {
|
|
23537
|
+
self.emit("error", cause instanceof RedirectionError ?
|
|
23538
|
+
cause : new RedirectionError({ cause: cause }));
|
|
23539
|
+
}
|
|
23507
23540
|
};
|
|
23508
23541
|
|
|
23509
23542
|
// Perform the first request
|
|
@@ -23512,10 +23545,17 @@ function requireFollowRedirects () {
|
|
|
23512
23545
|
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
23513
23546
|
|
|
23514
23547
|
RedirectableRequest.prototype.abort = function () {
|
|
23515
|
-
|
|
23548
|
+
destroyRequest(this._currentRequest);
|
|
23549
|
+
this._currentRequest.abort();
|
|
23516
23550
|
this.emit("abort");
|
|
23517
23551
|
};
|
|
23518
23552
|
|
|
23553
|
+
RedirectableRequest.prototype.destroy = function (error) {
|
|
23554
|
+
destroyRequest(this._currentRequest, error);
|
|
23555
|
+
destroy.call(this, error);
|
|
23556
|
+
return this;
|
|
23557
|
+
};
|
|
23558
|
+
|
|
23519
23559
|
// Writes buffered data to the current native request
|
|
23520
23560
|
RedirectableRequest.prototype.write = function (data, encoding, callback) {
|
|
23521
23561
|
// Writing is not allowed if end has been called
|
|
@@ -23628,6 +23668,7 @@ function requireFollowRedirects () {
|
|
|
23628
23668
|
self.removeListener("abort", clearTimer);
|
|
23629
23669
|
self.removeListener("error", clearTimer);
|
|
23630
23670
|
self.removeListener("response", clearTimer);
|
|
23671
|
+
self.removeListener("close", clearTimer);
|
|
23631
23672
|
if (callback) {
|
|
23632
23673
|
self.removeListener("timeout", callback);
|
|
23633
23674
|
}
|
|
@@ -23654,6 +23695,7 @@ function requireFollowRedirects () {
|
|
|
23654
23695
|
this.on("abort", clearTimer);
|
|
23655
23696
|
this.on("error", clearTimer);
|
|
23656
23697
|
this.on("response", clearTimer);
|
|
23698
|
+
this.on("close", clearTimer);
|
|
23657
23699
|
|
|
23658
23700
|
return this;
|
|
23659
23701
|
};
|
|
@@ -23712,8 +23754,7 @@ function requireFollowRedirects () {
|
|
|
23712
23754
|
var protocol = this._options.protocol;
|
|
23713
23755
|
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
23714
23756
|
if (!nativeProtocol) {
|
|
23715
|
-
|
|
23716
|
-
return;
|
|
23757
|
+
throw new TypeError("Unsupported protocol " + protocol);
|
|
23717
23758
|
}
|
|
23718
23759
|
|
|
23719
23760
|
// If specified, use the agent corresponding to the protocol
|
|
@@ -23805,15 +23846,14 @@ function requireFollowRedirects () {
|
|
|
23805
23846
|
}
|
|
23806
23847
|
|
|
23807
23848
|
// The response is a redirect, so abort the current request
|
|
23808
|
-
|
|
23849
|
+
destroyRequest(this._currentRequest);
|
|
23809
23850
|
// Discard the remainder of the response to avoid waiting for data
|
|
23810
23851
|
response.destroy();
|
|
23811
23852
|
|
|
23812
23853
|
// RFC7231§6.4: A client SHOULD detect and intervene
|
|
23813
23854
|
// in cyclical redirections (i.e., "infinite" redirection loops).
|
|
23814
23855
|
if (++this._redirectCount > this._options.maxRedirects) {
|
|
23815
|
-
|
|
23816
|
-
return;
|
|
23856
|
+
throw new TooManyRedirectsError();
|
|
23817
23857
|
}
|
|
23818
23858
|
|
|
23819
23859
|
// Store the request headers if applicable
|
|
@@ -23847,33 +23887,23 @@ function requireFollowRedirects () {
|
|
|
23847
23887
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
23848
23888
|
|
|
23849
23889
|
// If the redirect is relative, carry over the host of the last request
|
|
23850
|
-
var currentUrlParts =
|
|
23890
|
+
var currentUrlParts = parseUrl(this._currentUrl);
|
|
23851
23891
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
23852
23892
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
|
23853
23893
|
url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
23854
23894
|
|
|
23855
|
-
// Determine the URL of the redirection
|
|
23856
|
-
var redirectUrl;
|
|
23857
|
-
try {
|
|
23858
|
-
redirectUrl = url.resolve(currentUrl, location);
|
|
23859
|
-
}
|
|
23860
|
-
catch (cause) {
|
|
23861
|
-
this.emit("error", new RedirectionError({ cause: cause }));
|
|
23862
|
-
return;
|
|
23863
|
-
}
|
|
23864
|
-
|
|
23865
23895
|
// Create the redirected request
|
|
23866
|
-
|
|
23896
|
+
var redirectUrl = resolveUrl(location, currentUrl);
|
|
23897
|
+
debug("redirecting to", redirectUrl.href);
|
|
23867
23898
|
this._isRedirect = true;
|
|
23868
|
-
|
|
23869
|
-
Object.assign(this._options, redirectUrlParts);
|
|
23899
|
+
spreadUrlObject(redirectUrl, this._options);
|
|
23870
23900
|
|
|
23871
23901
|
// Drop confidential headers when redirecting to a less secure protocol
|
|
23872
23902
|
// or to a different domain that is not a superdomain
|
|
23873
|
-
if (
|
|
23874
|
-
|
|
23875
|
-
|
|
23876
|
-
!isSubdomain(
|
|
23903
|
+
if (redirectUrl.protocol !== currentUrlParts.protocol &&
|
|
23904
|
+
redirectUrl.protocol !== "https:" ||
|
|
23905
|
+
redirectUrl.host !== currentHost &&
|
|
23906
|
+
!isSubdomain(redirectUrl.host, currentHost)) {
|
|
23877
23907
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
23878
23908
|
}
|
|
23879
23909
|
|
|
@@ -23888,23 +23918,12 @@ function requireFollowRedirects () {
|
|
|
23888
23918
|
method: method,
|
|
23889
23919
|
headers: requestHeaders,
|
|
23890
23920
|
};
|
|
23891
|
-
|
|
23892
|
-
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
23893
|
-
}
|
|
23894
|
-
catch (err) {
|
|
23895
|
-
this.emit("error", err);
|
|
23896
|
-
return;
|
|
23897
|
-
}
|
|
23921
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
23898
23922
|
this._sanitizeOptions(this._options);
|
|
23899
23923
|
}
|
|
23900
23924
|
|
|
23901
23925
|
// Perform the redirected request
|
|
23902
|
-
|
|
23903
|
-
this._performRequest();
|
|
23904
|
-
}
|
|
23905
|
-
catch (cause) {
|
|
23906
|
-
this.emit("error", new RedirectionError({ cause: cause }));
|
|
23907
|
-
}
|
|
23926
|
+
this._performRequest();
|
|
23908
23927
|
};
|
|
23909
23928
|
|
|
23910
23929
|
// Wraps the key/value object of protocols with redirect functionality
|
|
@@ -23924,27 +23943,16 @@ function requireFollowRedirects () {
|
|
|
23924
23943
|
|
|
23925
23944
|
// Executes a request, following redirects
|
|
23926
23945
|
function request(input, options, callback) {
|
|
23927
|
-
// Parse parameters
|
|
23928
|
-
if (
|
|
23929
|
-
|
|
23930
|
-
try {
|
|
23931
|
-
parsed = urlToOptions(new URL(input));
|
|
23932
|
-
}
|
|
23933
|
-
catch (err) {
|
|
23934
|
-
/* istanbul ignore next */
|
|
23935
|
-
parsed = url.parse(input);
|
|
23936
|
-
}
|
|
23937
|
-
if (!isString(parsed.protocol)) {
|
|
23938
|
-
throw new InvalidUrlError({ input });
|
|
23939
|
-
}
|
|
23940
|
-
input = parsed;
|
|
23946
|
+
// Parse parameters, ensuring that input is an object
|
|
23947
|
+
if (isURL(input)) {
|
|
23948
|
+
input = spreadUrlObject(input);
|
|
23941
23949
|
}
|
|
23942
|
-
else if (
|
|
23943
|
-
input =
|
|
23950
|
+
else if (isString(input)) {
|
|
23951
|
+
input = spreadUrlObject(parseUrl(input));
|
|
23944
23952
|
}
|
|
23945
23953
|
else {
|
|
23946
23954
|
callback = options;
|
|
23947
|
-
options = input;
|
|
23955
|
+
options = validateUrl(input);
|
|
23948
23956
|
input = { protocol: protocol };
|
|
23949
23957
|
}
|
|
23950
23958
|
if (isFunction(options)) {
|
|
@@ -23983,27 +23991,57 @@ function requireFollowRedirects () {
|
|
|
23983
23991
|
return exports;
|
|
23984
23992
|
}
|
|
23985
23993
|
|
|
23986
|
-
/* istanbul ignore next */
|
|
23987
23994
|
function noop() { /* empty */ }
|
|
23988
23995
|
|
|
23989
|
-
|
|
23990
|
-
|
|
23991
|
-
|
|
23992
|
-
|
|
23993
|
-
|
|
23994
|
-
|
|
23995
|
-
|
|
23996
|
-
|
|
23997
|
-
|
|
23998
|
-
|
|
23999
|
-
|
|
24000
|
-
|
|
24001
|
-
href: urlObject.href,
|
|
24002
|
-
};
|
|
24003
|
-
if (urlObject.port !== "") {
|
|
24004
|
-
options.port = Number(urlObject.port);
|
|
23996
|
+
function parseUrl(input) {
|
|
23997
|
+
var parsed;
|
|
23998
|
+
/* istanbul ignore else */
|
|
23999
|
+
if (useNativeURL) {
|
|
24000
|
+
parsed = new URL(input);
|
|
24001
|
+
}
|
|
24002
|
+
else {
|
|
24003
|
+
// Ensure the URL is valid and absolute
|
|
24004
|
+
parsed = validateUrl(url.parse(input));
|
|
24005
|
+
if (!isString(parsed.protocol)) {
|
|
24006
|
+
throw new InvalidUrlError({ input });
|
|
24007
|
+
}
|
|
24005
24008
|
}
|
|
24006
|
-
return
|
|
24009
|
+
return parsed;
|
|
24010
|
+
}
|
|
24011
|
+
|
|
24012
|
+
function resolveUrl(relative, base) {
|
|
24013
|
+
/* istanbul ignore next */
|
|
24014
|
+
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
|
|
24015
|
+
}
|
|
24016
|
+
|
|
24017
|
+
function validateUrl(input) {
|
|
24018
|
+
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
24019
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
24020
|
+
}
|
|
24021
|
+
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
|
24022
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
24023
|
+
}
|
|
24024
|
+
return input;
|
|
24025
|
+
}
|
|
24026
|
+
|
|
24027
|
+
function spreadUrlObject(urlObject, target) {
|
|
24028
|
+
var spread = target || {};
|
|
24029
|
+
for (var key of preservedUrlFields) {
|
|
24030
|
+
spread[key] = urlObject[key];
|
|
24031
|
+
}
|
|
24032
|
+
|
|
24033
|
+
// Fix IPv6 hostname
|
|
24034
|
+
if (spread.hostname.startsWith("[")) {
|
|
24035
|
+
spread.hostname = spread.hostname.slice(1, -1);
|
|
24036
|
+
}
|
|
24037
|
+
// Ensure port is a number
|
|
24038
|
+
if (spread.port !== "") {
|
|
24039
|
+
spread.port = Number(spread.port);
|
|
24040
|
+
}
|
|
24041
|
+
// Concatenate path
|
|
24042
|
+
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
|
|
24043
|
+
|
|
24044
|
+
return spread;
|
|
24007
24045
|
}
|
|
24008
24046
|
|
|
24009
24047
|
function removeMatchingHeaders(regex, headers) {
|
|
@@ -24029,17 +24067,25 @@ function requireFollowRedirects () {
|
|
|
24029
24067
|
|
|
24030
24068
|
// Attach constructor and set default properties
|
|
24031
24069
|
CustomError.prototype = new (baseClass || Error)();
|
|
24032
|
-
CustomError.prototype
|
|
24033
|
-
|
|
24070
|
+
Object.defineProperties(CustomError.prototype, {
|
|
24071
|
+
constructor: {
|
|
24072
|
+
value: CustomError,
|
|
24073
|
+
enumerable: false,
|
|
24074
|
+
},
|
|
24075
|
+
name: {
|
|
24076
|
+
value: "Error [" + code + "]",
|
|
24077
|
+
enumerable: false,
|
|
24078
|
+
},
|
|
24079
|
+
});
|
|
24034
24080
|
return CustomError;
|
|
24035
24081
|
}
|
|
24036
24082
|
|
|
24037
|
-
function
|
|
24083
|
+
function destroyRequest(request, error) {
|
|
24038
24084
|
for (var event of events) {
|
|
24039
24085
|
request.removeListener(event, eventHandlers[event]);
|
|
24040
24086
|
}
|
|
24041
24087
|
request.on("error", noop);
|
|
24042
|
-
request.
|
|
24088
|
+
request.destroy(error);
|
|
24043
24089
|
}
|
|
24044
24090
|
|
|
24045
24091
|
function isSubdomain(subdomain, domain) {
|
|
@@ -24060,6 +24106,10 @@ function requireFollowRedirects () {
|
|
|
24060
24106
|
return typeof value === "object" && ("length" in value);
|
|
24061
24107
|
}
|
|
24062
24108
|
|
|
24109
|
+
function isURL(value) {
|
|
24110
|
+
return URL && value instanceof URL;
|
|
24111
|
+
}
|
|
24112
|
+
|
|
24063
24113
|
// Exports
|
|
24064
24114
|
followRedirects.exports = wrap({ http: http, https: https });
|
|
24065
24115
|
followRedirects.exports.wrap = wrap;
|
|
@@ -41131,7 +41181,8 @@ var LogoClouds = function LogoClouds(_ref) {
|
|
|
41131
41181
|
var configurations = _ref.configurations,
|
|
41132
41182
|
_ref$className = _ref.className,
|
|
41133
41183
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
41134
|
-
id = _ref.id
|
|
41184
|
+
id = _ref.id,
|
|
41185
|
+
disableButtonAndLinks = _ref.disableButtonAndLinks;
|
|
41135
41186
|
var properties = configurations.properties,
|
|
41136
41187
|
design = configurations.design;
|
|
41137
41188
|
var _properties$logos = properties.logos,
|
|
@@ -41171,7 +41222,7 @@ var LogoClouds = function LogoClouds(_ref) {
|
|
|
41171
41222
|
url = _ref2.url;
|
|
41172
41223
|
return /*#__PURE__*/React__default["default"].createElement("a", {
|
|
41173
41224
|
className: logoBaseClasses(index),
|
|
41174
|
-
href: url,
|
|
41225
|
+
href: !disableButtonAndLinks && url,
|
|
41175
41226
|
key: getUniqueKey(title, index)
|
|
41176
41227
|
}, /*#__PURE__*/React__default["default"].createElement(StyledImage$1, {
|
|
41177
41228
|
alt: alt,
|