@digipair/skill-sse 0.117.6 → 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 +354 -159
  2. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -128,7 +128,7 @@ function _create_class$w(Constructor, protoProps, staticProps) {
128
128
  if (protoProps) _defineProperties$w(Constructor.prototype, protoProps);
129
129
  return Constructor;
130
130
  }
131
- function _define_property$5(obj, key, value) {
131
+ function _define_property$6(obj, key, value) {
132
132
  if (key in obj) {
133
133
  Object.defineProperty(obj, key, {
134
134
  value: value,
@@ -219,7 +219,7 @@ function _non_iterable_rest$6() {
219
219
  function _non_iterable_spread$7() {
220
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.");
221
221
  }
222
- function _object_spread$3(target) {
222
+ function _object_spread$4(target) {
223
223
  for(var i = 1; i < arguments.length; i++){
224
224
  var source = arguments[i] != null ? arguments[i] : {};
225
225
  var ownKeys = Object.keys(source);
@@ -229,7 +229,7 @@ function _object_spread$3(target) {
229
229
  }));
230
230
  }
231
231
  ownKeys.forEach(function(key) {
232
- _define_property$5(target, key, source[key]);
232
+ _define_property$6(target, key, source[key]);
233
233
  });
234
234
  }
235
235
  return target;
@@ -687,12 +687,12 @@ var EventBuffer = /*#__PURE__*/ function() {
687
687
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
688
688
  var _this1 = this;
689
689
  _class_call_check$B(this, EventBuffer);
690
- _define_property$5(this, "buffer", "");
691
- _define_property$5(this, "serialize", void 0);
692
- _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);
693
693
  /**
694
694
  * Write a line with a field key and value appended with a newline character.
695
- */ _define_property$5(this, "writeField", function(name, value) {
695
+ */ _define_property$6(this, "writeField", function(name, value) {
696
696
  var sanitized = _this.sanitize(value);
697
697
  _this.buffer += name + ":" + sanitized + "\n";
698
698
  return _this;
@@ -703,7 +703,7 @@ var EventBuffer = /*#__PURE__*/ function() {
703
703
  * Data is serialized to a string using the given `serializer` function option or JSON stringification by default.
704
704
  *
705
705
  * @param data - Data to serialize and write.
706
- */ _define_property$5(this, "data", function(data) {
706
+ */ _define_property$6(this, "data", function(data) {
707
707
  var serialized = _this.serialize(data);
708
708
  _this.writeField("data", serialized);
709
709
  return _this;
@@ -714,7 +714,7 @@ var EventBuffer = /*#__PURE__*/ function() {
714
714
  * Defaults to an empty string if no argument is given.
715
715
  *
716
716
  * @param id - Identification string to write.
717
- */ _define_property$5(this, "id", function() {
717
+ */ _define_property$6(this, "id", function() {
718
718
  var id = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
719
719
  _this1.writeField("id", id);
720
720
  return _this1;
@@ -723,7 +723,7 @@ var EventBuffer = /*#__PURE__*/ function() {
723
723
  * Write a retry field that suggests a reconnection time with the given milliseconds.
724
724
  *
725
725
  * @param time - Time in milliseconds to retry.
726
- */ _define_property$5(this, "retry", function(time) {
726
+ */ _define_property$6(this, "retry", function(time) {
727
727
  var stringifed = time.toString();
728
728
  _this.writeField("retry", stringifed);
729
729
  return _this;
@@ -734,14 +734,14 @@ var EventBuffer = /*#__PURE__*/ function() {
734
734
  * This will not fire an event but is often used to keep the connection alive.
735
735
  *
736
736
  * @param text - Text of the comment. Otherwise writes an empty field value.
737
- */ _define_property$5(this, "comment", function() {
737
+ */ _define_property$6(this, "comment", function() {
738
738
  var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
739
739
  _this1.writeField("", text);
740
740
  return _this1;
741
741
  });
742
742
  /**
743
743
  * Indicate that the event has finished being created by writing an additional newline character.
744
- */ _define_property$5(this, "dispatch", function() {
744
+ */ _define_property$6(this, "dispatch", function() {
745
745
  _this.buffer += "\n";
746
746
  return _this;
747
747
  });
@@ -757,7 +757,7 @@ var EventBuffer = /*#__PURE__*/ function() {
757
757
  * @param data - Data to write.
758
758
  * @param eventName - Event name to write.
759
759
  * @param eventId - Event ID to write.
760
- */ _define_property$5(this, "push", function(data) {
760
+ */ _define_property$6(this, "push", function(data) {
761
761
  var eventName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "message", eventId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : generateId();
762
762
  _this1.event(eventName).id(eventId).data(data).dispatch();
763
763
  return _this1;
@@ -773,7 +773,7 @@ var EventBuffer = /*#__PURE__*/ function() {
773
773
  * @param options - Event name to use for each event created.
774
774
  *
775
775
  * @returns A promise that resolves with `true` or rejects based on the success of the stream write finishing.
776
- */ _define_property$5(this, "stream", createPushFromStream(this.push));
776
+ */ _define_property$6(this, "stream", createPushFromStream(this.push));
777
777
  /**
778
778
  * Iterate over an iterable and write yielded values as events into the buffer.
779
779
  *
@@ -784,16 +784,16 @@ var EventBuffer = /*#__PURE__*/ function() {
784
784
  * @param iterable - Iterable to consume data from.
785
785
  *
786
786
  * @returns A promise that resolves once all data has been successfully yielded from the iterable.
787
- */ _define_property$5(this, "iterate", createPushFromIterable(this.push));
787
+ */ _define_property$6(this, "iterate", createPushFromIterable(this.push));
788
788
  /**
789
789
  * Clear the contents of the buffer.
790
- */ _define_property$5(this, "clear", function() {
790
+ */ _define_property$6(this, "clear", function() {
791
791
  _this.buffer = "";
792
792
  return _this;
793
793
  });
794
794
  /**
795
795
  * Get a copy of the buffer contents.
796
- */ _define_property$5(this, "read", function() {
796
+ */ _define_property$6(this, "read", function() {
797
797
  return _this.buffer;
798
798
  });
799
799
  var _options_serializer;
@@ -882,16 +882,16 @@ var FetchConnection = (__FetchConnection = function _FetchConnection(request, re
882
882
  var _this = this;
883
883
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
884
884
  _class_call_check$B(this, _FetchConnection);
885
- _define_property$5(this, "writer", void 0);
886
- _define_property$5(this, "url", void 0);
887
- _define_property$5(this, "request", void 0);
888
- _define_property$5(this, "response", void 0);
889
- _define_property$5(this, "sendHead", function() {});
890
- _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) {
891
891
  var encoded = _FetchConnection.encoder.encode(chunk);
892
892
  _this.writer.write(encoded);
893
893
  });
894
- _define_property$5(this, "cleanup", function() {
894
+ _define_property$6(this, "cleanup", function() {
895
895
  _this.writer.close();
896
896
  });
897
897
  this.url = new URL(request.url);
@@ -906,26 +906,26 @@ var FetchConnection = (__FetchConnection = function _FetchConnection(request, re
906
906
  if (response) {
907
907
  applyHeaders(response.headers, this.response.headers);
908
908
  }
909
- }, _define_property$5(__FetchConnection, "encoder", new TextEncoder()), __FetchConnection);
909
+ }, _define_property$6(__FetchConnection, "encoder", new TextEncoder()), __FetchConnection);
910
910
  // src/adapters/NodeHttp1Connection.ts
911
911
  var NodeHttp1Connection = function NodeHttp1Connection(req, res) {
912
912
  var _this = this;
913
913
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
914
914
  _class_call_check$B(this, NodeHttp1Connection);
915
- _define_property$5(this, "controller", void 0);
916
- _define_property$5(this, "url", void 0);
917
- _define_property$5(this, "request", void 0);
918
- _define_property$5(this, "response", void 0);
919
- _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() {
920
920
  _this.controller.abort();
921
921
  });
922
- _define_property$5(this, "sendHead", function() {
922
+ _define_property$6(this, "sendHead", function() {
923
923
  _this.res.writeHead(_this.response.status, Object.fromEntries(_this.response.headers));
924
924
  });
925
- _define_property$5(this, "sendChunk", function(chunk) {
925
+ _define_property$6(this, "sendChunk", function(chunk) {
926
926
  _this.res.write(chunk);
927
927
  });
928
- _define_property$5(this, "cleanup", function() {
928
+ _define_property$6(this, "cleanup", function() {
929
929
  _this.req.removeListener("close", _this.onClose);
930
930
  _this.res.removeListener("close", _this.onClose);
931
931
  });
@@ -956,20 +956,20 @@ var NodeHttp2CompatConnection = function NodeHttp2CompatConnection(req, res) {
956
956
  var _this = this;
957
957
  var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
958
958
  _class_call_check$B(this, NodeHttp2CompatConnection);
959
- _define_property$5(this, "controller", void 0);
960
- _define_property$5(this, "url", void 0);
961
- _define_property$5(this, "request", void 0);
962
- _define_property$5(this, "response", void 0);
963
- _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() {
964
964
  _this.controller.abort();
965
965
  });
966
- _define_property$5(this, "sendHead", function() {
966
+ _define_property$6(this, "sendHead", function() {
967
967
  _this.res.writeHead(_this.response.status, Object.fromEntries(_this.response.headers));
968
968
  });
969
- _define_property$5(this, "sendChunk", function(chunk) {
969
+ _define_property$6(this, "sendChunk", function(chunk) {
970
970
  _this.res.write(chunk);
971
971
  });
972
- _define_property$5(this, "cleanup", function() {
972
+ _define_property$6(this, "cleanup", function() {
973
973
  _this.req.removeListener("close", _this.onClose);
974
974
  _this.res.removeListener("close", _this.onClose);
975
975
  });
@@ -985,7 +985,7 @@ var NodeHttp2CompatConnection = function NodeHttp2CompatConnection(req, res) {
985
985
  method: (_req_method = req.method) !== null && _req_method !== void 0 ? _req_method : DEFAULT_REQUEST_METHOD,
986
986
  signal: this.controller.signal
987
987
  });
988
- var allowedHeaders = _object_spread$3({}, req.headers);
988
+ var allowedHeaders = _object_spread$4({}, req.headers);
989
989
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
990
990
  try {
991
991
  for(var _iterator = Object.keys(allowedHeaders)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
@@ -1113,12 +1113,12 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1113
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.
1114
1114
  *
1115
1115
  * @readonly
1116
- */ _define_property$5(_assert_this_initialized$l(_this), "lastId", "");
1116
+ */ _define_property$6(_assert_this_initialized$l(_this), "lastId", "");
1117
1117
  /**
1118
1118
  * Indicates whether the session and underlying connection is open or not.
1119
1119
  *
1120
1120
  * @readonly
1121
- */ _define_property$5(_assert_this_initialized$l(_this), "isConnected", false);
1121
+ */ _define_property$6(_assert_this_initialized$l(_this), "isConnected", false);
1122
1122
  /**
1123
1123
  * Custom state for this session.
1124
1124
  *
@@ -1126,15 +1126,15 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1126
1126
  *
1127
1127
  * Use [module augmentation and declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
1128
1128
  * to safely add new properties to the `DefaultSessionState` interface.
1129
- */ _define_property$5(_assert_this_initialized$l(_this), "state", void 0);
1130
- _define_property$5(_assert_this_initialized$l(_this), "buffer", void 0);
1131
- _define_property$5(_assert_this_initialized$l(_this), "connection", void 0);
1132
- _define_property$5(_assert_this_initialized$l(_this), "sanitize", void 0);
1133
- _define_property$5(_assert_this_initialized$l(_this), "serialize", void 0);
1134
- _define_property$5(_assert_this_initialized$l(_this), "initialRetry", void 0);
1135
- _define_property$5(_assert_this_initialized$l(_this), "keepAliveInterval", void 0);
1136
- _define_property$5(_assert_this_initialized$l(_this), "keepAliveTimer", void 0);
1137
- _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() {
1138
1138
  _this.connection.sendHead();
1139
1139
  if (_this.connection.url.searchParams.has("padding")) {
1140
1140
  _this.buffer.comment(" ".repeat(2049)).dispatch();
@@ -1152,7 +1152,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1152
1152
  _this.isConnected = true;
1153
1153
  _this.emit("connected");
1154
1154
  });
1155
- _define_property$5(_assert_this_initialized$l(_this), "onDisconnected", function() {
1155
+ _define_property$6(_assert_this_initialized$l(_this), "onDisconnected", function() {
1156
1156
  _this.connection.request.signal.removeEventListener("abort", _this.onDisconnected);
1157
1157
  _this.connection.cleanup();
1158
1158
  if (_this.keepAliveTimer) {
@@ -1163,13 +1163,13 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1163
1163
  });
1164
1164
  /**
1165
1165
  * Write an empty comment and flush it to the client.
1166
- */ _define_property$5(_assert_this_initialized$l(_this), "keepAlive", function() {
1166
+ */ _define_property$6(_assert_this_initialized$l(_this), "keepAlive", function() {
1167
1167
  _this.buffer.comment().dispatch();
1168
1168
  _this.flush();
1169
1169
  });
1170
1170
  /**
1171
1171
  * Flush the contents of the internal buffer to the client and clear the buffer.
1172
- */ _define_property$5(_assert_this_initialized$l(_this), "flush", function() {
1172
+ */ _define_property$6(_assert_this_initialized$l(_this), "flush", function() {
1173
1173
  var contents = _this.buffer.read();
1174
1174
  _this.buffer.clear();
1175
1175
  _this.connection.sendChunk(contents);
@@ -1181,7 +1181,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1181
1181
  *
1182
1182
  * When using the Node HTTP APIs, this will be a new Request object with status code and headers copied from the original request.
1183
1183
  * When the originally given request or response is closed, the abort signal attached to this Request will be triggered.
1184
- */ _define_property$5(_assert_this_initialized$l(_this), "getRequest", function() {
1184
+ */ _define_property$6(_assert_this_initialized$l(_this), "getRequest", function() {
1185
1185
  return _this.connection.request;
1186
1186
  });
1187
1187
  /**
@@ -1192,7 +1192,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1192
1192
  *
1193
1193
  * When using the Node HTTP APIs, this will be a new Response object with status code and headers copied from the original response.
1194
1194
  * Its body will be `null`, as data is instead written to the stream of the originally given response object.
1195
- */ _define_property$5(_assert_this_initialized$l(_this), "getResponse", function() {
1195
+ */ _define_property$6(_assert_this_initialized$l(_this), "getResponse", function() {
1196
1196
  return _this.connection.response;
1197
1197
  });
1198
1198
  /**
@@ -1209,7 +1209,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1209
1209
  * @param data - Data to write.
1210
1210
  * @param eventName - Event name to write.
1211
1211
  * @param eventId - Event ID to write.
1212
- */ _define_property$5(_assert_this_initialized$l(_this), "push", function(data) {
1212
+ */ _define_property$6(_assert_this_initialized$l(_this), "push", function(data) {
1213
1213
  var eventName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "message", eventId = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : generateId();
1214
1214
  if (!_this.isConnected) {
1215
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.");
@@ -1231,7 +1231,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1231
1231
  * @param options - Options to alter how the stream is flushed to the client.
1232
1232
  *
1233
1233
  * @returns A promise that resolves with `true` or rejects based on the success of the stream write finishing.
1234
- */ _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));
1235
1235
  /**
1236
1236
  * Iterate over an iterable and send yielded values as events to the client.
1237
1237
  *
@@ -1242,7 +1242,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1242
1242
  * @param iterable - Iterable to consume data from.
1243
1243
  *
1244
1244
  * @returns A promise that resolves once all data has been successfully yielded from the iterable.
1245
- */ _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));
1246
1246
  var _this1 = _assert_this_initialized$l(_this);
1247
1247
  /**
1248
1248
  * Batch and send multiple events at once.
@@ -1257,7 +1257,7 @@ var Session = /*#__PURE__*/ function(TypedEmitter) {
1257
1257
  * @returns A promise that resolves once all data from the event buffer has been successfully sent to the client.
1258
1258
  *
1259
1259
  * @see EventBuffer
1260
- */ _define_property$5(_assert_this_initialized$l(_this), "batch", function() {
1260
+ */ _define_property$6(_assert_this_initialized$l(_this), "batch", function() {
1261
1261
  var _ref = _async_to_generator(function(batcher) {
1262
1262
  var buffer;
1263
1263
  return _ts_generator(this, function(_state) {
@@ -1378,8 +1378,8 @@ var Channel = /*#__PURE__*/ function(TypedEmitter) {
1378
1378
  * Custom state for this channel.
1379
1379
  *
1380
1380
  * Use this object to safely store information related to the channel.
1381
- */ _define_property$5(_assert_this_initialized$l(_this), "state", void 0);
1382
- _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());
1383
1383
  /**
1384
1384
  * Broadcast an event to every active session registered with this channel.
1385
1385
  *
@@ -1391,7 +1391,7 @@ var Channel = /*#__PURE__*/ function(TypedEmitter) {
1391
1391
  *
1392
1392
  * @param data - Data to write.
1393
1393
  * @param eventName - Event name to write.
1394
- */ _define_property$5(_assert_this_initialized$l(_this), "broadcast", function(data) {
1394
+ */ _define_property$6(_assert_this_initialized$l(_this), "broadcast", function(data) {
1395
1395
  var eventName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "message", options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1396
1396
  var _options_eventId;
1397
1397
  var eventId = (_options_eventId = options.eventId) !== null && _options_eventId !== void 0 ? _options_eventId : generateId();
@@ -9687,7 +9687,7 @@ function _create_class$v(Constructor, protoProps, staticProps) {
9687
9687
  if (staticProps) _defineProperties$v(Constructor, staticProps);
9688
9688
  return Constructor;
9689
9689
  }
9690
- function _define_property$4(obj, key, value) {
9690
+ function _define_property$5(obj, key, value) {
9691
9691
  if (key in obj) {
9692
9692
  Object.defineProperty(obj, key, {
9693
9693
  value: value,
@@ -9762,7 +9762,7 @@ function _non_iterable_rest$5() {
9762
9762
  function _non_iterable_spread$6() {
9763
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.");
9764
9764
  }
9765
- function _object_spread$2(target) {
9765
+ function _object_spread$3(target) {
9766
9766
  for(var i = 1; i < arguments.length; i++){
9767
9767
  var source = arguments[i] != null ? arguments[i] : {};
9768
9768
  var ownKeys = Object.keys(source);
@@ -9772,12 +9772,12 @@ function _object_spread$2(target) {
9772
9772
  }));
9773
9773
  }
9774
9774
  ownKeys.forEach(function(key) {
9775
- _define_property$4(target, key, source[key]);
9775
+ _define_property$5(target, key, source[key]);
9776
9776
  });
9777
9777
  }
9778
9778
  return target;
9779
9779
  }
9780
- function ownKeys$1(object, enumerableOnly) {
9780
+ function ownKeys$2(object, enumerableOnly) {
9781
9781
  var keys = Object.keys(object);
9782
9782
  if (Object.getOwnPropertySymbols) {
9783
9783
  var symbols = Object.getOwnPropertySymbols(object);
@@ -9785,12 +9785,12 @@ function ownKeys$1(object, enumerableOnly) {
9785
9785
  }
9786
9786
  return keys;
9787
9787
  }
9788
- function _object_spread_props$1(target, source) {
9788
+ function _object_spread_props$2(target, source) {
9789
9789
  source = source != null ? source : {};
9790
9790
  if (Object.getOwnPropertyDescriptors) {
9791
9791
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9792
9792
  } else {
9793
- ownKeys$1(Object(source)).forEach(function(key) {
9793
+ ownKeys$2(Object(source)).forEach(function(key) {
9794
9794
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9795
9795
  });
9796
9796
  }
@@ -10661,7 +10661,7 @@ function getCachedWeekInfo(locString) {
10661
10661
  data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo;
10662
10662
  // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86
10663
10663
  if (!("minimalDays" in data)) {
10664
- data = _object_spread$2({}, fallbackWeekSettings, data);
10664
+ data = _object_spread$3({}, fallbackWeekSettings, data);
10665
10665
  }
10666
10666
  weekInfoCache.set(locString, data);
10667
10667
  }
@@ -10768,7 +10768,7 @@ function supportsFastNumbers(loc) {
10768
10768
  "floor"
10769
10769
  ]);
10770
10770
  if (!forceSimple || Object.keys(otherOpts).length > 0) {
10771
- var intlOpts = _object_spread$2({
10771
+ var intlOpts = _object_spread$3({
10772
10772
  useGrouping: false
10773
10773
  }, opts);
10774
10774
  if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;
@@ -10838,7 +10838,7 @@ function supportsFastNumbers(loc) {
10838
10838
  });
10839
10839
  this.originalZone = dt.zone;
10840
10840
  }
10841
- var intlOpts = _object_spread$2({}, this.opts);
10841
+ var intlOpts = _object_spread$3({}, this.opts);
10842
10842
  intlOpts.timeZone = intlOpts.timeZone || z;
10843
10843
  this.dtf = getCachedDTF(intl, intlOpts);
10844
10844
  }
@@ -10869,7 +10869,7 @@ function supportsFastNumbers(loc) {
10869
10869
  locale: _this.dt.locale,
10870
10870
  format: _this.opts.timeZoneName
10871
10871
  });
10872
- return _object_spread_props$1(_object_spread$2({}, part), {
10872
+ return _object_spread_props$2(_object_spread$3({}, part), {
10873
10873
  value: offsetName
10874
10874
  });
10875
10875
  } else {
@@ -10894,7 +10894,7 @@ function supportsFastNumbers(loc) {
10894
10894
  */ var PolyRelFormatter = /*#__PURE__*/ function() {
10895
10895
  function PolyRelFormatter(intl, isEnglish, opts) {
10896
10896
  _class_call_check$A(this, PolyRelFormatter);
10897
- this.opts = _object_spread$2({
10897
+ this.opts = _object_spread$3({
10898
10898
  style: "long"
10899
10899
  }, opts);
10900
10900
  if (!isEnglish && hasRelative()) {
@@ -10989,7 +10989,7 @@ var fallbackWeekSettings = {
10989
10989
  key: "redefaultToEN",
10990
10990
  value: function redefaultToEN() {
10991
10991
  var alts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
10992
- return this.clone(_object_spread_props$1(_object_spread$2({}, alts), {
10992
+ return this.clone(_object_spread_props$2(_object_spread$3({}, alts), {
10993
10993
  defaultToEN: true
10994
10994
  }));
10995
10995
  }
@@ -10998,7 +10998,7 @@ var fallbackWeekSettings = {
10998
10998
  key: "redefaultToSystem",
10999
10999
  value: function redefaultToSystem() {
11000
11000
  var alts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
11001
- return this.clone(_object_spread_props$1(_object_spread$2({}, alts), {
11001
+ return this.clone(_object_spread_props$2(_object_spread$3({}, alts), {
11002
11002
  defaultToEN: false
11003
11003
  }));
11004
11004
  }
@@ -11877,7 +11877,7 @@ function isoWeekdayToLocal(isoWeekday, startOfWeek) {
11877
11877
  } else {
11878
11878
  weekYear = year;
11879
11879
  }
11880
- return _object_spread$2({
11880
+ return _object_spread$3({
11881
11881
  weekYear: weekYear,
11882
11882
  weekNumber: weekNumber,
11883
11883
  weekday: weekday
@@ -11897,7 +11897,7 @@ function weekToGregorian(weekData) {
11897
11897
  year = weekYear;
11898
11898
  }
11899
11899
  var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), month = _uncomputeOrdinal.month, day = _uncomputeOrdinal.day;
11900
- return _object_spread$2({
11900
+ return _object_spread$3({
11901
11901
  year: year,
11902
11902
  month: month,
11903
11903
  day: day
@@ -11906,7 +11906,7 @@ function weekToGregorian(weekData) {
11906
11906
  function gregorianToOrdinal(gregData) {
11907
11907
  var year = gregData.year, month = gregData.month, day = gregData.day;
11908
11908
  var ordinal = computeOrdinal(year, month, day);
11909
- return _object_spread$2({
11909
+ return _object_spread$3({
11910
11910
  year: year,
11911
11911
  ordinal: ordinal
11912
11912
  }, timeObject(gregData));
@@ -11914,7 +11914,7 @@ function gregorianToOrdinal(gregData) {
11914
11914
  function ordinalToGregorian(ordinalData) {
11915
11915
  var year = ordinalData.year, ordinal = ordinalData.ordinal;
11916
11916
  var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), month = _uncomputeOrdinal.month, day = _uncomputeOrdinal.day;
11917
- return _object_spread$2({
11917
+ return _object_spread$3({
11918
11918
  year: year,
11919
11919
  month: month,
11920
11920
  day: day
@@ -12210,7 +12210,7 @@ function parseZoneInfo(ts, offsetFormat, locale) {
12210
12210
  if (timeZone) {
12211
12211
  intlOpts.timeZone = timeZone;
12212
12212
  }
12213
- var modified = _object_spread$2({
12213
+ var modified = _object_spread$3({
12214
12214
  timeZoneName: offsetFormat
12215
12215
  }, intlOpts);
12216
12216
  var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function(m) {
@@ -12569,7 +12569,7 @@ var macroTokenToFormatOpts = {
12569
12569
  if (this.systemLoc === null) {
12570
12570
  this.systemLoc = this.loc.redefaultToSystem();
12571
12571
  }
12572
- 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));
12573
12573
  return df.format();
12574
12574
  }
12575
12575
  },
@@ -12577,7 +12577,7 @@ var macroTokenToFormatOpts = {
12577
12577
  key: "dtFormatter",
12578
12578
  value: function dtFormatter(dt) {
12579
12579
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
12580
- return this.loc.dtFormatter(dt, _object_spread$2({}, this.opts, opts));
12580
+ return this.loc.dtFormatter(dt, _object_spread$3({}, this.opts, opts));
12581
12581
  }
12582
12582
  },
12583
12583
  {
@@ -12613,7 +12613,7 @@ var macroTokenToFormatOpts = {
12613
12613
  if (this.opts.forceSimple) {
12614
12614
  return padStart(n, p);
12615
12615
  }
12616
- var opts = _object_spread$2({}, this.opts);
12616
+ var opts = _object_spread$3({}, this.opts);
12617
12617
  if (p > 0) {
12618
12618
  opts.padTo = p;
12619
12619
  }
@@ -13029,7 +13029,7 @@ function combineExtractors() {
13029
13029
  var _param = _sliced_to_array$5(param, 3), mergedVals = _param[0], mergedZone = _param[1], cursor = _param[2];
13030
13030
  var _ex = _sliced_to_array$5(ex(m, cursor), 3), val = _ex[0], zone = _ex[1], next = _ex[2];
13031
13031
  return [
13032
- _object_spread$2({}, mergedVals, val),
13032
+ _object_spread$3({}, mergedVals, val),
13033
13033
  zone || mergedZone,
13034
13034
  next
13035
13035
  ];
@@ -13340,7 +13340,7 @@ var lowOrderMatrix = {
13340
13340
  seconds: {
13341
13341
  milliseconds: 1000
13342
13342
  }
13343
- }, casualMatrix = _object_spread$2({
13343
+ }, casualMatrix = _object_spread$3({
13344
13344
  years: {
13345
13345
  quarters: 4,
13346
13346
  months: 12,
@@ -13368,7 +13368,7 @@ var lowOrderMatrix = {
13368
13368
  seconds: 30 * 24 * 60 * 60,
13369
13369
  milliseconds: 30 * 24 * 60 * 60 * 1000
13370
13370
  }
13371
- }, 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({
13372
13372
  years: {
13373
13373
  quarters: 4,
13374
13374
  months: 12,
@@ -13415,7 +13415,7 @@ function clone$1(dur, alts) {
13415
13415
  var clear = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
13416
13416
  // deep merge for vals
13417
13417
  var conf = {
13418
- values: clear ? alts.values : _object_spread$2({}, dur.values, alts.values || {}),
13418
+ values: clear ? alts.values : _object_spread$3({}, dur.values, alts.values || {}),
13419
13419
  loc: dur.loc.clone(alts.loc),
13420
13420
  conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
13421
13421
  matrix: alts.matrix || dur.matrix
@@ -13614,7 +13614,7 @@ function removeZeroes(vals) {
13614
13614
  value: function toFormat(fmt) {
13615
13615
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
13616
13616
  // reverse-compat since 1.2; we always round down now, never up, and we do it by default
13617
- var fmtOpts = _object_spread_props$1(_object_spread$2({}, opts), {
13617
+ var fmtOpts = _object_spread_props$2(_object_spread$3({}, opts), {
13618
13618
  floor: opts.round !== false && opts.floor !== false
13619
13619
  });
13620
13620
  return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
@@ -13647,7 +13647,7 @@ function removeZeroes(vals) {
13647
13647
  if (isUndefined$2(val) || val === 0 && !showZeros) {
13648
13648
  return null;
13649
13649
  }
13650
- return _this.loc.numberFormatter(_object_spread_props$1(_object_spread$2({
13650
+ return _this.loc.numberFormatter(_object_spread_props$2(_object_spread$3({
13651
13651
  style: "unit",
13652
13652
  unitDisplay: "long"
13653
13653
  }, opts), {
@@ -13656,7 +13656,7 @@ function removeZeroes(vals) {
13656
13656
  }).filter(function(n) {
13657
13657
  return n;
13658
13658
  });
13659
- return this.loc.listFormatter(_object_spread$2({
13659
+ return this.loc.listFormatter(_object_spread$3({
13660
13660
  type: "conjunction",
13661
13661
  style: opts.listStyle || "narrow"
13662
13662
  }, opts)).format(l);
@@ -13670,7 +13670,7 @@ function removeZeroes(vals) {
13670
13670
  */ key: "toObject",
13671
13671
  value: function toObject() {
13672
13672
  if (!this.isValid) return {};
13673
- return _object_spread$2({}, this.values);
13673
+ return _object_spread$3({}, this.values);
13674
13674
  }
13675
13675
  },
13676
13676
  {
@@ -13723,7 +13723,7 @@ function removeZeroes(vals) {
13723
13723
  if (!this.isValid) return null;
13724
13724
  var millis = this.toMillis();
13725
13725
  if (millis < 0 || millis >= 86400000) return null;
13726
- opts = _object_spread_props$1(_object_spread$2({
13726
+ opts = _object_spread_props$2(_object_spread$3({
13727
13727
  suppressMilliseconds: false,
13728
13728
  suppressSeconds: false,
13729
13729
  includePrefix: false,
@@ -13894,7 +13894,7 @@ function removeZeroes(vals) {
13894
13894
  */ key: "set",
13895
13895
  value: function set(values) {
13896
13896
  if (!this.isValid) return this;
13897
- var mixed = _object_spread$2({}, this.values, normalizeObject(values, Duration.normalizeUnit));
13897
+ var mixed = _object_spread$3({}, this.values, normalizeObject(values, Duration.normalizeUnit));
13898
13898
  return clone$1(this, {
13899
13899
  values: mixed
13900
13900
  });
@@ -15505,7 +15505,7 @@ function diff(earlier, later, units, opts) {
15505
15505
  });
15506
15506
  if (lowerOrderUnits.length === 0) {
15507
15507
  if (highWater < later) {
15508
- highWater = cursor.plus(_define_property$4({}, lowestOrder, 1));
15508
+ highWater = cursor.plus(_define_property$5({}, lowestOrder, 1));
15509
15509
  }
15510
15510
  if (highWater !== cursor) {
15511
15511
  results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
@@ -16065,7 +16065,7 @@ function clone$2(inst, alts) {
16065
16065
  loc: inst.loc,
16066
16066
  invalid: inst.invalid
16067
16067
  };
16068
- 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), {
16069
16069
  old: current
16070
16070
  }));
16071
16071
  }
@@ -16119,7 +16119,7 @@ function objToTS(obj, offset, zone) {
16119
16119
  }
16120
16120
  // create a new DT instance by adding a duration, adjusting for DSTs
16121
16121
  function adjustTime(inst, dur) {
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$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), {
16123
16123
  year: year,
16124
16124
  month: month,
16125
16125
  day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
@@ -16150,7 +16150,7 @@ function adjustTime(inst, dur) {
16150
16150
  function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
16151
16151
  var setZone = opts.setZone, zone = opts.zone;
16152
16152
  if (parsed && Object.keys(parsed).length !== 0 || parsedZone) {
16153
- 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), {
16154
16154
  zone: interpretationZone,
16155
16155
  specificOffset: specificOffset
16156
16156
  }));
@@ -17170,11 +17170,11 @@ function lastOpts(argList) {
17170
17170
  }
17171
17171
  var mixed;
17172
17172
  if (settingWeekStuff) {
17173
- 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);
17174
17174
  } else if (!isUndefined$2(normalized.ordinal)) {
17175
- mixed = ordinalToGregorian(_object_spread$2({}, gregorianToOrdinal(this.c), normalized));
17175
+ mixed = ordinalToGregorian(_object_spread$3({}, gregorianToOrdinal(this.c), normalized));
17176
17176
  } else {
17177
- mixed = _object_spread$2({}, this.toObject(), normalized);
17177
+ mixed = _object_spread$3({}, this.toObject(), normalized);
17178
17178
  // if we didn't set the day but we ended up on an overflow date,
17179
17179
  // use the last day of the right month
17180
17180
  if (isUndefined$2(normalized.day)) {
@@ -17293,7 +17293,7 @@ function lastOpts(argList) {
17293
17293
  * @return {DateTime}
17294
17294
  */ key: "endOf",
17295
17295
  value: function endOf(unit, opts) {
17296
- 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;
17297
17297
  }
17298
17298
  },
17299
17299
  {
@@ -17621,7 +17621,7 @@ function lastOpts(argList) {
17621
17621
  value: function toObject() {
17622
17622
  var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
17623
17623
  if (!this.isValid) return {};
17624
- var base = _object_spread$2({}, this.c);
17624
+ var base = _object_spread$3({}, this.c);
17625
17625
  if (opts.includeConfig) {
17626
17626
  base.outputCalendar = this.outputCalendar;
17627
17627
  base.numberingSystem = this.loc.numberingSystem;
@@ -17661,7 +17661,7 @@ function lastOpts(argList) {
17661
17661
  if (!this.isValid || !otherDateTime.isValid) {
17662
17662
  return Duration.invalid("created by diffing an invalid DateTime");
17663
17663
  }
17664
- var durOpts = _object_spread$2({
17664
+ var durOpts = _object_spread$3({
17665
17665
  locale: this.locale,
17666
17666
  numberingSystem: this.numberingSystem
17667
17667
  }, opts);
@@ -17765,7 +17765,7 @@ function lastOpts(argList) {
17765
17765
  units = options.unit;
17766
17766
  unit = undefined;
17767
17767
  }
17768
- 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), {
17769
17769
  numeric: "always",
17770
17770
  units: units,
17771
17771
  unit: unit
@@ -17791,7 +17791,7 @@ function lastOpts(argList) {
17791
17791
  if (!this.isValid) return null;
17792
17792
  return diffRelative(options.base || DateTime.fromObject({}, {
17793
17793
  zone: this.zone
17794
- }), this, _object_spread_props$1(_object_spread$2({}, options), {
17794
+ }), this, _object_spread_props$2(_object_spread$3({}, options), {
17795
17795
  numeric: "auto",
17796
17796
  units: [
17797
17797
  "years",
@@ -24059,7 +24059,7 @@ function _create_class$r(Constructor, protoProps, staticProps) {
24059
24059
  if (staticProps) _defineProperties$r(Constructor, staticProps);
24060
24060
  return Constructor;
24061
24061
  }
24062
- function _define_property$3(obj, key, value) {
24062
+ function _define_property$4(obj, key, value) {
24063
24063
  if (key in obj) {
24064
24064
  Object.defineProperty(obj, key, {
24065
24065
  value: value,
@@ -24112,7 +24112,7 @@ function _non_iterable_rest$2() {
24112
24112
  function _non_iterable_spread$4() {
24113
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.");
24114
24114
  }
24115
- function _object_spread$1(target) {
24115
+ function _object_spread$2(target) {
24116
24116
  for(var i = 1; i < arguments.length; i++){
24117
24117
  var source = arguments[i] != null ? arguments[i] : {};
24118
24118
  var ownKeys = Object.keys(source);
@@ -24122,12 +24122,12 @@ function _object_spread$1(target) {
24122
24122
  }));
24123
24123
  }
24124
24124
  ownKeys.forEach(function(key) {
24125
- _define_property$3(target, key, source[key]);
24125
+ _define_property$4(target, key, source[key]);
24126
24126
  });
24127
24127
  }
24128
24128
  return target;
24129
24129
  }
24130
- function ownKeys(object, enumerableOnly) {
24130
+ function ownKeys$1(object, enumerableOnly) {
24131
24131
  var keys = Object.keys(object);
24132
24132
  if (Object.getOwnPropertySymbols) {
24133
24133
  var symbols = Object.getOwnPropertySymbols(object);
@@ -24135,12 +24135,12 @@ function ownKeys(object, enumerableOnly) {
24135
24135
  }
24136
24136
  return keys;
24137
24137
  }
24138
- function _object_spread_props(target, source) {
24138
+ function _object_spread_props$1(target, source) {
24139
24139
  source = source != null ? source : {};
24140
24140
  if (Object.getOwnPropertyDescriptors) {
24141
24141
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
24142
24142
  } else {
24143
- ownKeys(Object(source)).forEach(function(key) {
24143
+ ownKeys$1(Object(source)).forEach(function(key) {
24144
24144
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
24145
24145
  });
24146
24146
  }
@@ -24333,14 +24333,14 @@ function indent(str, spaces) {
24333
24333
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
24334
24334
  // match is required
24335
24335
  if (!match) {
24336
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
24336
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
24337
24337
  v: nextMatch1
24338
24338
  };
24339
24339
  }
24340
24340
  var token = match.token, offset = match.offset;
24341
24341
  i1 += offset;
24342
24342
  if (token === ' ') {
24343
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
24343
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
24344
24344
  }
24345
24345
  tokens1 = _to_consumable_array$4(tokens1).concat([
24346
24346
  token
@@ -24359,7 +24359,7 @@ function indent(str, spaces) {
24359
24359
  if (contextKeys.some(function(el) {
24360
24360
  return el.startsWith(name);
24361
24361
  })) {
24362
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
24362
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
24363
24363
  }
24364
24364
  if (dateTimeIdentifiers.some(function(el) {
24365
24365
  return el === name;
@@ -24378,9 +24378,9 @@ function indent(str, spaces) {
24378
24378
  if (dateTimeIdentifiers.some(function(el) {
24379
24379
  return el.startsWith(name);
24380
24380
  })) {
24381
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
24381
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
24382
24382
  }
24383
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
24383
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
24384
24384
  v: nextMatch1
24385
24385
  };
24386
24386
  };
@@ -24392,7 +24392,7 @@ function indent(str, spaces) {
24392
24392
  }
24393
24393
  }
24394
24394
  var _obj;
24395
- 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);
24396
24396
  var identifiers = new ExternalTokenizer(function(input, stack) {
24397
24397
  LOG_PARSE_DEBUG && console.log('%s: T <identifier | nameIdentifier>', input.pos);
24398
24398
  var nameMatch = parseName(input, stack.context);
@@ -24441,11 +24441,11 @@ var insertSemicolon = new ExternalTokenizer(function(input, stack) {
24441
24441
  }
24442
24442
  });
24443
24443
  var _obj1;
24444
- 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);
24445
24445
  var _obj2;
24446
- 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);
24447
24447
  var _obj3;
24448
- 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);
24449
24449
  /**
24450
24450
  * A simple producer that retrievs a value from
24451
24451
  * a given context. Used to lazily take things.
@@ -24533,7 +24533,7 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
24533
24533
  */ key: "set",
24534
24534
  value: function set(key, value) {
24535
24535
  var constructor = /** @type { typeof VariableContext } */ this.constructor;
24536
- 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)));
24537
24537
  }
24538
24538
  },
24539
24539
  {
@@ -24597,7 +24597,7 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
24597
24597
  if ((typeof context === "undefined" ? "undefined" : _type_of$z(context)) !== 'object') {
24598
24598
  return {};
24599
24599
  }
24600
- return _object_spread$1({}, context);
24600
+ return _object_spread$2({}, context);
24601
24601
  }
24602
24602
  },
24603
24603
  {
@@ -24615,13 +24615,13 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
24615
24615
  return reduce$1(this.__unwrap(other), function(merged, value, key) {
24616
24616
  if (_instanceof$f(value, ValueProducer)) {
24617
24617
  // keep value producers in tact
24618
- 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));
24619
24619
  }
24620
24620
  value = _this.__unwrap(value);
24621
24621
  if (has$2(merged, key)) {
24622
24622
  value = _this.__merge(_this.__unwrap(merged[key]), value);
24623
24623
  }
24624
- 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));
24625
24625
  }, this.__unwrap(context));
24626
24626
  }
24627
24627
  }
@@ -24840,7 +24840,7 @@ var Variables = /*#__PURE__*/ function() {
24840
24840
  */ key: "assign",
24841
24841
  value: function assign() {
24842
24842
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
24843
- return Variables.of(_object_spread$1({}, this, options));
24843
+ return Variables.of(_object_spread$2({}, this, options));
24844
24844
  }
24845
24845
  },
24846
24846
  {
@@ -24855,7 +24855,7 @@ var Variables = /*#__PURE__*/ function() {
24855
24855
  context: this.context,
24856
24856
  parent: this.parent
24857
24857
  };
24858
- return Variables.of(_object_spread$1({}, defaultOptions, options));
24858
+ return Variables.of(_object_spread$2({}, defaultOptions, options));
24859
24859
  }
24860
24860
  }
24861
24861
  ], [
@@ -25338,7 +25338,7 @@ function _create_class$q(Constructor, protoProps, staticProps) {
25338
25338
  if (protoProps) _defineProperties$q(Constructor.prototype, protoProps);
25339
25339
  return Constructor;
25340
25340
  }
25341
- function _define_property$2(obj, key, value) {
25341
+ function _define_property$3(obj, key, value) {
25342
25342
  if (key in obj) {
25343
25343
  Object.defineProperty(obj, key, {
25344
25344
  value: value,
@@ -26645,7 +26645,7 @@ var builtins = {
26645
26645
  if (key in context) {
26646
26646
  return FALSE;
26647
26647
  }
26648
- 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));
26649
26649
  }, {});
26650
26650
  if (context === FALSE) {
26651
26651
  return null;
@@ -26698,7 +26698,7 @@ var builtins = {
26698
26698
  return null;
26699
26699
  }
26700
26700
  }
26701
- return Object.assign(Object.assign({}, context), _define_property$2({}, key, value));
26701
+ return Object.assign(Object.assign({}, context), _define_property$3({}, key, value));
26702
26702
  }
26703
26703
  function matches(a, b) {
26704
26704
  return a === b;
@@ -27425,7 +27425,7 @@ function evalNode(node, input, args) {
27425
27425
  return function(context) {
27426
27426
  return args.slice(1, -1).reduce(function(obj, arg) {
27427
27427
  var _arg = _sliced_to_array$1(arg(Object.assign(Object.assign({}, context), obj)), 2), key = _arg[0], value = _arg[1];
27428
- return Object.assign(Object.assign({}, obj), _define_property$2({}, key, value));
27428
+ return Object.assign(Object.assign({}, obj), _define_property$3({}, key, value));
27429
27429
  }, {});
27430
27430
  };
27431
27431
  case 'FunctionBody':
@@ -27922,7 +27922,7 @@ function extractValue(context, prop, _target) {
27922
27922
  'range'
27923
27923
  ].includes(getType(target))) {
27924
27924
  return target.map(function(t) {
27925
- return _define_property$2({}, prop, t);
27925
+ return _define_property$3({}, prop, t);
27926
27926
  });
27927
27927
  }
27928
27928
  return null;
@@ -44386,7 +44386,7 @@ function _class_call_check$1(instance, Constructor) {
44386
44386
  throw new TypeError("Cannot call a class as a function");
44387
44387
  }
44388
44388
  }
44389
- function _define_property$1(obj, key, value) {
44389
+ function _define_property$2(obj, key, value) {
44390
44390
  if (key in obj) {
44391
44391
  Object.defineProperty(obj, key, {
44392
44392
  value: value,
@@ -44466,7 +44466,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44466
44466
  _class_call_check$1(this, CelParser);
44467
44467
  var _this;
44468
44468
  _this = _super.call(this, allTokens);
44469
- _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() {
44470
44470
  _this.SUBRULE(_this.conditionalOr, {
44471
44471
  LABEL: 'conditionalOr'
44472
44472
  });
@@ -44481,7 +44481,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44481
44481
  });
44482
44482
  });
44483
44483
  }));
44484
- _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() {
44485
44485
  _this.SUBRULE(_this.relation, {
44486
44486
  LABEL: 'lhs'
44487
44487
  });
@@ -44492,7 +44492,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44492
44492
  });
44493
44493
  });
44494
44494
  }));
44495
- _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() {
44496
44496
  _this.SUBRULE(_this.conditionalAnd, {
44497
44497
  LABEL: 'lhs'
44498
44498
  });
@@ -44503,7 +44503,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44503
44503
  });
44504
44504
  });
44505
44505
  }));
44506
- _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() {
44507
44507
  _this.SUBRULE(_this.addition, {
44508
44508
  LABEL: 'lhs'
44509
44509
  });
@@ -44514,7 +44514,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44514
44514
  });
44515
44515
  });
44516
44516
  }));
44517
- _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() {
44518
44518
  _this.SUBRULE(_this.multiplication, {
44519
44519
  LABEL: 'lhs'
44520
44520
  });
@@ -44525,7 +44525,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44525
44525
  });
44526
44526
  });
44527
44527
  }));
44528
- _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() {
44529
44529
  _this.SUBRULE(_this.unaryExpression, {
44530
44530
  LABEL: 'lhs'
44531
44531
  });
@@ -44536,13 +44536,13 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44536
44536
  });
44537
44537
  });
44538
44538
  }));
44539
- _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() {
44540
44540
  _this.MANY(function() {
44541
44541
  _this.CONSUME(UnaryOperator);
44542
44542
  });
44543
44543
  _this.SUBRULE(_this.atomicExpression);
44544
44544
  }));
44545
- _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() {
44546
44546
  _this.CONSUME(OpenParenthesis, {
44547
44547
  LABEL: 'open'
44548
44548
  });
@@ -44551,7 +44551,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44551
44551
  LABEL: 'close'
44552
44552
  });
44553
44553
  }));
44554
- _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() {
44555
44555
  _this.CONSUME(OpenBracket);
44556
44556
  _this.OPTION(function() {
44557
44557
  _this.SUBRULE(_this.expr, {
@@ -44571,7 +44571,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44571
44571
  });
44572
44572
  });
44573
44573
  }));
44574
- _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() {
44575
44575
  _this.CONSUME(OpenCurlyBracket);
44576
44576
  _this.MANY(function() {
44577
44577
  _this.SUBRULE(_this.mapKeyValues, {
@@ -44596,7 +44596,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44596
44596
  ]);
44597
44597
  });
44598
44598
  }));
44599
- _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() {
44600
44600
  _this.SUBRULE(_this.expr, {
44601
44601
  LABEL: 'key'
44602
44602
  });
@@ -44608,7 +44608,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44608
44608
  _this.CONSUME(Comma);
44609
44609
  });
44610
44610
  }));
44611
- _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() {
44612
44612
  _this.CONSUME(Identifier);
44613
44613
  _this.CONSUME(OpenParenthesis);
44614
44614
  _this.OPTION(function() {
@@ -44624,7 +44624,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44624
44624
  });
44625
44625
  _this.CONSUME(CloseParenthesis);
44626
44626
  }));
44627
- _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() {
44628
44628
  _this.CONSUME(Identifier);
44629
44629
  _this.MANY(function() {
44630
44630
  _this.OR([
@@ -44643,7 +44643,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44643
44643
  ]);
44644
44644
  });
44645
44645
  }));
44646
- _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() {
44647
44647
  _this.CONSUME(Dot);
44648
44648
  _this.CONSUME(Identifier);
44649
44649
  // Optional method call with arguments (for collection macros)
@@ -44663,12 +44663,12 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
44663
44663
  _this.CONSUME(CloseParenthesis);
44664
44664
  });
44665
44665
  }));
44666
- _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() {
44667
44667
  _this.CONSUME(OpenBracket);
44668
44668
  _this.SUBRULE(_this.expr);
44669
44669
  _this.CONSUME(CloseBracket);
44670
44670
  }));
44671
- _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() {
44672
44672
  _this.OR([
44673
44673
  {
44674
44674
  ALT: function() {
@@ -44777,7 +44777,7 @@ function _create_class(Constructor, protoProps, staticProps) {
44777
44777
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
44778
44778
  return Constructor;
44779
44779
  }
44780
- function _define_property(obj, key, value) {
44780
+ function _define_property$1(obj, key, value) {
44781
44781
  if (key in obj) {
44782
44782
  Object.defineProperty(obj, key, {
44783
44783
  value: value,
@@ -44849,7 +44849,7 @@ function _non_iterable_rest() {
44849
44849
  function _non_iterable_spread() {
44850
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.");
44851
44851
  }
44852
- function _object_spread(target) {
44852
+ function _object_spread$1(target) {
44853
44853
  for(var i = 1; i < arguments.length; i++){
44854
44854
  var source = arguments[i] != null ? arguments[i] : {};
44855
44855
  var ownKeys = Object.keys(source);
@@ -44859,7 +44859,7 @@ function _object_spread(target) {
44859
44859
  }));
44860
44860
  }
44861
44861
  ownKeys.forEach(function(key) {
44862
- _define_property(target, key, source[key]);
44862
+ _define_property$1(target, key, source[key]);
44863
44863
  });
44864
44864
  }
44865
44865
  return target;
@@ -44945,13 +44945,13 @@ var CelVisitor = /*#__PURE__*/ function(BaseCelVisitor) {
44945
44945
  _class_call_check(this, CelVisitor);
44946
44946
  var _this;
44947
44947
  _this = _super.call(this);
44948
- _define_property(_assert_this_initialized(_this), "context", void 0);
44948
+ _define_property$1(_assert_this_initialized(_this), "context", void 0);
44949
44949
  /**
44950
44950
  * Tracks the current mode of the visitor to handle special cases.
44951
- */ _define_property(_assert_this_initialized(_this), "mode", Mode.normal);
44952
- _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);
44953
44953
  _this.context = context || {};
44954
- _this.functions = _object_spread({}, defaultFunctions, functions || {});
44954
+ _this.functions = _object_spread$1({}, defaultFunctions, functions || {});
44955
44955
  _this.validateVisitor();
44956
44956
  return _this;
44957
44957
  }
@@ -45692,6 +45692,198 @@ function evaluate(expression, context, functions) {
45692
45692
  }
45693
45693
  return toAstVisitorInstance.visit(result.cst);
45694
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
+ }
45695
45887
  const Handlebars = handlebars_min || HandlebarsNamespace;
45696
45888
  Handlebars.registerHelper('JSONstringify', function(value) {
45697
45889
  return JSON.stringify(value);
@@ -45706,7 +45898,10 @@ const DIGIPAIR_FUNCTIONS = {
45706
45898
  encodeUTF8: (value)=>Array.from(new TextEncoder().encode(value)).map((b)=>String.fromCharCode(b)).join(''),
45707
45899
  decodeUTF8: (value)=>new TextDecoder().decode(new Uint8Array(Array.from(value).map((c)=>c.charCodeAt(0)))),
45708
45900
  JSONparse: (value)=>JSON.parse(value),
45709
- JSONstringify: (value)=>JSON.stringify(value)
45901
+ JSONstringify: (value)=>JSON.stringify(value),
45902
+ camelCase: (value)=>camelCase(value),
45903
+ kebabCase: (value)=>kebabCase(value),
45904
+ snakeCase: (value)=>snakeCase(value)
45710
45905
  };
45711
45906
  const globalInstance = typeof window === 'undefined' ? global : window;
45712
45907
  const _config = globalInstance.__DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__ ?? {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-sse",
3
- "version": "0.117.6",
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",