@bigbinary/neeto-site-blocks 1.2.11 → 1.3.0

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.js CHANGED
@@ -15487,6 +15487,29 @@ var Media = function Media(_ref) {
15487
15487
  }, otherProps));
15488
15488
  };
15489
15489
 
15490
+ var PageNavigation = function PageNavigation(_ref) {
15491
+ var Icon = _ref.Icon,
15492
+ isStart = _ref.isStart,
15493
+ onClick = _ref.onClick,
15494
+ _ref$className = _ref.className,
15495
+ className = _ref$className === void 0 ? "" : _ref$className;
15496
+ var StyledIcon = styled(Icon)(function () {
15497
+ return {
15498
+ borderColor: "#1F2433"
15499
+ };
15500
+ });
15501
+ return /*#__PURE__*/React__default.createElement("button", {
15502
+ onClick: onClick,
15503
+ className: classnames("col-span-1", {
15504
+ "col-start-1": isStart,
15505
+ "col-start-12 flex justify-end": !isStart
15506
+ }, className)
15507
+ }, /*#__PURE__*/React__default.createElement(StyledIcon, {
15508
+ fill: "#66C1D4",
15509
+ size: 52
15510
+ }));
15511
+ };
15512
+
15490
15513
  var Pagination$1 = function Pagination(_ref) {
15491
15514
  var _classnames, _classnames2;
15492
15515
  var swiper = _ref.swiper,
@@ -16029,6 +16052,20 @@ function createElement(tag, classes) {
16029
16052
  el.classList.add(...(Array.isArray(classes) ? classes : [classes]));
16030
16053
  return el;
16031
16054
  }
16055
+ function elementOffset(el) {
16056
+ const window = getWindow();
16057
+ const document = getDocument();
16058
+ const box = el.getBoundingClientRect();
16059
+ const body = document.body;
16060
+ const clientTop = el.clientTop || body.clientTop || 0;
16061
+ const clientLeft = el.clientLeft || body.clientLeft || 0;
16062
+ const scrollTop = el === window ? window.scrollY : el.scrollTop;
16063
+ const scrollLeft = el === window ? window.scrollX : el.scrollLeft;
16064
+ return {
16065
+ top: box.top + scrollTop - clientTop,
16066
+ left: box.left + scrollLeft - clientLeft
16067
+ };
16068
+ }
16032
16069
  function elementPrevAll(el, selector) {
16033
16070
  const prevEls = [];
16034
16071
  while (el.previousElementSibling) {
@@ -23404,6 +23441,29 @@ function requireFollowRedirects () {
23404
23441
  var assert = require$$4;
23405
23442
  var debug = requireDebug();
23406
23443
 
23444
+ // Whether to use the native URL object or the legacy url module
23445
+ var useNativeURL = false;
23446
+ try {
23447
+ assert(new URL());
23448
+ }
23449
+ catch (error) {
23450
+ useNativeURL = error.code === "ERR_INVALID_URL";
23451
+ }
23452
+
23453
+ // URL fields to preserve in copy operations
23454
+ var preservedUrlFields = [
23455
+ "auth",
23456
+ "host",
23457
+ "hostname",
23458
+ "href",
23459
+ "path",
23460
+ "pathname",
23461
+ "port",
23462
+ "protocol",
23463
+ "query",
23464
+ "search",
23465
+ ];
23466
+
23407
23467
  // Create handlers that pass events from native requests
23408
23468
  var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
23409
23469
  var eventHandlers = Object.create(null);
@@ -23413,19 +23473,20 @@ function requireFollowRedirects () {
23413
23473
  };
23414
23474
  });
23415
23475
 
23476
+ // Error types with codes
23416
23477
  var InvalidUrlError = createErrorType(
23417
23478
  "ERR_INVALID_URL",
23418
23479
  "Invalid URL",
23419
23480
  TypeError
23420
23481
  );
23421
- // Error types with codes
23422
23482
  var RedirectionError = createErrorType(
23423
23483
  "ERR_FR_REDIRECTION_FAILURE",
23424
23484
  "Redirected request failed"
23425
23485
  );
23426
23486
  var TooManyRedirectsError = createErrorType(
23427
23487
  "ERR_FR_TOO_MANY_REDIRECTS",
23428
- "Maximum number of redirects exceeded"
23488
+ "Maximum number of redirects exceeded",
23489
+ RedirectionError
23429
23490
  );
23430
23491
  var MaxBodyLengthExceededError = createErrorType(
23431
23492
  "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
@@ -23436,6 +23497,9 @@ function requireFollowRedirects () {
23436
23497
  "write after end"
23437
23498
  );
23438
23499
 
23500
+ // istanbul ignore next
23501
+ var destroy = Writable.prototype.destroy || noop;
23502
+
23439
23503
  // An HTTP(S) request that can be redirected
23440
23504
  function RedirectableRequest(options, responseCallback) {
23441
23505
  // Initialize the request
@@ -23457,7 +23521,13 @@ function requireFollowRedirects () {
23457
23521
  // React to responses of native requests
23458
23522
  var self = this;
23459
23523
  this._onNativeResponse = function (response) {
23460
- self._processResponse(response);
23524
+ try {
23525
+ self._processResponse(response);
23526
+ }
23527
+ catch (cause) {
23528
+ self.emit("error", cause instanceof RedirectionError ?
23529
+ cause : new RedirectionError({ cause: cause }));
23530
+ }
23461
23531
  };
23462
23532
 
23463
23533
  // Perform the first request
@@ -23466,10 +23536,17 @@ function requireFollowRedirects () {
23466
23536
  RedirectableRequest.prototype = Object.create(Writable.prototype);
23467
23537
 
23468
23538
  RedirectableRequest.prototype.abort = function () {
23469
- abortRequest(this._currentRequest);
23539
+ destroyRequest(this._currentRequest);
23540
+ this._currentRequest.abort();
23470
23541
  this.emit("abort");
23471
23542
  };
23472
23543
 
23544
+ RedirectableRequest.prototype.destroy = function (error) {
23545
+ destroyRequest(this._currentRequest, error);
23546
+ destroy.call(this, error);
23547
+ return this;
23548
+ };
23549
+
23473
23550
  // Writes buffered data to the current native request
23474
23551
  RedirectableRequest.prototype.write = function (data, encoding, callback) {
23475
23552
  // Writing is not allowed if end has been called
@@ -23582,6 +23659,7 @@ function requireFollowRedirects () {
23582
23659
  self.removeListener("abort", clearTimer);
23583
23660
  self.removeListener("error", clearTimer);
23584
23661
  self.removeListener("response", clearTimer);
23662
+ self.removeListener("close", clearTimer);
23585
23663
  if (callback) {
23586
23664
  self.removeListener("timeout", callback);
23587
23665
  }
@@ -23608,6 +23686,7 @@ function requireFollowRedirects () {
23608
23686
  this.on("abort", clearTimer);
23609
23687
  this.on("error", clearTimer);
23610
23688
  this.on("response", clearTimer);
23689
+ this.on("close", clearTimer);
23611
23690
 
23612
23691
  return this;
23613
23692
  };
@@ -23666,8 +23745,7 @@ function requireFollowRedirects () {
23666
23745
  var protocol = this._options.protocol;
23667
23746
  var nativeProtocol = this._options.nativeProtocols[protocol];
23668
23747
  if (!nativeProtocol) {
23669
- this.emit("error", new TypeError("Unsupported protocol " + protocol));
23670
- return;
23748
+ throw new TypeError("Unsupported protocol " + protocol);
23671
23749
  }
23672
23750
 
23673
23751
  // If specified, use the agent corresponding to the protocol
@@ -23759,15 +23837,14 @@ function requireFollowRedirects () {
23759
23837
  }
23760
23838
 
23761
23839
  // The response is a redirect, so abort the current request
23762
- abortRequest(this._currentRequest);
23840
+ destroyRequest(this._currentRequest);
23763
23841
  // Discard the remainder of the response to avoid waiting for data
23764
23842
  response.destroy();
23765
23843
 
23766
23844
  // RFC7231§6.4: A client SHOULD detect and intervene
23767
23845
  // in cyclical redirections (i.e., "infinite" redirection loops).
23768
23846
  if (++this._redirectCount > this._options.maxRedirects) {
23769
- this.emit("error", new TooManyRedirectsError());
23770
- return;
23847
+ throw new TooManyRedirectsError();
23771
23848
  }
23772
23849
 
23773
23850
  // Store the request headers if applicable
@@ -23801,33 +23878,23 @@ function requireFollowRedirects () {
23801
23878
  var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
23802
23879
 
23803
23880
  // If the redirect is relative, carry over the host of the last request
23804
- var currentUrlParts = url.parse(this._currentUrl);
23881
+ var currentUrlParts = parseUrl(this._currentUrl);
23805
23882
  var currentHost = currentHostHeader || currentUrlParts.host;
23806
23883
  var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
23807
23884
  url.format(Object.assign(currentUrlParts, { host: currentHost }));
23808
23885
 
23809
- // Determine the URL of the redirection
23810
- var redirectUrl;
23811
- try {
23812
- redirectUrl = url.resolve(currentUrl, location);
23813
- }
23814
- catch (cause) {
23815
- this.emit("error", new RedirectionError({ cause: cause }));
23816
- return;
23817
- }
23818
-
23819
23886
  // Create the redirected request
23820
- debug("redirecting to", redirectUrl);
23887
+ var redirectUrl = resolveUrl(location, currentUrl);
23888
+ debug("redirecting to", redirectUrl.href);
23821
23889
  this._isRedirect = true;
23822
- var redirectUrlParts = url.parse(redirectUrl);
23823
- Object.assign(this._options, redirectUrlParts);
23890
+ spreadUrlObject(redirectUrl, this._options);
23824
23891
 
23825
23892
  // Drop confidential headers when redirecting to a less secure protocol
23826
23893
  // or to a different domain that is not a superdomain
23827
- if (redirectUrlParts.protocol !== currentUrlParts.protocol &&
23828
- redirectUrlParts.protocol !== "https:" ||
23829
- redirectUrlParts.host !== currentHost &&
23830
- !isSubdomain(redirectUrlParts.host, currentHost)) {
23894
+ if (redirectUrl.protocol !== currentUrlParts.protocol &&
23895
+ redirectUrl.protocol !== "https:" ||
23896
+ redirectUrl.host !== currentHost &&
23897
+ !isSubdomain(redirectUrl.host, currentHost)) {
23831
23898
  removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
23832
23899
  }
23833
23900
 
@@ -23842,23 +23909,12 @@ function requireFollowRedirects () {
23842
23909
  method: method,
23843
23910
  headers: requestHeaders,
23844
23911
  };
23845
- try {
23846
- beforeRedirect(this._options, responseDetails, requestDetails);
23847
- }
23848
- catch (err) {
23849
- this.emit("error", err);
23850
- return;
23851
- }
23912
+ beforeRedirect(this._options, responseDetails, requestDetails);
23852
23913
  this._sanitizeOptions(this._options);
23853
23914
  }
23854
23915
 
23855
23916
  // Perform the redirected request
23856
- try {
23857
- this._performRequest();
23858
- }
23859
- catch (cause) {
23860
- this.emit("error", new RedirectionError({ cause: cause }));
23861
- }
23917
+ this._performRequest();
23862
23918
  };
23863
23919
 
23864
23920
  // Wraps the key/value object of protocols with redirect functionality
@@ -23878,27 +23934,16 @@ function requireFollowRedirects () {
23878
23934
 
23879
23935
  // Executes a request, following redirects
23880
23936
  function request(input, options, callback) {
23881
- // Parse parameters
23882
- if (isString(input)) {
23883
- var parsed;
23884
- try {
23885
- parsed = urlToOptions(new URL(input));
23886
- }
23887
- catch (err) {
23888
- /* istanbul ignore next */
23889
- parsed = url.parse(input);
23890
- }
23891
- if (!isString(parsed.protocol)) {
23892
- throw new InvalidUrlError({ input });
23893
- }
23894
- input = parsed;
23937
+ // Parse parameters, ensuring that input is an object
23938
+ if (isURL(input)) {
23939
+ input = spreadUrlObject(input);
23895
23940
  }
23896
- else if (URL && (input instanceof URL)) {
23897
- input = urlToOptions(input);
23941
+ else if (isString(input)) {
23942
+ input = spreadUrlObject(parseUrl(input));
23898
23943
  }
23899
23944
  else {
23900
23945
  callback = options;
23901
- options = input;
23946
+ options = validateUrl(input);
23902
23947
  input = { protocol: protocol };
23903
23948
  }
23904
23949
  if (isFunction(options)) {
@@ -23937,27 +23982,57 @@ function requireFollowRedirects () {
23937
23982
  return exports;
23938
23983
  }
23939
23984
 
23940
- /* istanbul ignore next */
23941
23985
  function noop() { /* empty */ }
23942
23986
 
23943
- // from https://github.com/nodejs/node/blob/master/lib/internal/url.js
23944
- function urlToOptions(urlObject) {
23945
- var options = {
23946
- protocol: urlObject.protocol,
23947
- hostname: urlObject.hostname.startsWith("[") ?
23948
- /* istanbul ignore next */
23949
- urlObject.hostname.slice(1, -1) :
23950
- urlObject.hostname,
23951
- hash: urlObject.hash,
23952
- search: urlObject.search,
23953
- pathname: urlObject.pathname,
23954
- path: urlObject.pathname + urlObject.search,
23955
- href: urlObject.href,
23956
- };
23957
- if (urlObject.port !== "") {
23958
- options.port = Number(urlObject.port);
23987
+ function parseUrl(input) {
23988
+ var parsed;
23989
+ /* istanbul ignore else */
23990
+ if (useNativeURL) {
23991
+ parsed = new URL(input);
23992
+ }
23993
+ else {
23994
+ // Ensure the URL is valid and absolute
23995
+ parsed = validateUrl(url.parse(input));
23996
+ if (!isString(parsed.protocol)) {
23997
+ throw new InvalidUrlError({ input });
23998
+ }
23999
+ }
24000
+ return parsed;
24001
+ }
24002
+
24003
+ function resolveUrl(relative, base) {
24004
+ /* istanbul ignore next */
24005
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
24006
+ }
24007
+
24008
+ function validateUrl(input) {
24009
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
24010
+ throw new InvalidUrlError({ input: input.href || input });
23959
24011
  }
23960
- return options;
24012
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
24013
+ throw new InvalidUrlError({ input: input.href || input });
24014
+ }
24015
+ return input;
24016
+ }
24017
+
24018
+ function spreadUrlObject(urlObject, target) {
24019
+ var spread = target || {};
24020
+ for (var key of preservedUrlFields) {
24021
+ spread[key] = urlObject[key];
24022
+ }
24023
+
24024
+ // Fix IPv6 hostname
24025
+ if (spread.hostname.startsWith("[")) {
24026
+ spread.hostname = spread.hostname.slice(1, -1);
24027
+ }
24028
+ // Ensure port is a number
24029
+ if (spread.port !== "") {
24030
+ spread.port = Number(spread.port);
24031
+ }
24032
+ // Concatenate path
24033
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
24034
+
24035
+ return spread;
23961
24036
  }
23962
24037
 
23963
24038
  function removeMatchingHeaders(regex, headers) {
@@ -23983,17 +24058,25 @@ function requireFollowRedirects () {
23983
24058
 
23984
24059
  // Attach constructor and set default properties
23985
24060
  CustomError.prototype = new (baseClass || Error)();
23986
- CustomError.prototype.constructor = CustomError;
23987
- CustomError.prototype.name = "Error [" + code + "]";
24061
+ Object.defineProperties(CustomError.prototype, {
24062
+ constructor: {
24063
+ value: CustomError,
24064
+ enumerable: false,
24065
+ },
24066
+ name: {
24067
+ value: "Error [" + code + "]",
24068
+ enumerable: false,
24069
+ },
24070
+ });
23988
24071
  return CustomError;
23989
24072
  }
23990
24073
 
23991
- function abortRequest(request) {
24074
+ function destroyRequest(request, error) {
23992
24075
  for (var event of events) {
23993
24076
  request.removeListener(event, eventHandlers[event]);
23994
24077
  }
23995
24078
  request.on("error", noop);
23996
- request.abort();
24079
+ request.destroy(error);
23997
24080
  }
23998
24081
 
23999
24082
  function isSubdomain(subdomain, domain) {
@@ -24014,6 +24097,10 @@ function requireFollowRedirects () {
24014
24097
  return typeof value === "object" && ("length" in value);
24015
24098
  }
24016
24099
 
24100
+ function isURL(value) {
24101
+ return URL && value instanceof URL;
24102
+ }
24103
+
24017
24104
  // Exports
24018
24105
  followRedirects.exports = wrap({ http: http, https: https });
24019
24106
  followRedirects.exports.wrap = wrap;
@@ -38753,6 +38840,119 @@ var FooterWithLinks = function FooterWithLinks(_ref) {
38753
38840
  }, copyrightText));
38754
38841
  };
38755
38842
 
38843
+ /* eslint-disable consistent-return */
38844
+ function Keyboard(_ref) {
38845
+ let {
38846
+ swiper,
38847
+ extendParams,
38848
+ on,
38849
+ emit
38850
+ } = _ref;
38851
+ const document = getDocument();
38852
+ const window = getWindow();
38853
+ swiper.keyboard = {
38854
+ enabled: false
38855
+ };
38856
+ extendParams({
38857
+ keyboard: {
38858
+ enabled: false,
38859
+ onlyInViewport: true,
38860
+ pageUpDown: true
38861
+ }
38862
+ });
38863
+ function handle(event) {
38864
+ if (!swiper.enabled) return;
38865
+ const {
38866
+ rtlTranslate: rtl
38867
+ } = swiper;
38868
+ let e = event;
38869
+ if (e.originalEvent) e = e.originalEvent; // jquery fix
38870
+ const kc = e.keyCode || e.charCode;
38871
+ const pageUpDown = swiper.params.keyboard.pageUpDown;
38872
+ const isPageUp = pageUpDown && kc === 33;
38873
+ const isPageDown = pageUpDown && kc === 34;
38874
+ const isArrowLeft = kc === 37;
38875
+ const isArrowRight = kc === 39;
38876
+ const isArrowUp = kc === 38;
38877
+ const isArrowDown = kc === 40;
38878
+ // Directions locks
38879
+ if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
38880
+ return false;
38881
+ }
38882
+ if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
38883
+ return false;
38884
+ }
38885
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
38886
+ return undefined;
38887
+ }
38888
+ if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
38889
+ return undefined;
38890
+ }
38891
+ if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
38892
+ let inView = false;
38893
+ // Check that swiper should be inside of visible area of window
38894
+ if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {
38895
+ return undefined;
38896
+ }
38897
+ const el = swiper.el;
38898
+ const swiperWidth = el.clientWidth;
38899
+ const swiperHeight = el.clientHeight;
38900
+ const windowWidth = window.innerWidth;
38901
+ const windowHeight = window.innerHeight;
38902
+ const swiperOffset = elementOffset(el);
38903
+ if (rtl) swiperOffset.left -= el.scrollLeft;
38904
+ const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
38905
+ for (let i = 0; i < swiperCoord.length; i += 1) {
38906
+ const point = swiperCoord[i];
38907
+ if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
38908
+ if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
38909
+ inView = true;
38910
+ }
38911
+ }
38912
+ if (!inView) return undefined;
38913
+ }
38914
+ if (swiper.isHorizontal()) {
38915
+ if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
38916
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
38917
+ }
38918
+ if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
38919
+ if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
38920
+ } else {
38921
+ if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
38922
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
38923
+ }
38924
+ if (isPageDown || isArrowDown) swiper.slideNext();
38925
+ if (isPageUp || isArrowUp) swiper.slidePrev();
38926
+ }
38927
+ emit('keyPress', kc);
38928
+ return undefined;
38929
+ }
38930
+ function enable() {
38931
+ if (swiper.keyboard.enabled) return;
38932
+ document.addEventListener('keydown', handle);
38933
+ swiper.keyboard.enabled = true;
38934
+ }
38935
+ function disable() {
38936
+ if (!swiper.keyboard.enabled) return;
38937
+ document.removeEventListener('keydown', handle);
38938
+ swiper.keyboard.enabled = false;
38939
+ }
38940
+ on('init', () => {
38941
+ if (swiper.params.keyboard.enabled) {
38942
+ enable();
38943
+ }
38944
+ });
38945
+ on('destroy', () => {
38946
+ if (swiper.keyboard.enabled) {
38947
+ disable();
38948
+ }
38949
+ });
38950
+ Object.assign(swiper.keyboard, {
38951
+ enable,
38952
+ disable
38953
+ });
38954
+ }
38955
+
38756
38956
  /* eslint-disable consistent-return */
38757
38957
  function Mousewheel(_ref) {
38758
38958
  let {
@@ -39630,6 +39830,145 @@ function Pagination(_ref) {
39630
39830
  });
39631
39831
  }
39632
39832
 
39833
+ function History(_ref) {
39834
+ let {
39835
+ swiper,
39836
+ extendParams,
39837
+ on
39838
+ } = _ref;
39839
+ extendParams({
39840
+ history: {
39841
+ enabled: false,
39842
+ root: '',
39843
+ replaceState: false,
39844
+ key: 'slides',
39845
+ keepQuery: false
39846
+ }
39847
+ });
39848
+ let initialized = false;
39849
+ let paths = {};
39850
+ const slugify = text => {
39851
+ return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
39852
+ };
39853
+ const getPathValues = urlOverride => {
39854
+ const window = getWindow();
39855
+ let location;
39856
+ if (urlOverride) {
39857
+ location = new URL(urlOverride);
39858
+ } else {
39859
+ location = window.location;
39860
+ }
39861
+ const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');
39862
+ const total = pathArray.length;
39863
+ const key = pathArray[total - 2];
39864
+ const value = pathArray[total - 1];
39865
+ return {
39866
+ key,
39867
+ value
39868
+ };
39869
+ };
39870
+ const setHistory = (key, index) => {
39871
+ const window = getWindow();
39872
+ if (!initialized || !swiper.params.history.enabled) return;
39873
+ let location;
39874
+ if (swiper.params.url) {
39875
+ location = new URL(swiper.params.url);
39876
+ } else {
39877
+ location = window.location;
39878
+ }
39879
+ const slide = swiper.slides[index];
39880
+ let value = slugify(slide.getAttribute('data-history'));
39881
+ if (swiper.params.history.root.length > 0) {
39882
+ let root = swiper.params.history.root;
39883
+ if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
39884
+ value = `${root}/${key ? `${key}/` : ''}${value}`;
39885
+ } else if (!location.pathname.includes(key)) {
39886
+ value = `${key ? `${key}/` : ''}${value}`;
39887
+ }
39888
+ if (swiper.params.history.keepQuery) {
39889
+ value += location.search;
39890
+ }
39891
+ const currentState = window.history.state;
39892
+ if (currentState && currentState.value === value) {
39893
+ return;
39894
+ }
39895
+ if (swiper.params.history.replaceState) {
39896
+ window.history.replaceState({
39897
+ value
39898
+ }, null, value);
39899
+ } else {
39900
+ window.history.pushState({
39901
+ value
39902
+ }, null, value);
39903
+ }
39904
+ };
39905
+ const scrollToSlide = (speed, value, runCallbacks) => {
39906
+ if (value) {
39907
+ for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
39908
+ const slide = swiper.slides[i];
39909
+ const slideHistory = slugify(slide.getAttribute('data-history'));
39910
+ if (slideHistory === value) {
39911
+ const index = swiper.getSlideIndex(slide);
39912
+ swiper.slideTo(index, speed, runCallbacks);
39913
+ }
39914
+ }
39915
+ } else {
39916
+ swiper.slideTo(0, speed, runCallbacks);
39917
+ }
39918
+ };
39919
+ const setHistoryPopState = () => {
39920
+ paths = getPathValues(swiper.params.url);
39921
+ scrollToSlide(swiper.params.speed, paths.value, false);
39922
+ };
39923
+ const init = () => {
39924
+ const window = getWindow();
39925
+ if (!swiper.params.history) return;
39926
+ if (!window.history || !window.history.pushState) {
39927
+ swiper.params.history.enabled = false;
39928
+ swiper.params.hashNavigation.enabled = true;
39929
+ return;
39930
+ }
39931
+ initialized = true;
39932
+ paths = getPathValues(swiper.params.url);
39933
+ if (!paths.key && !paths.value) {
39934
+ if (!swiper.params.history.replaceState) {
39935
+ window.addEventListener('popstate', setHistoryPopState);
39936
+ }
39937
+ return;
39938
+ }
39939
+ scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);
39940
+ if (!swiper.params.history.replaceState) {
39941
+ window.addEventListener('popstate', setHistoryPopState);
39942
+ }
39943
+ };
39944
+ const destroy = () => {
39945
+ const window = getWindow();
39946
+ if (!swiper.params.history.replaceState) {
39947
+ window.removeEventListener('popstate', setHistoryPopState);
39948
+ }
39949
+ };
39950
+ on('init', () => {
39951
+ if (swiper.params.history.enabled) {
39952
+ init();
39953
+ }
39954
+ });
39955
+ on('destroy', () => {
39956
+ if (swiper.params.history.enabled) {
39957
+ destroy();
39958
+ }
39959
+ });
39960
+ on('transitionEnd _freeModeNoMomentumRelease', () => {
39961
+ if (initialized) {
39962
+ setHistory(swiper.params.history.key, swiper.activeIndex);
39963
+ }
39964
+ });
39965
+ on('slideChange', () => {
39966
+ if (initialized && swiper.params.cssMode) {
39967
+ setHistory(swiper.params.history.key, swiper.activeIndex);
39968
+ }
39969
+ });
39970
+ }
39971
+
39633
39972
  /* eslint no-underscore-dangle: "off" */
39634
39973
  /* eslint no-use-before-define: "off" */
39635
39974
  function Autoplay(_ref) {
@@ -41297,6 +41636,134 @@ var PricingInCardView = function PricingInCardView(_ref) {
41297
41636
  })));
41298
41637
  };
41299
41638
 
41639
+ var Slides = function Slides(_ref) {
41640
+ var configurations = _ref.configurations,
41641
+ _ref$className = _ref.className,
41642
+ className = _ref$className === void 0 ? "" : _ref$className,
41643
+ id = _ref.id;
41644
+ var _useState = useState(0),
41645
+ _useState2 = _slicedToArray(_useState, 2),
41646
+ activeIndex = _useState2[0],
41647
+ setActiveIndex = _useState2[1];
41648
+ var swiperRef = useRef(null);
41649
+ var properties = configurations.properties,
41650
+ design = configurations.design;
41651
+ var _properties$content$s = properties.content.slides,
41652
+ slides = _properties$content$s === void 0 ? [] : _properties$content$s,
41653
+ src = properties.backgroundImage.src,
41654
+ enableAnimation = properties.enableAnimation;
41655
+ var baseClasses = "grid grid-cols-12 items-center gap-y-4 sm:gap-x-4 grid-flow-row-dense";
41656
+ var renderSwiperSlide = function renderSwiperSlide(_ref2) {
41657
+ var title = _ref2.title,
41658
+ logoUrl = _ref2.logoUrl,
41659
+ subTitle = _ref2.subTitle,
41660
+ layout = _ref2.layout,
41661
+ imageUrl = _ref2.imageUrl;
41662
+ if (layout === "titleWithSubTitle") {
41663
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledImage$1, {
41664
+ className: "absolute top-8 right-12 w-20",
41665
+ src: logoUrl
41666
+ }), /*#__PURE__*/React__default.createElement("div", {
41667
+ className: "col-span-12"
41668
+ }, /*#__PURE__*/React__default.createElement(Typography$1, {
41669
+ isTitle: true,
41670
+ component: "h1",
41671
+ style: design.title
41672
+ }, title), /*#__PURE__*/React__default.createElement(Typography$1, {
41673
+ isTitle: true,
41674
+ component: "h1",
41675
+ style: design.subTitle
41676
+ }, subTitle)));
41677
+ }
41678
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledImage$1, {
41679
+ className: "absolute top-8 right-12 w-20",
41680
+ src: logoUrl
41681
+ }), /*#__PURE__*/React__default.createElement("div", {
41682
+ className: "bottom-0 col-span-12 flex w-full justify-center sm:absolute sm:col-span-10 sm:col-start-2"
41683
+ }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
41684
+ src: imageUrl
41685
+ })));
41686
+ };
41687
+ return /*#__PURE__*/React__default.createElement(MotionWrapper, {
41688
+ enableAnimation: enableAnimation,
41689
+ id: id,
41690
+ backgroundImage: mergeLeft({
41691
+ src: src
41692
+ }, design.backgroundImage),
41693
+ className: "relative flex items-center justify-between",
41694
+ design: mergeDesign(design.body, 80)
41695
+ }, /*#__PURE__*/React__default.createElement(PageNavigation, {
41696
+ activeIndex: activeIndex,
41697
+ slides: slides,
41698
+ swiperRef: swiperRef,
41699
+ isStart: true,
41700
+ Icon: ArrowLeftS$1,
41701
+ className: "absolute left-0 top-1/2 z-20 sm:left-2 lg:left-28",
41702
+ onClick: function onClick() {
41703
+ var _swiperRef$current;
41704
+ return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
41705
+ }
41706
+ }), /*#__PURE__*/React__default.createElement(Swiper, {
41707
+ loop: true,
41708
+ history: {
41709
+ enabled: true,
41710
+ key: id
41711
+ },
41712
+ keyboard: {
41713
+ enabled: true,
41714
+ onlyInViewport: true
41715
+ },
41716
+ modules: [History, Keyboard],
41717
+ spaceBetween: 10,
41718
+ onSlideChange: function onSlideChange(swiper) {
41719
+ return setActiveIndex(swiper.activeIndex);
41720
+ },
41721
+ onSwiper: function onSwiper(swiper) {
41722
+ swiperRef.current = swiper;
41723
+ }
41724
+ }, slides.map(function (_ref3, index) {
41725
+ var title = _ref3.title,
41726
+ url = _ref3.url,
41727
+ logoUrl = _ref3.logoUrl,
41728
+ subTitle = _ref3.subTitle,
41729
+ layout = _ref3.layout,
41730
+ imageUrl = _ref3.imageUrl,
41731
+ backgroundImage = _ref3.backgroundImage;
41732
+ return /*#__PURE__*/React__default.createElement(SwiperSlide, {
41733
+ className: classnames("my-auto", className),
41734
+ "data-history": url,
41735
+ key: getUniqueKey(title, index)
41736
+ }, /*#__PURE__*/React__default.createElement(StyledWrapper, {
41737
+ isRootWrapper: true,
41738
+ backgroundImage: mergeLeft({
41739
+ src: backgroundImage.src
41740
+ }, design.backgroundImage),
41741
+ className: classnames("neeto-site-block-wrapper relative lg:w-9/12", baseClasses),
41742
+ design: mergeRight(design.container, {
41743
+ paddingHorizontal: design.body.paddingHorizontal
41744
+ })
41745
+ }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
41746
+ className: "absolute top-8 right-12 w-20",
41747
+ src: logoUrl
41748
+ }), renderSwiperSlide({
41749
+ title: title,
41750
+ logoUrl: logoUrl,
41751
+ subTitle: subTitle,
41752
+ layout: layout,
41753
+ imageUrl: imageUrl
41754
+ })));
41755
+ })), /*#__PURE__*/React__default.createElement(PageNavigation, {
41756
+ activeIndex: activeIndex,
41757
+ swiperRef: swiperRef,
41758
+ Icon: ArrowRightS$1,
41759
+ className: "absolute top-1/2 right-0 z-20 sm:right-2 lg:right-28",
41760
+ onClick: function onClick() {
41761
+ var _swiperRef$current2;
41762
+ return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
41763
+ }
41764
+ }));
41765
+ };
41766
+
41300
41767
  var _excluded$1 = ["configurations", "className", "id"];
