unpoly-rails 0.53.4 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/dist/unpoly.js +52 -30
- data/dist/unpoly.min.js +4 -4
- data/lib/assets/javascripts/unpoly/dom.coffee +12 -6
- data/lib/assets/javascripts/unpoly/form.coffee +17 -6
- data/lib/assets/javascripts/unpoly/layout.coffee +4 -2
- data/lib/assets/javascripts/unpoly/link.coffee +7 -1
- data/lib/assets/javascripts/unpoly/protocol.coffee +1 -1
- data/lib/assets/javascripts/unpoly/util.coffee +0 -1
- data/lib/unpoly/rails/version.rb +1 -1
- data/package.json +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/spec/javascripts/helpers/show_lib_versions.coffee +0 -1
- data/spec_app/spec/javascripts/up/dom_spec.js.coffee +91 -3
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +114 -0
- data/spec_app/spec/javascripts/up/radio_spec.js.coffee +34 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09d999cdbc71d7d650deda5628c7edec8facd1a6fe09f69fbff912609467c4ac
|
4
|
+
data.tar.gz: 5be6bfaef8f6e50a8f30a9b0307bfbc9a25dd4193499f68353ae2ee88f3427ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a7fe8850e22b73c24d9e5070c4b8484b0942349649a8fe18abbe683ca3867e19ccb381fb779154adb46fcfecbcd8b160d3d7d01c2507f7874f8699c5295eb5
|
7
|
+
data.tar.gz: 0bff1f624aba76babe6f23c9a6da97cad15de0e360141b48a28331087d004f9d245f7cfb432a21dcfa5791c4a1f29b77194dede478a10e90d10d28b578fc90bb
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,55 @@ Changes to this project will be documented in this file.
|
|
5
5
|
|
6
6
|
This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
|
+
|
9
|
+
0.54.0
|
10
|
+
------
|
11
|
+
|
12
|
+
### Passive updates
|
13
|
+
|
14
|
+
- [`[up-hungry]`](/up-hungry) elements will now also be updated when the server responds with an error code. This helps when `[up-hungry]` is used to display error messages.
|
15
|
+
|
16
|
+
### Forms
|
17
|
+
|
18
|
+
- When a [form is submitted](/form-up-target) you can now consistently refer to that form element as `&` in CSS selectors ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
19
|
+
|
20
|
+
E.g. to reveal the first error message within a failed form submission:
|
21
|
+
|
22
|
+
```
|
23
|
+
<form id="my-form" up-target=".page" up-fail-reveal="& .error">
|
24
|
+
...
|
25
|
+
</form>
|
26
|
+
```
|
27
|
+
|
28
|
+
In this case `& .error` will be replaced by `#my-form .error` before submission.
|
29
|
+
|
30
|
+
This affects CSS selectors in the following HTML attributes:
|
31
|
+
|
32
|
+
- `form[up-target]`
|
33
|
+
- `form[up-fail-target]`
|
34
|
+
- `form[up-reveal]`
|
35
|
+
- `form[up-fail-reveal]`
|
36
|
+
|
37
|
+
|
38
|
+
### Linking to fragments
|
39
|
+
|
40
|
+
* When a [link is followed](/a-up-target) you can now consistently refer to that link element as `&` in CSS selectors ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
41
|
+
|
42
|
+
This affects CSS selectors in the following HTML attributes:
|
43
|
+
|
44
|
+
- `a[up-target]`
|
45
|
+
- `a[up-fail-target]`
|
46
|
+
- `a[up-reveal]`
|
47
|
+
- `a[up-fail-reveal]`
|
48
|
+
|
49
|
+
|
50
|
+
### Fragment update API
|
51
|
+
|
52
|
+
- New option for [`up.replace()`](/up.replace): `{ keep: false }` will disable preservation of [`[up-keep]`](/up-keep) elements.
|
53
|
+
- New option for [`up.replace()`](/up.replace): `{ hungry: false }` will disable updates of [`[up-hungry]`](/up-hungry) elements.
|
54
|
+
|
55
|
+
|
56
|
+
|
8
57
|
0.53.4
|
9
58
|
------
|
10
59
|
|
data/dist/unpoly.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
(function() {
|
7
7
|
window.up = {
|
8
|
-
version: "0.
|
8
|
+
version: "0.54.0",
|
9
9
|
renamedModule: function(oldName, newName) {
|
10
10
|
return typeof Object.defineProperty === "function" ? Object.defineProperty(up, oldName, {
|
11
11
|
get: function() {
|
@@ -2076,17 +2076,17 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
2076
2076
|
* Registers an empty rejection handler with the given promise.
|
2077
2077
|
* This prevents browsers from printing "Uncaught (in promise)" to the error
|
2078
2078
|
* console when the promise is rejection.
|
2079
|
-
|
2079
|
+
#
|
2080
2080
|
* This is helpful for event handlers where it is clear that no rejection
|
2081
2081
|
* handler will be registered:
|
2082
|
-
|
2082
|
+
#
|
2083
2083
|
* up.on('submit', 'form[up-target]', (event, $form) => {
|
2084
2084
|
* promise = up.submit($form)
|
2085
2085
|
* up.util.muteRejection(promise)
|
2086
2086
|
* })
|
2087
|
-
|
2087
|
+
#
|
2088
2088
|
* Does nothing if passed a missing value.
|
2089
|
-
|
2089
|
+
#
|
2090
2090
|
* @function up.util.muteRejection
|
2091
2091
|
* @param {Promise|undefined|null} promise
|
2092
2092
|
* @return {Promise}
|
@@ -2123,11 +2123,11 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
2123
2123
|
@internal
|
2124
2124
|
*/
|
2125
2125
|
rejectOnError = function(block) {
|
2126
|
-
var error
|
2126
|
+
var error;
|
2127
2127
|
try {
|
2128
2128
|
return block();
|
2129
|
-
} catch (
|
2130
|
-
error =
|
2129
|
+
} catch (_error) {
|
2130
|
+
error = _error;
|
2131
2131
|
return Promise.reject(error);
|
2132
2132
|
}
|
2133
2133
|
};
|
@@ -3850,10 +3850,9 @@ Internet Explorer 10 or lower
|
|
3850
3850
|
@internal
|
3851
3851
|
*/
|
3852
3852
|
sessionStorage = u.memoize(function() {
|
3853
|
-
var error;
|
3854
3853
|
try {
|
3855
3854
|
return window.sessionStorage;
|
3856
|
-
} catch (
|
3855
|
+
} catch (_error) {
|
3857
3856
|
return polyfilledSessionStorage();
|
3858
3857
|
}
|
3859
3858
|
});
|
@@ -4705,7 +4704,7 @@ an existing cookie should be deleted.
|
|
4705
4704
|
The name of the optional cookie the server can send to
|
4706
4705
|
[signal the initial request method](/up.protocol#signaling-the-initial-request-method).
|
4707
4706
|
@param {String} [config.methodParam='_method']
|
4708
|
-
The name of the POST parameter when [wrapping HTTP methods](/up.
|
4707
|
+
The name of the POST parameter when [wrapping HTTP methods](/up.proxy.config#config.wrapMethods)
|
4709
4708
|
in a `POST` request.
|
4710
4709
|
@param {String} [config.csrfHeader='X-CSRF-Token']
|
4711
4710
|
The name of the HTTP header that will include the
|
@@ -6462,7 +6461,7 @@ Unpoly will automatically be aware of sticky Bootstrap components such as
|
|
6462
6461
|
duration: options.duration
|
6463
6462
|
};
|
6464
6463
|
if (u.isString(options.reveal)) {
|
6465
|
-
selector = revealSelector(options.reveal);
|
6464
|
+
selector = revealSelector(options.reveal, options);
|
6466
6465
|
$element = up.first(selector) || $element;
|
6467
6466
|
revealOptions.top = true;
|
6468
6467
|
}
|
@@ -6477,7 +6476,7 @@ Unpoly will automatically be aware of sticky Bootstrap components such as
|
|
6477
6476
|
@internal
|
6478
6477
|
*/
|
6479
6478
|
revealSelector = function(selector, options) {
|
6480
|
-
selector = up.dom.resolveSelector(selector, options);
|
6479
|
+
selector = up.dom.resolveSelector(selector, options.origin);
|
6481
6480
|
if (selector[0] === '#') {
|
6482
6481
|
selector += ", a[name='" + selector + "']";
|
6483
6482
|
}
|
@@ -6718,14 +6717,17 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6718
6717
|
};
|
6719
6718
|
|
6720
6719
|
/**
|
6721
|
-
Resolves the given selector (which might contain `&` references)
|
6722
|
-
to
|
6720
|
+
Resolves the given CSS selector (which might contain `&` references)
|
6721
|
+
to a full CSS selector without ampersands.
|
6722
|
+
|
6723
|
+
If passed an `Element` or `jQuery` element, returns a CSS selector string
|
6724
|
+
for that element.
|
6723
6725
|
|
6724
6726
|
@function up.dom.resolveSelector
|
6725
6727
|
@param {string|Element|jQuery} selectorOrElement
|
6726
6728
|
@param {string|Element|jQuery} origin
|
6727
6729
|
The element that this selector resolution is relative to.
|
6728
|
-
That element's selector will be substituted for
|
6730
|
+
That element's selector will be substituted for `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
6729
6731
|
@internal
|
6730
6732
|
*/
|
6731
6733
|
resolveSelector = function(selectorOrElement, origin) {
|
@@ -6829,7 +6831,7 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6829
6831
|
here, in which case a selector will be inferred from the element's class and ID.
|
6830
6832
|
@param {string} url
|
6831
6833
|
The URL to fetch from the server.
|
6832
|
-
@param {string} [options.failTarget
|
6834
|
+
@param {string} [options.failTarget]
|
6833
6835
|
The CSS selector to update if the server sends a non-200 status code.
|
6834
6836
|
@param {string} [options.fallback]
|
6835
6837
|
The selector to update when the original target was not found in the page.
|
@@ -6878,7 +6880,7 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6878
6880
|
@param {Element|jQuery} [options.origin]
|
6879
6881
|
The element that triggered the replacement.
|
6880
6882
|
|
6881
|
-
The element's selector will be substituted for the `&` shorthand in the target selector.
|
6883
|
+
The element's selector will be substituted for the `&` shorthand in the target selector ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
6882
6884
|
@param {string} [options.layer='auto']
|
6883
6885
|
The name of the layer that ought to be updated. Valid values are
|
6884
6886
|
`auto`, `page`, `modal` and `popup`.
|
@@ -6889,13 +6891,17 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6889
6891
|
Unpoly will search in other layers, starting from the topmost layer.
|
6890
6892
|
@param {string} [options.failLayer='auto']
|
6891
6893
|
The name of the layer that ought to be updated if the server sends a non-200 status code.
|
6894
|
+
@param {boolean} [options.keep=true]
|
6895
|
+
Whether this replacement will preserve [`[up-keep]`](/up-keep) elements.
|
6896
|
+
@param {boolean} [options.hungry=true]
|
6897
|
+
Whether this replacement will update [`[up-hungry]`](/up-hungry) elements.
|
6892
6898
|
|
6893
6899
|
@return {Promise}
|
6894
6900
|
A promise that will be fulfilled when the page has been updated.
|
6895
6901
|
@stable
|
6896
6902
|
*/
|
6897
6903
|
replace = function(selectorOrElement, url, options) {
|
6898
|
-
var e,
|
6904
|
+
var e, failureOptions, fullLoad, improvedFailTarget, improvedTarget, onFailure, onSuccess, promise, request, successOptions;
|
6899
6905
|
options = u.options(options);
|
6900
6906
|
options.inspectResponse = fullLoad = function() {
|
6901
6907
|
return up.browser.navigate(url, u.only(options, 'method', 'data'));
|
@@ -6912,8 +6918,7 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6912
6918
|
failureOptions = u.merge(options, {
|
6913
6919
|
humanizedTarget: 'failure target',
|
6914
6920
|
provideTarget: void 0,
|
6915
|
-
restoreScroll: false
|
6916
|
-
hungry: false
|
6921
|
+
restoreScroll: false
|
6917
6922
|
});
|
6918
6923
|
u.renameKey(failureOptions, 'failTransition', 'transition');
|
6919
6924
|
u.renameKey(failureOptions, 'failLayer', 'layer');
|
@@ -6921,8 +6926,8 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6921
6926
|
try {
|
6922
6927
|
improvedTarget = bestPreflightSelector(selectorOrElement, successOptions);
|
6923
6928
|
improvedFailTarget = bestPreflightSelector(options.failTarget, failureOptions);
|
6924
|
-
} catch (
|
6925
|
-
e =
|
6929
|
+
} catch (_error) {
|
6930
|
+
e = _error;
|
6926
6931
|
return Promise.reject(e);
|
6927
6932
|
}
|
6928
6933
|
request = {
|
@@ -9539,12 +9544,16 @@ new page is loading.
|
|
9539
9544
|
@selector a[up-target]
|
9540
9545
|
@param {string} up-target
|
9541
9546
|
The CSS selector to replace
|
9547
|
+
|
9548
|
+
Inside the CSS selector you may refer to this link as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
9542
9549
|
@param {string} [up-method='get']
|
9543
9550
|
The HTTP method to use for the request.
|
9544
9551
|
@param {string} [up-transition='none']
|
9545
9552
|
The [transition](/up.motion) to use for morphing between the old and new elements.
|
9546
9553
|
@param [up-fail-target='body']
|
9547
|
-
The selector to replace if the server responds with an error.
|
9554
|
+
The CSS selector to replace if the server responds with an error.
|
9555
|
+
|
9556
|
+
Inside the CSS selector you may refer to this link as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
9548
9557
|
@param {string} [up-fail-transition='none']
|
9549
9558
|
The [transition](/up.motion) to use for morphing between the old and new elements
|
9550
9559
|
when the server responds with an error.
|
@@ -9560,10 +9569,12 @@ new page is loading.
|
|
9560
9569
|
Whether to reveal the target element after it was replaced.
|
9561
9570
|
|
9562
9571
|
You can also pass a CSS selector for the element to reveal.
|
9572
|
+
Inside the CSS selector you may refer to this link as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
9563
9573
|
@param {string} [up-fail-reveal='true']
|
9564
9574
|
Whether to reveal the target element when the server responds with an error.
|
9565
9575
|
|
9566
9576
|
You can also pass a CSS selector for the element to reveal.
|
9577
|
+
Inside the CSS selector you may refer to this link as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
9567
9578
|
@param {string} [up-restore-scroll='false']
|
9568
9579
|
Whether to restore previously known scroll position of all viewports
|
9569
9580
|
within the target selector.
|
@@ -9880,12 +9891,16 @@ open dialogs with sub-forms, etc. all without losing form state.
|
|
9880
9891
|
Defaults to the form's `up-method`, `data-method` or `method` attribute, or to `'post'`
|
9881
9892
|
if none of these attributes are given.
|
9882
9893
|
@param {string} [options.target]
|
9883
|
-
The selector to update when the form submission succeeds (server responds with status 200).
|
9894
|
+
The CSS selector to update when the form submission succeeds (server responds with status 200).
|
9884
9895
|
Defaults to the form's `up-target` attribute.
|
9896
|
+
|
9897
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
9885
9898
|
@param {string} [options.failTarget]
|
9886
|
-
The selector to update when the form submission fails (server responds with non-200 status).
|
9899
|
+
The CSS selector to update when the form submission fails (server responds with non-200 status).
|
9887
9900
|
Defaults to the form's `up-fail-target` attribute, or to an auto-generated
|
9888
9901
|
selector that matches the form itself.
|
9902
|
+
|
9903
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
9889
9904
|
@param {string} [options.fallback]
|
9890
9905
|
The selector to update when the original target was not found in the page.
|
9891
9906
|
Defaults to the form's `up-fallback` attribute.
|
@@ -10359,11 +10374,15 @@ open dialogs with sub-forms, etc. all without losing form state.
|
|
10359
10374
|
|
10360
10375
|
@selector form[up-target]
|
10361
10376
|
@param {string} up-target
|
10362
|
-
The selector to [replace](/up.replace) if the form submission is successful (200 status code).
|
10377
|
+
The CSS selector to [replace](/up.replace) if the form submission is successful (200 status code).
|
10378
|
+
|
10379
|
+
Inside the CSS selector you may refer to this form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
10363
10380
|
@param {string} [up-fail-target]
|
10364
|
-
The selector to [replace](/up.replace) if the form submission is not successful (non-200 status code).
|
10365
|
-
|
10366
|
-
|
10381
|
+
The CSS selector to [replace](/up.replace) if the form submission is not successful (non-200 status code).
|
10382
|
+
|
10383
|
+
Inside the CSS selector you may refer to this form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
10384
|
+
|
10385
|
+
If omitted, Unpoly will replace the `<form>` tag itself, assuming that the server has echoed the form with validation errors.
|
10367
10386
|
@param [up-fallback]
|
10368
10387
|
The selector to replace if the server responds with an error.
|
10369
10388
|
@param {string} [up-transition]
|
@@ -10397,6 +10416,7 @@ open dialogs with sub-forms, etc. all without losing form state.
|
|
10397
10416
|
Whether to reveal the target element after it was replaced.
|
10398
10417
|
|
10399
10418
|
You can also pass a CSS selector for the element to reveal.
|
10419
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
10400
10420
|
@param {string} [up-fail-reveal='true']
|
10401
10421
|
Whether to reveal the target element when the server responds with an error.
|
10402
10422
|
|
@@ -10406,6 +10426,8 @@ open dialogs with sub-forms, etc. all without losing form state.
|
|
10406
10426
|
<form up-target=".content" up-fail-reveal=".error">
|
10407
10427
|
...
|
10408
10428
|
</form>
|
10429
|
+
|
10430
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
10409
10431
|
@param {string} [up-restore-scroll='false']
|
10410
10432
|
Whether to restore previously known scroll position of all viewports
|
10411
10433
|
within the target selector.
|
data/dist/unpoly.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(){window.up={version:"0.53.4",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$,F,D,C,O,R,U,N,M,L,H,K,q,j,_,V,z,I,W,Q,B,J,X,G,Z,Y,tt,et,nt,rt,ot,it,ut,st,at,lt,ct,pt,ft,ht,dt,mt,vt,gt,yt,bt,wt,kt,St,Tt,Et,At,xt,Pt,$t,Ft,Dt,Ct,Ot,Rt,Ut,Nt,Mt,Lt,Ht,Kt,qt,jt,_t,Vt,zt,It,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe,he,de,me;return Pt=r.noop,gt=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},st=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},Ft=function(t,e){var n,r,o;return r=Ht(t),n=r.protocol+"//"+r.hostname,st(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.hash:void 0)===!0&&(n+=r.hash),(null!=e?e.search:void 0)!==!1&&(n+=r.search),n},I=function(t){var e;return e=Ht(location.href),t=Ht(t),e.protocol!==t.protocol||e.host!==t.host},Ht=function(t){var e;return t=pe(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),V(e.hostname)&&(e.href=e.href),e)},$t=function(t){return t?t.toUpperCase():"GET"},wt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,c,p,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,f=c=0,d=v.length;d>c;f=++c){for(s=v[f],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;m>h;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===f&&(o=e),n=e}return o},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},ne=function(t){var e,n,o,i,u,s,a,l,c,p,f;if(e=r(t),c=void 0,p=e.prop("tagName").toLowerCase(),f=jt(e.attr("up-id")))c=m("up-id",f);else if(u=jt(e.attr("id")))c=u.match(/^[a-z0-9\-_]+$/i)?"#"+u:m("id",u);else if(l=jt(e.attr("name")))c=p+m("name",l);else if(o=jt(xt(e)))for(c="",i=0,a=o.length;a>i;i++)s=o[i],c+="."+s;else c=(n=jt(e.attr("aria-label")))?m("aria-label",n):p;return c},m=function(t,e){return e=e.replace(/"/g,'\\"'),"["+t+'="'+e+'"]'},xt=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Yt(n,function(t){return it(t)&&!t.match(/^up-/)})},T=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},d=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;o>n;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},h=Object.assign||d,ce=r.trim,$=function(t,e){var n,r,o,i,u;for(u=[],r=n=0,i=t.length;i>n;r=++n)o=t[r],u.push(e(o,r));return u},dt=$,ae=function(t,e){var n,r,o,i;for(i=[],r=n=0,o=t-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(e(r));return i},et=function(t){return null===t},ct=function(t){return void 0===t},W=function(t){return!ct(t)},tt=function(t){return ct(t)||et(t)},Z=function(t){return!tt(t)},V=function(t){return tt(t)||rt(t)&&0===Object.keys(t).length||0===t.length},jt=function(t,e){return null==e&&(e=it),e(t)?t:void 0},it=function(t){return!V(t)},G=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||t instanceof String},nt=function(t){return"number"==typeof t||t instanceof Number},ot=function(t){return!("object"!=typeof t||et(t)||Y(t)||ut(t)||X(t)||_(t))},rt=function(t){var e;return e=typeof t,"object"===e&&!et(t)||"function"===e},B=function(t){return!(!t||1!==t.nodeType)},Y=function(t){return t instanceof jQuery},ut=function(t){return rt(t)&&G(t.then)},_=Array.isArray,X=function(t){return t instanceof FormData},le=function(t){return Array.prototype.slice.call(t)},k=function(t){return _(t)?t=t.slice():rt(t)&&!G(t)?t=h({},t):up.fail("Cannot copy %o",t),t},pe=function(t){return Y(t)?t.get(0):t},yt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],h.apply(null,[{}].concat(t.call(e)))},Lt=function(t,e){var n,r,o,i;if(o=t?k(t):{},e)for(r in e)n=e[r],i=o[r],Z(i)?rt(n)&&rt(i)&&(o[r]=Lt(i,n)):o[r]=n;return o},Mt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],x(e,Z)},x=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=n;break}return i},p=function(t,e){var n,r,o,i;for(i=!1,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=!0;break}return i},l=function(t,e){var n,r,o,i;for(i=!0,r=0,o=t.length;o>r;r++)if(n=t[r],!e(n)){i=!1;break}return i},y=function(t){return Yt(t,Z)},fe=function(t){var e;return e={},Yt(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Yt=function(t,e){var n;return n=[],$(t,function(t){return e(t)?n.push(t):void 0}),n},It=function(t,e){return Yt(t,function(t){return!e(t)})},j=function(t,e){return Yt(t,function(t){return w(e,t)})},_t=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),x(o,it)},ie=function(t,e){return setTimeout(e,t)},At=function(t){return setTimeout(t,0)},kt=function(t){return Promise.resolve().then(t)},ht=function(t){return t[t.length-1]},g=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Zt=gt(function(){var t,e,n;return t=r("<div>"),t.attr("up-viewport",""),t.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),P=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=t.css("overflow-y"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Ot=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},se=function(t,e,n){var o,i,u;return o=r(t),u=o.css(Object.keys(e)),o.css(e),i=function(){return o.css(u)},n?(n(),i()):Ot(i)},L=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),V(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},H=function(t){return t=pe(t),t.offsetHeight},E=function(t,e,n){},mt=function(t){var e,n;return e=r(t),n=e.css(["margin-top","margin-right","margin-bottom","margin-left"]),{top:parseFloat(n["margin-top"]),right:parseFloat(n["margin-right"]),bottom:parseFloat(n["margin-bottom"]),left:parseFloat(n["margin-left"])}},vt=function(t,e){var n,o,i,u,s,a;return e=Lt(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=mt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},S=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},ee=function(t,e){return t.find(e).addBack(e)},te=function(t,e){var n,r;return r=ee(t,e),n=t.parents(e),r.add(n)},D=function(t){return 27===t.keyCode},w=function(t,e){return t.indexOf(e)>=0},v=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Rt=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(e[u]=o[u]);return e},O=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=k(o),n=0,r=i.length;r>n;n++)u=i[n],delete e[u];return e},pt=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},ft=function(t){var e;return e=ct(t.button)||0===t.button,e&&pt(t)},he=function(){return new Promise(Pt)},Dt=function(){return r()},oe=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],tt(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},Qt=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},St=function(t){var e,n,o,i,u,s,a;for(u={},a=[],n=[],o=0,i=t.length;i>o;o++)s=t[o],at(s)?a.push(s):n.push(s);return u.parsed=n,a.length&&(e=a.join(", "),u.parsed.push(e)),u.select=function(){return u.find(void 0)},u.find=function(t){var e,n,o,i,s,a;for(n=Dt(),s=u.parsed,o=0,i=s.length;i>o;o++)a=s[o],e=t?t.find(a):r(a),n=n.add(e);return n},u.selectInSubtree=function(t){var e;return e=u.find(t),u.doesMatch(t)&&(e=e.add(t)),e},u.doesMatch=function(t){var e;return e=r(t),p(u.parsed,function(t){return e.is(t)})},u.seekUp=function(t){var e,n,o;for(o=r(t),e=o,n=void 0;e.length;){if(u.doesMatch(e)){n=e;break}e=e.parent()}return n||Dt()},u},C=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],G(n)?n.apply(null,e):n},b=function(t){var e;return e=Nt(t),Object.preventExtensions(e),e},Nt=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,G(n)&&(n=n()),h(e,n)},e.reset(),e},de=function(t){var e,n;return t=pe(t),e=t.parentNode,n=le(t.childNodes),$(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Ct=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},J=function(t){var e,n;for(e=r(t);;){if(n=e.css("position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},N=function(t,e){var n,o,i,u;return n=r(t),o=Ct(n),i=n.position(),u=o.offset(),n.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},Jt=function(t){var e,n,r,o,i,u,s;if(_(t),X(t))return up.fail("Cannot convert FormData into an array");for(u=Xt(t),e=[],s=u.split("&"),n=0,r=s.length;r>n;n++)i=s[n],it(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},Xt=function(t,e){var n;if(e=Lt(e,{purpose:"url"}),at(t))return t.replace(/^\?/,"");if(X(t))return up.fail("Cannot convert FormData into a query string");if(it(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},Gt=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),it(o)&&f(s,o,i),s},f=function(t,e,n,r){var o;return t||(t=[]),_(t)?t.push({name:e,value:n}):X(t)?t.append(e,n):rt(t)?t[e]=n:at(t)&&(o=Xt([{name:e,value:n}],r),t=[t,o].join("&")),t},bt=function(t,e){return $(Jt(e),function(e){return t=f(t,e.name,e.value)}),t},U=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],_(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),me().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&","<":"<",">":">",'"':"""},F=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},qt=function(t,e){var n;return n=t[e],delete t[e],n},Bt=function(t,e,n){return t[n]=qt(t,e)},Kt=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},R=function(t){var e;return e=ht(t),ot(e)?t.pop():{}},Ut=function(t){var e;return e=r(t).css("opacity"),Z(e)?parseFloat(e):void 0},me=gt(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),q=function(t){return t},Q=function(t){return t=pe(t),!jQuery.contains(document.documentElement,t)},Vt=function(e){var n,r;return n=Et(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},s=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=ht(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;return!this.currentTask&&(this.currentTask=this.queue.shift())?(t=this.currentTask(),c(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))):void 0},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=dt(e,Vt),this.poke(),this.promise()},e}(),ue=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},re=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return dt(e,function(t){return t()})}},zt=function(t){var e,n;return n=void 0,e=new Promise(function(e,r){return n=ie(t,e)}),e.cancel=function(){return clearTimeout(n)},e},K=function(t){var e,n,r,o;return e=vt(t),r=g(),n=e.left+.5*e.width,o=.5*r.width,o>n?"left":"right"},A=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},M=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;n++)o=t[n],_(o)?e=e.concat(o):e.push(o);return e},lt=function(t){return!!t},c=function(t,e){return t.then(e,e)},Tt=function(t){return null!=t?t["catch"](Pt):void 0},Et=function(){var t,e;return e=void 0,It=void 0,t=new Promise(function(t,n){return e=t,It=n}),t.resolve=e,t.reject=It,t.promise=function(){return t},t},Wt=function(t){var e,n;try{return t()}catch(n){return e=n,Promise.reject(e)}},z=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Jt,requestDataAsQuery:Xt,appendRequestData:f,mergeRequestData:bt,requestDataFromForm:Gt,offsetParent:Ct,fixedToAbsolute:N,isFixed:J,presentAttr:_t,parseUrl:Ht,normalizeUrl:Ft,normalizeMethod:$t,methodAllowsPayload:wt,createElementFromHtml:T,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:ne,assign:h,assignPolyfill:d,copy:k,merge:yt,options:Lt,option:Mt,fail:U,each:$,map:dt,times:ae,any:p,all:l,detect:x,select:Yt,reject:It,intersect:j,compact:y,uniq:fe,last:ht,isNull:et,isDefined:W,isUndefined:ct,isGiven:Z,isMissing:tt,isPresent:it,isBlank:V,presence:jt,isObject:rt,isFunction:G,isString:at,isNumber:nt,isElement:B,isJQuery:Y,isPromise:ut,isOptions:ot,isArray:_,isFormData:X,isUnmodifiedKeyEvent:pt,isUnmodifiedMouseEvent:ft,nullJQuery:Dt,unJQuery:pe,setTimer:ie,nextFrame:At,measure:vt,temporaryCss:se,cssAnimate:E,forceCompositing:L,forceRepaint:H,escapePressed:D,copyAttributes:S,selectInSubtree:ee,selectInDynasty:te,contains:w,toArray:le,castedAttr:v,clientSize:g,only:Rt,except:O,trim:ce,unresolvablePromise:he,setMissingAttrs:oe,remove:Qt,memoize:gt,scrollbarWidth:Zt,documentHasVerticalScrollbar:P,config:b,openConfig:Nt,unwrapElement:de,multiSelector:St,error:U,pluckData:Kt,pluckKey:qt,renameKey:Bt,extractOptions:R,isDetached:Q,noop:Pt,opacity:Ut,whenReady:me,identity:q,escapeHtml:F,DivertibleChain:s,submittedValue:ue,sequence:re,promiseTimer:zt,previewable:Vt,evalOption:C,horizontalScreenHalf:K,detachWith:A,flatten:M,isTruthy:lt,newDeferred:Et,always:c,muteRejection:Tt,rejectOnError:Wt,isBodyDescendant:z,isCrossDomain:I,microtask:kt}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return this.config.cachable?this.config.cachable(t):!0},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix?(t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)):void 0},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;return o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;return o=t.store[e],i=o.timestamp,!r||r>i?(n=e,r=i):void 0}}(this)),n)?delete this.store[n]:void 0},r.prototype.alias=function(e,n){var r;return r=this.get(e,{silent:!0}),t.isDefined(r)?this.set(n,r):void 0},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;return this.isEnabled()&&this.isCachable(t)?(this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}):void 0},r.prototype.remove=function(t){var e;return this.isCachable(t)?(e=this.normalizeStoreKey(t),delete this.store[e]):void 0},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),e?(n=this.timestamp()-t.timestamp,e>n):!0},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.hungrySteps=e(this.hungrySteps,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.options.transition=t.option(this.options.transition,this.options.animation),this.options.hungry=t.option(this.options.hungry,!0),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=t.option(up.dom.config.fallbackTransition,e.options.transition)),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return this.options.provideTarget?this.plans[0].selector:(t=this.oldPlan())?t.selector:this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?t.steps.concat(this.hungrySteps()):this.matchingPlanNotFound()},n.prototype.hungrySteps=function(){var e,n,r,o,i,u,s,a,l;if(a=[],this.options.hungry)for(e=up.radio.hungrySelector().select(),i=0,u=e.length;u>i;i++)o=e[i],n=$(o),s=t.selectorForElement(n),(r=this.options.response.first(s))&&(l=t.option(up.radio.config.hungryTransition,this.options.transition),a.push({selector:s,$old:n,$new:r,transition:l,reveal:!1,origin:null}));return a},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.parseSteps=e(this.parseSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this),this.reveal=n.reveal,this.origin=n.origin,this.selector=up.dom.resolveSelector(t,this.origin),this.transition=n.transition,this.response=n.response,this.oldLayer=n.layer,this.parseSteps()}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.parseSteps=function(){var e,n;return e=/\ *,\ */,this.steps=[],n=this.selector.split(e),t.each(n,function(t){return function(e,n){var r,o,i,u;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],r=0===n?t.reveal:!1,t.steps.push({selector:u,pseudoClass:i,transition:t.transition,origin:t.origin,reveal:r})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;return null===this.scheduledValue||this.currentTimer||this.currentCallback?void 0:(this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this)))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;return t=this.readFieldValue(),this.isNewValue(t)?(this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()):void 0},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function r(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return r.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},r.prototype.onMousedown=function(t,e){return up.link.shouldProcessEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},r.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},r.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onClick.apply(e,r))}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onMousedown.apply(e,r))}}(this))},r.prototype.followLink=function(t,e){return null==e&&(e={}),up.bus.whenEmitted("up:link:follow",{$element:t}).then(function(n){return function(){return up.feedback.start(t,e,function(){return n.followNow(t,e)})}}(this))},r.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},r.prototype.matchesLink=function(t){return t.is(this.fullSelector())},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkElement=e(this.unmarkElement,this),this.markElement=e(this.markElement,this),this.whenElementFinished=e(this.whenElementFinished,this),this.finishOneElement=e(this.finishOneElement,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.className="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.className,this.finishEvent="up:"+t+":finish"}return n.prototype.claim=function(t,e){return this.finish(t).then(function(n){return function(){return n.start(t,e)}}(this))},n.prototype.start=function(t,e){var n;return n=e(t),this.markElement(t,n),n.then(function(e){return function(){return e.unmarkElement(t)}}(this)),n},n.prototype.finish=function(e){var n,r;return n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.finishOneElement=function(t){var e;return e=$(t),e.trigger(this.finishEvent),this.whenElementFinished(e)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markElement=function(t,e){return t.addClass(this.className),t.data(this.dataKey,e)},n.prototype.unmarkElement=function(t){return t.removeClass(this.className),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferSearchToData=e(this.transferSearchToData,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),t.methodAllowsPayload(this.method)?this.transferSearchToData():this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return this.data&&!t.isFormData(this.data)?(e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0):void 0},o.prototype.transferSearchToData=function(){var e,n;return n=t.parseUrl(this.url),e=n.search,e?(this.data=t.mergeRequestData(this.data,e),this.url=t.normalizeUrl(n,{search:!1})):void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,c,p,f,h;l=new XMLHttpRequest,p=t.copy(e.headers),c=e.data,f=e.method,h=e.url,u=up.proxy.wrapMethod(f,c),f=u[0],c=u[1],t.isFormData(c)?delete p["Content-Type"]:t.isPresent(c)?(c=t.requestDataAsQuery(c,{purpose:"form"}),p["Content-Type"]="application/x-www-form-urlencoded"):c=null,e.target&&(p[up.protocol.config.targetHeader]=e.target),e.failTarget&&(p[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||p["X-Requested-With"]||(p["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(p[up.protocol.config.csrfHeader]=o),l.open(f,h);for(i in p)a=p[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(c)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return this.transferSearchToData(),e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record);
|
2
|
-
}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canConsole,canCssTransition,canDOMParser,canFormData,canInputEvent,canPromise,canPushState,hash,isIE10OrWorse,isRecentJQuery,isSupported,navigate,polyfilledSessionStorage,popCookie,puts,sessionStorage,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,navigate=function(t,e){var n;return null==e&&(e={}),n=new up.Request(u.merge(e,{url:t})),n.navigate()},submitForm=function(t){return t.submit()},puts=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],console[e].apply(console,t)},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(t){var e,n,r,o,i,s,a,l,c;if(s=200,r="",u.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(t))l="undefined";else if(u.isNumber(t)||u.isFunction(t))l=t.toString();else if(u.isArray(t))l="["+u.map(t,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(t))l="$("+u.map(t,stringifyArg).join(", ")+")",r=")";else if(u.isElement(t)){for(e=$(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],o=0,i=a.length;i>o;o++)n=a[o],(c=e.attr(n))&&(l+=" "+n+'="'+c+'"');l+=">",r=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=r),l},sprintf=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,e].concat(slice.call(t)))},sprintfWithFormattedArgs=function(){var t,e,n,r;return e=arguments[0],r=arguments[1],t=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=t[n],r=e(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE10OrWorse=u.memoize(function(){return!window.atob}),canPushState=function(){return u.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},canCssTransition=function(){return"transition"in document.documentElement.style},canInputEvent=function(){return"oninput"in document.createElement("input")},canPromise=function(){return!!window.Promise},canFormData=function(){return!!window.FormData},canDOMParser=function(){return!!window.DOMParser},canConsole=function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd},isRecentJQuery=function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9},popCookie=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,u.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(t){return t.preload||u.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},isSupported=function(){return!isIE10OrWorse()&&isRecentJQuery()&&canConsole()&&canDOMParser()&&canFormData()&&canCssTransition()&&canInputEvent()&&canPromise()},sessionStorage=u.memoize(function(){try{return window.sessionStorage}catch(t){return polyfilledSessionStorage()}}),polyfilledSessionStorage=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},hash=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),u.presence(t)},{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,navigate:navigate,submitForm:submitForm,canPushState:canPushState,whenConfirmed:whenConfirmed,isSupported:isSupported,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage,popCookie:popCookie,hash:hash,canPushState:canPushState}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,fixRenamedEvents,forgetUpDescription,haltEvent,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,renamedEvent,renamedEvents,resetBus,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,renamedEvents={},upListenerToJqueryListener=function(t){return function(e){var n;return n=e.$element||$(this),t.apply(n.get(0),[e,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(t,e){var n,r,o;return n=u.copy(t),fixRenamedEvents(n),o=n.pop(),r=void 0,e?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},fixRenamedEvents=function(t){var e;return e=t[0].split(/\s+/),e=u.map(e,function(t){var e;return(e=renamedEvents[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},live=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(t=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(e=$(document)).on.apply(e,t),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],t=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(e=$(document)).off.apply(e,t)},rememberUpDescription=function(t){var e;return e=upDescriptionNumber(t),liveUpDescriptions[e]=t},forgetUpDescription=function(t){var e;return e=upDescriptionNumber(t),delete liveUpDescriptions[e]},upDescriptionNumber=function(t){return u.last(t)._descriptionNumber},emit=function(t,e){var n,r;return null==e&&(e={}),r=$.Event(t,e),(n=e.$element)?delete e.$element:n=$(document),logEmission(t,e),n.trigger(r),r},logEmission=function(t,e){var n,r,o;return e.hasOwnProperty("message")?(n=e.message,delete e.message,n!==!1&&(u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n)?u.isPresent(e)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[t],[e])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[t])):void 0):u.isPresent(e)?up.puts("Emitted event %s (%o)",t,e):up.puts("Emitted event %s",t)},nobodyPrevents=function(){var t,e;return t=1<=arguments.length?slice.call(arguments,0):[],e=emit.apply(null,t),!e.isDefaultPrevented()},whenEmitted=function(){var t;return t=1<=arguments.length?slice.call(arguments,0):[],new Promise(function(e,n){return nobodyPrevents.apply(null,t)?e():n(new Error("Event "+t[0]+" was prevented"))})},onEscape=function(t){return live("keydown","body",function(e){return u.escapePressed(e)?t(e):void 0})},haltEvent=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},consumeAction=function(t){return haltEvent(t),"up:action:consumed"!==t.type?emit("up:action:consumed",{$element:$(t.target),message:!1}):void 0},snapshot=function(){var t,e,n;n=[];for(e in liveUpDescriptions)t=liveUpDescriptions[e],n.push(t.isDefault=!0);return n},resetBus=function(){var t,e,n,r,o,i;e=[];for(o in liveUpDescriptions)t=liveUpDescriptions[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(unbind.apply(null,t));return i},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},renamedEvent=function(t,e){return renamedEvents[t]=e},boot=function(){return up.browser.isSupported()?(emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",resetBus),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,haltEvent:haltEvent,consumeAction:consumeAction,renamedEvent:renamedEvent,boot:boot}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)||t.responseURL},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),up.bus.on("up:framework:booted",o),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var t=[].slice;up.log=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return m=up.util,r=up.browser,n="up.log.enabled",o=m.config({prefix:"[UP] ",enabled:"true"===r.sessionStorage().getItem(n),collapse:!1}),h=function(){return o.reset()},c=function(t){return""+o.prefix+t},i=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["debug",c(n)].concat(t.call(e))):void 0},f=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["log",c(n)].concat(t.call(e))):void 0},v=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["warn",c(n)].concat(t.call(e))):void 0},l=function(){var e,n,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),!o.enabled||!i)return n();u=o.collapse?"groupCollapsed":"group",r.puts.apply(r,[u,c(i)].concat(t.call(e)));try{return n()}finally{i&&r.puts("groupEnd")}},a=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["error",c(n)].concat(t.call(e))):void 0},p=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=o.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",r.puts("log",t)},up.on("up:framework:boot",p),up.on("up:framework:reset",h),d=function(t){return r.sessionStorage().setItem(n,t.toString()),o.enabled=t},s=function(){return d(!0)},u=function(){return d(!1)},{puts:f,debug:i,error:a,warn:v,group:l,config:o,enable:s,disable:u}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,c,p;return p=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+p.escapeHtml(t)+"</span>"},c=p.config({$toast:null}),l=function(){return i(),c.reset()},s=function(e){return p.isArray(e)?(e[0]=p.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=p.escapeHtml(e),e},u=function(){return!!c.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),c.$toast=a},i=function(){return u()?(c.$toast.remove(),c.$toast=null):void 0},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S;return S=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,p=[],g=[],c=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=S.options(e[0]),d(p,o,r,n)):void 0},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)):void 0},h=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=S.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,f(e)]),i(e,r)},y=function(t){return S.isFunction(t)?t:S.isArray(t)&&S.all(t,S.isFunction)?S.sequence.apply(S,t):void 0},i=function(t,e){var o;return(e=y(e))?(t.addClass(n),o=t.data(r)||function(){return w(t)},o=S.sequence(o,e),t.data(r,o)):void 0},w=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=S.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,p],l=[],o=0,i=a.length;i>o;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;i>o;o++)c=s[o],n=S.selectInSubtree(t,c.selector),r.length&&(n=n.filter(function(){var t;return t=e(this),S.all(r,function(e){return 0===t.closest(e).length})})),n.length?a.push(up.log.group(c.isSystem?void 0:"Compiling '%s' on %d element(s)",c.selector,n.length,function(){return c.batch?u(c,n,n.get()):n.each(function(){return u(c,e(this),this)})})):a.push(void 0);return a}());return l})},a=function(t){return b(t)()},b=function(t){var o,i;return o=S.selectInSubtree(t,"."+n),i=S.map(o,function(t){return e(t).data(r)}),i=S.compact(i),S.sequence.apply(S,i)},f=function(t){var n,r;return n=e(t),r=n.attr("up-data"),S.isString(r)&&""!==S.trim(r)?JSON.parse(r):{}},k=function(){var t;return t=function(t){return t.isSystem},p=S.select(p,t),g=S.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",k),{compiler:c,macro:v,compile:l,clean:a,prepareClean:b,data:f}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,d=function(){return n.reset(),c=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(c=u,u=void 0),u=t},h=function(t){return i("replaceState",t)},p=function(t,e){return e=v.options(e,{force:!1}),t=s(t),!e.force&&o(t)||!up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t})?void 0:i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return up.browser.canPushState()&&n.enabled?(i=e(),window.history[t](i,"",o),a(r()),!0):!1},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",d),{config:n,push:p,replace:h,url:r,isUrl:o,previousUrl:function(){return c},normalizeUrl:s}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var anchoredRight,config,finishScrolling,firstHashTarget,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealHash,revealOrRestoreScroll,revealSelector,saveScroll,scroll,scrollAbruptlyNow,scrollTopKey,scrollTops,scrollWithAnimateNow,scrollableElementForViewport,scrollingTracker,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=new up.Cache({size:30,key:up.history.normalizeUrl}),scrollingTracker=new up.MotionTracker("scrolling"),reset=function(){return config.reset(),lastScrollTops.clear(),scrollingTracker.finish()},scroll=function(t,e,n){var r;return r=scrollableElementForViewport(t),n=u.options(n),n.duration=u.option(n.duration,config.duration),n.easing=u.option(n.easing,config.easing),finishScrolling(r).then(function(){return up.motion.isEnabled()&&n.duration>0?scrollWithAnimateNow(r,e,n):scrollAbruptlyNow(r,e)})},scrollableElementForViewport=function(t){var e;return e=$(t),e.get(0)===document?$("html, body"):e},scrollWithAnimateNow=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(scrollingTracker.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(scrollingTracker.eventName)}),o},scrollingTracker.claim(t,r)},scrollAbruptlyNow=function(t,e){return t.scrollTop(e),Promise.resolve()},finishScrolling=function(t){var e;return e=scrollableElementForViewport(t),scrollingTracker.finish(e)},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||up.fail("Fixed element %o must have a CSS attribute %s",n.get(0),e),parseFloat(r)+n.height()},e=function(){var t,e,o,i;for(o=$(config.fixedTop.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"top"));return i}(),t=function(){var t,e,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n;return n=$(t).first(),up.puts("Revealing fragment %o",n.get(0)),e=u.options(e),u.rejectOnError(function(){var t,r,o,i,s,a,l,c,p,f,h,d,m;return t=e.viewport?$(e.viewport):viewportOf(n),h=u.option(e.snap,config.snap),m=t.is(document),d=m?u.clientSize().height:t.outerHeight(),c=t.scrollTop(),s=c,l=void 0,a=void 0,m?(a=measureObstruction(),l=0):(a={top:0,bottom:0},l=c),p=function(){return s+a.top},f=function(){return s+d-a.bottom-1},r=u.measure(n,{relative:t,includeMargin:!0}),o=r.top+l,i=o+Math.min(r.height,config.substance)-1,i>f()&&(s+=i-f()),(o<p()||e.top)&&(s=o-a.top),h>s&&r.top<.5*d&&(s=0),s!==c?scroll(t,s,e):Promise.resolve()})},revealHash=function(){var t,e;return(e=up.browser.hash())&&(t=firstHashTarget(e))?reveal(t):Promise.resolve()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t,e){var n,r;return null==e&&(e={}),n=$(t),r=viewportSelector().seekUp(n),0===r.length&&e.strict!==!1&&up.fail("Could not find viewport for %o",n),r},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().selectInSubtree(e)},viewports=function(){return viewportSelector().select()},scrollTopKey=function(t){var e;return e=$(t),e.is(document)?"document":u.selectorForElement(e)},scrollTops=function(){var t,e,n,r,o;for(o={},r=config.viewports,e=0,n=r.length;n>e;e++)t=r[e],$(t).each(function(){var t,e,n;return t=$(this),e=scrollTopKey(t),n=t.scrollTop(),o[e]=n});return o},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),r=e.add(n)):r=viewports(),o=lastScrollTops.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=u.map(r,function(t){var e,n;return e=scrollTopKey(t),n=o[e]||0,scroll(t,n,{duration:0})}),Promise.all(t)})},revealOrRestoreScroll=function(t,e){var n,r,o;return e=u.options(e),n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal&&(r={duration:e.duration},u.isString(e.reveal)&&(o=revealSelector(e.reveal),n=up.first(o)||n,r.top=!0),n.length)?reveal(n,r):Promise.resolve()},revealSelector=function(t,e){return t=up.dom.resolveSelector(t,e),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},firstHashTarget=function(t){return(t=up.browser.hash(t))?up.first("[id='"+t+"'], a[name='"+t+"']"):void 0},up.on("up:app:booted",revealHash),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,revealHash:revealHash,firstHashTarget:firstHashTarget,scroll:scroll,config:config,viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function($){var autofocus,bestMatchingSteps,bestPreflightSelector,config,destroy,detectScriptFixes,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,first,firstInLayer,firstInPriority,fixScripts,hello,isRealElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,shouldSwapElementsDirectly,source,swapElements,swapElementsDirectly,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:null}),reset=function(){return config.reset()},setSource=function(t,e){var n;return n=$(t),u.isPresent(e)&&(e=u.normalizeUrl(e)),n.attr("up-source",e)},source=function(t){var e;return e=$(t).closest("[up-source]"),u.presence(e.attr("up-source"))||up.browser.url()},resolveSelector=function(t,e){var n,r;return u.isString(t)?(r=t,u.contains(r,"&")&&(u.isPresent(e)?(n=u.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=u.selectorForElement(t),r},replace=function(t,e,n){var r,o,i,s,a,l,c,p,f,h,d;if(n=u.options(n),n.inspectResponse=s=function(){return up.browser.navigate(e,u.only(n,"method","data"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||s(),u.unresolvablePromise();d=u.merge(n,{humanizedTarget:"target"}),i=u.merge(n,{humanizedTarget:"failure target",provideTarget:void 0,restoreScroll:!1,hungry:!1}),u.renameKey(i,"failTransition","transition"),u.renameKey(i,"failLayer","layer"),u.renameKey(i,"failReveal","reveal");try{l=bestPreflightSelector(t,d),a=bestPreflightSelector(n.failTarget,i)}catch(o){return r=o,Promise.reject(r)}return h={url:e,method:n.method,data:n.data,target:l,failTarget:a,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout},p=function(t){return processResponse(!0,l,t,d)},c=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=processResponse(!1,a,t,i),u.always(e,n))},f=up.request(h),n.preload||(f=f.then(p,c)),f},processResponse=function(t,e,n,r){var o,i,s,a,l;return a=n.request,l=n.url,i=l,o=a.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),s="GET"===n.method,t?s?(r.history===!1||u.isString(r.history)||(r.history=i),r.source===!1||u.isString(r.source)||(r.source=l)):(u.isString(r.history)||(r.history=!1),u.isString(r.source)||(r.source="keep")):s?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=l)):(r.history=!1,r.source="keep"),shouldExtractTitle(r)&&n.title&&(r.title=n.title),extract(e,n.text,r)},shouldExtractTitle=function(t){return!(t.title===!1||u.isString(t.title)||t.history===!1&&t.title!==!0)},extract=function(t,e,n){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),n.saveScroll!==!1&&up.layout.saveScroll(),u.rejectOnError(function(){var r,o,i,s,a,l,c;for("function"==typeof n.provideTarget&&n.provideTarget(),s=parseResponseDoc(e),r=bestMatchingSteps(t,s,n),shouldExtractTitle(n)&&(a=s.title())&&(n.title=a),updateHistoryAndTitle(n),c=[],o=0,i=r.length;i>o;o++)l=r[o],up.log.group("Updating %s",l.selector,function(){var t,e;return t=u.merge(n,u.only(l,"origin","reveal")),fixScripts(l.$new),e=swapElements(l.$old,l.$new,l.pseudoClass,l.transition,t),c.push(e)});return Promise.all(c)})})},bestPreflightSelector=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},bestMatchingSteps=function(t,e,n){var r;return n=u.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},fixScripts=function(t){var e,n,r,o,i;for(n=[],detectScriptFixes(t.get(0),n),i=[],r=0,o=n.length;o>r;r++)e=n[r],i.push(e());return i},detectScriptFixes=function(t,e){var n,r,o,i,u,s;if("NOSCRIPT"===t.tagName)return r=document.createElement("noscript"),r.textContent=t.innerHTML,e.push(function(){return t.parentNode.replaceChild(r,t)});if("SCRIPT"===t.tagName)return e.push(function(){return t.parentNode.removeChild(t)});for(u=t.children,s=[],o=0,i=u.length;i>o;o++)n=u[o],s.push(detectScriptFixes(n,e));return s},parseResponseDoc=function(t){var e;return e=u.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("head title"))?t.textContent:void 0},first:function(t){var n;return(n=$.find(t,e)[0])?$(n):void 0}}},updateHistoryAndTitle=function(t){return t=u.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),u.isString(t.title)?document.title=t.title:void 0},swapElements=function(t,e,n,r,o){var i,s,a,l,c;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(t)})),up.motion.finish(t),n?(i=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(i):t.append(i),hello(i.children(),o),l=up.layout.revealOrRestoreScroll(i,o),l=l.then(function(){return up.animate(i,r,o)}),l=l.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(t,e,o))?(emitFragmentKept(a),l=Promise.resolve()):(o.keepPlans=transferKeepableElements(t,e,o),s=up.syntax.prepareClean(t),c=function(){return shouldSwapElementsDirectly(t,e,r,o)?(swapElementsDirectly(t,e),r=!1):e.insertBefore(t),o.source!==!1&&setSource(e,o.source),autofocus(e),hello(e,o),up.morph(t,e,r,o)},l=destroy(t,{clean:s,beforeWipe:c,log:!1})),l},shouldSwapElementsDirectly=function(t,e,n,r){var o;return o=t.add(e),t.is("body")||!up.motion.willAnimate(o,n,r)},swapElementsDirectly=function(t,e){return t.replaceWith(e)},transferKeepableElements=function(t,e,n){var r,o,i,s,a,l,c,p;if(s=[],n.keep)for(p=t.find("[up-keep]"),i=0,l=p.length;l>i;i++)a=p[i],r=$(a),(c=findKeepPlan(r,e,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),c.$newElement.replaceWith(r),s.push(c));return s},findKeepPlan=function(t,e,n){var r,o,i,s,a;return n.keep&&(r=t,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?e.find(s):u.selectInSubtree(e,s),o=o.first(),o.length&&o.is("[up-keep]")&&(a={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(a,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i))))?a:void 0},hello=function(t,e){var n,r,o,i,s,a;for(n=$(t),e=u.options(e,{keepPlans:[]}),o=[],a=e.keepPlans,r=0,i=a.length;i>r;r++)s=a[r],emitFragmentKept(s),o.push(s.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,e),n},emitFragmentInserted=function(t,e){var n;return n=$(t),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:e.origin})},emitFragmentKept=function(t){var e;return e=u.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},autofocus=function(t){var e,n;return n="[autofocus]:last",e=u.selectInSubtree(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},isRealElement=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},first=function(t,e){var n;return e=u.options(e,{layer:"auto"}),n=resolveSelector(t,e.origin),"auto"===e.layer?firstInPriority(n,e.origin):firstInLayer(n,e.layer)},firstInPriority=function(t,e){var n,r,o,i,s,a;for(i=["popup","modal","page"],n=void 0,u.isPresent(e)&&(a=layerOf(e),u.remove(i,a),i.unshift(a)),r=0,s=i.length;s>r&&(o=i[r],!(n=firstInLayer(t,o)));r++);return n},firstInLayer=function(t,e){var n,r,o,i,u,s;for(r=$(t),o=void 0,u=0,s=r.length;s>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,e)){o=n;break}return o},layerOf=function(t){var e;return e=$(t),up.popup.contains(e)?"popup":up.modal.contains(e)?"modal":"page"},matchesLayer=function(t,e){return layerOf(t)===e},destroy=function(t,e){var n,r,o,i,s,a;return n=$(t),e=u.options(e,{animation:!1}),shouldLogDestruction(n,e)&&(i=["Destroying fragment %o",n.get(0)],s=["Destroyed fragment %o",n.get(0)]),0===n.length?Promise.resolve():(up.emit("up:fragment:destroy",{$element:n,message:i}),n.addClass("up-destroying"),updateHistoryAndTitle(e),r=function(){var t;return t=up.motion.animateOptions(e),up.motion.animate(n,e.animation,t)},o=e.beforeWipe||Promise.resolve(),a=function(){return e.clean||(e.clean=function(){return up.syntax.clean(n)}),e.clean(),up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:s}),n.remove()},r().then(o).then(a))},shouldLogDestruction=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},reload=function(t,e){var n;return e=u.options(e,{cache:!1}),n=e.url||source(t),replace(t,n,e)},up.on("up:app:boot",function(){var t;return t=$(document.body),setSource(t,up.browser.url()),hello(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello,config:config}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$;return x=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=x.config({duration:300,delay:0,easing:"ease",
|
3
|
-
enabled:!0}),k=function(){return c(),v=x.copy(u),g=x.copy(s),i.reset()},f=function(){return i.enabled},n=function(t,i,u){var s;return s=e(t),u=r(u),p(s,u).then(function(){return P(s,i,u)?x.isFunction(i)?i(s,u):x.isString(i)?n(s,a(i),u):x.isOptions(i)?o(s,i,u):up.fail("Animation must be a function, animation name or object of CSS properties, but it was %o",i):S(s,i)})},P=function(t,e,n){return n=r(n),f()&&!h(e)&&n.duration>0&&x.all(t,x.isBodyDescendant)},S=function(t,e){return x.isOptions(e)&&t.css(e),Promise.resolve()},o=function(t,e,n){var r;return r=function(){var r,o,i,u,s,a,l,c,p,f;return c=Object.keys(e),l={"transition-property":c.join(", "),"transition-duration":n.duration+"ms","transition-delay":n.delay+"ms","transition-timing-function":n.easing},u=t.css(Object.keys(l)),o=x.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;return e=t.originalEvent.propertyName,x.contains(c,e)?i():void 0},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=x.setTimer(n.duration+p,i),o.then(function(){var e;return t.off(m.finishEvent,s),t.off("transitionend",a),clearTimeout(r),f(),t.css({transition:"none"}),e=!("none"===u["transition-property"]||"all"===u["transition-property"]&&"0"===u["transition-duration"][0]),e?(x.forceRepaint(t),t.css(u)):void 0}),f=x.forceCompositing(t),t.css(l),t.css(e),o.promise()},m.start(t,r)},r=function(){var e,n,r,o,u;return n=1<=arguments.length?t.call(arguments,0):[],u=n.shift()||{},e=x.isJQuery(n[0])?n.shift():x.nullJQuery(),o=x.isObject(n[0])?n.shift():{},r={},r.easing=x.option(u.easing,x.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(x.option(u.duration,x.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(x.option(u.delay,x.presentAttr(e,"up-delay"),o.delay,i.delay)),r.finishedMotion=u.finishedMotion,r},a=function(t){return v[t]||up.fail("Unknown animation %o",t)},$=function(t,e,n,r){var o,i,u,s,a,l;return n.copy===!1||t.is(".up-ghost")||e.is(".up-ghost")?r(t,e,n):(s=void 0,i=void 0,a=void 0,u=void 0,o=up.layout.viewportOf(t),x.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),l=x.merge(n,{duration:0}),up.layout.revealOrRestoreScroll(e,l).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=x.temporaryCss(e,{opacity:"0"}),f=r(s.$ghost,i.$ghost,n),l=s.$ghost.add(i.$ghost),c=t.add(e),m.forwardFinishEvent(c,l,f),f.then(function(){return p(),s.$bounds.remove(),i.$bounds.remove()})}))},c=function(t){return m.finish(t)},d=function(t,n,o,i){var u,s,a,c,f;return i=x.options(i),i=x.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=P(u,c,i),up.log.group(f?"Morphing %o to %o with transition %o":void 0,a.get(0),s.get(0),o,function(){return p(u,i).then(function(){return f?c?$(a,s,i,c):up.fail("Unknown transition %o",o):T(a,s,i)})})},p=function(t,e){return e.finishedMotion?Promise.resolve():(e.finishedMotion=!0,c(t))},l=function(t){var e;if(h(t))return void 0;if(x.isFunction(t))return t;if(x.isArray(t))return h(t[0])&&h(t[1])?void 0:function(e,r,o){return Promise.all([n(e,t[0],o),n(r,t[1],o)])};if(x.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}},T=function(t,e,n){var r;return t.hide(),r=x.merge(n,{duration:0}),up.layout.revealOrRestoreScroll(e,r)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=x.measure(t,{relative:!0,inner:!0}),i=t.clone(),i.find("script").remove(),i.css({position:"static"===t.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(t),c(t.offset().top-i.offset().top),o=up.layout.fixedChildren(i),a=0,l=o.length;l>a;a++)s=o[a],x.fixedToAbsolute(s,n);return{$ghost:i,$bounds:r,moveTop:c}},w=function(t,e){return g[t]=e},b=function(t,e){return v[t]=e},E=function(){return u=x.copy(v),s=x.copy(g)},h=function(t){return!t||"none"===t||x.isOptions(t)&&x.isBlank(t)},b("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),b("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),A=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},b("move-to-top",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.top+r.height,n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.top+r.height,t.css(A(0,-o)),n(t,A(0,0),e)}),b("move-to-bottom",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().height-r.top,n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().height-r.top,t.css(A(0,o)),n(t,A(0,0),e)}),b("move-to-left",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.left+r.width,n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.left+r.width,t.css(A(-o,0)),n(t,A(0,0),e)}),b("move-to-right",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().width-r.left,n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().width-r.left,t.css(A(o,0)),n(t,A(0,0),e)}),b("roll-down",function(t,e){var r,o,i;return o=t.height(),i=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),r=n(t,{height:o+"px"},e),r.then(i),r}),w("move-left","move-to-left/move-from-right"),w("move-right","move-to-right/move-from-left"),w("move-up","move-to-top/move-from-bottom"),w("move-down","move-to-bottom/move-from-top"),w("cross-fade","fade-out/fade-in"),up.on("up:framework:booted",E),up.on("up:framework:reset",k),{morph:d,animate:n,animateOptions:r,willAnimate:P,finish:c,transition:w,animation:b,config:i,isEnabled:f,prependCopy:y,isNone:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$,F,D,C,O,R,U,N,M;return N=up.util,n=void 0,T=void 0,C=void 0,b=void 0,O=void 0,A=[],l=N.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return l.cacheSize},expiry:function(){return l.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),c=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(T),T=null},s=function(){return clearTimeout(C),C=null},$=function(){return n=null,u(),s(),b=0,l.reset(),i.clear(),O=!1,A=[]},$(),y=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=N.extractOptions(e),N.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||a(),!n&&(o=c(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=v(i),D(i,o),o["catch"](function(t){return P(i)})),r.preload||(g(),N.always(o,m)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},y.apply(null,e).then(r,n)})},f=function(){return 0===b},p=function(){return b>0},g=function(){var t;return b+=1,C?void 0:(t=function(){return p()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},C=N.setTimer(l.slowDelay,t))},m=function(){return b-=1,f()&&(s(),O)?(up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1):void 0},v=function(t){return b<l.maxRequests?d(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return d(t)},e=N.previewable(e),A.push(e),e.promise},d=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),N.always(n,F),N.always(n,w),n):(N.microtask(w),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;return n=t.request,t.url&&n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},w=function(){var t;return void("function"==typeof(t=A.shift())&&t())},o=i.alias,D=i.set,P=i.remove,a=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),S=function(t){var e,r;return r=parseInt(N.presentAttr(t,"up-delay"))||l.preloadDelay,t.is(n)?void 0:(n=t,u(),e=function(){return N.muteRejection(k(t)),n=null},R(e,r))},R=function(t,e){return T=setTimeout(t,e)},U=function(t){return t.is(n)?(n=void 0,u()):void 0},k=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},h=function(t){return N.contains(l.safeMethods,t)},M=function(t,e,n){return N.contains(l.wrapMethods,t)&&(e=N.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.compiler("a[up-preload], [up-href][up-preload]",function(t){return up.link.isSafe(t)?(t.on("mouseenter touchstart",function(e){return up.link.shouldProcessEvent(e,t)?S(t):void 0}),t.on("mouseleave",function(){return U(t)})):void 0}),up.on("up:framework:reset",$),{preload:k,ajax:r,request:y,get:c,alias:o,clear:a,remove:P,isIdle:f,isBusy:p,isSafeMethod:h,wrapMethod:M,config:l}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function($){var DEFAULT_FOLLOW_VARIANT,addFollowVariant,allowDefault,defaultFollow,defaultPreload,follow,followMethod,followVariantForLink,followVariants,isFollowable,isSafe,makeFollowable,shouldProcessEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r;return n=$(t),r=followVariantForLink(n),r.followLink(n,e)},defaultFollow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target")),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e=u.merge(e,up.motion.animateOptions(e,n)),up.browser.whenConfirmed(e).then(function(){return up.replace(r,o,e)})},defaultPreload=function(t,e){return e=u.options(e),e.preload=!0,defaultFollow(t,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},allowDefault=function(t){},followVariants=[],addFollowVariant=function(t,e){var n;return n=new up.FollowVariant(t,e),followVariants.push(n),n.registerEvents(),n},isFollowable=function(t){return!!followVariantForLink(t,{"default":!1})},followVariantForLink=function(t,e){var n,r;return e=u.options(e),n=$(t),r=u.detect(followVariants,function(t){return t.matchesLink(n)}),e["default"]!==!1&&(r||(r=DEFAULT_FOLLOW_VARIANT)),r},makeFollowable=function(t){var e;return e=$(t),isFollowable(e)?void 0:e.attr("up-follow","")},shouldProcessEvent=function(t,e){var n,r,o;return n=$(t.target),r=n.closest("a, [up-href]").not(e),o=up.form.fieldSelector().seekUp(n),0===r.length&&0===o.length&&u.isUnmodifiedMouseEvent(t)},isSafe=function(t,e){var n,r;return n=$(t),r=followMethod(n,e),up.proxy.isSafeMethod(r)},DEFAULT_FOLLOW_VARIANT=addFollowVariant("[up-target], [up-follow]",{follow:function(t,e){return defaultFollow(t,e)},preload:function(t,e){return defaultPreload(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?makeFollowable(t):e["up-target"]=n,u.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(t){var e,n,r,o,i,s,a,l,c,p;if(e=t.find("a, [up-href]"),(c=t.attr("up-expand"))&&(e=e.filter(c)),i=e.get(0)){for(p=/^up-/,a={},a["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],s=n.name,s.match(p)&&(a[s]=n.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,isSafe:isSafe,isFollowable:isFollowable,shouldProcessEvent:shouldProcessEvent,followMethod:followMethod,addFollowVariant:addFollowVariant,followVariantForLink:followVariantForLink,allowDefault:allowDefault}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,fieldSelector,findSwitcherForTarget,observe,observeField,reset,resolveValidateTarget,submit,switchTarget,switchTargets,switcherValues,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},fieldSelector=function(){return u.multiSelector(config.fields)},submit=function(t,e){var n,r,o;return n=$(t).closest("form"),e=u.options(e),r=u.option(e.target,n.attr("up-target"),"body"),o=u.option(e.url,n.attr("action"),up.browser.url()),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-reveal"),!0),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.history=u.option(e.history,u.castedAttr(n,"up-history"),!0),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.method=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),e.headers=u.option(e.headers,{}),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.data=u.requestDataFromForm(n),e=u.merge(e,up.motion.animateOptions(e,n)),e.validate&&(e.headers||(e.headers={}),e.transition=!1,e.failTransition=!1,e.headers[up.protocol.config.validateHeader]=e.validate),up.bus.whenEmitted("up:form:submit",{$element:n}).then(function(){var t;return up.feedback.start(n),up.browser.canPushState()||e.history===!1?(t=up.replace(r,o,e),u.always(t,function(){return up.feedback.stop(n)}),t):(n.get(0).submit(),u.unresolvablePromise())})},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($element,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option(u.presentAttr($element,"up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),$fields=fieldSelector().selectInSubtree($element),destructors=u.map($fields,function(t){return observeField($(t),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},autosubmit=function(t,e){return observe(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return submit(n)})})},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),u.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!1),e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},switcherValues=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(e.target,n.attr("up-switch")),u.isPresent(o)||up.fail("No switch target given for %o",n.get(0)),r=switcherValues(n),$(o).each(function(){return switchTarget($(this),r)})},switchTarget=function(t,e){var n,r,o,i;return n=$(t),e||(e=switcherValues(findSwitcherForTarget(n))),(r=n.attr("up-hide-for"))?(r=r.split(" "),o=0===u.intersect(e,r).length):(i=(i=n.attr("up-show-for"))?i.split(" "):[":present",":checked"],o=u.intersect(e,i).length>0),n.toggle(o),n.addClass("up-switched")},findSwitcherForTarget=function(t){var e,n;return e=$("[up-switch]"),n=u.detect(e,function(e){var n;return n=$(e).attr("up-switch"),t.is(n)}),n?$(n):u.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),u.muteRejection(submit(e))}),up.on("change","[up-validate]",function(t,e){return u.muteRejection(validate(e))}),up.compiler("[up-switch]",function(t){return switchTargets(t)}),up.on("change","[up-switch]",function(t,e){return switchTargets(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return switchTarget(t)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.compiler("[up-autosubmit]",function(t){return autosubmit(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets,autosubmit:autosubmit,fieldSelector:fieldSelector}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function($){var align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,isOpen,preloadNow,reset,state,toggleAsap,u,unveilFrame;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$popup)&&t.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var t,e,n;switch(t={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(e=state.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=u.measure(state.$anchor),state.position){case"bottom-right":t.top=e.top+e.height,t.left=e.left+e.width-n.width;break;case"bottom-left":t.top=e.top+e.height,t.left=e.left;break;case"top-right":t.top=e.top-n.height,t.left=e.left+e.width-n.width;break;case"top-left":t.top=e.top-n.height,t.left=e.left;break;default:up.fail("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(t)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t){var e;return e=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),state.$popup=e},unveilFrame=function(){return state.$popup.show()},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(t,e){return chain.asap(closeNow,function(){return attachNow(t,e)})},attachNow=function(t,e){var n,r,o,i,s,a,l;return n=$(t),n.length||up.fail("Cannot attach popup to non-existing element %o",t),e=u.options(e),l=u.option(u.pluckKey(e,"url"),n.attr("up-href"),n.attr("href")),i=u.option(u.pluckKey(e,"html")),l||i||up.fail("up.popup.attach() requires either an { url } or { html } option"),a=u.option(u.pluckKey(e,"target"),n.attr("up-popup"))||up.fail("No target selector given for [up-popup]"),s=u.option(e.position,n.attr("up-position"),config.position),e.animation=u.option(e.animation,n.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(n,"up-sticky"),config.sticky),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(n,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,n.attr("up-confirm")),e.method=up.link.followMethod(n,e),e.layer="popup",e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.provideTarget=function(){return createHiddenFrame(a)},r=up.motion.animateOptions(e,n,{duration:config.openDuration,easing:config.openEasing}),o=u.merge(e,{animation:!1}),e.preload&&l?up.replace(a,l,e):up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:popup:open",{url:l,message:"Opening popup"}).then(function(){var t;return state.phase="opening",state.$anchor=n,state.position=s,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=e.sticky,t=i?up.extract(a,i,o):up.replace(a,l,o),t=t.then(function(){return align(),unveilFrame(),up.animate(state.$popup,e.animation,r)}),t=t.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e;return isOpen()?(t=u.options(t,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),e=up.motion.animateOptions(t,{duration:config.closeDuration,easing:config.closeEasing}),u.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,t).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},preloadNow=function(t,e){return e=u.options(e),e.preload=!0,attachNow(t,e)},toggleAsap=function(t,e){return t.is(".up-current")?closeAsap():attachAsap(t,e)},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return toggleAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click up:action:consumed",function(t){var e;return e=$(t.target),e.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(t.origin&&contains(t.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click",".up-popup [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,preloadNow,reset,shiftElements,state,templateHtml,u,unshiftElements,unveilFrame,visitAsap;return u=up.util,config=u.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$modal)&&t.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var t;return t=flavorDefault("template"),u.evalOption(t,{closeLabel:flavorDefault("closeLabel")})},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t,e){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),u.isPresent(state.position)&&o.attr("up-position",state.position),r=o.find(".up-modal-dialog"),u.isPresent(e.width)&&r.css("width",e.width),u.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),u.isPresent(e.height)&&r.css("height",e.height),state.closable||o.find(".up-modal-close").remove(),n=o.find(".up-modal-content"),u.$createPlaceholder(t,n),o.hide(),o.appendTo(document.body),state.$modal=o},unveilFrame=function(){return state.$modal.show()},shiftElements=function(){var t,e,n,r,o;return u.documentHasVerticalScrollbar()?(t=$("body"),r=u.scrollbarWidth(),e=parseFloat(t.css("padding-right")),n=r+e,o=u.temporaryCss(t,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var t,e,n,o;return t=$(this),e=parseFloat(t.css("right")),n=r+e,o=u.temporaryCss(t,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var t,e;for(t=[];e=state.unshifters.pop();)t.push(e());return t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(t,e){return e=u.options(e),e.$link=$(t),openAsap(e)},preloadNow=function(t,e){return e=u.options(e),e.$link=t,e.preload=!0,openNow(e)},visitAsap=function(t,e){return e=u.options(e),e.url=t,openAsap(e)},extractAsap=function(t,e,n){return n=u.options(n),n.html=e,n.history=u.option(n.history,!1),n.target=t,openAsap(n)},openAsap=function(t){return chain.asap(closeNow,function(){return openNow(t)})},openNow=function(t){var e,n,r,o,i;return t=u.options(t),e=u.option(u.pluckKey(t,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(t,"url"),e.attr("up-href"),e.attr("href")),r=u.option(u.pluckKey(t,"html")),o=u.option(u.pluckKey(t,"target"),e.attr("up-modal"),"body"),t.flavor=u.option(t.flavor,e.attr("up-flavor"),config.flavor),t.position=u.option(t.position,e.attr("up-position"),flavorDefault("position",t.flavor)),t.position=u.evalOption(t.position,{$link:e}),t.width=u.option(t.width,e.attr("up-width"),flavorDefault("width",t.flavor)),t.maxWidth=u.option(t.maxWidth,e.attr("up-max-width"),flavorDefault("maxWidth",t.flavor)),t.height=u.option(t.height,e.attr("up-height"),flavorDefault("height")),t.animation=u.option(t.animation,e.attr("up-animation"),flavorDefault("openAnimation",t.flavor)),t.animation=u.evalOption(t.animation,{position:t.position}),t.backdropAnimation=u.option(t.backdropAnimation,e.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",t.flavor)),t.backdropAnimation=u.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=u.option(t.sticky,u.castedAttr(e,"up-sticky"),flavorDefault("sticky",t.flavor)),t.closable=u.option(t.closable,u.castedAttr(e,"up-closable"),flavorDefault("closable",t.flavor)),t.confirm=u.option(t.confirm,e.attr("up-confirm")),t.method=up.link.followMethod(e,t),t.layer="modal",t.failTarget=u.option(t.failTarget,e.attr("up-fail-target")),t.failLayer=u.option(t.failLayer,e.attr("up-fail-layer"),"auto"),n=up.motion.animateOptions(t,e,{duration:flavorDefault("openDuration",t.flavor),easing:flavorDefault("openEasing",t.flavor)}),t.history=u.option(t.history,u.castedAttr(e,"up-history"),flavorDefault("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return createHiddenFrame(o,t)},t.preload?up.replace(o,i,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var e,s;return state.phase="opening",state.flavor=t.flavor,state.sticky=t.sticky,state.closable=t.closable,state.position=t.position,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e=u.merge(t,{animation:!1}),s=r?up.extract(o,r,e):up.replace(o,i,e),s=s.then(function(){return shiftElements(),unveilFrame(),animate(t.animation,t.backdropAnimation,n)}),s=s.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e,n,r,o;return t=u.options(t),isOpen()?(o=u.option(t.animation,flavorDefault("closeAnimation")),o=u.evalOption(o,{position:state.position}),n=u.option(t.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),e=up.motion.animateOptions(t,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(t,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var t;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,t=animate(o,n,e),t=t.then(function(){return up.destroy(state.$modal,r)}),t=t.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,state.closable=null,state.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},markAsAnimating=function(t){return null==t&&(t=!0),state.$modal.toggleClass("up-modal-animating",t)},animate=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(markAsAnimating(),r=Promise.all([up.animate(state.$modal.find(".up-modal-viewport"),t,n),up.animate(state.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},flavor=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),u.assign(flavorOverrides(t),e)},flavorOverrides=function(t){return flavors[t]||(flavors[t]={})},flavorDefault=function(t,e){var n;return null==e&&(e=state.flavor),e&&(n=flavorOverrides(e)[t]),u.isMissing(n)&&(n=config[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return followAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click",".up-modal",function(t){
|
4
|
-
|
1
|
+
(function(){window.up={version:"0.54.0",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$,F,D,C,O,R,U,N,M,L,H,K,q,j,_,V,z,I,W,Q,B,J,X,G,Z,Y,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe,he,de,me,ve,ge,ye,be,we,ke,Se,Te,Ee,Ae,xe,Pe,$e,Fe,De,Ce,Oe,Re,Ue,Ne,Me,Le,He,Ke,qe,je,_e,Ve,ze,Ie,We,Qe,Be,Je,Xe,Ge,Ze,Ye,tn,en,nn,rn,on,un,sn,an,ln,cn,pn,fn,hn,dn,mn,vn;return Pe=r.noop,ge=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},se=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},Fe=function(t,e){var n,r,o;return r=He(t),n=r.protocol+"//"+r.hostname,se(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.hash:void 0)===!0&&(n+=r.hash),(null!=e?e.search:void 0)!==!1&&(n+=r.search),n},I=function(t){var e;return e=He(location.href),t=He(t),e.protocol!==t.protocol||e.host!==t.host},He=function(t){var e;return t=fn(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),V(e.hostname)&&(e.href=e.href),e)},$e=function(t){return t?t.toUpperCase():"GET"},we=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,c,p,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,f=c=0,d=v.length;d>c;f=++c){for(s=v[f],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;m>h;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===f&&(o=e),n=e}return o},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},nn=function(t){var e,n,o,i,u,s,a,l,c,p,f;if(e=r(t),c=void 0,p=e.prop("tagName").toLowerCase(),f=je(e.attr("up-id")))c=m("up-id",f);else if(u=je(e.attr("id")))c=u.match(/^[a-z0-9\-_]+$/i)?"#"+u:m("id",u);else if(l=je(e.attr("name")))c=p+m("name",l);else if(o=je(xe(e)))for(c="",i=0,a=o.length;a>i;i++)s=o[i],c+="."+s;else c=(n=je(e.attr("aria-label")))?m("aria-label",n):p;return c},m=function(t,e){return e=e.replace(/"/g,'\\"'),"["+t+'="'+e+'"]'},xe=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Ye(n,function(t){return ie(t)&&!t.match(/^up-/)})},T=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},d=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;o>n;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},h=Object.assign||d,pn=r.trim,$=function(t,e){var n,r,o,i,u;for(u=[],r=n=0,i=t.length;i>n;r=++n)o=t[r],u.push(e(o,r));return u},de=$,ln=function(t,e){var n,r,o,i;for(i=[],r=n=0,o=t-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(e(r));return i},ee=function(t){return null===t},ce=function(t){return void 0===t},W=function(t){return!ce(t)},te=function(t){return ce(t)||ee(t)},Z=function(t){return!te(t)},V=function(t){return te(t)||re(t)&&0===Object.keys(t).length||0===t.length},je=function(t,e){return null==e&&(e=ie),e(t)?t:void 0},ie=function(t){return!V(t)},G=function(t){return"function"==typeof t},ae=function(t){return"string"==typeof t||t instanceof String},ne=function(t){return"number"==typeof t||t instanceof Number},oe=function(t){return!("object"!=typeof t||ee(t)||Y(t)||ue(t)||X(t)||_(t))},re=function(t){var e;return e=typeof t,"object"===e&&!ee(t)||"function"===e},B=function(t){return!(!t||1!==t.nodeType)},Y=function(t){return t instanceof jQuery},ue=function(t){return re(t)&&G(t.then)},_=Array.isArray,X=function(t){return t instanceof FormData},cn=function(t){return Array.prototype.slice.call(t)},k=function(t){return _(t)?t=t.slice():re(t)&&!G(t)?t=h({},t):up.fail("Cannot copy %o",t),t},fn=function(t){return Y(t)?t.get(0):t},ye=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],h.apply(null,[{}].concat(t.call(e)))},Le=function(t,e){var n,r,o,i;if(o=t?k(t):{},e)for(r in e)n=e[r],i=o[r],Z(i)?re(n)&&re(i)&&(o[r]=Le(i,n)):o[r]=n;return o},Me=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],x(e,Z)},x=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=n;break}return i},p=function(t,e){var n,r,o,i;for(i=!1,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=!0;break}return i},l=function(t,e){var n,r,o,i;for(i=!0,r=0,o=t.length;o>r;r++)if(n=t[r],!e(n)){i=!1;break}return i},y=function(t){return Ye(t,Z)},hn=function(t){var e;return e={},Ye(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Ye=function(t,e){var n;return n=[],$(t,function(t){return e(t)?n.push(t):void 0}),n},Ie=function(t,e){return Ye(t,function(t){return!e(t)})},j=function(t,e){return Ye(t,function(t){return w(e,t)})},_e=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),x(o,ie)},un=function(t,e){return setTimeout(e,t)},Ae=function(t){return setTimeout(t,0)},ke=function(t){return Promise.resolve().then(t)},he=function(t){return t[t.length-1]},g=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ze=ge(function(){var t,e,n;return t=r("<div>"),t.attr("up-viewport",""),t.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),P=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=t.css("overflow-y"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Oe=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},an=function(t,e,n){var o,i,u;return o=r(t),u=o.css(Object.keys(e)),o.css(e),i=function(){return o.css(u)},n?(n(),i()):Oe(i)},L=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),V(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},H=function(t){return t=fn(t),t.offsetHeight},E=function(){},me=function(t){var e,n;return e=r(t),n=e.css(["margin-top","margin-right","margin-bottom","margin-left"]),{top:parseFloat(n["margin-top"]),right:parseFloat(n["margin-right"]),bottom:parseFloat(n["margin-bottom"]),left:parseFloat(n["margin-left"])}},ve=function(t,e){var n,o,i,u,s,a;return e=Le(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=me(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},S=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],u.push(n.specified?e.attr(n.name,n.value):void 0);return u},en=function(t,e){return t.find(e).addBack(e)},tn=function(t,e){var n,r;return r=en(t,e),n=t.parents(e),r.add(n)},D=function(t){return 27===t.keyCode},w=function(t,e){return t.indexOf(e)>=0},v=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Re=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(e[u]=o[u]);return e},O=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=k(o),n=0,r=i.length;r>n;n++)u=i[n],delete e[u];return e},pe=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},fe=function(t){var e;return e=ce(t.button)||0===t.button,e&&pe(t)},dn=function(){return new Promise(Pe)},De=function(){return r()},on=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],r.push(te(t.attr(n))?t.attr(n,o):void 0);return r},Qe=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},Se=function(t){var e,n,o,i,u,s,a;for(u={},a=[],n=[],o=0,i=t.length;i>o;o++)s=t[o],ae(s)?a.push(s):n.push(s);return u.parsed=n,a.length&&(e=a.join(", "),u.parsed.push(e)),u.select=function(){return u.find(void 0)},u.find=function(t){var e,n,o,i,s,a;for(n=De(),s=u.parsed,o=0,i=s.length;i>o;o++)a=s[o],e=t?t.find(a):r(a),n=n.add(e);return n},u.selectInSubtree=function(t){var e;return e=u.find(t),u.doesMatch(t)&&(e=e.add(t)),e},u.doesMatch=function(t){var e;return e=r(t),p(u.parsed,function(t){return e.is(t)})},u.seekUp=function(t){var e,n,o;for(o=r(t),e=o,n=void 0;e.length;){if(u.doesMatch(e)){n=e;break}e=e.parent()}return n||De()},u},C=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],G(n)?n.apply(null,e):n},b=function(t){var e;return e=Ne(t),Object.preventExtensions(e),e},Ne=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,G(n)&&(n=n()),h(e,n)},e.reset(),e},mn=function(t){var e,n;return t=fn(t),e=t.parentNode,n=cn(t.childNodes),$(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Ce=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},J=function(t){var e,n;for(e=r(t);;){if(n=e.css("position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},N=function(t,e){var n,o,i,u;return n=r(t),o=Ce(n),i=n.position(),u=o.offset(),n.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},Je=function(t){var e,n,r,o,i,u,s;if(_(t),X(t))return up.fail("Cannot convert FormData into an array");for(u=Xe(t),e=[],s=u.split("&"),n=0,r=s.length;r>n;n++)i=s[n],ie(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},Xe=function(t,e){var n;if(e=Le(e,{purpose:"url"}),ae(t))return t.replace(/^\?/,"");if(X(t))return up.fail("Cannot convert FormData into a query string");if(ie(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},Ge=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),ie(o)&&f(s,o,i),s},f=function(t,e,n,r){var o;return t||(t=[]),_(t)?t.push({name:e,value:n}):X(t)?t.append(e,n):re(t)?t[e]=n:ae(t)&&(o=Xe([{name:e,value:n}],r),t=[t,o].join("&")),t},be=function(t,e){return $(Je(e),function(e){return t=f(t,e.name,e.value)}),t},U=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],_(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),vn().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&","<":"<",">":">",'"':"""},F=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},qe=function(t,e){var n;return n=t[e],delete t[e],n},Be=function(t,e,n){return t[n]=qe(t,e)},Ke=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},R=function(t){var e;return e=he(t),oe(e)?t.pop():{}},Ue=function(t){var e;return e=r(t).css("opacity"),Z(e)?parseFloat(e):void 0},vn=ge(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),q=function(t){return t},Q=function(t){return t=fn(t),!jQuery.contains(document.documentElement,t)},Ve=function(e){var n,r;return n=Ee(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},s=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=he(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;return!this.currentTask&&(this.currentTask=this.queue.shift())?(t=this.currentTask(),c(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))):void 0},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=de(e,Ve),this.poke(),this.promise()},e}(),sn=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},rn=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return de(e,function(t){return t()})}},ze=function(t){var e,n;return n=void 0,e=new Promise(function(e){return n=un(t,e)}),e.cancel=function(){return clearTimeout(n)},e},K=function(t){var e,n,r,o;return e=ve(t),r=g(),n=e.left+.5*e.width,o=.5*r.width,o>n?"left":"right"},A=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},M=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;n++)o=t[n],_(o)?e=e.concat(o):e.push(o);return e},le=function(t){return!!t},c=function(t,e){return t.then(e,e)},Te=function(t){return null!=t?t["catch"](Pe):void 0},Ee=function(){var t,e;return e=void 0,Ie=void 0,t=new Promise(function(t,n){return e=t,Ie=n}),t.resolve=e,t.reject=Ie,t.promise=function(){return t},t},We=function(t){var e;try{return t()}catch(n){return e=n,Promise.reject(e)}},z=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Je,requestDataAsQuery:Xe,appendRequestData:f,mergeRequestData:be,requestDataFromForm:Ge,offsetParent:Ce,fixedToAbsolute:N,isFixed:J,presentAttr:_e,parseUrl:He,normalizeUrl:Fe,normalizeMethod:$e,methodAllowsPayload:we,createElementFromHtml:T,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:nn,assign:h,assignPolyfill:d,copy:k,merge:ye,options:Le,option:Me,fail:U,each:$,map:de,times:ln,any:p,all:l,detect:x,select:Ye,reject:Ie,intersect:j,compact:y,uniq:hn,last:he,isNull:ee,isDefined:W,isUndefined:ce,isGiven:Z,isMissing:te,isPresent:ie,isBlank:V,presence:je,isObject:re,isFunction:G,isString:ae,isNumber:ne,isElement:B,isJQuery:Y,isPromise:ue,isOptions:oe,isArray:_,isFormData:X,isUnmodifiedKeyEvent:pe,isUnmodifiedMouseEvent:fe,nullJQuery:De,unJQuery:fn,setTimer:un,nextFrame:Ae,measure:ve,temporaryCss:an,cssAnimate:E,forceCompositing:L,forceRepaint:H,escapePressed:D,copyAttributes:S,selectInSubtree:en,selectInDynasty:tn,contains:w,toArray:cn,castedAttr:v,clientSize:g,only:Re,except:O,trim:pn,unresolvablePromise:dn,setMissingAttrs:on,remove:Qe,memoize:ge,scrollbarWidth:Ze,documentHasVerticalScrollbar:P,config:b,openConfig:Ne,unwrapElement:mn,multiSelector:Se,error:U,pluckData:Ke,pluckKey:qe,renameKey:Be,extractOptions:R,isDetached:Q,noop:Pe,opacity:Ue,whenReady:vn,identity:q,escapeHtml:F,DivertibleChain:s,submittedValue:sn,sequence:rn,promiseTimer:ze,previewable:Ve,evalOption:C,horizontalScreenHalf:K,detachWith:A,flatten:M,isTruthy:le,newDeferred:Ee,always:c,muteRejection:Te,rejectOnError:We,isBodyDescendant:z,isCrossDomain:I,microtask:ke}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return this.config.cachable?this.config.cachable(t):!0},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix?(t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)):void 0},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;return o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;return o=t.store[e],i=o.timestamp,!r||r>i?(n=e,r=i):void 0}}(this)),n)?delete this.store[n]:void 0},r.prototype.alias=function(e,n){var r;return r=this.get(e,{silent:!0}),t.isDefined(r)?this.set(n,r):void 0},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;return this.isEnabled()&&this.isCachable(t)?(this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}):void 0},r.prototype.remove=function(t){var e;return this.isCachable(t)?(e=this.normalizeStoreKey(t),delete this.store[e]):void 0},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),e?(n=this.timestamp()-t.timestamp,e>n):!0},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.hungrySteps=e(this.hungrySteps,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.options.transition=t.option(this.options.transition,this.options.animation),this.options.hungry=t.option(this.options.hungry,!0),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=t.option(up.dom.config.fallbackTransition,e.options.transition)),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return this.options.provideTarget?this.plans[0].selector:(t=this.oldPlan())?t.selector:this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?t.steps.concat(this.hungrySteps()):this.matchingPlanNotFound()},n.prototype.hungrySteps=function(){var e,n,r,o,i,u,s,a,l;if(a=[],this.options.hungry)for(e=up.radio.hungrySelector().select(),i=0,u=e.length;u>i;i++)o=e[i],n=$(o),s=t.selectorForElement(n),(r=this.options.response.first(s))&&(l=t.option(up.radio.config.hungryTransition,this.options.transition),a.push({selector:s,$old:n,$new:r,transition:l,reveal:!1,origin:null}));return a},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.parseSteps=e(this.parseSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this),this.reveal=n.reveal,this.origin=n.origin,this.selector=up.dom.resolveSelector(t,this.origin),this.transition=n.transition,this.response=n.response,this.oldLayer=n.layer,this.parseSteps()}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.parseSteps=function(){var e,n;return e=/\ *,\ */,this.steps=[],n=this.selector.split(e),t.each(n,function(t){return function(e,n){var r,o,i,u;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],r=0===n?t.reveal:!1,t.steps.push({selector:u,pseudoClass:i,transition:t.transition,origin:t.origin,reveal:r})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;return null===this.scheduledValue||this.currentTimer||this.currentCallback?void 0:(this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this)))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;return t=this.readFieldValue(),this.isNewValue(t)?(this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()):void 0},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function r(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return r.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},r.prototype.onMousedown=function(t,e){return up.link.shouldProcessEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},r.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},r.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onClick.apply(e,r))}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onMousedown.apply(e,r))}}(this))},r.prototype.followLink=function(t,e){return null==e&&(e={}),up.bus.whenEmitted("up:link:follow",{$element:t}).then(function(n){return function(){return up.feedback.start(t,e,function(){return n.followNow(t,e)})}}(this))},r.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},r.prototype.matchesLink=function(t){return t.is(this.fullSelector())},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkElement=e(this.unmarkElement,this),this.markElement=e(this.markElement,this),this.whenElementFinished=e(this.whenElementFinished,this),this.finishOneElement=e(this.finishOneElement,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.className="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.className,this.finishEvent="up:"+t+":finish"}return n.prototype.claim=function(t,e){return this.finish(t).then(function(n){return function(){return n.start(t,e)}}(this))},n.prototype.start=function(t,e){var n;return n=e(t),this.markElement(t,n),n.then(function(e){return function(){return e.unmarkElement(t)}}(this)),n},n.prototype.finish=function(e){var n,r;return n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.finishOneElement=function(t){var e;return e=$(t),e.trigger(this.finishEvent),this.whenElementFinished(e)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markElement=function(t,e){return t.addClass(this.className),t.data(this.dataKey,e)},n.prototype.unmarkElement=function(t){return t.removeClass(this.className),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferSearchToData=e(this.transferSearchToData,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),t.methodAllowsPayload(this.method)?this.transferSearchToData():this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return this.data&&!t.isFormData(this.data)?(e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0):void 0},o.prototype.transferSearchToData=function(){var e,n;return n=t.parseUrl(this.url),e=n.search,e?(this.data=t.mergeRequestData(this.data,e),this.url=t.normalizeUrl(n,{search:!1})):void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,c,p,f,h;l=new XMLHttpRequest,p=t.copy(e.headers),c=e.data,f=e.method,h=e.url,u=up.proxy.wrapMethod(f,c),f=u[0],c=u[1],t.isFormData(c)?delete p["Content-Type"]:t.isPresent(c)?(c=t.requestDataAsQuery(c,{purpose:"form"}),p["Content-Type"]="application/x-www-form-urlencoded"):c=null,e.target&&(p[up.protocol.config.targetHeader]=e.target),e.failTarget&&(p[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||p["X-Requested-With"]||(p["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(p[up.protocol.config.csrfHeader]=o),l.open(f,h);for(i in p)a=p[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(c)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return this.transferSearchToData(),e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)
|
2
|
+
}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canConsole,canCssTransition,canDOMParser,canFormData,canInputEvent,canPromise,canPushState,hash,isIE10OrWorse,isRecentJQuery,isSupported,navigate,polyfilledSessionStorage,popCookie,puts,sessionStorage,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,navigate=function(t,e){var n;return null==e&&(e={}),n=new up.Request(u.merge(e,{url:t})),n.navigate()},submitForm=function(t){return t.submit()},puts=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],console[e].apply(console,t)},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(t){var e,n,r,o,i,s,a,l,c;if(s=200,r="",u.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(t))l="undefined";else if(u.isNumber(t)||u.isFunction(t))l=t.toString();else if(u.isArray(t))l="["+u.map(t,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(t))l="$("+u.map(t,stringifyArg).join(", ")+")",r=")";else if(u.isElement(t)){for(e=$(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],o=0,i=a.length;i>o;o++)n=a[o],(c=e.attr(n))&&(l+=" "+n+'="'+c+'"');l+=">",r=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=r),l},sprintf=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,e].concat(slice.call(t)))},sprintfWithFormattedArgs=function(){var t,e,n,r;return e=arguments[0],r=arguments[1],t=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=t[n],r=e(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE10OrWorse=u.memoize(function(){return!window.atob}),canPushState=function(){return u.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},canCssTransition=function(){return"transition"in document.documentElement.style},canInputEvent=function(){return"oninput"in document.createElement("input")},canPromise=function(){return!!window.Promise},canFormData=function(){return!!window.FormData},canDOMParser=function(){return!!window.DOMParser},canConsole=function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd},isRecentJQuery=function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9},popCookie=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,u.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(t){return t.preload||u.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},isSupported=function(){return!isIE10OrWorse()&&isRecentJQuery()&&canConsole()&&canDOMParser()&&canFormData()&&canCssTransition()&&canInputEvent()&&canPromise()},sessionStorage=u.memoize(function(){try{return window.sessionStorage}catch(t){return polyfilledSessionStorage()}}),polyfilledSessionStorage=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},hash=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),u.presence(t)},{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,navigate:navigate,submitForm:submitForm,canPushState:canPushState,whenConfirmed:whenConfirmed,isSupported:isSupported,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage,popCookie:popCookie,hash:hash,canPushState:canPushState}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,fixRenamedEvents,forgetUpDescription,haltEvent,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,renamedEvent,renamedEvents,resetBus,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,renamedEvents={},upListenerToJqueryListener=function(t){return function(e){var n;return n=e.$element||$(this),t.apply(n.get(0),[e,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(t,e){var n,r,o;return n=u.copy(t),fixRenamedEvents(n),o=n.pop(),r=void 0,e?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},fixRenamedEvents=function(t){var e;return e=t[0].split(/\s+/),e=u.map(e,function(t){var e;return(e=renamedEvents[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},live=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(t=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(e=$(document)).on.apply(e,t),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],t=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(e=$(document)).off.apply(e,t)},rememberUpDescription=function(t){var e;return e=upDescriptionNumber(t),liveUpDescriptions[e]=t},forgetUpDescription=function(t){var e;return e=upDescriptionNumber(t),delete liveUpDescriptions[e]},upDescriptionNumber=function(t){return u.last(t)._descriptionNumber},emit=function(t,e){var n,r;return null==e&&(e={}),r=$.Event(t,e),(n=e.$element)?delete e.$element:n=$(document),logEmission(t,e),n.trigger(r),r},logEmission=function(t,e){var n,r,o;return e.hasOwnProperty("message")?(n=e.message,delete e.message,n!==!1&&(u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n)?u.isPresent(e)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[t],[e])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[t])):void 0):u.isPresent(e)?up.puts("Emitted event %s (%o)",t,e):up.puts("Emitted event %s",t)},nobodyPrevents=function(){var t,e;return t=1<=arguments.length?slice.call(arguments,0):[],e=emit.apply(null,t),!e.isDefaultPrevented()},whenEmitted=function(){var t;return t=1<=arguments.length?slice.call(arguments,0):[],new Promise(function(e,n){return nobodyPrevents.apply(null,t)?e():n(new Error("Event "+t[0]+" was prevented"))})},onEscape=function(t){return live("keydown","body",function(e){return u.escapePressed(e)?t(e):void 0})},haltEvent=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},consumeAction=function(t){return haltEvent(t),"up:action:consumed"!==t.type?emit("up:action:consumed",{$element:$(t.target),message:!1}):void 0},snapshot=function(){var t,e,n;n=[];for(e in liveUpDescriptions)t=liveUpDescriptions[e],n.push(t.isDefault=!0);return n},resetBus=function(){var t,e,n,r,o,i;e=[];for(o in liveUpDescriptions)t=liveUpDescriptions[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(unbind.apply(null,t));return i},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},renamedEvent=function(t,e){return renamedEvents[t]=e},boot=function(){return up.browser.isSupported()?(emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",resetBus),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,haltEvent:haltEvent,consumeAction:consumeAction,renamedEvent:renamedEvent,boot:boot}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)||t.responseURL},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),up.bus.on("up:framework:booted",o),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var t=[].slice;up.log=function(){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m;return d=up.util,n=up.browser,e="up.log.enabled",r=d.config({prefix:"[UP] ",enabled:"true"===n.sessionStorage().getItem(e),collapse:!1}),f=function(){return r.reset()},l=function(t){return""+r.prefix+t},o=function(){var e,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r.enabled&&o?n.puts.apply(n,["debug",l(o)].concat(t.call(e))):void 0},p=function(){var e,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r.enabled&&o?n.puts.apply(n,["log",l(o)].concat(t.call(e))):void 0},m=function(){var e,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r?n.puts.apply(n,["warn",l(r)].concat(t.call(e))):void 0},a=function(){var e,o,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o=e.pop(),!r.enabled||!i)return o();u=r.collapse?"groupCollapsed":"group",n.puts.apply(n,[u,l(i)].concat(t.call(e)));try{return o()}finally{i&&n.puts("groupEnd")}},s=function(){var e,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r?n.puts.apply(n,["error",l(r)].concat(t.call(e))):void 0},c=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=r.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",n.puts("log",t)},up.on("up:framework:boot",c),up.on("up:framework:reset",f),h=function(t){return n.sessionStorage().setItem(e,t.toString()),r.enabled=t},u=function(){return h(!0)},i=function(){return h(!1)},{puts:p,debug:o,error:s,warn:m,group:a,config:r,enable:u,disable:i}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,c,p;return p=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+p.escapeHtml(t)+"</span>"},c=p.config({$toast:null}),l=function(){return i(),c.reset()},s=function(e){return p.isArray(e)?(e[0]=p.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=p.escapeHtml(e),e},u=function(){return!!c.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),c.$toast=a},i=function(){return u()?(c.$toast.remove(),c.$toast=null):void 0},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S;return S=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,p=[],g=[],c=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=S.options(e[0]),d(p,o,r,n)):void 0},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)):void 0},h=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=S.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,f(e)]),i(e,r)},y=function(t){return S.isFunction(t)?t:S.isArray(t)&&S.all(t,S.isFunction)?S.sequence.apply(S,t):void 0},i=function(t,e){var o;return(e=y(e))?(t.addClass(n),o=t.data(r)||function(){return w(t)},o=S.sequence(o,e),t.data(r,o)):void 0},w=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=S.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,p],l=[],o=0,i=a.length;i>o;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;i>o;o++)c=s[o],n=S.selectInSubtree(t,c.selector),r.length&&(n=n.filter(function(){var t;return t=e(this),S.all(r,function(e){return 0===t.closest(e).length})})),a.push(n.length?up.log.group(c.isSystem?void 0:"Compiling '%s' on %d element(s)",c.selector,n.length,function(){return c.batch?u(c,n,n.get()):n.each(function(){return u(c,e(this),this)})}):void 0);return a}());return l})},a=function(t){return b(t)()},b=function(t){var o,i;return o=S.selectInSubtree(t,"."+n),i=S.map(o,function(t){return e(t).data(r)}),i=S.compact(i),S.sequence.apply(S,i)},f=function(t){var n,r;return n=e(t),r=n.attr("up-data"),S.isString(r)&&""!==S.trim(r)?JSON.parse(r):{}},k=function(){var t;return t=function(t){return t.isSystem},p=S.select(p,t),g=S.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",k),{compiler:c,macro:v,compile:l,clean:a,prepareClean:b,data:f}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,d=function(){return n.reset(),c=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(c=u,u=void 0),u=t},h=function(t){return i("replaceState",t)},p=function(t,e){return e=v.options(e,{force:!1}),t=s(t),!e.force&&o(t)||!up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t})?void 0:i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return up.browser.canPushState()&&n.enabled?(i=e(),window.history[t](i,"",o),a(r()),!0):!1},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",d),{config:n,push:p,replace:h,url:r,isUrl:o,previousUrl:function(){return c},normalizeUrl:s}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var anchoredRight,config,finishScrolling,firstHashTarget,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealHash,revealOrRestoreScroll,revealSelector,saveScroll,scroll,scrollAbruptlyNow,scrollTopKey,scrollTops,scrollWithAnimateNow,scrollableElementForViewport,scrollingTracker,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=new up.Cache({size:30,key:up.history.normalizeUrl}),scrollingTracker=new up.MotionTracker("scrolling"),reset=function(){return config.reset(),lastScrollTops.clear(),scrollingTracker.finish()},scroll=function(t,e,n){var r;return r=scrollableElementForViewport(t),n=u.options(n),n.duration=u.option(n.duration,config.duration),n.easing=u.option(n.easing,config.easing),finishScrolling(r).then(function(){return up.motion.isEnabled()&&n.duration>0?scrollWithAnimateNow(r,e,n):scrollAbruptlyNow(r,e)})},scrollableElementForViewport=function(t){var e;return e=$(t),e.get(0)===document?$("html, body"):e},scrollWithAnimateNow=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(scrollingTracker.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(scrollingTracker.eventName)}),o},scrollingTracker.claim(t,r)},scrollAbruptlyNow=function(t,e){return t.scrollTop(e),Promise.resolve()},finishScrolling=function(t){var e;return e=scrollableElementForViewport(t),scrollingTracker.finish(e)},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||up.fail("Fixed element %o must have a CSS attribute %s",n.get(0),e),parseFloat(r)+n.height()},e=function(){var t,e,o,i;for(o=$(config.fixedTop.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"top"));return i}(),t=function(){var t,e,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n;return n=$(t).first(),up.puts("Revealing fragment %o",n.get(0)),e=u.options(e),u.rejectOnError(function(){var t,r,o,i,s,a,l,c,p,f,h,d,m;return t=e.viewport?$(e.viewport):viewportOf(n),h=u.option(e.snap,config.snap),m=t.is(document),d=m?u.clientSize().height:t.outerHeight(),c=t.scrollTop(),s=c,l=void 0,a=void 0,m?(a=measureObstruction(),l=0):(a={top:0,bottom:0},l=c),p=function(){return s+a.top},f=function(){return s+d-a.bottom-1},r=u.measure(n,{relative:t,includeMargin:!0}),o=r.top+l,i=o+Math.min(r.height,config.substance)-1,i>f()&&(s+=i-f()),(o<p()||e.top)&&(s=o-a.top),h>s&&r.top<.5*d&&(s=0),s!==c?scroll(t,s,e):Promise.resolve()})},revealHash=function(){var t,e;return(e=up.browser.hash())&&(t=firstHashTarget(e))?reveal(t):Promise.resolve()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t,e){var n,r;return null==e&&(e={}),n=$(t),r=viewportSelector().seekUp(n),0===r.length&&e.strict!==!1&&up.fail("Could not find viewport for %o",n),r},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().selectInSubtree(e)},viewports=function(){return viewportSelector().select()},scrollTopKey=function(t){var e;return e=$(t),e.is(document)?"document":u.selectorForElement(e)},scrollTops=function(){var t,e,n,r,o;for(o={},r=config.viewports,e=0,n=r.length;n>e;e++)t=r[e],$(t).each(function(){var t,e,n;return t=$(this),e=scrollTopKey(t),n=t.scrollTop(),o[e]=n});return o},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),r=e.add(n)):r=viewports(),o=lastScrollTops.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=u.map(r,function(t){var e,n;return e=scrollTopKey(t),n=o[e]||0,scroll(t,n,{duration:0})}),Promise.all(t)})},revealOrRestoreScroll=function(t,e){var n,r,o;return e=u.options(e),n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal&&(r={duration:e.duration},u.isString(e.reveal)&&(o=revealSelector(e.reveal,e),n=up.first(o)||n,r.top=!0),n.length)?reveal(n,r):Promise.resolve()},revealSelector=function(t,e){return t=up.dom.resolveSelector(t,e.origin),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},firstHashTarget=function(t){return(t=up.browser.hash(t))?up.first("[id='"+t+"'], a[name='"+t+"']"):void 0},up.on("up:app:booted",revealHash),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,revealHash:revealHash,firstHashTarget:firstHashTarget,scroll:scroll,config:config,viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function($){var autofocus,bestMatchingSteps,bestPreflightSelector,config,destroy,detectScriptFixes,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,first,firstInLayer,firstInPriority,fixScripts,hello,isRealElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,shouldSwapElementsDirectly,source,swapElements,swapElementsDirectly,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:null}),reset=function(){return config.reset()},setSource=function(t,e){var n;return n=$(t),u.isPresent(e)&&(e=u.normalizeUrl(e)),n.attr("up-source",e)},source=function(t){var e;return e=$(t).closest("[up-source]"),u.presence(e.attr("up-source"))||up.browser.url()},resolveSelector=function(t,e){var n,r;return u.isString(t)?(r=t,u.contains(r,"&")&&(u.isPresent(e)?(n=u.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=u.selectorForElement(t),r},replace=function(t,e,n){var r,o,i,s,a,l,c,p,f,h;if(n=u.options(n),n.inspectResponse=i=function(){return up.browser.navigate(e,u.only(n,"method","data"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||i(),u.unresolvablePromise();h=u.merge(n,{humanizedTarget:"target"}),o=u.merge(n,{humanizedTarget:"failure target",provideTarget:void 0,restoreScroll:!1}),u.renameKey(o,"failTransition","transition"),u.renameKey(o,"failLayer","layer"),u.renameKey(o,"failReveal","reveal");try{a=bestPreflightSelector(t,h),s=bestPreflightSelector(n.failTarget,o)}catch(d){return r=d,Promise.reject(r)}return f={url:e,method:n.method,data:n.data,target:a,failTarget:s,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout},c=function(t){return processResponse(!0,a,t,h)},l=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=processResponse(!1,s,t,o),u.always(e,n))},p=up.request(f),n.preload||(p=p.then(c,l)),p},processResponse=function(t,e,n,r){var o,i,s,a,l;return a=n.request,l=n.url,i=l,o=a.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),s="GET"===n.method,t?s?(r.history===!1||u.isString(r.history)||(r.history=i),r.source===!1||u.isString(r.source)||(r.source=l)):(u.isString(r.history)||(r.history=!1),u.isString(r.source)||(r.source="keep")):s?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=l)):(r.history=!1,r.source="keep"),shouldExtractTitle(r)&&n.title&&(r.title=n.title),extract(e,n.text,r)},shouldExtractTitle=function(t){return!(t.title===!1||u.isString(t.title)||t.history===!1&&t.title!==!0)},extract=function(t,e,n){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),n.saveScroll!==!1&&up.layout.saveScroll(),u.rejectOnError(function(){var r,o,i,s,a,l,c;for("function"==typeof n.provideTarget&&n.provideTarget(),s=parseResponseDoc(e),r=bestMatchingSteps(t,s,n),shouldExtractTitle(n)&&(a=s.title())&&(n.title=a),updateHistoryAndTitle(n),c=[],o=0,i=r.length;i>o;o++)l=r[o],up.log.group("Updating %s",l.selector,function(){var t,e;return t=u.merge(n,u.only(l,"origin","reveal")),fixScripts(l.$new),e=swapElements(l.$old,l.$new,l.pseudoClass,l.transition,t),c.push(e)});return Promise.all(c)})})},bestPreflightSelector=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},bestMatchingSteps=function(t,e,n){var r;return n=u.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},fixScripts=function(t){var e,n,r,o,i;for(n=[],detectScriptFixes(t.get(0),n),i=[],r=0,o=n.length;o>r;r++)e=n[r],i.push(e());return i},detectScriptFixes=function(t,e){var n,r,o,i,u,s;if("NOSCRIPT"===t.tagName)return r=document.createElement("noscript"),r.textContent=t.innerHTML,e.push(function(){return t.parentNode.replaceChild(r,t)});if("SCRIPT"===t.tagName)return e.push(function(){return t.parentNode.removeChild(t)});for(u=t.children,s=[],o=0,i=u.length;i>o;o++)n=u[o],s.push(detectScriptFixes(n,e));return s},parseResponseDoc=function(t){var e;return e=u.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("head title"))?t.textContent:void 0},first:function(t){var n;return(n=$.find(t,e)[0])?$(n):void 0}}},updateHistoryAndTitle=function(t){return t=u.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),u.isString(t.title)?document.title=t.title:void 0},swapElements=function(t,e,n,r,o){var i,s,a,l,c;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(t)})),up.motion.finish(t),n?(i=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(i):t.append(i),hello(i.children(),o),l=up.layout.revealOrRestoreScroll(i,o),l=l.then(function(){return up.animate(i,r,o)}),l=l.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(t,e,o))?(emitFragmentKept(a),l=Promise.resolve()):(o.keepPlans=transferKeepableElements(t,e,o),s=up.syntax.prepareClean(t),c=function(){return shouldSwapElementsDirectly(t,e,r,o)?(swapElementsDirectly(t,e),r=!1):e.insertBefore(t),o.source!==!1&&setSource(e,o.source),autofocus(e),hello(e,o),up.morph(t,e,r,o)},l=destroy(t,{clean:s,beforeWipe:c,log:!1})),l},shouldSwapElementsDirectly=function(t,e,n,r){var o;return o=t.add(e),t.is("body")||!up.motion.willAnimate(o,n,r)},swapElementsDirectly=function(t,e){return t.replaceWith(e)},transferKeepableElements=function(t,e,n){var r,o,i,s,a,l,c,p;if(s=[],n.keep)for(p=t.find("[up-keep]"),i=0,l=p.length;l>i;i++)a=p[i],r=$(a),(c=findKeepPlan(r,e,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),c.$newElement.replaceWith(r),s.push(c));return s},findKeepPlan=function(t,e,n){var r,o,i,s,a;return n.keep&&(r=t,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?e.find(s):u.selectInSubtree(e,s),o=o.first(),o.length&&o.is("[up-keep]")&&(a={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(a,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i))))?a:void 0},hello=function(t,e){var n,r,o,i,s,a;for(n=$(t),e=u.options(e,{keepPlans:[]}),o=[],a=e.keepPlans,r=0,i=a.length;i>r;r++)s=a[r],emitFragmentKept(s),o.push(s.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,e),n},emitFragmentInserted=function(t,e){var n;return n=$(t),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:e.origin})},emitFragmentKept=function(t){var e;return e=u.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},autofocus=function(t){var e,n;return n="[autofocus]:last",e=u.selectInSubtree(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},isRealElement=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},first=function(t,e){var n;return e=u.options(e,{layer:"auto"}),n=resolveSelector(t,e.origin),"auto"===e.layer?firstInPriority(n,e.origin):firstInLayer(n,e.layer)},firstInPriority=function(t,e){var n,r,o,i,s,a;for(i=["popup","modal","page"],n=void 0,u.isPresent(e)&&(a=layerOf(e),u.remove(i,a),i.unshift(a)),r=0,s=i.length;s>r&&(o=i[r],!(n=firstInLayer(t,o)));r++);return n},firstInLayer=function(t,e){var n,r,o,i,u,s;for(r=$(t),o=void 0,u=0,s=r.length;s>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,e)){o=n;break}return o},layerOf=function(t){var e;return e=$(t),up.popup.contains(e)?"popup":up.modal.contains(e)?"modal":"page"},matchesLayer=function(t,e){return layerOf(t)===e},destroy=function(t,e){var n,r,o,i,s,a;return n=$(t),e=u.options(e,{animation:!1}),shouldLogDestruction(n,e)&&(i=["Destroying fragment %o",n.get(0)],s=["Destroyed fragment %o",n.get(0)]),0===n.length?Promise.resolve():(up.emit("up:fragment:destroy",{$element:n,message:i}),n.addClass("up-destroying"),updateHistoryAndTitle(e),r=function(){var t;return t=up.motion.animateOptions(e),up.motion.animate(n,e.animation,t)},o=e.beforeWipe||Promise.resolve(),a=function(){return e.clean||(e.clean=function(){return up.syntax.clean(n)}),e.clean(),up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:s}),n.remove()},r().then(o).then(a))},shouldLogDestruction=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},reload=function(t,e){var n;return e=u.options(e,{cache:!1}),n=e.url||source(t),replace(t,n,e)},up.on("up:app:boot",function(){var t;return t=$(document.body),setSource(t,up.browser.url()),hello(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello,config:config}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$;return x=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=x.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=x.copy(u),g=x.copy(s),i.reset()},f=function(){return i.enabled
|
3
|
+
},n=function(t,i,u){var s;return s=e(t),u=r(u),p(s,u).then(function(){return P(s,i,u)?x.isFunction(i)?i(s,u):x.isString(i)?n(s,a(i),u):x.isOptions(i)?o(s,i,u):up.fail("Animation must be a function, animation name or object of CSS properties, but it was %o",i):S(s,i)})},P=function(t,e,n){return n=r(n),f()&&!h(e)&&n.duration>0&&x.all(t,x.isBodyDescendant)},S=function(t,e){return x.isOptions(e)&&t.css(e),Promise.resolve()},o=function(t,e,n){var r;return r=function(){var r,o,i,u,s,a,l,c,p,f;return c=Object.keys(e),l={"transition-property":c.join(", "),"transition-duration":n.duration+"ms","transition-delay":n.delay+"ms","transition-timing-function":n.easing},u=t.css(Object.keys(l)),o=x.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;return e=t.originalEvent.propertyName,x.contains(c,e)?i():void 0},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=x.setTimer(n.duration+p,i),o.then(function(){var e;return t.off(m.finishEvent,s),t.off("transitionend",a),clearTimeout(r),f(),t.css({transition:"none"}),e=!("none"===u["transition-property"]||"all"===u["transition-property"]&&"0"===u["transition-duration"][0]),e?(x.forceRepaint(t),t.css(u)):void 0}),f=x.forceCompositing(t),t.css(l),t.css(e),o.promise()},m.start(t,r)},r=function(){var e,n,r,o,u;return n=1<=arguments.length?t.call(arguments,0):[],u=n.shift()||{},e=x.isJQuery(n[0])?n.shift():x.nullJQuery(),o=x.isObject(n[0])?n.shift():{},r={},r.easing=x.option(u.easing,x.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(x.option(u.duration,x.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(x.option(u.delay,x.presentAttr(e,"up-delay"),o.delay,i.delay)),r.finishedMotion=u.finishedMotion,r},a=function(t){return v[t]||up.fail("Unknown animation %o",t)},$=function(t,e,n,r){var o,i,u,s,a,l;return n.copy===!1||t.is(".up-ghost")||e.is(".up-ghost")?r(t,e,n):(s=void 0,i=void 0,a=void 0,u=void 0,o=up.layout.viewportOf(t),x.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),l=x.merge(n,{duration:0}),up.layout.revealOrRestoreScroll(e,l).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=x.temporaryCss(e,{opacity:"0"}),f=r(s.$ghost,i.$ghost,n),l=s.$ghost.add(i.$ghost),c=t.add(e),m.forwardFinishEvent(c,l,f),f.then(function(){return p(),s.$bounds.remove(),i.$bounds.remove()})}))},c=function(t){return m.finish(t)},d=function(t,n,o,i){var u,s,a,c,f;return i=x.options(i),i=x.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=P(u,c,i),up.log.group(f?"Morphing %o to %o with transition %o":void 0,a.get(0),s.get(0),o,function(){return p(u,i).then(function(){return f?c?$(a,s,i,c):up.fail("Unknown transition %o",o):T(a,s,i)})})},p=function(t,e){return e.finishedMotion?Promise.resolve():(e.finishedMotion=!0,c(t))},l=function(t){var e;if(h(t))return void 0;if(x.isFunction(t))return t;if(x.isArray(t))return h(t[0])&&h(t[1])?void 0:function(e,r,o){return Promise.all([n(e,t[0],o),n(r,t[1],o)])};if(x.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}},T=function(t,e,n){var r;return t.hide(),r=x.merge(n,{duration:0}),up.layout.revealOrRestoreScroll(e,r)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=x.measure(t,{relative:!0,inner:!0}),i=t.clone(),i.find("script").remove(),i.css({position:"static"===t.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(t),c(t.offset().top-i.offset().top),o=up.layout.fixedChildren(i),a=0,l=o.length;l>a;a++)s=o[a],x.fixedToAbsolute(s,n);return{$ghost:i,$bounds:r,moveTop:c}},w=function(t,e){return g[t]=e},b=function(t,e){return v[t]=e},E=function(){return u=x.copy(v),s=x.copy(g)},h=function(t){return!t||"none"===t||x.isOptions(t)&&x.isBlank(t)},b("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),b("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),A=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},b("move-to-top",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.top+r.height,n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.top+r.height,t.css(A(0,-o)),n(t,A(0,0),e)}),b("move-to-bottom",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().height-r.top,n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().height-r.top,t.css(A(0,o)),n(t,A(0,0),e)}),b("move-to-left",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.left+r.width,n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=r.left+r.width,t.css(A(-o,0)),n(t,A(0,0),e)}),b("move-to-right",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().width-r.left,n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.clientSize().width-r.left,t.css(A(o,0)),n(t,A(0,0),e)}),b("roll-down",function(t,e){var r,o,i;return o=t.height(),i=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),r=n(t,{height:o+"px"},e),r.then(i),r}),w("move-left","move-to-left/move-from-right"),w("move-right","move-to-right/move-from-left"),w("move-up","move-to-top/move-from-bottom"),w("move-down","move-to-bottom/move-from-top"),w("cross-fade","fade-out/fade-in"),up.on("up:framework:booted",E),up.on("up:framework:reset",k),{morph:d,animate:n,animateOptions:r,willAnimate:P,finish:c,transition:w,animation:b,config:i,isEnabled:f,prependCopy:y,isNone:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,x,P,$,F,D,C,O,R,U,N,M;return N=up.util,n=void 0,T=void 0,C=void 0,b=void 0,O=void 0,A=[],l=N.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return l.cacheSize},expiry:function(){return l.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),c=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(T),T=null},s=function(){return clearTimeout(C),C=null},$=function(){return n=null,u(),s(),b=0,l.reset(),i.clear(),O=!1,A=[]},$(),y=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=N.extractOptions(e),N.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||a(),!n&&(o=c(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=v(i),D(i,o),o["catch"](function(){return P(i)})),r.preload||(g(),N.always(o,m)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},y.apply(null,e).then(r,n)})},f=function(){return 0===b},p=function(){return b>0},g=function(){var t;return b+=1,C?void 0:(t=function(){return p()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},C=N.setTimer(l.slowDelay,t))},m=function(){return b-=1,f()&&(s(),O)?(up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1):void 0},v=function(t){return b<l.maxRequests?d(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return d(t)},e=N.previewable(e),A.push(e),e.promise},d=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),N.always(n,F),N.always(n,w),n):(N.microtask(w),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;return n=t.request,t.url&&n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},w=function(){var t;return void("function"==typeof(t=A.shift())&&t())},o=i.alias,D=i.set,P=i.remove,a=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),S=function(t){var e,r;return r=parseInt(N.presentAttr(t,"up-delay"))||l.preloadDelay,t.is(n)?void 0:(n=t,u(),e=function(){return N.muteRejection(k(t)),n=null},R(e,r))},R=function(t,e){return T=setTimeout(t,e)},U=function(t){return t.is(n)?(n=void 0,u()):void 0},k=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},h=function(t){return N.contains(l.safeMethods,t)},M=function(t,e,n){return N.contains(l.wrapMethods,t)&&(e=N.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.compiler("a[up-preload], [up-href][up-preload]",function(t){return up.link.isSafe(t)?(t.on("mouseenter touchstart",function(e){return up.link.shouldProcessEvent(e,t)?S(t):void 0}),t.on("mouseleave",function(){return U(t)})):void 0}),up.on("up:framework:reset",$),{preload:k,ajax:r,request:y,get:c,alias:o,clear:a,remove:P,isIdle:f,isBusy:p,isSafeMethod:h,wrapMethod:M,config:l}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function($){var DEFAULT_FOLLOW_VARIANT,addFollowVariant,allowDefault,defaultFollow,defaultPreload,follow,followMethod,followVariantForLink,followVariants,isFollowable,isSafe,makeFollowable,shouldProcessEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r;return n=$(t),r=followVariantForLink(n),r.followLink(n,e)},defaultFollow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target")),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e=u.merge(e,up.motion.animateOptions(e,n)),up.browser.whenConfirmed(e).then(function(){return up.replace(r,o,e)})},defaultPreload=function(t,e){return e=u.options(e),e.preload=!0,defaultFollow(t,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},allowDefault=function(){},followVariants=[],addFollowVariant=function(t,e){var n;return n=new up.FollowVariant(t,e),followVariants.push(n),n.registerEvents(),n},isFollowable=function(t){return!!followVariantForLink(t,{"default":!1})},followVariantForLink=function(t,e){var n,r;return e=u.options(e),n=$(t),r=u.detect(followVariants,function(t){return t.matchesLink(n)}),e["default"]!==!1&&(r||(r=DEFAULT_FOLLOW_VARIANT)),r},makeFollowable=function(t){var e;return e=$(t),isFollowable(e)?void 0:e.attr("up-follow","")},shouldProcessEvent=function(t,e){var n,r,o;return n=$(t.target),r=n.closest("a, [up-href]").not(e),o=up.form.fieldSelector().seekUp(n),0===r.length&&0===o.length&&u.isUnmodifiedMouseEvent(t)},isSafe=function(t,e){var n,r;return n=$(t),r=followMethod(n,e),up.proxy.isSafeMethod(r)},DEFAULT_FOLLOW_VARIANT=addFollowVariant("[up-target], [up-follow]",{follow:function(t,e){return defaultFollow(t,e)},preload:function(t,e){return defaultPreload(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?makeFollowable(t):e["up-target"]=n,u.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(t){var e,n,r,o,i,s,a,l,c,p;if(e=t.find("a, [up-href]"),(c=t.attr("up-expand"))&&(e=e.filter(c)),i=e.get(0)){for(p=/^up-/,a={},a["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],s=n.name,s.match(p)&&(a[s]=n.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,isSafe:isSafe,isFollowable:isFollowable,shouldProcessEvent:shouldProcessEvent,followMethod:followMethod,addFollowVariant:addFollowVariant,followVariantForLink:followVariantForLink,allowDefault:allowDefault}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,fieldSelector,findSwitcherForTarget,observe,observeField,reset,resolveValidateTarget,submit,switchTarget,switchTargets,switcherValues,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},fieldSelector=function(){return u.multiSelector(config.fields)},submit=function(t,e){var n,r,o;return n=$(t).closest("form"),e=u.options(e),r=u.option(e.target,n.attr("up-target"),"body"),o=u.option(e.url,n.attr("action"),up.browser.url()),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-reveal"),!0),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.history=u.option(e.history,u.castedAttr(n,"up-history"),!0),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.method=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),e.headers=u.option(e.headers,{}),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.data=u.requestDataFromForm(n),e=u.merge(e,up.motion.animateOptions(e,n)),e.validate&&(e.headers||(e.headers={}),e.transition=!1,e.failTransition=!1,e.headers[up.protocol.config.validateHeader]=e.validate),up.bus.whenEmitted("up:form:submit",{$element:n}).then(function(){var t;return up.feedback.start(n),up.browser.canPushState()||e.history===!1?(t=up.replace(r,o,e),u.always(t,function(){return up.feedback.stop(n)}),t):(n.get(0).submit(),u.unresolvablePromise())})},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($element,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option(u.presentAttr($element,"up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),$fields=fieldSelector().selectInSubtree($element),destructors=u.map($fields,function(t){return observeField($(t),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},autosubmit=function(t,e){return observe(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return submit(n)})})},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),u.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!1),e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},switcherValues=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(e.target,n.attr("up-switch")),u.isPresent(o)||up.fail("No switch target given for %o",n.get(0)),r=switcherValues(n),$(o).each(function(){return switchTarget($(this),r)})},switchTarget=function(t,e){var n,r,o,i;return n=$(t),e||(e=switcherValues(findSwitcherForTarget(n))),(r=n.attr("up-hide-for"))?(r=r.split(" "),o=0===u.intersect(e,r).length):(i=(i=n.attr("up-show-for"))?i.split(" "):[":present",":checked"],o=u.intersect(e,i).length>0),n.toggle(o),n.addClass("up-switched")},findSwitcherForTarget=function(t){var e,n;return e=$("[up-switch]"),n=u.detect(e,function(e){var n;return n=$(e).attr("up-switch"),t.is(n)}),n?$(n):u.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),u.muteRejection(submit(e))}),up.on("change","[up-validate]",function(t,e){return u.muteRejection(validate(e))}),up.compiler("[up-switch]",function(t){return switchTargets(t)}),up.on("change","[up-switch]",function(t,e){return switchTargets(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return switchTarget(t)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.compiler("[up-autosubmit]",function(t){return autosubmit(t)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets,autosubmit:autosubmit,fieldSelector:fieldSelector}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function($){var align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,isOpen,preloadNow,reset,state,toggleAsap,u,unveilFrame;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$popup)&&t.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var t,e,n;switch(t={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(e=state.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=u.measure(state.$anchor),state.position){case"bottom-right":t.top=e.top+e.height,t.left=e.left+e.width-n.width;break;case"bottom-left":t.top=e.top+e.height,t.left=e.left;break;case"top-right":t.top=e.top-n.height,t.left=e.left+e.width-n.width;break;case"top-left":t.top=e.top-n.height,t.left=e.left;break;default:up.fail("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(t)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t){var e;return e=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),state.$popup=e},unveilFrame=function(){return state.$popup.show()},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(t,e){return chain.asap(closeNow,function(){return attachNow(t,e)})},attachNow=function(t,e){var n,r,o,i,s,a,l;return n=$(t),n.length||up.fail("Cannot attach popup to non-existing element %o",t),e=u.options(e),l=u.option(u.pluckKey(e,"url"),n.attr("up-href"),n.attr("href")),i=u.option(u.pluckKey(e,"html")),l||i||up.fail("up.popup.attach() requires either an { url } or { html } option"),a=u.option(u.pluckKey(e,"target"),n.attr("up-popup"))||up.fail("No target selector given for [up-popup]"),s=u.option(e.position,n.attr("up-position"),config.position),e.animation=u.option(e.animation,n.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(n,"up-sticky"),config.sticky),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(n,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,n.attr("up-confirm")),e.method=up.link.followMethod(n,e),e.layer="popup",e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.provideTarget=function(){return createHiddenFrame(a)},r=up.motion.animateOptions(e,n,{duration:config.openDuration,easing:config.openEasing}),o=u.merge(e,{animation:!1}),e.preload&&l?up.replace(a,l,e):up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:popup:open",{url:l,message:"Opening popup"}).then(function(){var t;return state.phase="opening",state.$anchor=n,state.position=s,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=e.sticky,t=i?up.extract(a,i,o):up.replace(a,l,o),t=t.then(function(){return align(),unveilFrame(),up.animate(state.$popup,e.animation,r)}),t=t.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e;return isOpen()?(t=u.options(t,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),e=up.motion.animateOptions(t,{duration:config.closeDuration,easing:config.closeEasing}),u.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,t).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},preloadNow=function(t,e){return e=u.options(e),e.preload=!0,attachNow(t,e)},toggleAsap=function(t,e){return t.is(".up-current")?closeAsap():attachAsap(t,e)},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return toggleAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click up:action:consumed",function(t){var e;return e=$(t.target),e.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(t.origin&&contains(t.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click",".up-popup [up-close]",function(t){return closeAsap(),up.bus.consumeAction(t)}),up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,preloadNow,reset,shiftElements,state,templateHtml,u,unshiftElements,unveilFrame,visitAsap;return u=up.util,config=u.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$modal)&&t.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var t;return t=flavorDefault("template"),u.evalOption(t,{closeLabel:flavorDefault("closeLabel")})},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t,e){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),u.isPresent(state.position)&&o.attr("up-position",state.position),r=o.find(".up-modal-dialog"),u.isPresent(e.width)&&r.css("width",e.width),u.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),u.isPresent(e.height)&&r.css("height",e.height),state.closable||o.find(".up-modal-close").remove(),n=o.find(".up-modal-content"),u.$createPlaceholder(t,n),o.hide(),o.appendTo(document.body),state.$modal=o},unveilFrame=function(){return state.$modal.show()},shiftElements=function(){var t,e,n,r,o;return u.documentHasVerticalScrollbar()?(t=$("body"),r=u.scrollbarWidth(),e=parseFloat(t.css("padding-right")),n=r+e,o=u.temporaryCss(t,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var t,e,n,o;return t=$(this),e=parseFloat(t.css("right")),n=r+e,o=u.temporaryCss(t,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var t,e;for(t=[];e=state.unshifters.pop();)t.push(e());return t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(t,e){return e=u.options(e),e.$link=$(t),openAsap(e)},preloadNow=function(t,e){return e=u.options(e),e.$link=t,e.preload=!0,openNow(e)},visitAsap=function(t,e){return e=u.options(e),e.url=t,openAsap(e)},extractAsap=function(t,e,n){return n=u.options(n),n.html=e,n.history=u.option(n.history,!1),n.target=t,openAsap(n)},openAsap=function(t){return chain.asap(closeNow,function(){return openNow(t)})},openNow=function(t){var e,n,r,o,i;return t=u.options(t),e=u.option(u.pluckKey(t,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(t,"url"),e.attr("up-href"),e.attr("href")),r=u.option(u.pluckKey(t,"html")),o=u.option(u.pluckKey(t,"target"),e.attr("up-modal"),"body"),t.flavor=u.option(t.flavor,e.attr("up-flavor"),config.flavor),t.position=u.option(t.position,e.attr("up-position"),flavorDefault("position",t.flavor)),t.position=u.evalOption(t.position,{$link:e}),t.width=u.option(t.width,e.attr("up-width"),flavorDefault("width",t.flavor)),t.maxWidth=u.option(t.maxWidth,e.attr("up-max-width"),flavorDefault("maxWidth",t.flavor)),t.height=u.option(t.height,e.attr("up-height"),flavorDefault("height")),t.animation=u.option(t.animation,e.attr("up-animation"),flavorDefault("openAnimation",t.flavor)),t.animation=u.evalOption(t.animation,{position:t.position}),t.backdropAnimation=u.option(t.backdropAnimation,e.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",t.flavor)),t.backdropAnimation=u.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=u.option(t.sticky,u.castedAttr(e,"up-sticky"),flavorDefault("sticky",t.flavor)),t.closable=u.option(t.closable,u.castedAttr(e,"up-closable"),flavorDefault("closable",t.flavor)),t.confirm=u.option(t.confirm,e.attr("up-confirm")),t.method=up.link.followMethod(e,t),t.layer="modal",t.failTarget=u.option(t.failTarget,e.attr("up-fail-target")),t.failLayer=u.option(t.failLayer,e.attr("up-fail-layer"),"auto"),n=up.motion.animateOptions(t,e,{duration:flavorDefault("openDuration",t.flavor),easing:flavorDefault("openEasing",t.flavor)}),t.history=u.option(t.history,u.castedAttr(e,"up-history"),flavorDefault("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return createHiddenFrame(o,t)},t.preload?up.replace(o,i,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var e,s;return state.phase="opening",state.flavor=t.flavor,state.sticky=t.sticky,state.closable=t.closable,state.position=t.position,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e=u.merge(t,{animation:!1}),s=r?up.extract(o,r,e):up.replace(o,i,e),s=s.then(function(){return shiftElements(),unveilFrame(),animate(t.animation,t.backdropAnimation,n)}),s=s.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e,n,r,o;return t=u.options(t),isOpen()?(o=u.option(t.animation,flavorDefault("closeAnimation")),o=u.evalOption(o,{position:state.position}),n=u.option(t.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),e=up.motion.animateOptions(t,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(t,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var t;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,t=animate(o,n,e),t=t.then(function(){return up.destroy(state.$modal,r)}),t=t.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,state.closable=null,state.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},markAsAnimating=function(t){return null==t&&(t=!0),state.$modal.toggleClass("up-modal-animating",t)},animate=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(markAsAnimating(),r=Promise.all([up.animate(state.$modal.find(".up-modal-viewport"),t,n),up.animate(state.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},flavor=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),u.assign(flavorOverrides(t),e)},flavorOverrides=function(t){return flavors[t]||(flavors[t]={})},flavorDefault=function(t,e){var n;return null==e&&(e=state.flavor),e&&(n=flavorOverrides(e)[t]),u.isMissing(n)&&(n=config[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return followAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click",".up-modal",function(t){var e;if(state.closable)return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:(up.bus.consumeAction(t),closeAsap())
|
4
|
+
}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(t.origin&&contains(t.origin)&&!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){return state.closable?closeAsap():void 0}),up.on("click",".up-modal [up-close]",function(t){return closeAsap(),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return u.isPresent(t.$link)?u.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,c,p,f;return f=up.util,s=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var t;return null!=(t=p.$tooltip)&&t.remove(),p.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(t={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(e=p.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=f.measure(p.$anchor),p.position){case"top":t.top=e.top-n.height,t.left=e.left+.5*(e.width-n.width);break;case"left":t.top=e.top+.5*(e.height-n.height),t.left=e.left-n.width;break;case"right":t.top=e.top+.5*(e.height-n.height),t.left=e.left+e.width;break;case"bottom":t.top=e.top+e.height,t.left=e.left+.5*(e.width-n.width);break;default:up.fail("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),p.$tooltip.css(t)},a=function(t){var e;return e=f.$createElementFromSelector(".up-tooltip"),f.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),p.$tooltip=e},n=function(t,e){return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,c,h;return o=t(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),h=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),s.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),p.phase="opening",p.$anchor=o,a({text:h,html:l}),p.position=c,e(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=f.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),f.assign(t,e),p.phase="closing",up.destroy(p.$tooltip,t).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):Promise.resolve()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d;return h=up.util,o=h.config({currentClasses:["up-current"]}),l=function(){return o.reset()},i=function(){var t;return t=o.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},n="up-active",r="a, [up-href]",a=function(t){return h.isPresent(t)?h.normalizeUrl(t,{stripTrailingSlash:!0}):void 0},c=function(t){var e,n,r,o,i,u,s,l,c,p;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(e=u[n],c=h.presentAttr(t,e))for(p="up-alias"===e?c.split(" "):[c],r=0,i=p.length;i>r;r++)s=p[r],"#"!==s&&(s=a(s),l.push(s));return l},d=function(t){var e,n,r,o;return t=h.map(t,a),t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},s=function(){var t,n;return t=d([up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()]),n=i(),h.each(e(r),function(r){var o,i;return o=e(r),i=c(o),up.link.isSafe(o)&&t.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(t){var n;return n=e(t),n.is(r)&&(n=h.presence(n.parent(r))||n),n},p=function(){var e,r,o,i,s,a;return o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),s=h.options(o[0]),e=u(i),s.preload||e.addClass(n),r?(a=r(),h.isPromise(a)?h.always(a,function(){return f(e)}):up.warn("Expected block to return a promise, but got %o",a),a):void 0},f=function(t){var e;return e=u(t),e.removeClass(n)},up.on("up:fragment:inserted",function(){return s()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?s():void 0}),up.on("up:framework:reset",l),{config:o,start:p,stop:f}}(jQuery),up.renamedModule("navigation","feedback")}.call(this),function(){up.radio=function(){var t,e,n,r;return r=up.util,t=r.config({hungry:["[up-hungry]"],hungryTransition:null}),n=function(){return t.reset()},e=function(){return r.multiSelector(t.hungry)},up.on("up:framework:reset",n),{config:t,hungrySelector:e}}(jQuery)}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;return e()&&up.link.isFollowable(t)?(i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)):void 0})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
|
@@ -58,14 +58,17 @@ up.dom = (($) ->
|
|
58
58
|
u.presence($element.attr("up-source")) || up.browser.url()
|
59
59
|
|
60
60
|
###*
|
61
|
-
Resolves the given selector (which might contain `&` references)
|
62
|
-
to
|
61
|
+
Resolves the given CSS selector (which might contain `&` references)
|
62
|
+
to a full CSS selector without ampersands.
|
63
|
+
|
64
|
+
If passed an `Element` or `jQuery` element, returns a CSS selector string
|
65
|
+
for that element.
|
63
66
|
|
64
67
|
@function up.dom.resolveSelector
|
65
68
|
@param {string|Element|jQuery} selectorOrElement
|
66
69
|
@param {string|Element|jQuery} origin
|
67
70
|
The element that this selector resolution is relative to.
|
68
|
-
That element's selector will be substituted for
|
71
|
+
That element's selector will be substituted for `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
69
72
|
@internal
|
70
73
|
###
|
71
74
|
resolveSelector = (selectorOrElement, origin) ->
|
@@ -164,7 +167,7 @@ up.dom = (($) ->
|
|
164
167
|
here, in which case a selector will be inferred from the element's class and ID.
|
165
168
|
@param {string} url
|
166
169
|
The URL to fetch from the server.
|
167
|
-
@param {string} [options.failTarget
|
170
|
+
@param {string} [options.failTarget]
|
168
171
|
The CSS selector to update if the server sends a non-200 status code.
|
169
172
|
@param {string} [options.fallback]
|
170
173
|
The selector to update when the original target was not found in the page.
|
@@ -213,7 +216,7 @@ up.dom = (($) ->
|
|
213
216
|
@param {Element|jQuery} [options.origin]
|
214
217
|
The element that triggered the replacement.
|
215
218
|
|
216
|
-
The element's selector will be substituted for the `&` shorthand in the target selector.
|
219
|
+
The element's selector will be substituted for the `&` shorthand in the target selector ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
217
220
|
@param {string} [options.layer='auto']
|
218
221
|
The name of the layer that ought to be updated. Valid values are
|
219
222
|
`auto`, `page`, `modal` and `popup`.
|
@@ -224,6 +227,10 @@ up.dom = (($) ->
|
|
224
227
|
Unpoly will search in other layers, starting from the topmost layer.
|
225
228
|
@param {string} [options.failLayer='auto']
|
226
229
|
The name of the layer that ought to be updated if the server sends a non-200 status code.
|
230
|
+
@param {boolean} [options.keep=true]
|
231
|
+
Whether this replacement will preserve [`[up-keep]`](/up-keep) elements.
|
232
|
+
@param {boolean} [options.hungry=true]
|
233
|
+
Whether this replacement will update [`[up-hungry]`](/up-hungry) elements.
|
227
234
|
|
228
235
|
@return {Promise}
|
229
236
|
A promise that will be fulfilled when the page has been updated.
|
@@ -245,7 +252,6 @@ up.dom = (($) ->
|
|
245
252
|
humanizedTarget: 'failure target'
|
246
253
|
provideTarget: undefined # don't provide a target if we're targeting the failTarget
|
247
254
|
restoreScroll: false
|
248
|
-
hungry: false
|
249
255
|
|
250
256
|
u.renameKey(failureOptions, 'failTransition', 'transition')
|
251
257
|
u.renameKey(failureOptions, 'failLayer', 'layer')
|
@@ -75,12 +75,16 @@ up.form = (($) ->
|
|
75
75
|
Defaults to the form's `up-method`, `data-method` or `method` attribute, or to `'post'`
|
76
76
|
if none of these attributes are given.
|
77
77
|
@param {string} [options.target]
|
78
|
-
The selector to update when the form submission succeeds (server responds with status 200).
|
78
|
+
The CSS selector to update when the form submission succeeds (server responds with status 200).
|
79
79
|
Defaults to the form's `up-target` attribute.
|
80
|
+
|
81
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
80
82
|
@param {string} [options.failTarget]
|
81
|
-
The selector to update when the form submission fails (server responds with non-200 status).
|
83
|
+
The CSS selector to update when the form submission fails (server responds with non-200 status).
|
82
84
|
Defaults to the form's `up-fail-target` attribute, or to an auto-generated
|
83
85
|
selector that matches the form itself.
|
86
|
+
|
87
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
84
88
|
@param {string} [options.fallback]
|
85
89
|
The selector to update when the original target was not found in the page.
|
86
90
|
Defaults to the form's `up-fallback` attribute.
|
@@ -521,11 +525,15 @@ up.form = (($) ->
|
|
521
525
|
|
522
526
|
@selector form[up-target]
|
523
527
|
@param {string} up-target
|
524
|
-
The selector to [replace](/up.replace) if the form submission is successful (200 status code).
|
528
|
+
The CSS selector to [replace](/up.replace) if the form submission is successful (200 status code).
|
529
|
+
|
530
|
+
Inside the CSS selector you may refer to this form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
525
531
|
@param {string} [up-fail-target]
|
526
|
-
The selector to [replace](/up.replace) if the form submission is not successful (non-200 status code).
|
527
|
-
|
528
|
-
|
532
|
+
The CSS selector to [replace](/up.replace) if the form submission is not successful (non-200 status code).
|
533
|
+
|
534
|
+
Inside the CSS selector you may refer to this form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
535
|
+
|
536
|
+
If omitted, Unpoly will replace the `<form>` tag itself, assuming that the server has echoed the form with validation errors.
|
529
537
|
@param [up-fallback]
|
530
538
|
The selector to replace if the server responds with an error.
|
531
539
|
@param {string} [up-transition]
|
@@ -559,6 +567,7 @@ up.form = (($) ->
|
|
559
567
|
Whether to reveal the target element after it was replaced.
|
560
568
|
|
561
569
|
You can also pass a CSS selector for the element to reveal.
|
570
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
562
571
|
@param {string} [up-fail-reveal='true']
|
563
572
|
Whether to reveal the target element when the server responds with an error.
|
564
573
|
|
@@ -568,6 +577,8 @@ up.form = (($) ->
|
|
568
577
|
<form up-target=".content" up-fail-reveal=".error">
|
569
578
|
...
|
570
579
|
</form>
|
580
|
+
|
581
|
+
Inside the CSS selector you may refer to the form as `&` ([like in Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector)).
|
571
582
|
@param {string} [up-restore-scroll='false']
|
572
583
|
Whether to restore previously known scroll position of all viewports
|
573
584
|
within the target selector.
|
@@ -471,7 +471,7 @@ up.layout = (($) ->
|
|
471
471
|
if options.reveal
|
472
472
|
revealOptions = { duration: options.duration }
|
473
473
|
if u.isString(options.reveal)
|
474
|
-
selector = revealSelector(options.reveal)
|
474
|
+
selector = revealSelector(options.reveal, options)
|
475
475
|
$element = up.first(selector) || $element
|
476
476
|
revealOptions.top = true
|
477
477
|
|
@@ -490,7 +490,9 @@ up.layout = (($) ->
|
|
490
490
|
@internal
|
491
491
|
###
|
492
492
|
revealSelector = (selector, options) ->
|
493
|
-
|
493
|
+
# up.dom.resolveSelector() will (1) substitute any "&" shorthands with an selector
|
494
|
+
# for options.origin and (2) convert selector into a string, if it is an Element.
|
495
|
+
selector = up.dom.resolveSelector(selector, options.origin)
|
494
496
|
if selector[0] == '#'
|
495
497
|
selector += ", a[name='#{selector}']"
|
496
498
|
selector
|