unpoly-rails 3.8.0.1 → 3.9.1

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.
@@ -5,7 +5,7 @@
5
5
  /***/ (() => {
6
6
 
7
7
  window.up = {
8
- version: '3.8.0'
8
+ version: '3.9.1'
9
9
  };
10
10
 
11
11
 
@@ -51,11 +51,8 @@ up.util = (function () {
51
51
  }
52
52
  };
53
53
  }
54
- const NORMALIZE_URL_DEFAULTS = {
55
- host: 'cross-domain',
56
- };
57
54
  function normalizeURL(url, options) {
58
- options = newOptions(options, NORMALIZE_URL_DEFAULTS);
55
+ options = newOptions(options, { host: 'cross-domain' });
59
56
  const parts = parseURL(url);
60
57
  let normalized = '';
61
58
  if (options.host === 'cross-domain') {
@@ -77,8 +74,22 @@ up.util = (function () {
77
74
  }
78
75
  return normalized;
79
76
  }
80
- function matchURLs(leftURL, rightURL) {
81
- return normalizeURL(leftURL) === normalizeURL(rightURL);
77
+ function matchURLs(leftURL, rightURL, options) {
78
+ return matchableURL(leftURL, options) === matchableURL(rightURL, options);
79
+ }
80
+ function matchableURL(url, options) {
81
+ if (!url)
82
+ return;
83
+ return normalizeURL(url, Object.assign({ hash: false, trailingSlash: false }, options));
84
+ }
85
+ function matchableURLPatternAtom(patternAtom) {
86
+ if (patternAtom.endsWith('/'))
87
+ return [patternAtom, patternAtom.slice(0, -1)];
88
+ if (patternAtom.includes('/?'))
89
+ return [patternAtom, patternAtom.replace('/?', '?')];
90
+ if (patternAtom.endsWith('/*'))
91
+ return [patternAtom, patternAtom.slice(0, -2), patternAtom.slice(0, -2) + '?*'];
92
+ return patternAtom;
82
93
  }
83
94
  const APP_PROTOCOL = location.protocol;
84
95
  const APP_HOSTNAME = location.hostname;
@@ -730,6 +741,8 @@ up.util = (function () {
730
741
  return {
731
742
  parseURL,
732
743
  normalizeURL,
744
+ matchableURL,
745
+ matchableURLPatternAtom,
733
746
  matchURLs,
734
747
  normalizeMethod,
735
748
  methodAllowsPayload,
@@ -1829,7 +1842,7 @@ up.BodyShifter = class BodyShifter {
1829
1842
  if (!this._isShifted())
1830
1843
  return;
1831
1844
  let originalValue = e.style(element, styleProp);
1832
- this._cleaners.push(e.setTemporaryStyle(e.root, { ['--up-original-' + styleProp]: originalValue }), e.addTemporaryClass(element, SHIFT_CLASS));
1845
+ this._cleaners.push(e.setTemporaryStyle(element, { ['--up-original-' + styleProp]: originalValue }), e.addTemporaryClass(element, SHIFT_CLASS));
1833
1846
  }
1834
1847
  _unshiftNow() {
1835
1848
  let cleaner;
@@ -1922,7 +1935,7 @@ up.Change.Addition = class Addition extends up.Change {
1922
1935
  source = (oldElement && up.fragment.source(oldElement));
1923
1936
  }
1924
1937
  if (source) {
1925
- e.setMissingAttr(newElement, 'up-source', u.normalizeURL(source, { hash: false }));
1938
+ e.setMissingAttr(newElement, 'up-source', up.fragment.normalizeSource(source));
1926
1939
  }
1927
1940
  }
1928
1941
  setTime({ newElement, time }) {
@@ -1962,7 +1975,7 @@ var _a;
1962
1975
  const u = up.util;
1963
1976
  up.RenderJob = (_a = class RenderJob {
1964
1977
  constructor(options) {
1965
- this.options = up.RenderOptions.preprocess(options);
1978
+ this.options = options;
1966
1979
  }
1967
1980
  execute() {
1968
1981
  this._rendered = this._executePromise();
@@ -1972,6 +1985,7 @@ up.RenderJob = (_a = class RenderJob {
1972
1985
  return __awaiter(this, void 0, void 0, function* () {
1973
1986
  try {
1974
1987
  this._guardRender();
1988
+ this.options = up.RenderOptions.preprocess(this.options);
1975
1989
  let result = yield this._getChange().execute();
1976
1990
  this._handleResult(result);
1977
1991
  return result;
@@ -2429,9 +2443,6 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
2429
2443
  step.scroll = false;
2430
2444
  step.focus = false;
2431
2445
  }
2432
- if ((step.placement === 'swap') || (step.placement === 'content')) {
2433
- step.scrollBehavior = 'instant';
2434
- }
2435
2446
  });
2436
2447
  }
2437
2448
  _hasHistory() {
@@ -2740,11 +2751,6 @@ up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
2740
2751
  var _a;
2741
2752
  const u = up.util;
2742
2753
  up.Change.FromURL = (_a = class FromURL extends up.Change {
2743
- constructor(options) {
2744
- super(options);
2745
- this.options.layer = up.layer.getAll(this.options);
2746
- this.options.normalizeLayerOptions = false;
2747
- }
2748
2754
  execute() {
2749
2755
  var _b, _c;
2750
2756
  let _newPageReason = this._newPageReason();
@@ -2958,12 +2964,13 @@ const u = up.util;
2958
2964
  up.Change.FromContent = (_a = class FromContent extends up.Change {
2959
2965
  constructor(options) {
2960
2966
  super(options);
2961
- this._origin = this.options.origin;
2962
- this._preview = this.options.preview;
2967
+ this._origin = options.origin;
2968
+ this._preview = options.preview;
2969
+ this._layers = options.layers;
2963
2970
  }
2964
2971
  _getPlans() {
2965
2972
  let plans = [];
2966
- this._lookupLayers();
2973
+ this._filterLayers();
2967
2974
  this._improveOptionsFromResponseDoc();
2968
2975
  this._expandIntoPlans(plans, this._layers, this.options.target);
2969
2976
  this._expandIntoPlans(plans, this._layers, this.options.fallback);
@@ -2972,9 +2979,8 @@ up.Change.FromContent = (_a = class FromContent extends up.Change {
2972
2979
  _isRenderableLayer(layer) {
2973
2980
  return (layer === 'new') || layer.isOpen();
2974
2981
  }
2975
- _lookupLayers() {
2976
- this._allLayers = up.layer.getAll(this.options);
2977
- this._layers = u.filter(this._allLayers, this._isRenderableLayer);
2982
+ _filterLayers() {
2983
+ this._layers = u.filter(this._layers, this._isRenderableLayer);
2978
2984
  }
2979
2985
  _expandIntoPlans(plans, layers, targets) {
2980
2986
  for (let layer of layers) {
@@ -4304,12 +4310,6 @@ up.FragmentPolling = class FragmentPolling {
4304
4310
  up.puts('[up-poll]', 'Will not poll hidden fragment');
4305
4311
  return;
4306
4312
  }
4307
- if (up.emit(this._fragment, 'up:fragment:poll', { log: ['Polling fragment', this._fragment] }).defaultPrevented) {
4308
- up.puts('[up-poll]', 'User prevented up:fragment:poll event');
4309
- this._satisfyInterval();
4310
- this._scheduleRemainingTime();
4311
- return;
4312
- }
4313
4313
  this._reloadNow();
4314
4314
  }
4315
4315
  _getFullDelay() {
@@ -4329,21 +4329,20 @@ up.FragmentPolling = class FragmentPolling {
4329
4329
  }
4330
4330
  _reloadNow() {
4331
4331
  this._clearReloadTimer();
4332
- let reloadOptions = {
4333
- url: this._options.url,
4334
- fail: false,
4335
- background: true,
4336
- };
4337
4332
  let oldAbortable = this._abortable;
4338
4333
  try {
4339
4334
  this._abortable = false;
4340
4335
  this._loading = true;
4341
- up.reload(this._fragment, reloadOptions).then(this._onReloadSuccess.bind(this), this._onReloadFailure.bind(this));
4336
+ up.reload(this._fragment, this._reloadOptions()).then(this._onReloadSuccess.bind(this), this._onReloadFailure.bind(this));
4342
4337
  }
4343
4338
  finally {
4344
4339
  this._abortable = oldAbortable;
4345
4340
  }
4346
4341
  }
4342
+ _reloadOptions() {
4343
+ let guardEvent = up.event.build('up:fragment:poll', { log: ['Polling fragment', this._fragment] });
4344
+ return Object.assign(Object.assign({}, this._options), { guardEvent });
4345
+ }
4347
4346
  _onFragmentAborted({ newLayer }) {
4348
4347
  if (this._abortable && !newLayer) {
4349
4348
  this._stop();
@@ -4561,8 +4560,8 @@ up.Layer = class Layer extends up.Record {
4561
4560
  _containsEventTarget(event) {
4562
4561
  return this.contains(event.target);
4563
4562
  }
4564
- wasHitByMouseEvent(event) {
4565
- const hittableElement = document.elementFromPoint(event.clientX, event.clientY);
4563
+ wasHitByMouseEvent({ clientX, clientY }) {
4564
+ const hittableElement = document.elementFromPoint(clientX, clientY);
4566
4565
  return !hittableElement || this.contains(hittableElement);
4567
4566
  }
4568
4567
  _buildEventEmitter(args) {
@@ -4673,7 +4672,7 @@ up.Layer = class Layer extends up.Record {
4673
4672
  }
4674
4673
  set location(location) {
4675
4674
  const previousLocation = this.location;
4676
- location = up.history.normalizeURL(location);
4675
+ location = u.normalizeURL(location);
4677
4676
  if (previousLocation !== location || this.opening) {
4678
4677
  this.savedLocation = location;
4679
4678
  if (this.showsLiveHistory()) {
@@ -4881,7 +4880,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4881
4880
  up.log.putsEvent(event);
4882
4881
  if (halt)
4883
4882
  up.event.halt(event);
4884
- this.dismiss(':outside', { origin: event.target });
4883
+ up.error.muteUncriticalSync(() => this.dismiss(':outside', { origin: event.target }));
4885
4884
  }
4886
4885
  onEscapePressed(event) {
4887
4886
  if (this.isFront()) {
@@ -4891,7 +4890,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4891
4890
  }
4892
4891
  else if (this._supportsDismissMethod('key')) {
4893
4892
  up.event.halt(event, { log: true });
4894
- this.dismiss(':key');
4893
+ up.error.muteUncriticalSync(() => this.dismiss(':key'));
4895
4894
  }
4896
4895
  }
4897
4896
  }
@@ -4916,7 +4915,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4916
4915
  }
4917
4916
  return this.on(eventTypes, event => {
4918
4917
  event.preventDefault();
4919
- closeFn.call(this, event, { response: event.response });
4918
+ up.error.muteUncriticalSync(() => closeFn.call(this, event, { response: event.response }));
4920
4919
  });
4921
4920
  }
4922
4921
  tryAcceptForLocation(options) {
@@ -4929,7 +4928,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4929
4928
  let location, resolution;
4930
4929
  if (urlPattern && (location = this.location) && (resolution = urlPattern.recognize(location))) {
4931
4930
  const closeValue = Object.assign(Object.assign({}, resolution), { location });
4932
- closeFn.call(this, closeValue, options);
4931
+ up.error.muteUncriticalSync(() => closeFn.call(this, closeValue, options));
4933
4932
  }
4934
4933
  }
4935
4934
  teardownHandlers() {
@@ -5164,92 +5163,110 @@ up.Layer.Cover = (_a = class Cover extends up.Layer.OverlayWithViewport {
5164
5163
  /* 58 */
5165
5164
  /***/ (() => {
5166
5165
 
5166
+ var _a;
5167
5167
  const u = up.util;
5168
5168
  const e = up.element;
5169
- up.LayerLookup = class LayerLookup {
5170
- constructor(stack, ...args) {
5171
- this._stack = stack;
5172
- const options = u.parseArgIntoOptions(args, 'layer');
5173
- if (options.normalizeLayerOptions !== false) {
5174
- up.layer.normalizeOptions(options);
5175
- }
5176
- this._values = u.parseTokens(options.layer);
5177
- this._origin = options.origin;
5178
- this._baseLayer = options.baseLayer || this._originLayer() || this._stack.current;
5179
- if (u.isString(this._baseLayer)) {
5180
- const recursiveOptions = Object.assign(Object.assign({}, options), { baseLayer: this._stack.current, normalizeLayerOptions: false });
5181
- this._baseLayer = new this.constructor(this._stack, this._baseLayer, recursiveOptions).first();
5169
+ up.LayerLookup = (_a = class LayerLookup {
5170
+ constructor(stack, options) {
5171
+ this._stack = stack;
5172
+ if (options.normalizeLayerOptions !== false) {
5173
+ up.layer.normalizeOptions(options);
5174
+ }
5175
+ this._options = options;
5176
+ this._values = u.parseTokens(options.layer);
5182
5177
  }
5183
- }
5184
- _originLayer() {
5185
- if (this._origin) {
5186
- return this._forElement(this._origin);
5178
+ all() {
5179
+ let results = u.flatMap(this._values, value => this._resolveValue(value));
5180
+ results = u.compact(results);
5181
+ results = u.uniq(results);
5182
+ return results;
5187
5183
  }
5188
- }
5189
- first() {
5190
- return this.all()[0];
5191
- }
5192
- all() {
5193
- let results = u.flatMap(this._values, value => this._resolveValue(value));
5194
- results = u.compact(results);
5195
- results = u.uniq(results);
5196
- return results;
5197
- }
5198
- _forElement(element) {
5199
- element = e.get(element);
5200
- return u.find(this._stack.reversed(), layer => layer.contains(element));
5201
- }
5202
- _forIndex(value) {
5203
- return this._stack.at(value);
5204
- }
5205
- _resolveValue(value) {
5206
- if (value instanceof up.Layer) {
5207
- return value;
5184
+ static all(stack, ...args) {
5185
+ const options = u.parseArgIntoOptions(args, 'layer');
5186
+ const { layer } = options;
5187
+ if (layer instanceof up.Layer) {
5188
+ return [layer];
5189
+ }
5190
+ return new this(stack, options).all();
5208
5191
  }
5209
- if (u.isNumber(value)) {
5210
- return this._forIndex(value);
5192
+ _forElement(element) {
5193
+ element = e.get(element);
5194
+ return u.find(this._stack.reversed(), layer => layer.contains(element));
5211
5195
  }
5212
- if (/^\d+$/.test(value)) {
5213
- return this._forIndex(Number(value));
5196
+ _forIndex(value) {
5197
+ return this._stack.at(value);
5214
5198
  }
5215
- if (u.isElementish(value)) {
5216
- return this._forElement(value);
5199
+ _resolveValue(value) {
5200
+ if (value instanceof up.Layer) {
5201
+ return value;
5202
+ }
5203
+ if (u.isNumber(value)) {
5204
+ return this._forIndex(value);
5205
+ }
5206
+ if (/^\d+$/.test(value)) {
5207
+ return this._forIndex(Number(value));
5208
+ }
5209
+ if (u.isElementish(value)) {
5210
+ return this._forElement(value);
5211
+ }
5212
+ switch (value) {
5213
+ case 'any':
5214
+ return [this._getBaseLayer(), ...this._stack.reversed()];
5215
+ case 'current':
5216
+ return this._getBaseLayer();
5217
+ case 'closest':
5218
+ return this._stack.selfAndAncestorsOf(this._getBaseLayer());
5219
+ case 'parent':
5220
+ return this._getBaseLayer().parent;
5221
+ case 'ancestor':
5222
+ case 'ancestors':
5223
+ return this._getBaseLayer().ancestors;
5224
+ case 'child':
5225
+ return this._getBaseLayer().child;
5226
+ case 'descendant':
5227
+ case 'descendants':
5228
+ return this._getBaseLayer().descendants;
5229
+ case 'subtree':
5230
+ return this._getBaseLayer().subtree;
5231
+ case 'new':
5232
+ return 'new';
5233
+ case 'root':
5234
+ return this._stack.root;
5235
+ case 'overlay':
5236
+ case 'overlays':
5237
+ return u.reverse(this._stack.overlays);
5238
+ case 'front':
5239
+ return this._stack.front;
5240
+ case 'origin':
5241
+ return this._getOriginLayer();
5242
+ default:
5243
+ return up.fail("Unknown { layer } option: %o", value);
5244
+ }
5245
+ }
5246
+ _getOriginLayer() {
5247
+ let { origin } = this._options;
5248
+ if (origin) {
5249
+ return this._forElement(origin);
5250
+ }
5217
5251
  }
5218
- switch (value) {
5219
- case 'any':
5220
- return [this._baseLayer, ...this._stack.reversed()];
5221
- case 'current':
5222
- return this._baseLayer;
5223
- case 'closest':
5224
- return this._stack.selfAndAncestorsOf(this._baseLayer);
5225
- case 'parent':
5226
- return this._baseLayer.parent;
5227
- case 'ancestor':
5228
- case 'ancestors':
5229
- return this._baseLayer.ancestors;
5230
- case 'child':
5231
- return this._baseLayer.child;
5232
- case 'descendant':
5233
- case 'descendants':
5234
- return this._baseLayer.descendants;
5235
- case 'subtree':
5236
- return this._baseLayer.subtree;
5237
- case 'new':
5238
- return 'new';
5239
- case 'root':
5240
- return this._stack.root;
5241
- case 'overlay':
5242
- case 'overlays':
5243
- return u.reverse(this._stack.overlays);
5244
- case 'front':
5245
- return this._stack.front;
5246
- case 'origin':
5247
- return this._originLayer();
5248
- default:
5249
- return up.fail("Unknown { layer } option: %o", value);
5252
+ _getBaseLayer() {
5253
+ let { baseLayer } = this._options;
5254
+ if (u.isString(baseLayer)) {
5255
+ const recursiveOptions = Object.assign(Object.assign({}, this._options), { baseLayer: this._stack.current, normalizeLayerOptions: false, layer: baseLayer });
5256
+ return this.constructor.all(this._stack, recursiveOptions)[0];
5257
+ }
5258
+ else {
5259
+ return baseLayer || this._getOriginLayer() || this._stack.current;
5260
+ }
5250
5261
  }
5251
- }
5252
- };
5262
+ },
5263
+ (() => {
5264
+ u.memoizeMethod(_a.prototype, {
5265
+ _getBaseLayer: true,
5266
+ _getOriginLayer: true,
5267
+ });
5268
+ })(),
5269
+ _a);
5253
5270
 
5254
5271
 
5255
5272
  /***/ }),
@@ -5317,7 +5334,7 @@ up.LayerStack = class LayerStack {
5317
5334
  return this.getAll(...args)[0];
5318
5335
  }
5319
5336
  getAll(...args) {
5320
- return new up.LayerLookup(this, ...args).all();
5337
+ return up.LayerLookup.all(this, ...args);
5321
5338
  }
5322
5339
  sync() {
5323
5340
  for (let layer of this.layers) {
@@ -5370,22 +5387,22 @@ up.LayerStack = class LayerStack {
5370
5387
  /* 60 */
5371
5388
  /***/ (() => {
5372
5389
 
5390
+ const u = up.util;
5373
5391
  up.LinkFeedbackURLs = class LinkFeedbackURLs {
5374
5392
  constructor(link) {
5375
- const normalize = up.feedback.normalizeURL;
5376
5393
  this._isSafe = up.link.isSafe(link);
5377
5394
  if (this._isSafe) {
5378
5395
  const href = link.getAttribute('href');
5379
5396
  if (href && (href !== '#')) {
5380
- this.href = normalize(href);
5397
+ this._href = u.matchableURL(href);
5381
5398
  }
5382
5399
  const upHREF = link.getAttribute('up-href');
5383
5400
  if (upHREF) {
5384
- this._upHREF = normalize(upHREF);
5401
+ this._upHREF = u.matchableURL(upHREF);
5385
5402
  }
5386
5403
  const alias = link.getAttribute('up-alias');
5387
5404
  if (alias) {
5388
- this._aliasPattern = new up.URLPattern(alias, normalize);
5405
+ this._aliasPattern = new up.URLPattern(alias);
5389
5406
  }
5390
5407
  }
5391
5408
  }
@@ -5394,7 +5411,7 @@ up.LinkFeedbackURLs = class LinkFeedbackURLs {
5394
5411
  if (!normalizedLocation) {
5395
5412
  return false;
5396
5413
  }
5397
- return !!(this.href === normalizedLocation ||
5414
+ return !!(this._href === normalizedLocation ||
5398
5415
  this._upHREF === normalizedLocation ||
5399
5416
  ((_b = (_a = this._aliasPattern) === null || _a === void 0 ? void 0 : _a.test) === null || _b === void 0 ? void 0 : _b.call(_a, normalizedLocation, false)));
5400
5417
  }
@@ -6039,6 +6056,7 @@ up.RenderOptions = (function () {
6039
6056
  'source',
6040
6057
  'saveScroll',
6041
6058
  'navigate',
6059
+ 'baseLayer',
6042
6060
  ]);
6043
6061
  const CONTENT_KEYS = [
6044
6062
  'url',
@@ -6066,7 +6084,13 @@ up.RenderOptions = (function () {
6066
6084
  var _a, _b;
6067
6085
  (_b = (_a = up.migrate).preprocessRenderOptions) === null || _b === void 0 ? void 0 : _b.call(_a, options);
6068
6086
  const defaults = u.merge(GLOBAL_DEFAULTS, navigateDefaults(options));
6069
- return u.merge(u.omit(defaults, LATE_KEYS), { defaults }, { inputDevice: up.event.inputDevice }, options, preloadOverrides(options));
6087
+ return u.merge(u.omit(defaults, LATE_KEYS), { defaults }, { inputDevice: up.event.inputDevice }, options, lookupLayers(options), preloadOverrides(options));
6088
+ }
6089
+ function lookupLayers(options) {
6090
+ return {
6091
+ layers: up.layer.getAll(options),
6092
+ normalizeLayerOptions: false,
6093
+ };
6070
6094
  }
6071
6095
  function finalize(preprocessedOptions, lateDefaults) {
6072
6096
  return u.merge(preprocessedOptions.defaults, lateDefaults, preprocessedOptions);
@@ -6093,11 +6117,13 @@ up.RenderOptions = (function () {
6093
6117
  return overrides;
6094
6118
  }
6095
6119
  function deriveFailOptions(preprocessedOptions) {
6120
+ let overrides = failOverrides(preprocessedOptions);
6121
+ let layers = lookupLayers(overrides);
6096
6122
  if (preprocessedOptions.failOptions) {
6097
- return Object.assign(Object.assign(Object.assign(Object.assign({}, preprocessedOptions.defaults), u.pick(preprocessedOptions, SHARED_KEYS)), failOverrides(preprocessedOptions)), { failPrefixForced: true });
6123
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, preprocessedOptions.defaults), u.pick(preprocessedOptions, SHARED_KEYS)), overrides), layers), { failPrefixForced: true });
6098
6124
  }
6099
6125
  else {
6100
- return Object.assign(Object.assign({}, preprocessedOptions), failOverrides(preprocessedOptions));
6126
+ return Object.assign(Object.assign(Object.assign({}, preprocessedOptions), overrides), layers);
6101
6127
  }
6102
6128
  }
6103
6129
  return {
@@ -7163,16 +7189,16 @@ const e = up.element;
7163
7189
  const u = up.util;
7164
7190
  up.RevealMotion = class RevealMotion {
7165
7191
  constructor(element, options = {}) {
7166
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
7192
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
7167
7193
  this._element = element;
7168
7194
  this._viewport = e.get(options.viewport) || up.viewport.get(this._element);
7169
7195
  this._obstructionsLayer = up.layer.get(this._viewport);
7170
- this._behavior = (_a = options.behavior) !== null && _a !== void 0 ? _a : 'instant';
7196
+ this._behavior = (_b = (_a = options.scrollBehavior) !== null && _a !== void 0 ? _a : options.behavior) !== null && _b !== void 0 ? _b : 'instant';
7171
7197
  const viewportConfig = up.viewport.config;
7172
- this._snap = (_c = (_b = options.snap) !== null && _b !== void 0 ? _b : options.revealSnap) !== null && _c !== void 0 ? _c : viewportConfig.revealSnap;
7173
- this._padding = (_e = (_d = options.padding) !== null && _d !== void 0 ? _d : options.revealPadding) !== null && _e !== void 0 ? _e : viewportConfig.revealPadding;
7174
- this._top = (_g = (_f = options.top) !== null && _f !== void 0 ? _f : options.revealTop) !== null && _g !== void 0 ? _g : viewportConfig.revealTop;
7175
- this._max = (_j = (_h = options.max) !== null && _h !== void 0 ? _h : options.revealMax) !== null && _j !== void 0 ? _j : viewportConfig.revealMax;
7198
+ this._snap = (_d = (_c = options.snap) !== null && _c !== void 0 ? _c : options.revealSnap) !== null && _d !== void 0 ? _d : viewportConfig.revealSnap;
7199
+ this._padding = (_f = (_e = options.padding) !== null && _e !== void 0 ? _e : options.revealPadding) !== null && _f !== void 0 ? _f : viewportConfig.revealPadding;
7200
+ this._top = (_h = (_g = options.top) !== null && _g !== void 0 ? _g : options.revealTop) !== null && _h !== void 0 ? _h : viewportConfig.revealTop;
7201
+ this._max = (_k = (_j = options.max) !== null && _j !== void 0 ? _j : options.revealMax) !== null && _k !== void 0 ? _k : viewportConfig.revealMax;
7176
7202
  this._topObstructionSelector = viewportConfig.selector('fixedTopSelectors');
7177
7203
  this._bottomObstructionSelector = viewportConfig.selector('fixedBottomSelectors');
7178
7204
  }
@@ -7441,8 +7467,7 @@ up.Tether = class Tether {
7441
7467
 
7442
7468
  const u = up.util;
7443
7469
  up.URLPattern = class URLPattern {
7444
- constructor(fullPattern, normalizeURL = u.normalizeURL) {
7445
- this._normalizeURL = normalizeURL;
7470
+ constructor(fullPattern) {
7446
7471
  this._groups = [];
7447
7472
  const positiveList = [];
7448
7473
  const negativeList = [];
@@ -7461,14 +7486,8 @@ up.URLPattern = class URLPattern {
7461
7486
  if (!list.length) {
7462
7487
  return;
7463
7488
  }
7464
- list = list.map((url) => {
7465
- if (url[0] === '*') {
7466
- url = '/' + url;
7467
- }
7468
- url = this._normalizeURL(url);
7469
- url = u.escapeRegExp(url);
7470
- return url;
7471
- });
7489
+ list = u.flatMap(list, u.matchableURLPatternAtom);
7490
+ list = list.map(u.escapeRegExp);
7472
7491
  let reCode = list.join('|');
7473
7492
  reCode = reCode.replace(/\\\*/g, '.*?');
7474
7493
  reCode = reCode.replace(/(:|\\\$)([a-z][\w-]*)/ig, (match, type, name) => {
@@ -7489,13 +7508,13 @@ up.URLPattern = class URLPattern {
7489
7508
  }
7490
7509
  test(url, doNormalize = true) {
7491
7510
  if (doNormalize) {
7492
- url = this._normalizeURL(url);
7511
+ url = u.matchableURL(url);
7493
7512
  }
7494
7513
  return this._positiveRegexp.test(url) && !this._isExcluded(url);
7495
7514
  }
7496
7515
  recognize(url, doNormalize = true) {
7497
7516
  if (doNormalize) {
7498
- url = this._normalizeURL(url);
7517
+ url = u.matchableURL(url);
7499
7518
  }
7500
7519
  let match = this._positiveRegexp.exec(url);
7501
7520
  if (match && !this._isExcluded(url)) {
@@ -7631,9 +7650,8 @@ up.event = (function () {
7631
7650
  }
7632
7651
  function build(...args) {
7633
7652
  const props = u.extractOptions(args);
7634
- const type = args[0] || props.type || up.fail('Expected event type to be passed as string argument or { type } property');
7635
- const event = document.createEvent('Event');
7636
- event.initEvent(type, true, true);
7653
+ const type = args[0] || props.type || up.fail('Missing event type');
7654
+ const event = new Event(type, { bubbles: true, cancelable: true });
7637
7655
  Object.assign(event, u.omit(props, ['type', 'target']));
7638
7656
  return event;
7639
7657
  }
@@ -7658,8 +7676,11 @@ up.event = (function () {
7658
7676
  return (u.isUndefined(event.button) || (event.button === 0)) &&
7659
7677
  !u.some(keyModifiers, modifier => event[modifier]);
7660
7678
  }
7679
+ function isSyntheticClick(event) {
7680
+ return u.isMissing(event.clientX);
7681
+ }
7661
7682
  function fork(originalEvent, newType, copyKeys = []) {
7662
- const newEvent = up.event.build(newType, u.pick(originalEvent, copyKeys));
7683
+ const newEvent = build(newType, u.pick(originalEvent, copyKeys));
7663
7684
  newEvent.originalEvent = originalEvent;
7664
7685
  ['stopPropagation', 'stopImmediatePropagation', 'preventDefault'].forEach(function (key) {
7665
7686
  const originalMethod = newEvent[key];
@@ -7683,7 +7704,7 @@ up.event = (function () {
7683
7704
  Object.assign(forkedEvent, eventProps);
7684
7705
  up.emit(element, forkedEvent);
7685
7706
  }
7686
- on('up:click', 'a[up-emit]', executeEmitAttr);
7707
+ on('up:click', '[up-emit]', executeEmitAttr);
7687
7708
  let inputDevices = ['unknown'];
7688
7709
  function getInputDevice() {
7689
7710
  return u.last(inputDevices);
@@ -7704,6 +7725,7 @@ up.event = (function () {
7704
7725
  onEscape,
7705
7726
  halt,
7706
7727
  isUnmodified,
7728
+ isSyntheticClick,
7707
7729
  fork,
7708
7730
  keyModifiers,
7709
7731
  get inputDevice() { return getInputDevice(); }
@@ -7954,7 +7976,7 @@ up.script = (function () {
7954
7976
  }));
7955
7977
  const SYSTEM_MACRO_PRIORITIES = {
7956
7978
  '[up-back]': -100,
7957
- '[up-content]': -200,
7979
+ '[up-clickable]': -200,
7958
7980
  '[up-drawer]': -200,
7959
7981
  '[up-modal]': -200,
7960
7982
  '[up-cover]': -200,
@@ -8167,13 +8189,8 @@ up.history = (function () {
8167
8189
  nextPreviousLocation = undefined;
8168
8190
  trackCurrentLocation();
8169
8191
  }
8170
- const DEFAULT_NORMALIZE_OPTIONS = { hash: true };
8171
- function normalizeURL(url, options) {
8172
- options = u.merge(DEFAULT_NORMALIZE_OPTIONS, options);
8173
- return u.normalizeURL(url, options);
8174
- }
8175
- function currentLocation(normalizeOptions) {
8176
- return normalizeURL(location.href, normalizeOptions);
8192
+ function currentLocation() {
8193
+ return u.normalizeURL(location.href);
8177
8194
  }
8178
8195
  function trackCurrentLocation() {
8179
8196
  const url = currentLocation();
@@ -8183,19 +8200,17 @@ up.history = (function () {
8183
8200
  }
8184
8201
  }
8185
8202
  trackCurrentLocation();
8186
- const ADDITIONAL_NORMALIZE_OPTIONS_FOR_COMPARISON = { trailingSlash: false };
8187
8203
  function isLocation(url, options) {
8188
- options = u.merge(ADDITIONAL_NORMALIZE_OPTIONS_FOR_COMPARISON, options);
8189
- return normalizeURL(url, options) === currentLocation(options);
8204
+ return u.matchURLs(url, location.href, Object.assign({ hash: true }, options));
8190
8205
  }
8191
8206
  function replace(location, options = {}) {
8192
- location = normalizeURL(location);
8207
+ location = u.normalizeURL(location);
8193
8208
  if (manipulate('replaceState', location) && (options.event !== false)) {
8194
8209
  emitLocationChanged({ location, reason: 'replace', log: `Replaced state for ${location}` });
8195
8210
  }
8196
8211
  }
8197
8212
  function push(location) {
8198
- location = normalizeURL(location);
8213
+ location = u.normalizeURL(location);
8199
8214
  if (!isLocation(location) && manipulate('pushState', location)) {
8200
8215
  emitLocationChanged({ location, reason: 'push', log: `Advanced to location ${location}` });
8201
8216
  }
@@ -8223,7 +8238,7 @@ up.history = (function () {
8223
8238
  return;
8224
8239
  }
8225
8240
  let location = currentLocation();
8226
- up.render({
8241
+ up.error.muteUncriticalRejection(up.render({
8227
8242
  guardEvent: up.event.build('up:location:restore', { location, log: `Restoring location ${location}` }),
8228
8243
  url: location,
8229
8244
  target: config.restoreTargets,
@@ -8238,7 +8253,7 @@ up.history = (function () {
8238
8253
  scroll: ['restore', 'auto'],
8239
8254
  saveFocus: false,
8240
8255
  focus: ['restore', 'auto'],
8241
- });
8256
+ }));
8242
8257
  }
8243
8258
  function onPop(event) {
8244
8259
  trackCurrentLocation();
@@ -8283,7 +8298,7 @@ up.history = (function () {
8283
8298
  function updateLang(newLang) {
8284
8299
  e.toggleAttr(e.root, 'lang', newLang, !!newLang);
8285
8300
  }
8286
- up.macro('a[up-back], [up-href][up-back]', function (link) {
8301
+ up.macro('[up-back]', function (link) {
8287
8302
  if (previousLocation) {
8288
8303
  e.setMissingAttrs(link, {
8289
8304
  'up-href': previousLocation,
@@ -8300,7 +8315,6 @@ up.history = (function () {
8300
8315
  replace,
8301
8316
  get location() { return currentLocation(); },
8302
8317
  get previousLocation() { return previousLocation; },
8303
- normalizeURL,
8304
8318
  isLocation,
8305
8319
  findMetaTags,
8306
8320
  updateMetaTags,
@@ -8375,6 +8389,9 @@ up.fragment = (function () {
8375
8389
  element = getSmart(element, options);
8376
8390
  return e.closestAttr(element, 'up-source');
8377
8391
  }
8392
+ function normalizeSource(source) {
8393
+ return u.normalizeURL(source, { hash: false });
8394
+ }
8378
8395
  function timeOf(element) {
8379
8396
  let value = e.closestAttr(element, 'up-time');
8380
8397
  if (value && value !== 'false') {
@@ -8809,7 +8826,7 @@ up.fragment = (function () {
8809
8826
  }
8810
8827
  up.on('up:framework:boot', function () {
8811
8828
  const { documentElement } = document;
8812
- documentElement.setAttribute('up-source', u.normalizeURL(location.href, { hash: false }));
8829
+ documentElement.setAttribute('up-source', normalizeSource(location.href));
8813
8830
  up.hello(documentElement);
8814
8831
  if (!up.browser.canPushState()) {
8815
8832
  return up.warn('Cannot push history changes. Next fragment update will load in a new page.');
@@ -8828,6 +8845,7 @@ up.fragment = (function () {
8828
8845
  contains,
8829
8846
  closest,
8830
8847
  source: sourceOf,
8848
+ normalizeSource,
8831
8849
  visit,
8832
8850
  markAsDestroying: markFragmentAsDestroying,
8833
8851
  emitInserted: emitFragmentInserted,
@@ -9042,7 +9060,7 @@ up.viewport = (function () {
9042
9060
  }
9043
9061
  }
9044
9062
  function newStateCache() {
9045
- return new up.FIFOCache({ capacity: 30, normalizeKey: up.history.normalizeURL });
9063
+ return new up.FIFOCache({ capacity: 30, normalizeKey: u.matchableURL });
9046
9064
  }
9047
9065
  function parseOptions(args) {
9048
9066
  const options = u.copy(u.extractOptions(args));
@@ -9721,8 +9739,10 @@ up.layer = (function () {
9721
9739
  return [config[mode], config.overlay, config.any];
9722
9740
  }
9723
9741
  }
9724
- function normalizeOptions(options) {
9742
+ function normalizeLayerOption(options) {
9725
9743
  var _a, _b;
9744
+ if (options.layer instanceof up.Layer)
9745
+ return;
9726
9746
  (_b = (_a = up.migrate).handleLayerOptions) === null || _b === void 0 ? void 0 : _b.call(_a, options);
9727
9747
  if (u.isGiven(options.layer)) {
9728
9748
  let match = String(options.layer).match(/^(new|shatter|swap)( (\w+))?/);
@@ -9741,25 +9761,30 @@ up.layer = (function () {
9741
9761
  }
9742
9762
  }
9743
9763
  }
9744
- else {
9745
- if (options.mode) {
9746
- options.layer = 'new';
9747
- }
9748
- else if (u.isElementish(options.target)) {
9749
- options.layer = stack.get(options.target, { normalizeLayerOptions: false });
9750
- }
9751
- else if (options.origin) {
9752
- options.layer = 'origin';
9753
- }
9754
- else {
9755
- options.layer = 'current';
9756
- }
9764
+ else if (options.mode) {
9765
+ options.layer = 'new';
9766
+ }
9767
+ else if (u.isElementish(options.target)) {
9768
+ options.layer = stack.get(options.target, { normalizeLayerOptions: false });
9757
9769
  }
9758
- if (!options.context) {
9759
- options.context = {};
9770
+ else if (options.origin) {
9771
+ options.layer = 'origin';
9760
9772
  }
9773
+ else {
9774
+ options.layer = 'current';
9775
+ }
9776
+ }
9777
+ function setBaseLayerOption(options) {
9778
+ if (options.baseLayer instanceof up.Layer)
9779
+ return;
9761
9780
  options.baseLayer = stack.get('current', Object.assign(Object.assign({}, options), { normalizeLayerOptions: false }));
9762
9781
  }
9782
+ function normalizeOptions(options) {
9783
+ var _a;
9784
+ normalizeLayerOption(options);
9785
+ (_a = options.context) !== null && _a !== void 0 ? _a : (options.context = {});
9786
+ setBaseLayerOption(options);
9787
+ }
9763
9788
  function build(options, beforeNew) {
9764
9789
  var _a;
9765
9790
  const { mode } = options;
@@ -9888,20 +9913,18 @@ up.link = (function () {
9888
9913
  const u = up.util;
9889
9914
  const e = up.element;
9890
9915
  let lastMousedownTarget = null;
9891
- const LINKS_WITH_LOCAL_HTML = ['a[up-content]', 'a[up-fragment]', 'a[up-document]'];
9892
- const LINKS_WITH_REMOTE_HTML = ['a[href]', '[up-href]'];
9893
- const ATTRIBUTES_SUGGESTING_FOLLOW = ['[up-follow]', '[up-target]', '[up-layer]', '[up-transition]', '[up-preload]', '[up-instant]', '[up-href]'];
9894
- function combineFollowableSelectors(elementSelectors, attributeSelectors) {
9895
- return u.flatMap(elementSelectors, elementSelector => attributeSelectors.map(attrSelector => elementSelector + attrSelector));
9896
- }
9916
+ const ATTRS_WITH_LOCAL_HTML = '[up-content], [up-fragment], [up-document]';
9917
+ const ATTRS_SUGGESTING_FOLLOW = `${ATTRS_WITH_LOCAL_HTML}, [up-target], [up-layer], [up-transition], [up-preload]`;
9918
+ const DEFAULT_INTERACTIVE_ELEMENT = 'a[href], button';
9897
9919
  const config = new up.Config(() => ({
9898
- followSelectors: combineFollowableSelectors(LINKS_WITH_REMOTE_HTML, ATTRIBUTES_SUGGESTING_FOLLOW).concat(LINKS_WITH_LOCAL_HTML),
9899
- noFollowSelectors: ['[up-follow=false]', 'a[download]', 'a[target]', 'a[href^="#"]:not([up-content]):not([up-fragment]):not([up-document])', 'a[href^="javascript:"]', 'a[href^="mailto:"]', e.crossOriginSelector('href'), e.crossOriginSelector('up-href')],
9920
+ followSelectors: ['[up-follow]', `a:is(${ATTRS_SUGGESTING_FOLLOW})`],
9921
+ noFollowSelectors: ['[up-follow=false]', 'a[download]', 'a[target]', 'a[href^="javascript:"]', 'a[href^="mailto:"]', `a[href^="#"]:not(${ATTRS_WITH_LOCAL_HTML})`, e.crossOriginSelector('href'), e.crossOriginSelector('up-href')],
9900
9922
  instantSelectors: ['[up-instant]'],
9901
9923
  noInstantSelectors: ['[up-instant=false]', '[onclick]'],
9902
- preloadSelectors: combineFollowableSelectors(LINKS_WITH_REMOTE_HTML, ['[up-preload]']),
9924
+ preloadSelectors: ['[up-preload]'],
9903
9925
  noPreloadSelectors: ['[up-preload=false]'],
9904
- clickableSelectors: LINKS_WITH_LOCAL_HTML.concat(['[up-emit]', '[up-accept]', '[up-dismiss]', '[up-clickable]']),
9926
+ clickableSelectors: ['[up-clickable]', '[up-follow]', '[up-emit]', '[up-accept]', '[up-dismiss]', `a:is(${ATTRS_SUGGESTING_FOLLOW})`],
9927
+ noClickableSelectors: ['[up-clickable=false]', DEFAULT_INTERACTIVE_ELEMENT],
9905
9928
  preloadDelay: 90,
9906
9929
  }));
9907
9930
  function isPreloadDisabled(link) {
@@ -10035,18 +10058,15 @@ up.link = (function () {
10035
10058
  link.setAttribute('up-follow', '');
10036
10059
  }
10037
10060
  }
10038
- function makeClickable(link) {
10039
- if (link.matches('a[href], button')) {
10040
- return;
10041
- }
10042
- let role = link.matches('a') ? 'link' : 'button';
10043
- e.setMissingAttrs(link, {
10061
+ function makeClickable(element) {
10062
+ let role = element.matches('a, [up-follow]') ? 'link' : 'button';
10063
+ e.setMissingAttrs(element, {
10044
10064
  tabindex: '0',
10045
10065
  role,
10046
10066
  'up-clickable': ''
10047
10067
  });
10048
- link.addEventListener('keydown', function (event) {
10049
- if ((event.key === 'Enter') || (event.key === 'Space')) {
10068
+ element.addEventListener('keydown', function (event) {
10069
+ if ((event.key === 'Enter') || (element.role === 'button' && event.key === 'Space')) {
10050
10070
  return forkEventAsUpClick(event);
10051
10071
  }
10052
10072
  });
@@ -10056,7 +10076,7 @@ up.link = (function () {
10056
10076
  if (event.defaultPrevented) {
10057
10077
  return false;
10058
10078
  }
10059
- const betterTargetSelector = `a, [up-href], ${up.form.fieldSelector()}`;
10079
+ const betterTargetSelector = `a, [up-follow], ${up.form.fieldSelector()}`;
10060
10080
  const betterTarget = event.target.closest(betterTargetSelector);
10061
10081
  return !betterTarget || (betterTarget === link);
10062
10082
  }
@@ -10075,7 +10095,7 @@ up.link = (function () {
10075
10095
  if (isInstant(element) && lastMousedownTarget) {
10076
10096
  up.event.halt(event);
10077
10097
  }
10078
- else if (layer.wasHitByMouseEvent(event) && !didUserDragAway(event)) {
10098
+ else if (up.event.inputDevice === 'key' || up.event.isSyntheticClick(event) || (layer.wasHitByMouseEvent(event) && !didUserDragAway(event))) {
10079
10099
  forkEventAsUpClick(event);
10080
10100
  }
10081
10101
  return lastMousedownTarget = null;
@@ -10161,6 +10181,7 @@ up.link = (function () {
10161
10181
  return {
10162
10182
  follow,
10163
10183
  followOptions,
10184
+ requestOptions: parseRequestOptions,
10164
10185
  preload,
10165
10186
  makeFollowable,
10166
10187
  isSafe,
@@ -10168,7 +10189,6 @@ up.link = (function () {
10168
10189
  shouldFollowEvent,
10169
10190
  convertClicks,
10170
10191
  config,
10171
- combineFollowableSelectors,
10172
10192
  loadDeferred,
10173
10193
  };
10174
10194
  })();
@@ -10189,11 +10209,10 @@ up.deferred = { load: up.link.loadDeferred };
10189
10209
  up.form = (function () {
10190
10210
  const u = up.util;
10191
10211
  const e = up.element;
10192
- const ATTRIBUTES_SUGGESTING_SUBMIT = ['[up-submit]', '[up-target]', '[up-layer]', '[up-transition]'];
10193
10212
  const config = new up.Config(() => ({
10194
10213
  groupSelectors: ['[up-form-group]', 'fieldset', 'label', 'form'],
10195
10214
  fieldSelectors: ['select', 'input:not([type=submit]):not([type=image])', 'button[type]:not([type=submit])', 'textarea'],
10196
- submitSelectors: up.link.combineFollowableSelectors(['form'], ATTRIBUTES_SUGGESTING_SUBMIT),
10215
+ submitSelectors: ['form:is([up-submit], [up-target], [up-layer], [up-transition])'],
10197
10216
  noSubmitSelectors: ['[up-submit=false]', '[target]', e.crossOriginSelector('action')],
10198
10217
  submitButtonSelectors: ['input[type=submit]', 'input[type=image]', 'button[type=submit]', 'button:not([type])'],
10199
10218
  watchInputEvents: ['input', 'change'],
@@ -10220,15 +10239,8 @@ up.form = (function () {
10220
10239
  function findSubmitButtons(root) {
10221
10240
  return e.subtree(root, submitButtonSelector());
10222
10241
  }
10223
- function submittingButton(form) {
10224
- const selector = submitButtonSelector();
10225
- const focusedElement = document.activeElement;
10226
- if (focusedElement && focusedElement.form === form) {
10227
- if (focusedElement.matches(selector)) {
10228
- return focusedElement;
10229
- }
10230
- }
10231
- return e.get(form, selector);
10242
+ function isSubmitButton(element) {
10243
+ return element === null || element === void 0 ? void 0 : element.matches(submitButtonSelector());
10232
10244
  }
10233
10245
  function submitButtonSelector() {
10234
10246
  return config.selector('submitButtonSelectors');
@@ -10330,15 +10342,15 @@ up.form = (function () {
10330
10342
  return u.sequence(containers.map(disableContainer));
10331
10343
  }
10332
10344
  function destinationOptions(form, options, parserOptions) {
10345
+ var _a;
10333
10346
  options = u.options(options);
10334
10347
  form = getForm(form);
10335
10348
  const parser = new up.OptionsParser(form, options, parserOptions);
10336
10349
  parser.string('contentType', { attr: 'enctype' });
10337
10350
  parser.json('headers');
10338
10351
  const params = up.Params.fromForm(form);
10339
- const submitButton = submittingButton(form);
10352
+ const submitButton = ((_a = options.submitButton) !== null && _a !== void 0 ? _a : (options.submitButton = findSubmitButtons(form)[0]));
10340
10353
  if (submitButton) {
10341
- options.submitButton = submitButton;
10342
10354
  params.addField(submitButton);
10343
10355
  options.method || (options.method = submitButton.getAttribute('formmethod'));
10344
10356
  options.url || (options.url = submitButton.getAttribute('formaction'));
@@ -10356,12 +10368,6 @@ up.form = (function () {
10356
10368
  }
10357
10369
  return options;
10358
10370
  }
10359
- up.on('up:click', submitButtonSelector, function (event, button) {
10360
- const form = getForm(button);
10361
- if (form && isSubmittable(form)) {
10362
- button.focus();
10363
- }
10364
- });
10365
10371
  function watch(root, ...args) {
10366
10372
  root = up.element.get(root);
10367
10373
  const callback = u.extractCallback(args) || watchCallbackFromElement(root) || up.fail('No callback given for up.watch()');
@@ -10514,8 +10520,9 @@ up.form = (function () {
10514
10520
  up.on('submit', config.selectorFn('submitSelectors'), function (event, form) {
10515
10521
  if (event.defaultPrevented)
10516
10522
  return;
10523
+ const submitButton = u.presence(event.submitter, isSubmitButton);
10517
10524
  up.event.halt(event, { log: true });
10518
- up.error.muteUncriticalRejection(submit(form));
10525
+ up.error.muteUncriticalRejection(submit(form, { submitButton }));
10519
10526
  });
10520
10527
  up.compiler(validatingFieldSelector, function (fieldOrForm) {
10521
10528
  let validator = up.FormValidator.forElement(fieldOrForm);
@@ -10586,17 +10593,12 @@ up.feedback = (function () {
10586
10593
  const CLASS_ACTIVE = 'up-active';
10587
10594
  const CLASS_LOADING = 'up-loading';
10588
10595
  const SELECTOR_LINK = 'a, [up-href]';
10589
- function normalizeURL(url) {
10590
- if (url) {
10591
- return u.normalizeURL(url, { trailingSlash: false, hash: false });
10592
- }
10593
- }
10594
10596
  function linkURLs(link) {
10595
10597
  return link.upFeedbackURLs || (link.upFeedbackURLs = new up.LinkFeedbackURLs(link));
10596
10598
  }
10597
10599
  function updateFragment(fragment, { layer } = {}) {
10598
10600
  layer || (layer = up.layer.get(fragment));
10599
- let layerLocation = getNormalizedLayerLocation(layer);
10601
+ let layerLocation = getMatchableLayerLocation(layer);
10600
10602
  const navSelector = config.selector('navSelectors');
10601
10603
  const navLinkSelector = `${navSelector} :is(${SELECTOR_LINK}), ${navSelector}:is(${SELECTOR_LINK})`;
10602
10604
  const links = up.fragment.all(navLinkSelector, { layer });
@@ -10608,8 +10610,8 @@ up.feedback = (function () {
10608
10610
  e.toggleAttr(link, 'aria-current', 'page', isCurrent);
10609
10611
  }
10610
10612
  }
10611
- function getNormalizedLayerLocation(layer) {
10612
- return layer.feedbackLocation || normalizeURL(layer.location);
10613
+ function getMatchableLayerLocation(layer) {
10614
+ return layer.feedbackLocation || u.matchableURL(layer.location);
10613
10615
  }
10614
10616
  function findActivatableArea(element) {
10615
10617
  return e.ancestor(element, SELECTOR_LINK) || element;
@@ -10635,7 +10637,7 @@ up.feedback = (function () {
10635
10637
  }
10636
10638
  function updateLayerIfLocationChanged(layer) {
10637
10639
  const processedLocation = layer.feedbackLocation;
10638
- const layerLocation = getNormalizedLayerLocation(layer.location);
10640
+ const layerLocation = getMatchableLayerLocation(layer.location);
10639
10641
  if (!processedLocation || (processedLocation !== layerLocation)) {
10640
10642
  layer.feedbackLocation = layerLocation;
10641
10643
  updateFragment(layer.element, { layer });
@@ -10660,7 +10662,6 @@ up.feedback = (function () {
10660
10662
  return {
10661
10663
  config,
10662
10664
  showAroundRequest,
10663
- normalizeURL,
10664
10665
  };
10665
10666
  })();
10666
10667
 
@@ -10714,9 +10715,11 @@ up.radio = (function () {
10714
10715
  up.FragmentPolling.forFragment(element).forceStop();
10715
10716
  }
10716
10717
  function pollOptions(fragment, options = {}) {
10717
- const parser = new up.OptionsParser(fragment, options);
10718
+ const defaults = { background: true };
10719
+ const parser = new up.OptionsParser(fragment, options, { defaults });
10718
10720
  parser.number('interval', { default: config.pollInterval });
10719
10721
  parser.string('ifLayer', { default: 'front' });
10722
+ parser.include(up.link.requestOptions);
10720
10723
  return options;
10721
10724
  }
10722
10725
  up.attribute('up-poll', function (fragment) {