@digipair/skill-sse 0.117.7 → 0.117.8

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.
Files changed (2) hide show
  1. package/dist/index.esm.js +350 -159
  2. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -4,7 +4,6 @@ import { setImmediate } from 'node:timers';
4
4
  import { Readable } from 'node:stream';
5
5
  import { randomUUID, randomBytes } from 'node:crypto';
6
6
  import { EventEmitter } from 'node:events';
7
- import { snakeCase, kebabCase, camelCase } from 'case-anything/dist/index.js';
8
7
 
9
8
  // src/Session.ts
10
9
  function _array_like_to_array$8(arr, len) {
@@ -129,7 +128,7 @@ function _create_class$w(Constructor, protoProps, staticProps) {
129
128
  if (protoProps) _defineProperties$w(Constructor.prototype, protoProps);
130
129
  return Constructor;
131
130
  }
132
- function _define_property$5(obj, key, value) {
131
+ function _define_property$6(obj, key, value) {
133
132
  if (key in obj) {
134
133
  Object.defineProperty(obj, key, {
135
134
  value: value,
@@ -220,7 +219,7 @@ function _non_iterable_rest$6() {
220
219
  function _non_iterable_spread$7() {
221
220
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
222
221
  }
223
- function _object_spread$3(target) {
222
+ function _object_spread$4(target) {
224
223
  for(var i = 1; i < arguments.length; i++){
225
224
  var source = arguments[i] != null ? arguments[i] : {};
226
225
  var ownKeys = Object.keys(source);
@@ -230,7 +229,7 @@ function _object_spread$3(target) {
230
229
  }));
231
230
  }
232
231
  ownKeys.forEach(function(key) {
233
- _define_property$5(target, key, source[key]);
232
+ _define_property$6(target, key, source[key]);
234
233
  });
235
234
  }
236
235
  return target;
@@ -688,12 +687,12 @@ var EventBuffer = /*#__PURE__*/ function() {
688
687
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
689
688
  var _this1 = this;
690
689
  _class_call_check$B(this, EventBuffer);
691
- _define_property$5(this, "buffer", "");
692
- _define_property$5(this, "serialize", void 0);
693
- _define_property$5(this, "sanitize", void 0);
690
+ _define_property$6(this, "buffer", "");
691
+ _define_property$6(this, "serialize", void 0);
692
+ _define_property$6(this, "sanitize", void 0);
694
693
  /**
695
694
  * Write a line with a field key and value appended with a newline character.
696
- */ _define_property$5(this, "writeField", function(name, value) {
695
+ */ _define_property$6(this, "writeField", function(name, value) {
697
696
  var sanitized = _this.sanitize(value);
698
697
  _this.buffer += name + ":" + sanitized + "\n";
699
698
  return _this;
@@ -704,7 +703,7 @@ var EventBuffer = /*#__PURE__*/ function() {
704
703
  * Data is serialized to a string using the given `serializer` function option or JSON stringification by default.
705
704
  *
706
705
  * @param data - Data to serialize and write.
707
- */ _define_property$5(this, "data", function(data) {
706
+ */ _define_property$6(this, "data", function(data) {
708
707
  var serialized = _this.serialize(data);
709
708
  _this.writeField("data", serialized);
710
709
  return _this;
@@ -715,7 +714,7 @@ var EventBuffer = /*#__PURE__*/ function() {
715
714
  * Defaults to an empty string if no argument is given.
716
715
  *
717
716
  * @param id - Identification string to write.
718
- */ _define_property$5(this, "id", function() {
717
+ */ _define_property$6(this, "id", function() {
719
718
  var id = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
720
719
  _this1.writeField("id", id);
721
720
  return _this1;
@@ -724,7 +723,7 @@ var EventBuffer = /*#__PURE__*/ function() {
724
723
  * Write a retry field that suggests a reconnection time with the given milliseconds.
725
724
  *
726
725
  * @param time - Time in milliseconds to retry.
727
- */ _define_property$5(this, "retry", function(time) {
726
+ */ _define_property$6(this, "retry", function(time) {
728
727
  var stringifed = time.toString();
729
728
  _this.writeField("retry", stringifed);
730
729
  return _this;
@@ -735,14 +734,14 @@ var EventBuffer = /*#__PURE__*/ function() {
735
734
  * This will not fire an event but is often used to keep the connection alive.
736
735
  *
737
736
  * @param text - Text of the comment. Otherwise writes an empty field value.
738
- */ _define_property$5(this, "comment", function() {
737
+ */ _define_property$6(this, "comment", function() {
739
738
  var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
740
739
  _this1.writeField("", text);
741
740
  return _this1;
742
741
  });
743
742
  /**
744
743
  * Indicate that the event has finished being created by writing an additional newline character.
745
- */ _define_property$5(this, "dispatch", function() {
744
+ */ _define_property$6(this, "dispatch", function() {
746
745
  _this.buffer += "\n";
747
746
  return _this;
748
747
  });
@@ -758,7 +757,7 @@ var EventBuffer = /*#__PURE__*/ function() {
758
757
  * @param data - Data to write.
759
758
  * @param eventName - Event name to write.
760
759
  * @param eventId - Event ID to write.
761
- */ _define_property$5(this, "push", function(data) {
760
+ */ _define_property$6(this, "push", function(data) {
762
761
  var eventName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "message", eventId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : generateId();
763
762
  _this1.event(eventName).id(eventId).data(data).dispatch();
764
763
  return _this1;
@@ -774,7 +773,7 @@ var EventBuffer = /*#__PURE__*/ function() {
774
773
  * @param options - Event name to use for each event created.
775
774
  *
776
775
  * @returns A promise that resolves with `true` or rejects based on the success of the stream write finishing.
777
- */ _define_property$5(this, "stream", createPushFromStream(this.push));
776
+ */ _define_property$6(this, "stream", createPushFromStream(this.push));
778
777
  /**
779
778
  * Iterate over an iterable and write yielded values as events into the buffer.
780
779
  *
@@ -785,16 +784,16 @@ var EventBuffer = /*#__PURE__*/ function() {
785
784
  * @param iterable - Iterable to consume data from.
786
785
  *
787
786
  * @returns A promise that resolves once all data has been successfully yielded from the iterable.
788
- */ _define_property$5(this, "iterate", createPushFromIterable(this.push));
787
+ */ _define_property$6(this, "iterate", createPushFromIterable(this.push));
789
788
  /**
790
789
  * Clear the contents of the buffer.
791
- */ _define_property$5(this, "clear", function() {
790
+ */ _define_property$6(this, "clear", function() {
792
791
  _this.buffer = "";
793
792
  return _this;
794
793
  });
795
794
  /**
796
795
  * Get a copy of the buffer contents.
797
- */ _define_property$5(this, "read", function() {
796
+ */ _define_property$6(this, "read", function() {
798
797
  return _this.buffer;
799
798
  });
800
799
  var _options_serializer;
@@ -883,16 +882,16 @@ var FetchConnection = (__FetchConnection = function _FetchConnection(request, re
883
882
  var _this = this;
884
883
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
885
884
  _class_call_check$B(this, _FetchConnection);
886
- _define_property$5(this, "writer", void 0);
887
- _define_property$5(this, "url", void 0);
888
- _define_property$5(this, "request", void 0);
889
- _define_property$5(this, "response", void 0);
890
- _define_property$5(this, "sendHead", function() {});
891
- _define_property$5(this, "sendChunk", function(chunk) {
885
+ _define_property$6(this, "writer", void 0);
886
+ _define_property$6(this, "url", void 0);
887
+ _define_property$6(this, "request", void 0);
888
+ _define_property$6(this, "response", void 0);
889
+ _define_property$6(this, "sendHead", function() {});
890
+ _define_property$6(this, "sendChunk", function(chunk) {
892
891
  var encoded = _FetchConnection.encoder.encode(chunk);
893
892
  _this.writer.write(encoded);
894
893
  });
895
- _define_property$5(this, "cleanup", function() {
894
+ _define_property$6(this, "cleanup", function() {
896
895
  _this.writer.close();
897
896
  });
898
897
  this.url = new URL(request.url);
@@ -907,26 +906,26 @@ var FetchConnection = (__FetchConnection = function _FetchConnection(request, re
907
906
  if (response) {
908
907
  applyHeaders(response.headers, this.response.headers);
909
908
  }
910
- }, _define_property$5(__FetchConnection, "encoder", new TextEncoder()), __FetchConnection);
909
+ }, _define_property$6(__FetchConnection, "encoder", new TextEncoder()), __FetchConnection);
911
910
  // src/adapters/NodeHttp1Connection.ts
912
911
  var NodeHttp1Connection = function NodeHttp1Connection(req, res) {
913
912
  var _this = this;
914
913
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
915
914
  _class_call_check$B(this, NodeHttp1Connection);
916
- _define_property$5(this, "controller", void 0);
917
- _define_property$5(this, "url", void 0);
918
- _define_property$5(this, "request", void 0);
919
- _define_property$5(this, "response", void 0);
920
- _define_property$5(this, "onClose", function() {
915
+ _define_property$6(this, "controller", void 0);
916
+ _define_property$6(this, "url", void 0);
917
+ _define_property$6(this, "request", void 0);
918
+ _define_property$6(this, "response", void 0);
919
+ _define_property$6(this, "onClose", function() {
921
920
  _this.controller.abort();
922
921
  });
923
- _define_property$5(this, "sendHead", function() {
922
+ _define_property$6(this, "sendHead", function() {
924
923
  _this.res.writeHead(_this.response.status, Object.fromEntries(_this.response.headers));
925
924
  });
926
- _define_property$5(this, "sendChunk", function(chunk) {
925
+ _define_property$6(this, "sendChunk", function(chunk) {
927
926
  _this.res.write(chunk);
928
927
  });
929
- _define_property$5(this, "cleanup", function() {
928
+ _define_property$6(this, "cleanup", function() {
930
929
  _this.req.removeListener("close", _this.onClose);
931
930
  _this.res.removeListener("close", _this.onClose);
932
931
  });
@@ -957,20 +956,20 @@ var NodeHttp2CompatConnection = function NodeHttp2CompatConnection(req, res) {
957
956
  var _this = this;
958
957
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
959
958
  _class_call_check$B(this, NodeHttp2CompatConnection);
960
- _define_property$5(this, "controller", void 0);
961
- _define_property$5(this, "url", void 0);
962
- _define_property$5(this, "request", void 0);
963
- _define_property$5(this, "response", void 0);
964
- _define_property$5(this, "onClose", function() {
959
+ _define_property$6(this, "controller", void 0);
960
+ _define_property$6(this, "url", void 0);
961
+ _define_property$6(this, "request", void 0);
962
+ _define_property$6(this, "response", void 0);
963
+ _define_property$6(this, "onClose", function() {
965
964
  _this.controller.abort();
966
965
  });
967
- _define_property$5(this, "sendHead", function() {
966
+ _define_property$6(this, "sendHead", function() {
968
967
  _this.res.writeHead(_this.response.status, Object.fromEntries(_this.response.headers));
969
968
  });
970
- _define_property$5(this, "sendChunk", function(chunk) {
969
+ _define_property$6(this, "sendChunk", function(chunk) {
971
970
  _this.res.write(chunk);
972
971
  });
973
- _define_property$5(this, "cleanup", function() {
972
+ _define_property$6(this, "cleanup", function() {
974
973
  _this.req.removeListener("close", _this.onClose);
975
974
  _this.res.removeListener("close", _this.onClose);
976
975
  });
@@ -986,7 +985,7 @@ var NodeHttp2CompatConnection = function NodeHttp2CompatConnection(req, res) {
986
985
  method: (_req_method = req.method) !== null && _req_method !== void 0 ? _req_method : DEFAULT_REQUEST_METHOD,
987
986
  signal: this.controller.signal
988
987
  });
989
- var allowedHeaders = _object_spread$3({}, req.headers);
988
+ var allowedHeaders = _object_spread$4({}, req.headers);
990
989
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
991
990
  try {
992
991
  for(var _iterator = Object.keys(allowedHeaders)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
@@ -1114,12 +1113,12 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1114
1113
  * For security reasons, keep in mind that the client can provide *any* initial ID here. Use the `trustClientEventId` constructor option to ignore the client-given initial ID.
1115
1114
  *
1116
1115
  * @readonly
1117
- */ _define_property$5(_assert_this_initialized$l(_this), "lastId", "");
1116
+ */ _define_property$6(_assert_this_initialized$l(_this), "lastId", "");
1118
1117
  /**
1119
1118
  * Indicates whether the session and underlying connection is open or not.
1120
1119
  *
1121
1120
  * @readonly
1122
- */ _define_property$5(_assert_this_initialized$l(_this), "isConnected", false);
1121
+ */ _define_property$6(_assert_this_initialized$l(_this), "isConnected", false);
1123
1122
  /**
1124
1123
  * Custom state for this session.
1125
1124
  *
@@ -1127,15 +1126,15 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1127
1126
  *
1128
1127
  * Use [module augmentation and declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
1129
1128
  * to safely add new properties to the `DefaultSessionState` interface.
1130
- */ _define_property$5(_assert_this_initialized$l(_this), "state", void 0);
1131
- _define_property$5(_assert_this_initialized$l(_this), "buffer", void 0);
1132
- _define_property$5(_assert_this_initialized$l(_this), "connection", void 0);
1133
- _define_property$5(_assert_this_initialized$l(_this), "sanitize", void 0);
1134
- _define_property$5(_assert_this_initialized$l(_this), "serialize", void 0);
1135
- _define_property$5(_assert_this_initialized$l(_this), "initialRetry", void 0);
1136
- _define_property$5(_assert_this_initialized$l(_this), "keepAliveInterval", void 0);
1137
- _define_property$5(_assert_this_initialized$l(_this), "keepAliveTimer", void 0);
1138
- _define_property$5(_assert_this_initialized$l(_this), "initialize", function() {
1129
+ */ _define_property$6(_assert_this_initialized$l(_this), "state", void 0);
1130
+ _define_property$6(_assert_this_initialized$l(_this), "buffer", void 0);
1131
+ _define_property$6(_assert_this_initialized$l(_this), "connection", void 0);
1132
+ _define_property$6(_assert_this_initialized$l(_this), "sanitize", void 0);
1133
+ _define_property$6(_assert_this_initialized$l(_this), "serialize", void 0);
1134
+ _define_property$6(_assert_this_initialized$l(_this), "initialRetry", void 0);
1135
+ _define_property$6(_assert_this_initialized$l(_this), "keepAliveInterval", void 0);
1136
+ _define_property$6(_assert_this_initialized$l(_this), "keepAliveTimer", void 0);
1137
+ _define_property$6(_assert_this_initialized$l(_this), "initialize", function() {
1139
1138
  _this.connection.sendHead();
1140
1139
  if (_this.connection.url.searchParams.has("padding")) {
1141
1140
  _this.buffer.comment(" ".repeat(2049)).dispatch();
@@ -1153,7 +1152,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1153
1152
  _this.isConnected = true;
1154
1153
  _this.emit("connected");
1155
1154
  });
1156
- _define_property$5(_assert_this_initialized$l(_this), "onDisconnected", function() {
1155
+ _define_property$6(_assert_this_initialized$l(_this), "onDisconnected", function() {
1157
1156
  _this.connection.request.signal.removeEventListener("abort", _this.onDisconnected);
1158
1157
  _this.connection.cleanup();
1159
1158
  if (_this.keepAliveTimer) {
@@ -1164,13 +1163,13 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1164
1163
  });
1165
1164
  /**
1166
1165
  * Write an empty comment and flush it to the client.
1167
- */ _define_property$5(_assert_this_initialized$l(_this), "keepAlive", function() {
1166
+ */ _define_property$6(_assert_this_initialized$l(_this), "keepAlive", function() {
1168
1167
  _this.buffer.comment().dispatch();
1169
1168
  _this.flush();
1170
1169
  });
1171
1170
  /**
1172
1171
  * Flush the contents of the internal buffer to the client and clear the buffer.
1173
- */ _define_property$5(_assert_this_initialized$l(_this), "flush", function() {
1172
+ */ _define_property$6(_assert_this_initialized$l(_this), "flush", function() {
1174
1173
  var contents = _this.buffer.read();
1175
1174
  _this.buffer.clear();
1176
1175
  _this.connection.sendChunk(contents);
@@ -1182,7 +1181,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1182
1181
  *
1183
1182
  * When using the Node HTTP APIs, this will be a new Request object with status code and headers copied from the original request.
1184
1183
  * When the originally given request or response is closed, the abort signal attached to this Request will be triggered.
1185
- */ _define_property$5(_assert_this_initialized$l(_this), "getRequest", function() {
1184
+ */ _define_property$6(_assert_this_initialized$l(_this), "getRequest", function() {
1186
1185
  return _this.connection.request;
1187
1186
  });
1188
1187
  /**
@@ -1193,7 +1192,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1193
1192
  *
1194
1193
  * When using the Node HTTP APIs, this will be a new Response object with status code and headers copied from the original response.
1195
1194
  * Its body will be `null`, as data is instead written to the stream of the originally given response object.
1196
- */ _define_property$5(_assert_this_initialized$l(_this), "getResponse", function() {
1195
+ */ _define_property$6(_assert_this_initialized$l(_this), "getResponse", function() {
1197
1196
  return _this.connection.response;
1198
1197
  });
1199
1198
  /**
@@ -1210,7 +1209,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1210
1209
  * @param data - Data to write.
1211
1210
  * @param eventName - Event name to write.
1212
1211
  * @param eventId - Event ID to write.
1213
- */ _define_property$5(_assert_this_initialized$l(_this), "push", function(data) {
1212
+ */ _define_property$6(_assert_this_initialized$l(_this), "push", function(data) {
1214
1213
  var eventName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "message", eventId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : generateId();
1215
1214
  if (!_this.isConnected) {
1216
1215
  throw new SseError("Cannot push data to a non-active session. Ensure the session is connected before attempting to push events. If using the Fetch API, the response stream must begin being consumed before the session is considered connected.");
@@ -1232,7 +1231,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1232
1231
  * @param options - Options to alter how the stream is flushed to the client.
1233
1232
  *
1234
1233
  * @returns A promise that resolves with `true` or rejects based on the success of the stream write finishing.
1235
- */ _define_property$5(_assert_this_initialized$l(_this), "stream", createPushFromStream(_this.push));
1234
+ */ _define_property$6(_assert_this_initialized$l(_this), "stream", createPushFromStream(_this.push));
1236
1235
  /**
1237
1236
  * Iterate over an iterable and send yielded values as events to the client.
1238
1237
  *
@@ -1243,7 +1242,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1243
1242
  * @param iterable - Iterable to consume data from.
1244
1243
  *
1245
1244
  * @returns A promise that resolves once all data has been successfully yielded from the iterable.
1246
- */ _define_property$5(_assert_this_initialized$l(_this), "iterate", createPushFromIterable(_this.push));
1245
+ */ _define_property$6(_assert_this_initialized$l(_this), "iterate", createPushFromIterable(_this.push));
1247
1246
  var _this1 = _assert_this_initialized$l(_this);
1248
1247
  /**
1249
1248
  * Batch and send multiple events at once.
@@ -1258,7 +1257,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1258
1257
  * @returns A promise that resolves once all data from the event buffer has been successfully sent to the client.
1259
1258
  *
1260
1259
  * @see EventBuffer
1261
- */ _define_property$5(_assert_this_initialized$l(_this), "batch", function() {
1260
+ */ _define_property$6(_assert_this_initialized$l(_this), "batch", function() {
1262
1261
  var _ref = _async_to_generator(function(batcher) {
1263
1262
  var buffer;
1264
1263
  return _ts_generator(this, function(_state) {
@@ -1379,8 +1378,8 @@ var Channel = /*#__PURE__*/ function(TypedEmitter) {
1379
1378
  * Custom state for this channel.
1380
1379
  *
1381
1380
  * Use this object to safely store information related to the channel.
1382
- */ _define_property$5(_assert_this_initialized$l(_this), "state", void 0);
1383
- _define_property$5(_assert_this_initialized$l(_this), "sessions", /* @__PURE__ */ new Set());
1381
+ */ _define_property$6(_assert_this_initialized$l(_this), "state", void 0);
1382
+ _define_property$6(_assert_this_initialized$l(_this), "sessions", /* @__PURE__ */ new Set());
1384
1383
  /**
1385
1384
  * Broadcast an event to every active session registered with this channel.
1386
1385
  *
@@ -1392,7 +1391,7 @@ var Channel = /*#__PURE__*/ function(TypedEmitter) {
1392
1391
  *
1393
1392
  * @param data - Data to write.
1394
1393
  * @param eventName - Event name to write.
1395
- */ _define_property$5(_assert_this_initialized$l(_this), "broadcast", function(data) {
1394
+ */ _define_property$6(_assert_this_initialized$l(_this), "broadcast", function(data) {
1396
1395
  var eventName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "message", options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1397
1396
  var _options_eventId;
1398
1397
  var eventId = (_options_eventId = options.eventId) !== null && _options_eventId !== void 0 ? _options_eventId : generateId();
@@ -9688,7 +9687,7 @@ function _create_class$v(Constructor, protoProps, staticProps) {
9688
9687
  if (staticProps) _defineProperties$v(Constructor, staticProps);
9689
9688
  return Constructor;
9690
9689
  }
9691
- function _define_property$4(obj, key, value) {
9690
+ function _define_property$5(obj, key, value) {
9692
9691
  if (key in obj) {
9693
9692
  Object.defineProperty(obj, key, {
9694
9693
  value: value,
@@ -9763,7 +9762,7 @@ function _non_iterable_rest$5() {
9763
9762
  function _non_iterable_spread$6() {
9764
9763
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9765
9764
  }
9766
- function _object_spread$2(target) {
9765
+ function _object_spread$3(target) {
9767
9766
  for(var i = 1; i < arguments.length; i++){
9768
9767
  var source = arguments[i] != null ? arguments[i] : {};
9769
9768
  var ownKeys = Object.keys(source);
@@ -9773,12 +9772,12 @@ function _object_spread$2(target) {
9773
9772
  }));
9774
9773
  }
9775
9774
  ownKeys.forEach(function(key) {
9776
- _define_property$4(target, key, source[key]);
9775
+ _define_property$5(target, key, source[key]);
9777
9776
  });
9778
9777
  }
9779
9778
  return target;
9780
9779
  }
9781
- function ownKeys$1(object, enumerableOnly) {
9780
+ function ownKeys$2(object, enumerableOnly) {
9782
9781
  var keys = Object.keys(object);
9783
9782
  if (Object.getOwnPropertySymbols) {
9784
9783
  var symbols = Object.getOwnPropertySymbols(object);
@@ -9786,12 +9785,12 @@ function ownKeys$1(object, enumerableOnly) {
9786
9785
  }
9787
9786
  return keys;
9788
9787
  }
9789
- function _object_spread_props$1(target, source) {
9788
+ function _object_spread_props$2(target, source) {
9790
9789
  source = source != null ? source : {};
9791
9790
  if (Object.getOwnPropertyDescriptors) {
9792
9791
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9793
9792
  } else {
9794
- ownKeys$1(Object(source)).forEach(function(key) {
9793
+ ownKeys$2(Object(source)).forEach(function(key) {
9795
9794
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9796
9795
  });
9797
9796
  }
@@ -10662,7 +10661,7 @@ function getCachedWeekInfo(locString) {
10662
10661
  data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo;
10663
10662
  // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86
10664
10663
  if (!("minimalDays" in data)) {
10665
- data = _object_spread$2({}, fallbackWeekSettings, data);
10664
+ data = _object_spread$3({}, fallbackWeekSettings, data);
10666
10665
  }
10667
10666
  weekInfoCache.set(locString, data);
10668
10667
  }
@@ -10769,7 +10768,7 @@ function supportsFastNumbers(loc) {
10769
10768
  "floor"
10770
10769
  ]);
10771
10770
  if (!forceSimple || Object.keys(otherOpts).length > 0) {
10772
- var intlOpts = _object_spread$2({
10771
+ var intlOpts = _object_spread$3({
10773
10772
  useGrouping: false
10774
10773
  }, opts);
10775
10774
  if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;
@@ -10839,7 +10838,7 @@ function supportsFastNumbers(loc) {
10839
10838
  });
10840
10839
  this.originalZone = dt.zone;
10841
10840
  }
10842
- var intlOpts = _object_spread$2({}, this.opts);
10841
+ var intlOpts = _object_spread$3({}, this.opts);
10843
10842
  intlOpts.timeZone = intlOpts.timeZone || z;
10844
10843
  this.dtf = getCachedDTF(intl, intlOpts);
10845
10844
  }
@@ -10870,7 +10869,7 @@ function supportsFastNumbers(loc) {
10870
10869
  locale: _this.dt.locale,
10871
10870
  format: _this.opts.timeZoneName
10872
10871
  });
10873
- return _object_spread_props$1(_object_spread$2({}, part), {
10872
+ return _object_spread_props$2(_object_spread$3({}, part), {
10874
10873
  value: offsetName
10875
10874
  });
10876
10875
  } else {
@@ -10895,7 +10894,7 @@ function supportsFastNumbers(loc) {
10895
10894
  */ var PolyRelFormatter = /*#__PURE__*/ function() {
10896
10895
  function PolyRelFormatter(intl, isEnglish, opts) {
10897
10896
  _class_call_check$A(this, PolyRelFormatter);
10898
- this.opts = _object_spread$2({
10897
+ this.opts = _object_spread$3({
10899
10898
  style: "long"
10900
10899
  }, opts);
10901
10900
  if (!isEnglish && hasRelative()) {
@@ -10990,7 +10989,7 @@ var fallbackWeekSettings = {
10990
10989
  key: "redefaultToEN",
10991
10990
  value: function redefaultToEN() {
10992
10991
  var alts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
10993
- return this.clone(_object_spread_props$1(_object_spread$2({}, alts), {
10992
+ return this.clone(_object_spread_props$2(_object_spread$3({}, alts), {
10994
10993
  defaultToEN: true
10995
10994
  }));
10996
10995
  }
@@ -10999,7 +10998,7 @@ var fallbackWeekSettings = {
10999
10998
  key: "redefaultToSystem",
11000
10999
  value: function redefaultToSystem() {
11001
11000
  var alts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
11002
- return this.clone(_object_spread_props$1(_object_spread$2({}, alts), {
11001
+ return this.clone(_object_spread_props$2(_object_spread$3({}, alts), {
11003
11002
  defaultToEN: false
11004
11003
  }));
11005
11004
  }
@@ -11878,7 +11877,7 @@ function isoWeekdayToLocal(isoWeekday, startOfWeek) {
11878
11877
  } else {
11879
11878
  weekYear = year;
11880
11879
  }
11881
- return _object_spread$2({
11880
+ return _object_spread$3({
11882
11881
  weekYear: weekYear,
11883
11882
  weekNumber: weekNumber,
11884
11883
  weekday: weekday
@@ -11898,7 +11897,7 @@ function weekToGregorian(weekData) {
11898
11897
  year = weekYear;
11899
11898
  }
11900
11899
  var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), month = _uncomputeOrdinal.month, day = _uncomputeOrdinal.day;
11901
- return _object_spread$2({
11900
+ return _object_spread$3({
11902
11901
  year: year,
11903
11902
  month: month,
11904
11903
  day: day
@@ -11907,7 +11906,7 @@ function weekToGregorian(weekData) {
11907
11906
  function gregorianToOrdinal(gregData) {
11908
11907
  var year = gregData.year, month = gregData.month, day = gregData.day;
11909
11908
  var ordinal = computeOrdinal(year, month, day);
11910
- return _object_spread$2({
11909
+ return _object_spread$3({
11911
11910
  year: year,
11912
11911
  ordinal: ordinal
11913
11912
  }, timeObject(gregData));
@@ -11915,7 +11914,7 @@ function gregorianToOrdinal(gregData) {
11915
11914
  function ordinalToGregorian(ordinalData) {
11916
11915
  var year = ordinalData.year, ordinal = ordinalData.ordinal;
11917
11916
  var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), month = _uncomputeOrdinal.month, day = _uncomputeOrdinal.day;
11918
- return _object_spread$2({
11917
+ return _object_spread$3({
11919
11918
  year: year,
11920
11919
  month: month,
11921
11920
  day: day
@@ -12211,7 +12210,7 @@ function parseZoneInfo(ts, offsetFormat, locale) {
12211
12210
  if (timeZone) {
12212
12211
  intlOpts.timeZone = timeZone;
12213
12212
  }
12214
- var modified = _object_spread$2({
12213
+ var modified = _object_spread$3({
12215
12214
  timeZoneName: offsetFormat
12216
12215
  }, intlOpts);
12217
12216
  var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function(m) {
@@ -12570,7 +12569,7 @@ var macroTokenToFormatOpts = {
12570
12569
  if (this.systemLoc === null) {
12571
12570
  this.systemLoc = this.loc.redefaultToSystem();
12572
12571
  }
12573
- var df = this.systemLoc.dtFormatter(dt, _object_spread$2({}, this.opts, opts));
12572
+ var df = this.systemLoc.dtFormatter(dt, _object_spread$3({}, this.opts, opts));
12574
12573
  return df.format();
12575
12574
  }
12576
12575
  },
@@ -12578,7 +12577,7 @@ var macroTokenToFormatOpts = {
12578
12577
  key: "dtFormatter",
12579
12578
  value: function dtFormatter(dt) {
12580
12579
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
12581
- return this.loc.dtFormatter(dt, _object_spread$2({}, this.opts, opts));
12580
+ return this.loc.dtFormatter(dt, _object_spread$3({}, this.opts, opts));
12582
12581
  }
12583
12582
  },
12584
12583
  {
@@ -12614,7 +12613,7 @@ var macroTokenToFormatOpts = {
12614
12613
  if (this.opts.forceSimple) {
12615
12614
  return padStart(n, p);
12616
12615
  }
12617
- var opts = _object_spread$2({}, this.opts);
12616
+ var opts = _object_spread$3({}, this.opts);
12618
12617
  if (p > 0) {
12619
12618
  opts.padTo = p;
12620
12619
  }
@@ -13030,7 +13029,7 @@ function combineExtractors() {
13030
13029
  var _param = _sliced_to_array$5(param, 3), mergedVals = _param[0], mergedZone = _param[1], cursor = _param[2];
13031
13030
  var _ex = _sliced_to_array$5(ex(m, cursor), 3), val = _ex[0], zone = _ex[1], next = _ex[2];
13032
13031
  return [
13033
- _object_spread$2({}, mergedVals, val),
13032
+ _object_spread$3({}, mergedVals, val),
13034
13033
  zone || mergedZone,
13035
13034
  next
13036
13035
  ];
@@ -13341,7 +13340,7 @@ var lowOrderMatrix = {
13341
13340
  seconds: {
13342
13341
  milliseconds: 1000
13343
13342
  }
13344
- }, casualMatrix = _object_spread$2({
13343
+ }, casualMatrix = _object_spread$3({
13345
13344
  years: {
13346
13345
  quarters: 4,
13347
13346
  months: 12,
@@ -13369,7 +13368,7 @@ var lowOrderMatrix = {
13369
13368
  seconds: 30 * 24 * 60 * 60,
13370
13369
  milliseconds: 30 * 24 * 60 * 60 * 1000
13371
13370
  }
13372
- }, lowOrderMatrix), daysInYearAccurate = 146097.0 / 400, daysInMonthAccurate = 146097.0 / 4800, accurateMatrix = _object_spread$2({
13371
+ }, lowOrderMatrix), daysInYearAccurate = 146097.0 / 400, daysInMonthAccurate = 146097.0 / 4800, accurateMatrix = _object_spread$3({
13373
13372
  years: {
13374
13373
  quarters: 4,
13375
13374
  months: 12,
@@ -13416,7 +13415,7 @@ function clone$1(dur, alts) {
13416
13415
  var clear = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
13417
13416
  // deep merge for vals
13418
13417
  var conf = {
13419
- values: clear ? alts.values : _object_spread$2({}, dur.values, alts.values || {}),
13418
+ values: clear ? alts.values : _object_spread$3({}, dur.values, alts.values || {}),
13420
13419
  loc: dur.loc.clone(alts.loc),
13421
13420
  conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
13422
13421
  matrix: alts.matrix || dur.matrix
@@ -13615,7 +13614,7 @@ function removeZeroes(vals) {
13615
13614
  value: function toFormat(fmt) {
13616
13615
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
13617
13616
  // reverse-compat since 1.2; we always round down now, never up, and we do it by default
13618
- var fmtOpts = _object_spread_props$1(_object_spread$2({}, opts), {
13617
+ var fmtOpts = _object_spread_props$2(_object_spread$3({}, opts), {
13619
13618
  floor: opts.round !== false && opts.floor !== false
13620
13619
  });
13621
13620
  return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
@@ -13648,7 +13647,7 @@ function removeZeroes(vals) {
13648
13647
  if (isUndefined$2(val) || val === 0 && !showZeros) {
13649
13648
  return null;
13650
13649
  }
13651
- return _this.loc.numberFormatter(_object_spread_props$1(_object_spread$2({
13650
+ return _this.loc.numberFormatter(_object_spread_props$2(_object_spread$3({
13652
13651
  style: "unit",
13653
13652
  unitDisplay: "long"
13654
13653
  }, opts), {
@@ -13657,7 +13656,7 @@ function removeZeroes(vals) {
13657
13656
  }).filter(function(n) {
13658
13657
  return n;
13659
13658
  });
13660
- return this.loc.listFormatter(_object_spread$2({
13659
+ return this.loc.listFormatter(_object_spread$3({
13661
13660
  type: "conjunction",
13662
13661
  style: opts.listStyle || "narrow"
13663
13662
  }, opts)).format(l);
@@ -13671,7 +13670,7 @@ function removeZeroes(vals) {
13671
13670
  */ key: "toObject",
13672
13671
  value: function toObject() {
13673
13672
  if (!this.isValid) return {};
13674
- return _object_spread$2({}, this.values);
13673
+ return _object_spread$3({}, this.values);
13675
13674
  }
13676
13675
  },
13677
13676
  {
@@ -13724,7 +13723,7 @@ function removeZeroes(vals) {
13724
13723
  if (!this.isValid) return null;
13725
13724
  var millis = this.toMillis();
13726
13725
  if (millis < 0 || millis >= 86400000) return null;
13727
- opts = _object_spread_props$1(_object_spread$2({
13726
+ opts = _object_spread_props$2(_object_spread$3({
13728
13727
  suppressMilliseconds: false,
13729
13728
  suppressSeconds: false,
13730
13729
  includePrefix: false,
@@ -13895,7 +13894,7 @@ function removeZeroes(vals) {
13895
13894
  */ key: "set",
13896
13895
  value: function set(values) {
13897
13896
  if (!this.isValid) return this;
13898
- var mixed = _object_spread$2({}, this.values, normalizeObject(values, Duration.normalizeUnit));
13897
+ var mixed = _object_spread$3({}, this.values, normalizeObject(values, Duration.normalizeUnit));
13899
13898
  return clone$1(this, {
13900
13899
  values: mixed
13901
13900
  });
@@ -15506,7 +15505,7 @@ function diff(earlier, later, units, opts) {
15506
15505
  });
15507
15506
  if (lowerOrderUnits.length === 0) {
15508
15507
  if (highWater < later) {
15509
- highWater = cursor.plus(_define_property$4({}, lowestOrder, 1));
15508
+ highWater = cursor.plus(_define_property$5({}, lowestOrder, 1));
15510
15509
  }
15511
15510
  if (highWater !== cursor) {
15512
15511
  results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
@@ -16066,7 +16065,7 @@ function clone$2(inst, alts) {
16066
16065
  loc: inst.loc,
16067
16066
  invalid: inst.invalid
16068
16067
  };
16069
- return new DateTime(_object_spread_props$1(_object_spread$2({}, current, alts), {
16068
+ return new DateTime(_object_spread_props$2(_object_spread$3({}, current, alts), {
16070
16069
  old: current
16071
16070
  }));
16072
16071
  }
@@ -16120,7 +16119,7 @@ function objToTS(obj, offset, zone) {
16120
16119
  }
16121
16120
  // create a new DT instance by adding a duration, adjusting for DSTs
16122
16121
  function adjustTime(inst, dur) {
16123
- var oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = _object_spread_props$1(_object_spread$2({}, inst.c), {
16122
+ var oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = _object_spread_props$2(_object_spread$3({}, inst.c), {
16124
16123
  year: year,
16125
16124
  month: month,
16126
16125
  day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
@@ -16151,7 +16150,7 @@ function adjustTime(inst, dur) {
16151
16150
  function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
16152
16151
  var setZone = opts.setZone, zone = opts.zone;
16153
16152
  if (parsed && Object.keys(parsed).length !== 0 || parsedZone) {
16154
- var interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, _object_spread_props$1(_object_spread$2({}, opts), {
16153
+ var interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, _object_spread_props$2(_object_spread$3({}, opts), {
16155
16154
  zone: interpretationZone,
16156
16155
  specificOffset: specificOffset
16157
16156
  }));
@@ -17171,11 +17170,11 @@ function lastOpts(argList) {
17171
17170
  }
17172
17171
  var mixed;
17173
17172
  if (settingWeekStuff) {
17174
- mixed = weekToGregorian(_object_spread$2({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek);
17173
+ mixed = weekToGregorian(_object_spread$3({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek);
17175
17174
  } else if (!isUndefined$2(normalized.ordinal)) {
17176
- mixed = ordinalToGregorian(_object_spread$2({}, gregorianToOrdinal(this.c), normalized));
17175
+ mixed = ordinalToGregorian(_object_spread$3({}, gregorianToOrdinal(this.c), normalized));
17177
17176
  } else {
17178
- mixed = _object_spread$2({}, this.toObject(), normalized);
17177
+ mixed = _object_spread$3({}, this.toObject(), normalized);
17179
17178
  // if we didn't set the day but we ended up on an overflow date,
17180
17179
  // use the last day of the right month
17181
17180
  if (isUndefined$2(normalized.day)) {
@@ -17294,7 +17293,7 @@ function lastOpts(argList) {
17294
17293
  * @return {DateTime}
17295
17294
  */ key: "endOf",
17296
17295
  value: function endOf(unit, opts) {
17297
- return this.isValid ? this.plus(_define_property$4({}, unit, 1)).startOf(unit, opts).minus(1) : this;
17296
+ return this.isValid ? this.plus(_define_property$5({}, unit, 1)).startOf(unit, opts).minus(1) : this;
17298
17297
  }
17299
17298
  },
17300
17299
  {
@@ -17622,7 +17621,7 @@ function lastOpts(argList) {
17622
17621
  value: function toObject() {
17623
17622
  var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
17624
17623
  if (!this.isValid) return {};
17625
- var base = _object_spread$2({}, this.c);
17624
+ var base = _object_spread$3({}, this.c);
17626
17625
  if (opts.includeConfig) {
17627
17626
  base.outputCalendar = this.outputCalendar;
17628
17627
  base.numberingSystem = this.loc.numberingSystem;
@@ -17662,7 +17661,7 @@ function lastOpts(argList) {
17662
17661
  if (!this.isValid || !otherDateTime.isValid) {
17663
17662
  return Duration.invalid("created by diffing an invalid DateTime");
17664
17663
  }
17665
- var durOpts = _object_spread$2({
17664
+ var durOpts = _object_spread$3({
17666
17665
  locale: this.locale,
17667
17666
  numberingSystem: this.numberingSystem
17668
17667
  }, opts);
@@ -17766,7 +17765,7 @@ function lastOpts(argList) {
17766
17765
  units = options.unit;
17767
17766
  unit = undefined;
17768
17767
  }
17769
- return diffRelative(base, this.plus(padding), _object_spread_props$1(_object_spread$2({}, options), {
17768
+ return diffRelative(base, this.plus(padding), _object_spread_props$2(_object_spread$3({}, options), {
17770
17769
  numeric: "always",
17771
17770
  units: units,
17772
17771
  unit: unit
@@ -17792,7 +17791,7 @@ function lastOpts(argList) {
17792
17791
  if (!this.isValid) return null;
17793
17792
  return diffRelative(options.base || DateTime.fromObject({}, {
17794
17793
  zone: this.zone
17795
- }), this, _object_spread_props$1(_object_spread$2({}, options), {
17794
+ }), this, _object_spread_props$2(_object_spread$3({}, options), {
17796
17795
  numeric: "auto",
17797
17796
  units: [
17798
17797
  "years",
@@ -24060,7 +24059,7 @@ function _create_class$r(Constructor, protoProps, staticProps) {
24060
24059
  if (staticProps) _defineProperties$r(Constructor, staticProps);
24061
24060
  return Constructor;
24062
24061
  }
24063
- function _define_property$3(obj, key, value) {
24062
+ function _define_property$4(obj, key, value) {
24064
24063
  if (key in obj) {
24065
24064
  Object.defineProperty(obj, key, {
24066
24065
  value: value,
@@ -24113,7 +24112,7 @@ function _non_iterable_rest$2() {
24113
24112
  function _non_iterable_spread$4() {
24114
24113
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
24115
24114
  }
24116
- function _object_spread$1(target) {
24115
+ function _object_spread$2(target) {
24117
24116
  for(var i = 1; i < arguments.length; i++){
24118
24117
  var source = arguments[i] != null ? arguments[i] : {};
24119
24118
  var ownKeys = Object.keys(source);
@@ -24123,12 +24122,12 @@ function _object_spread$1(target) {
24123
24122
  }));
24124
24123
  }
24125
24124
  ownKeys.forEach(function(key) {
24126
- _define_property$3(target, key, source[key]);
24125
+ _define_property$4(target, key, source[key]);
24127
24126
  });
24128
24127
  }
24129
24128
  return target;
24130
24129
  }
24131
- function ownKeys(object, enumerableOnly) {
24130
+ function ownKeys$1(object, enumerableOnly) {
24132
24131
  var keys = Object.keys(object);
24133
24132
  if (Object.getOwnPropertySymbols) {
24134
24133
  var symbols = Object.getOwnPropertySymbols(object);
@@ -24136,12 +24135,12 @@ function ownKeys(object, enumerableOnly) {
24136
24135
  }
24137
24136
  return keys;
24138
24137
  }
24139
- function _object_spread_props(target, source) {
24138
+ function _object_spread_props$1(target, source) {
24140
24139
  source = source != null ? source : {};
24141
24140
  if (Object.getOwnPropertyDescriptors) {
24142
24141
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
24143
24142
  } else {
24144
- ownKeys(Object(source)).forEach(function(key) {
24143
+ ownKeys$1(Object(source)).forEach(function(key) {
24145
24144
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
24146
24145
  });
24147
24146
  }
@@ -24334,14 +24333,14 @@ function indent(str, spaces) {
24334
24333
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
24335
24334
  // match is required
24336
24335
  if (!match) {
24337
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
24336
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
24338
24337
  v: nextMatch1
24339
24338
  };
24340
24339
  }
24341
24340
  var token = match.token, offset = match.offset;
24342
24341
  i1 += offset;
24343
24342
  if (token === ' ') {
24344
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
24343
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
24345
24344
  }
24346
24345
  tokens1 = _to_consumable_array$4(tokens1).concat([
24347
24346
  token
@@ -24360,7 +24359,7 @@ function indent(str, spaces) {
24360
24359
  if (contextKeys.some(function(el) {
24361
24360
  return el.startsWith(name);
24362
24361
  })) {
24363
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
24362
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
24364
24363
  }
24365
24364
  if (dateTimeIdentifiers.some(function(el) {
24366
24365
  return el === name;
@@ -24379,9 +24378,9 @@ function indent(str, spaces) {
24379
24378
  if (dateTimeIdentifiers.some(function(el) {
24380
24379
  return el.startsWith(name);
24381
24380
  })) {
24382
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
24381
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
24383
24382
  }
24384
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
24383
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
24385
24384
  v: nextMatch1
24386
24385
  };
24387
24386
  };
@@ -24393,7 +24392,7 @@ function indent(str, spaces) {
24393
24392
  }
24394
24393
  }
24395
24394
  var _obj;
24396
- var identifiersMap = (_obj = {}, _define_property$3(_obj, identifier, 'identifier'), _define_property$3(_obj, nameIdentifier, 'nameIdentifier'), _obj);
24395
+ var identifiersMap = (_obj = {}, _define_property$4(_obj, identifier, 'identifier'), _define_property$4(_obj, nameIdentifier, 'nameIdentifier'), _obj);
24397
24396
  var identifiers = new ExternalTokenizer(function(input, stack) {
24398
24397
  LOG_PARSE_DEBUG && console.log('%s: T <identifier | nameIdentifier>', input.pos);
24399
24398
  var nameMatch = parseName(input, stack.context);
@@ -24442,11 +24441,11 @@ var insertSemicolon = new ExternalTokenizer(function(input, stack) {
24442
24441
  }
24443
24442
  });
24444
24443
  var _obj1;
24445
- var prefixedContextStarts = (_obj1 = {}, _define_property$3(_obj1, functionInvocationStart, 'FunctionInvocation'), _define_property$3(_obj1, filterExpressionStart, 'FilterExpression'), _define_property$3(_obj1, pathExpressionStart, 'PathExpression'), _obj1);
24444
+ var prefixedContextStarts = (_obj1 = {}, _define_property$4(_obj1, functionInvocationStart, 'FunctionInvocation'), _define_property$4(_obj1, filterExpressionStart, 'FilterExpression'), _define_property$4(_obj1, pathExpressionStart, 'PathExpression'), _obj1);
24446
24445
  var _obj2;
24447
- var contextStarts = (_obj2 = {}, _define_property$3(_obj2, contextStart, 'Context'), _define_property$3(_obj2, functionDefinitionStart, 'FunctionDefinition'), _define_property$3(_obj2, forExpressionStart, 'ForExpression'), _define_property$3(_obj2, listStart, 'List'), _define_property$3(_obj2, ifExpressionStart, 'IfExpression'), _define_property$3(_obj2, quantifiedExpressionStart, 'QuantifiedExpression'), _obj2);
24446
+ var contextStarts = (_obj2 = {}, _define_property$4(_obj2, contextStart, 'Context'), _define_property$4(_obj2, functionDefinitionStart, 'FunctionDefinition'), _define_property$4(_obj2, forExpressionStart, 'ForExpression'), _define_property$4(_obj2, listStart, 'List'), _define_property$4(_obj2, ifExpressionStart, 'IfExpression'), _define_property$4(_obj2, quantifiedExpressionStart, 'QuantifiedExpression'), _obj2);
24448
24447
  var _obj3;
24449
- var contextEnds = (_obj3 = {}, _define_property$3(_obj3, Context, 'Context'), _define_property$3(_obj3, FunctionDefinition, 'FunctionDefinition'), _define_property$3(_obj3, ForExpression, 'ForExpression'), _define_property$3(_obj3, List, 'List'), _define_property$3(_obj3, IfExpression, 'IfExpression'), _define_property$3(_obj3, QuantifiedExpression, 'QuantifiedExpression'), _define_property$3(_obj3, PathExpression, 'PathExpression'), _define_property$3(_obj3, FunctionInvocation, 'FunctionInvocation'), _define_property$3(_obj3, FilterExpression, 'FilterExpression'), _define_property$3(_obj3, ArithmeticExpression, 'ArithmeticExpression'), _obj3);
24448
+ var contextEnds = (_obj3 = {}, _define_property$4(_obj3, Context, 'Context'), _define_property$4(_obj3, FunctionDefinition, 'FunctionDefinition'), _define_property$4(_obj3, ForExpression, 'ForExpression'), _define_property$4(_obj3, List, 'List'), _define_property$4(_obj3, IfExpression, 'IfExpression'), _define_property$4(_obj3, QuantifiedExpression, 'QuantifiedExpression'), _define_property$4(_obj3, PathExpression, 'PathExpression'), _define_property$4(_obj3, FunctionInvocation, 'FunctionInvocation'), _define_property$4(_obj3, FilterExpression, 'FilterExpression'), _define_property$4(_obj3, ArithmeticExpression, 'ArithmeticExpression'), _obj3);
24450
24449
  /**
24451
24450
  * A simple producer that retrievs a value from
24452
24451
  * a given context. Used to lazily take things.
@@ -24534,7 +24533,7 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
24534
24533
  */ key: "set",
24535
24534
  value: function set(key, value) {
24536
24535
  var constructor = /** @type { typeof VariableContext } */ this.constructor;
24537
- return constructor.of(_object_spread_props(_object_spread$1({}, this.value), _define_property$3({}, key, value)));
24536
+ return constructor.of(_object_spread_props$1(_object_spread$2({}, this.value), _define_property$4({}, key, value)));
24538
24537
  }
24539
24538
  },
24540
24539
  {
@@ -24598,7 +24597,7 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
24598
24597
  if ((typeof context === "undefined" ? "undefined" : _type_of$z(context)) !== 'object') {
24599
24598
  return {};
24600
24599
  }
24601
- return _object_spread$1({}, context);
24600
+ return _object_spread$2({}, context);
24602
24601
  }
24603
24602
  },
24604
24603
  {
@@ -24616,13 +24615,13 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
24616
24615
  return reduce$1(this.__unwrap(other), function(merged, value, key) {
24617
24616
  if (_instanceof$f(value, ValueProducer)) {
24618
24617
  // keep value producers in tact
24619
- return _object_spread_props(_object_spread$1({}, merged), _define_property$3({}, key, value));
24618
+ return _object_spread_props$1(_object_spread$2({}, merged), _define_property$4({}, key, value));
24620
24619
  }
24621
24620
  value = _this.__unwrap(value);
24622
24621
  if (has$2(merged, key)) {
24623
24622
  value = _this.__merge(_this.__unwrap(merged[key]), value);
24624
24623
  }
24625
- return _object_spread_props(_object_spread$1({}, merged), _define_property$3({}, key, value));
24624
+ return _object_spread_props$1(_object_spread$2({}, merged), _define_property$4({}, key, value));
24626
24625
  }, this.__unwrap(context));
24627
24626
  }
24628
24627
  }
@@ -24841,7 +24840,7 @@ var Variables = /*#__PURE__*/ function() {
24841
24840
  */ key: "assign",
24842
24841
  value: function assign() {
24843
24842
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
24844
- return Variables.of(_object_spread$1({}, this, options));
24843
+ return Variables.of(_object_spread$2({}, this, options));
24845
24844
  }
24846
24845
  },
24847
24846
  {
@@ -24856,7 +24855,7 @@ var Variables = /*#__PURE__*/ function() {
24856
24855
  context: this.context,
24857
24856
  parent: this.parent
24858
24857
  };
24859
- return Variables.of(_object_spread$1({}, defaultOptions, options));
24858
+ return Variables.of(_object_spread$2({}, defaultOptions, options));
24860
24859
  }
24861
24860
  }
24862
24861
  ], [
@@ -25339,7 +25338,7 @@ function _create_class$q(Constructor, protoProps, staticProps) {
25339
25338
  if (protoProps) _defineProperties$q(Constructor.prototype, protoProps);
25340
25339
  return Constructor;
25341
25340
  }
25342
- function _define_property$2(obj, key, value) {
25341
+ function _define_property$3(obj, key, value) {
25343
25342
  if (key in obj) {
25344
25343
  Object.defineProperty(obj, key, {
25345
25344
  value: value,
@@ -26646,7 +26645,7 @@ var builtins = {
26646
26645
  if (key in context) {
26647
26646
  return FALSE;
26648
26647
  }
26649
- return Object.assign(Object.assign({}, context), _define_property$2({}, entry.key, entry.value));
26648
+ return Object.assign(Object.assign({}, context), _define_property$3({}, entry.key, entry.value));
26650
26649
  }, {});
26651
26650
  if (context === FALSE) {
26652
26651
  return null;
@@ -26699,7 +26698,7 @@ var builtins = {
26699
26698
  return null;
26700
26699
  }
26701
26700
  }
26702
- return Object.assign(Object.assign({}, context), _define_property$2({}, key, value));
26701
+ return Object.assign(Object.assign({}, context), _define_property$3({}, key, value));
26703
26702
  }
26704
26703
  function matches(a, b) {
26705
26704
  return a === b;
@@ -27426,7 +27425,7 @@ function evalNode(node, input, args) {
27426
27425
  return function(context) {
27427
27426
  return args.slice(1, -1).reduce(function(obj, arg) {
27428
27427
  var _arg = _sliced_to_array$1(arg(Object.assign(Object.assign({}, context), obj)), 2), key = _arg[0], value = _arg[1];
27429
- return Object.assign(Object.assign({}, obj), _define_property$2({}, key, value));
27428
+ return Object.assign(Object.assign({}, obj), _define_property$3({}, key, value));
27430
27429
  }, {});
27431
27430
  };
27432
27431
  case 'FunctionBody':
@@ -27923,7 +27922,7 @@ function extractValue(context, prop, _target) {
27923
27922
  'range'
27924
27923
  ].includes(getType(target))) {
27925
27924
  return target.map(function(t) {
27926
- return _define_property$2({}, prop, t);
27925
+ return _define_property$3({}, prop, t);
27927
27926
  });
27928
27927
  }
27929
27928
  return null;
@@ -44387,7 +44386,7 @@ function _class_call_check$1(instance, Constructor) {
44387
44386
  throw new TypeError("Cannot call a class as a function");
44388
44387
  }
44389
44388
  }
44390
- function _define_property$1(obj, key, value) {
44389
+ function _define_property$2(obj, key, value) {
44391
44390
  if (key in obj) {
44392
44391
  Object.defineProperty(obj, key, {
44393
44392
  value: value,
@@ -44467,7 +44466,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44467
44466
  _class_call_check$1(this, CelParser);
44468
44467
  var _this;
44469
44468
  _this = _super.call(this, allTokens);
44470
- _define_property$1(_assert_this_initialized$1(_this), "expr", _this.RULE('expr', function() {
44469
+ _define_property$2(_assert_this_initialized$1(_this), "expr", _this.RULE('expr', function() {
44471
44470
  _this.SUBRULE(_this.conditionalOr, {
44472
44471
  LABEL: 'conditionalOr'
44473
44472
  });
@@ -44482,7 +44481,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44482
44481
  });
44483
44482
  });
44484
44483
  }));
44485
- _define_property$1(_assert_this_initialized$1(_this), "conditionalAnd", _this.RULE('conditionalAnd', function() {
44484
+ _define_property$2(_assert_this_initialized$1(_this), "conditionalAnd", _this.RULE('conditionalAnd', function() {
44486
44485
  _this.SUBRULE(_this.relation, {
44487
44486
  LABEL: 'lhs'
44488
44487
  });
@@ -44493,7 +44492,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44493
44492
  });
44494
44493
  });
44495
44494
  }));
44496
- _define_property$1(_assert_this_initialized$1(_this), "conditionalOr", _this.RULE('conditionalOr', function() {
44495
+ _define_property$2(_assert_this_initialized$1(_this), "conditionalOr", _this.RULE('conditionalOr', function() {
44497
44496
  _this.SUBRULE(_this.conditionalAnd, {
44498
44497
  LABEL: 'lhs'
44499
44498
  });
@@ -44504,7 +44503,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44504
44503
  });
44505
44504
  });
44506
44505
  }));
44507
- _define_property$1(_assert_this_initialized$1(_this), "relation", _this.RULE('relation', function() {
44506
+ _define_property$2(_assert_this_initialized$1(_this), "relation", _this.RULE('relation', function() {
44508
44507
  _this.SUBRULE(_this.addition, {
44509
44508
  LABEL: 'lhs'
44510
44509
  });
@@ -44515,7 +44514,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44515
44514
  });
44516
44515
  });
44517
44516
  }));
44518
- _define_property$1(_assert_this_initialized$1(_this), "addition", _this.RULE('addition', function() {
44517
+ _define_property$2(_assert_this_initialized$1(_this), "addition", _this.RULE('addition', function() {
44519
44518
  _this.SUBRULE(_this.multiplication, {
44520
44519
  LABEL: 'lhs'
44521
44520
  });
@@ -44526,7 +44525,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44526
44525
  });
44527
44526
  });
44528
44527
  }));
44529
- _define_property$1(_assert_this_initialized$1(_this), "multiplication", _this.RULE('multiplication', function() {
44528
+ _define_property$2(_assert_this_initialized$1(_this), "multiplication", _this.RULE('multiplication', function() {
44530
44529
  _this.SUBRULE(_this.unaryExpression, {
44531
44530
  LABEL: 'lhs'
44532
44531
  });
@@ -44537,13 +44536,13 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44537
44536
  });
44538
44537
  });
44539
44538
  }));
44540
- _define_property$1(_assert_this_initialized$1(_this), "unaryExpression", _this.RULE('unaryExpression', function() {
44539
+ _define_property$2(_assert_this_initialized$1(_this), "unaryExpression", _this.RULE('unaryExpression', function() {
44541
44540
  _this.MANY(function() {
44542
44541
  _this.CONSUME(UnaryOperator);
44543
44542
  });
44544
44543
  _this.SUBRULE(_this.atomicExpression);
44545
44544
  }));
44546
- _define_property$1(_assert_this_initialized$1(_this), "parenthesisExpression", _this.RULE('parenthesisExpression', function() {
44545
+ _define_property$2(_assert_this_initialized$1(_this), "parenthesisExpression", _this.RULE('parenthesisExpression', function() {
44547
44546
  _this.CONSUME(OpenParenthesis, {
44548
44547
  LABEL: 'open'
44549
44548
  });
@@ -44552,7 +44551,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44552
44551
  LABEL: 'close'
44553
44552
  });
44554
44553
  }));
44555
- _define_property$1(_assert_this_initialized$1(_this), "listExpression", _this.RULE('listExpression', function() {
44554
+ _define_property$2(_assert_this_initialized$1(_this), "listExpression", _this.RULE('listExpression', function() {
44556
44555
  _this.CONSUME(OpenBracket);
44557
44556
  _this.OPTION(function() {
44558
44557
  _this.SUBRULE(_this.expr, {
@@ -44572,7 +44571,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44572
44571
  });
44573
44572
  });
44574
44573
  }));
44575
- _define_property$1(_assert_this_initialized$1(_this), "mapExpression", _this.RULE('mapExpression', function() {
44574
+ _define_property$2(_assert_this_initialized$1(_this), "mapExpression", _this.RULE('mapExpression', function() {
44576
44575
  _this.CONSUME(OpenCurlyBracket);
44577
44576
  _this.MANY(function() {
44578
44577
  _this.SUBRULE(_this.mapKeyValues, {
@@ -44597,7 +44596,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44597
44596
  ]);
44598
44597
  });
44599
44598
  }));
44600
- _define_property$1(_assert_this_initialized$1(_this), "mapKeyValues", _this.RULE('mapKeyValues', function() {
44599
+ _define_property$2(_assert_this_initialized$1(_this), "mapKeyValues", _this.RULE('mapKeyValues', function() {
44601
44600
  _this.SUBRULE(_this.expr, {
44602
44601
  LABEL: 'key'
44603
44602
  });
@@ -44609,7 +44608,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44609
44608
  _this.CONSUME(Comma);
44610
44609
  });
44611
44610
  }));
44612
- _define_property$1(_assert_this_initialized$1(_this), "macrosExpression", _this.RULE('macrosExpression', function() {
44611
+ _define_property$2(_assert_this_initialized$1(_this), "macrosExpression", _this.RULE('macrosExpression', function() {
44613
44612
  _this.CONSUME(Identifier);
44614
44613
  _this.CONSUME(OpenParenthesis);
44615
44614
  _this.OPTION(function() {
@@ -44625,7 +44624,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44625
44624
  });
44626
44625
  _this.CONSUME(CloseParenthesis);
44627
44626
  }));
44628
- _define_property$1(_assert_this_initialized$1(_this), "identifierExpression", _this.RULE('identifierExpression', function() {
44627
+ _define_property$2(_assert_this_initialized$1(_this), "identifierExpression", _this.RULE('identifierExpression', function() {
44629
44628
  _this.CONSUME(Identifier);
44630
44629
  _this.MANY(function() {
44631
44630
  _this.OR([
@@ -44644,7 +44643,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44644
44643
  ]);
44645
44644
  });
44646
44645
  }));
44647
- _define_property$1(_assert_this_initialized$1(_this), "identifierDotExpression", _this.RULE('identifierDotExpression', function() {
44646
+ _define_property$2(_assert_this_initialized$1(_this), "identifierDotExpression", _this.RULE('identifierDotExpression', function() {
44648
44647
  _this.CONSUME(Dot);
44649
44648
  _this.CONSUME(Identifier);
44650
44649
  // Optional method call with arguments (for collection macros)
@@ -44664,12 +44663,12 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44664
44663
  _this.CONSUME(CloseParenthesis);
44665
44664
  });
44666
44665
  }));
44667
- _define_property$1(_assert_this_initialized$1(_this), "indexExpression", _this.RULE('indexExpression', function() {
44666
+ _define_property$2(_assert_this_initialized$1(_this), "indexExpression", _this.RULE('indexExpression', function() {
44668
44667
  _this.CONSUME(OpenBracket);
44669
44668
  _this.SUBRULE(_this.expr);
44670
44669
  _this.CONSUME(CloseBracket);
44671
44670
  }));
44672
- _define_property$1(_assert_this_initialized$1(_this), "atomicExpression", _this.RULE('atomicExpression', function() {
44671
+ _define_property$2(_assert_this_initialized$1(_this), "atomicExpression", _this.RULE('atomicExpression', function() {
44673
44672
  _this.OR([
44674
44673
  {
44675
44674
  ALT: function() {
@@ -44778,7 +44777,7 @@ function _create_class(Constructor, protoProps, staticProps) {
44778
44777
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
44779
44778
  return Constructor;
44780
44779
  }
44781
- function _define_property(obj, key, value) {
44780
+ function _define_property$1(obj, key, value) {
44782
44781
  if (key in obj) {
44783
44782
  Object.defineProperty(obj, key, {
44784
44783
  value: value,
@@ -44850,7 +44849,7 @@ function _non_iterable_rest() {
44850
44849
  function _non_iterable_spread() {
44851
44850
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
44852
44851
  }
44853
- function _object_spread(target) {
44852
+ function _object_spread$1(target) {
44854
44853
  for(var i = 1; i < arguments.length; i++){
44855
44854
  var source = arguments[i] != null ? arguments[i] : {};
44856
44855
  var ownKeys = Object.keys(source);
@@ -44860,7 +44859,7 @@ function _object_spread(target) {
44860
44859
  }));
44861
44860
  }
44862
44861
  ownKeys.forEach(function(key) {
44863
- _define_property(target, key, source[key]);
44862
+ _define_property$1(target, key, source[key]);
44864
44863
  });
44865
44864
  }
44866
44865
  return target;
@@ -44946,13 +44945,13 @@ var CelVisitor = /*#__PURE__*/ function(BaseCelVisitor) {
44946
44945
  _class_call_check(this, CelVisitor);
44947
44946
  var _this;
44948
44947
  _this = _super.call(this);
44949
- _define_property(_assert_this_initialized(_this), "context", void 0);
44948
+ _define_property$1(_assert_this_initialized(_this), "context", void 0);
44950
44949
  /**
44951
44950
  * Tracks the current mode of the visitor to handle special cases.
44952
- */ _define_property(_assert_this_initialized(_this), "mode", Mode.normal);
44953
- _define_property(_assert_this_initialized(_this), "functions", void 0);
44951
+ */ _define_property$1(_assert_this_initialized(_this), "mode", Mode.normal);
44952
+ _define_property$1(_assert_this_initialized(_this), "functions", void 0);
44954
44953
  _this.context = context || {};
44955
- _this.functions = _object_spread({}, defaultFunctions, functions || {});
44954
+ _this.functions = _object_spread$1({}, defaultFunctions, functions || {});
44956
44955
  _this.validateVisitor();
44957
44956
  return _this;
44958
44957
  }
@@ -45693,6 +45692,198 @@ function evaluate(expression, context, functions) {
45693
45692
  }
45694
45693
  return toAstVisitorInstance.visit(result.cst);
45695
45694
  }
45695
+ // Latin-1 Supplement
45696
+ // upper case ranges
45697
+ // [À-ÖØ-ß]
45698
+ // lower case ranges
45699
+ // [à-öø-ÿ]
45700
+ var magicSplit = /^[a-zà-öø-ÿа-я]+|[A-ZÀ-ÖØ-ßА-Я][a-zà-öø-ÿа-я]+|[a-zà-öø-ÿа-я]+|[0-9]+|[A-ZÀ-ÖØ-ßА-Я]+(?![a-zà-öø-ÿа-я])/g;
45701
+ var spaceSplit = /\S+/g;
45702
+ /**
45703
+ * A string.matchAll function that will return an array of "string parts" and the indexes at which it split each part
45704
+ */ function getPartsAndIndexes(string, splitRegex) {
45705
+ var result = {
45706
+ parts: [],
45707
+ prefixes: []
45708
+ };
45709
+ var matches = string.matchAll(splitRegex);
45710
+ var lastWordEndIndex = 0;
45711
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
45712
+ try {
45713
+ for(var _iterator = matches[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
45714
+ var match = _step.value;
45715
+ if (typeof match.index !== 'number') continue;
45716
+ var word = match[0];
45717
+ result.parts.push(word);
45718
+ var prefix = string.slice(lastWordEndIndex, match.index).trim();
45719
+ result.prefixes.push(prefix);
45720
+ lastWordEndIndex = match.index + word.length;
45721
+ }
45722
+ } catch (err) {
45723
+ _didIteratorError = true;
45724
+ _iteratorError = err;
45725
+ } finally{
45726
+ try {
45727
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
45728
+ _iterator.return();
45729
+ }
45730
+ } finally{
45731
+ if (_didIteratorError) {
45732
+ throw _iteratorError;
45733
+ }
45734
+ }
45735
+ }
45736
+ var tail = string.slice(lastWordEndIndex).trim();
45737
+ if (tail) {
45738
+ result.parts.push('');
45739
+ result.prefixes.push(tail);
45740
+ }
45741
+ return result;
45742
+ }
45743
+ /**
45744
+ * A function that splits a string on words and returns an array of words.
45745
+ * - It can prefix each word with a given character
45746
+ * - It can strip or keep special characters, this affects the logic for adding a prefix as well
45747
+ */ function splitAndPrefix(string, options) {
45748
+ var _ref = options || {}, _ref_keepSpecialCharacters = _ref.keepSpecialCharacters, keepSpecialCharacters = _ref_keepSpecialCharacters === void 0 ? false : _ref_keepSpecialCharacters, keep = _ref.keep, _ref_prefix = _ref.prefix, prefix = _ref_prefix === void 0 ? '' : _ref_prefix;
45749
+ var normalString = string.trim().normalize('NFC');
45750
+ var hasSpaces = normalString.includes(' ');
45751
+ var split = hasSpaces ? spaceSplit : magicSplit;
45752
+ var partsAndIndexes = getPartsAndIndexes(normalString, split);
45753
+ return partsAndIndexes.parts.map(function(_part, i) {
45754
+ var foundPrefix = partsAndIndexes.prefixes[i] || '';
45755
+ var part = _part;
45756
+ if (keepSpecialCharacters === false) {
45757
+ if (keep) {
45758
+ part = part.normalize('NFD').replace(new RegExp("[^a-zA-Z\xd8\xdf\xf80-9".concat(keep.join(''), "]"), 'g'), '');
45759
+ }
45760
+ if (!keep) {
45761
+ part = part.normalize('NFD').replace(/[^a-zA-ZØßø0-9]/g, '');
45762
+ foundPrefix = '';
45763
+ }
45764
+ }
45765
+ if (keep && foundPrefix) {
45766
+ foundPrefix = foundPrefix.replace(new RegExp("[^".concat(keep.join(''), "]"), 'g'), '');
45767
+ }
45768
+ // the first word doesn't need a prefix, so only return the found prefix
45769
+ if (i === 0) {
45770
+ // console.log(`foundPrefix → `, foundPrefix)
45771
+ return foundPrefix + part;
45772
+ }
45773
+ if (!foundPrefix && !part) return '';
45774
+ if (!hasSpaces) {
45775
+ // return the found prefix OR fall back to a given prefix
45776
+ return (foundPrefix || prefix) + part;
45777
+ }
45778
+ // space based sentence was split on spaces, so only return found prefixes
45779
+ if (!foundPrefix && prefix.match(/\s/)) {
45780
+ // in this case we have no more found prefix, it was trimmed, but we're looking to add a space
45781
+ // so let's return that space
45782
+ return ' ' + part;
45783
+ }
45784
+ return (foundPrefix || prefix) + part;
45785
+ }).filter(Boolean);
45786
+ }
45787
+ /**
45788
+ * Capitalises a single word
45789
+ * @returns the word with the first character in uppercase and the rest in lowercase
45790
+ */ function capitaliseWord(string) {
45791
+ var match = string.matchAll(magicSplit).next().value;
45792
+ var firstLetterIndex = match ? match.index : 0;
45793
+ return string.slice(0, firstLetterIndex + 1).toUpperCase() + string.slice(firstLetterIndex + 1).toLowerCase();
45794
+ }
45795
+ function _define_property(obj, key, value) {
45796
+ if (key in obj) {
45797
+ Object.defineProperty(obj, key, {
45798
+ value: value,
45799
+ enumerable: true,
45800
+ configurable: true,
45801
+ writable: true
45802
+ });
45803
+ } else {
45804
+ obj[key] = value;
45805
+ }
45806
+ return obj;
45807
+ }
45808
+ function _object_spread(target) {
45809
+ for(var i = 1; i < arguments.length; i++){
45810
+ var source = arguments[i] != null ? arguments[i] : {};
45811
+ var ownKeys = Object.keys(source);
45812
+ if (typeof Object.getOwnPropertySymbols === "function") {
45813
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
45814
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
45815
+ }));
45816
+ }
45817
+ ownKeys.forEach(function(key) {
45818
+ _define_property(target, key, source[key]);
45819
+ });
45820
+ }
45821
+ return target;
45822
+ }
45823
+ function ownKeys(object, enumerableOnly) {
45824
+ var keys = Object.keys(object);
45825
+ if (Object.getOwnPropertySymbols) {
45826
+ var symbols = Object.getOwnPropertySymbols(object);
45827
+ keys.push.apply(keys, symbols);
45828
+ }
45829
+ return keys;
45830
+ }
45831
+ function _object_spread_props(target, source) {
45832
+ source = source != null ? source : {};
45833
+ if (Object.getOwnPropertyDescriptors) {
45834
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
45835
+ } else {
45836
+ ownKeys(Object(source)).forEach(function(key) {
45837
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
45838
+ });
45839
+ }
45840
+ return target;
45841
+ }
45842
+ /**
45843
+ * # 🐪 camelCase
45844
+ * converts a string to camelCase
45845
+ * - first lowercase then all capitalised
45846
+ * - *strips away* special characters by default
45847
+ *
45848
+ * @example
45849
+ * camelCase('$catDog') === 'catDog'
45850
+ * @example
45851
+ * camelCase('$catDog', { keepSpecialCharacters: true }) === '$catDog'
45852
+ */ function camelCase(string, options) {
45853
+ return splitAndPrefix(string, options).reduce(function(result, word, index) {
45854
+ return index === 0 || !(word[0] || '').match(magicSplit) ? result + word.toLowerCase() : result + capitaliseWord(word);
45855
+ }, '');
45856
+ }
45857
+ /**
45858
+ * # 🥙 kebab-case
45859
+ * converts a string to kebab-case
45860
+ * - hyphenated lowercase
45861
+ * - *strips away* special characters by default
45862
+ *
45863
+ * @example
45864
+ * kebabCase('$catDog') === 'cat-dog'
45865
+ * @example
45866
+ * kebabCase('$catDog', { keepSpecialCharacters: true }) === '$cat-dog'
45867
+ */ function kebabCase(string, options) {
45868
+ return splitAndPrefix(string, _object_spread_props(_object_spread({}, options), {
45869
+ prefix: '-'
45870
+ })).join('').toLowerCase();
45871
+ }
45872
+ /**
45873
+ * # 🐍 snake_case
45874
+ * converts a string to snake_case
45875
+ * - underscored lowercase
45876
+ * - *strips away* special characters by default
45877
+ *
45878
+ * @example
45879
+ * snakeCase('$catDog') === 'cat_dog'
45880
+ * @example
45881
+ * snakeCase('$catDog', { keepSpecialCharacters: true }) === '$cat_dog'
45882
+ */ function snakeCase(string, options) {
45883
+ return splitAndPrefix(string, _object_spread_props(_object_spread({}, options), {
45884
+ prefix: '_'
45885
+ })).join('').toLowerCase();
45886
+ }
45696
45887
  const Handlebars = handlebars_min || HandlebarsNamespace;
45697
45888
  Handlebars.registerHelper('JSONstringify', function(value) {
45698
45889
  return JSON.stringify(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-sse",
3
- "version": "0.117.7",
3
+ "version": "0.117.8",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",