41301
41768
  var TestimonialWithSlider = function TestimonialWithSlider(_ref) {
41302
41769
  var configurations = _ref.configurations,
@@ -41495,5 +41962,5 @@ var index = /*#__PURE__*/Object.freeze({
41495
41962
  Outlined: OutlineIcons
41496
41963
  });
41497
41964
 
41498
- export { BlogContent, CardsClassic, CardsInGridView, CardsWithCustomizableGrid, CardsWithImage, CtaClassic, CtaWithEmailAction, CtaWithLogo, index$1 as DESIGN_OPTIONS, Embed, FaqWithHamburgerView as FaqWithAccordion, FeatureWithBulletList, FeatureWithDetails, FeatureWithGrid, FeatureWithImage, FeatureWithJumboText, FeatureWithList, FeatureWithProgressBar, FooterClassic, FooterWithIcons, FooterWithLinks, GalleryClassic, GalleryWithAutoplay, HeaderWithButtons, HeaderWithIcons, HeaderWithLogoTitle, HeroWithCallToAction, HeroWithMultipleLayouts, index as Icons, LogoClouds, Paragraph, PricingInCardView, TestimonialWithSlider, TestimonialWithVerticalView };
41965
+ export { BlogContent, CardsClassic, CardsInGridView, CardsWithCustomizableGrid, CardsWithImage, CtaClassic, CtaWithEmailAction, CtaWithLogo, index$1 as DESIGN_OPTIONS, Embed, FaqWithHamburgerView as FaqWithAccordion, FeatureWithBulletList, FeatureWithDetails, FeatureWithGrid, FeatureWithImage, FeatureWithJumboText, FeatureWithList, FeatureWithProgressBar, FooterClassic, FooterWithIcons, FooterWithLinks, GalleryClassic, GalleryWithAutoplay, HeaderWithButtons, HeaderWithIcons, HeaderWithLogoTitle, HeroWithCallToAction, HeroWithMultipleLayouts, index as Icons, LogoClouds, Paragraph, PricingInCardView, Slides, TestimonialWithSlider, TestimonialWithVerticalView };
41499
41966
  //# sourceMappingURL=index.js.map