upjs-rails 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b92f1a5f0bbaa4e375c121941f69f046f720c722
4
- data.tar.gz: ddd4812c22d9ae7a2745037564f147a3523e344c
3
+ metadata.gz: 9be294721beb31d8896962cd3c88cca5b6c06c72
4
+ data.tar.gz: 6d6c036721685044defdd46e5a638924e4966045
5
5
  SHA512:
6
- metadata.gz: 39452897102d34f99bda5eae970cf67538d906600d1b94d2768041c835ab5d91ba20c01c5137e27208817858edc38480a81b1274d747fa3569c35e8484bfcf58
7
- data.tar.gz: 4c9005ede5ab2d3835e34c2d2df5c60d5fa38d8936dad005975d5ca08e0787325f03c70ce52989cdf9340cd23e55bb9a09f9041b227dbc5b69a51b2aecf1b9dc
6
+ metadata.gz: 1c0cd5d3fb663e9c04a0e062a45f9b50ff34575f225d213e73ee2cf32450794afb27a7286a0d9a0435616ae51e0af777d8f78a61a5fdcad18493d11f6e8b0d9f
7
+ data.tar.gz: dd19ad7811f063d5c57e94d482c9d771052f63c30f46bba101414fb4dc38b84d52454a66667efdfb4ac6729f3ef892d14f88fe986a0b5232010c7714bb02db57
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  This project mostly adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
 
8
+ 0.12.1
9
+ ------
10
+
11
+ ### Compatible changes
12
+
13
+ - `up.on` now returns a function that unbinds the events when called
14
+ - Fixed a bug where restoring previous scroll positions was not worked
15
+ in situations where the same operation would also reveal the replaced element.
16
+ - Various bugfixes
17
+
18
+
8
19
  0.12.0
9
20
  ------
10
21
 
@@ -15,7 +26,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
15
26
 
16
27
  ### Incompatible changes
17
28
 
18
- - Remove the `up.`slot, which was poorly implemented, untested, and not much better than the `:empty` pseudo-selector
29
+ - Remove `up.slot`, which was poorly implemented, untested, and not much better than the `:empty` pseudo-selector
19
30
  which has great browser support
20
31
  - Replaced the `up.bus.on(...)` event registry with vanilla DOM events bound to `document`. Also renamed
21
32
  events in the process.
data/dist/up.js CHANGED
@@ -1405,7 +1405,7 @@ We need to work on this page:
1405
1405
  Emits an event with the given name and property.
1406
1406
  Returns whether any event listener has prevented the default action.
1407
1407
 
1408
- @method nobodyPrevents
1408
+ @method up.bus.nobodyPrevents
1409
1409
  @protected
1410
1410
  */
1411
1411
  nobodyPrevents = function() {
@@ -1523,6 +1523,8 @@ We need to work on this page:
1523
1523
  The function takes the affected element as the first argument (as a jQuery object).
1524
1524
  If the element has an `up-data` attribute, its value is parsed as JSON
1525
1525
  and passed as a second argument.
1526
+ @return {Function}
1527
+ A function that unbinds the event listeners when called.
1526
1528
  */
1527
1529
  liveDescriptions = [];
1528
1530
  defaultLiveDescriptions = null;
@@ -1539,17 +1541,21 @@ We need to work on this page:
1539
1541
  };
1540
1542
  };
1541
1543
  live = function() {
1542
- var args, behavior, description, lastIndex, ref;
1544
+ var $document, args, behavior, description, lastIndex;
1543
1545
  args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
1544
1546
  if (!up.browser.isSupported()) {
1545
- return;
1547
+ return (function() {});
1546
1548
  }
1547
1549
  description = u.copy(args);
1548
1550
  lastIndex = description.length - 1;
1549
1551
  behavior = description[lastIndex];
1550
1552
  description[lastIndex] = upListenerToJqueryListener(behavior);
1551
1553
  liveDescriptions.push(description);
1552
- return (ref = $(document)).on.apply(ref, description);
1554
+ $document = $(document);
1555
+ $document.on.apply($document, description);
1556
+ return function() {
1557
+ return $document.off.apply($document, description);
1558
+ };
1553
1559
  };
1554
1560
 
1555
1561
  /**
@@ -1892,6 +1898,7 @@ We need to work on this page:
1892
1898
 
1893
1899
  /**
1894
1900
  @method up.history.config
1901
+ @property
1895
1902
  @param {Array<String>} [config.popTargets=['body']]
1896
1903
  An array of CSS selectors to replace when the user goes
1897
1904
  back in history.
@@ -2092,13 +2099,14 @@ This modules contains functions to scroll the viewport and reveal contained elem
2092
2099
  var slice = [].slice;
2093
2100
 
2094
2101
  up.layout = (function($) {
2095
- var SCROLL_PROMISE_KEY, anchoredRight, config, finishScrolling, fixedChildren, lastScrollTops, measureObstruction, reset, restoreScroll, reveal, saveScroll, scroll, scrollTops, u, viewportOf, viewportSelector, viewports, viewportsWithin;
2102
+ var SCROLL_PROMISE_KEY, anchoredRight, config, finishScrolling, fixedChildren, lastScrollTops, measureObstruction, reset, restoreScroll, reveal, revealOrRestoreScroll, saveScroll, scroll, scrollTops, u, viewportOf, viewportSelector, viewports, viewportsWithin;
2096
2103
  u = up.util;
2097
2104
 
2098
2105
  /**
2099
2106
  Configures the application layout.
2100
2107
 
2101
2108
  @method up.layout.config
2109
+ @property
2102
2110
  @param {Array<String>} [config.viewports]
2103
2111
  An array of CSS selectors that find viewports
2104
2112
  (containers that scroll their contents).
@@ -2315,6 +2323,7 @@ This modules contains functions to scroll the viewport and reveal contained elem
2315
2323
  */
2316
2324
  reveal = function(elementOrSelector, options) {
2317
2325
  var $element, $viewport, elementDims, firstElementRow, lastElementRow, newScrollPos, obstruction, offsetShift, originalScrollPos, predictFirstVisibleRow, predictLastVisibleRow, snap, viewportHeight, viewportIsDocument;
2326
+ u.debug('Revealing %o', elementOrSelector);
2318
2327
  options = u.options(options);
2319
2328
  $element = $(elementOrSelector);
2320
2329
  $viewport = options.viewport ? $(options.viewport) : viewportOf($element);
@@ -2477,6 +2486,7 @@ This modules contains functions to scroll the viewport and reveal contained elem
2477
2486
  }
2478
2487
  url = u.option(options.url, up.history.url());
2479
2488
  tops = u.option(options.tops, scrollTops());
2489
+ u.debug('Saving scroll positions for URL %o: %o', url, tops);
2480
2490
  return lastScrollTops.set(url, tops);
2481
2491
  };
2482
2492
 
@@ -2491,10 +2501,11 @@ This modules contains functions to scroll the viewport and reveal contained elem
2491
2501
  @protected
2492
2502
  */
2493
2503
  restoreScroll = function(options) {
2494
- var $ancestorViewports, $descendantViewports, $matchingViewport, $viewports, key, results, right, scrollTop, tops;
2504
+ var $ancestorViewports, $descendantViewports, $matchingViewport, $viewports, key, right, scrollTop, tops, url;
2495
2505
  if (options == null) {
2496
2506
  options = {};
2497
2507
  }
2508
+ url = up.history.url();
2498
2509
  $viewports = void 0;
2499
2510
  if (options.around) {
2500
2511
  $descendantViewports = viewportsWithin(options.around);
@@ -2503,17 +2514,36 @@ This modules contains functions to scroll the viewport and reveal contained elem
2503
2514
  } else {
2504
2515
  $viewports = viewports();
2505
2516
  }
2506
- tops = lastScrollTops.get(up.history.url());
2507
- results = [];
2517
+ tops = lastScrollTops.get(url);
2518
+ u.debug('Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)', url, $viewports, tops);
2508
2519
  for (key in tops) {
2509
2520
  scrollTop = tops[key];
2510
2521
  right = key === 'document' ? document : key;
2511
2522
  $matchingViewport = $viewports.filter(right);
2512
- results.push(up.scroll($matchingViewport, scrollTop, {
2523
+ scroll($matchingViewport, scrollTop, {
2513
2524
  duration: 0
2514
- }));
2525
+ });
2526
+ }
2527
+ return u.resolvedDeferred();
2528
+ };
2529
+
2530
+ /**
2531
+ @protected
2532
+ @method up.layout.revealOrRestoreScroll
2533
+ @return {Deferred} A promise for when the revealing or scroll restauration ends
2534
+ */
2535
+ revealOrRestoreScroll = function(selectorOrElement, options) {
2536
+ var $element;
2537
+ $element = $(selectorOrElement);
2538
+ if (options.restoreScroll) {
2539
+ return restoreScroll({
2540
+ around: $element
2541
+ });
2542
+ } else if (options.reveal) {
2543
+ return reveal($element);
2544
+ } else {
2545
+ return u.resolvedDeferred();
2515
2546
  }
2516
- return results;
2517
2547
  };
2518
2548
 
2519
2549
  /**
@@ -2597,6 +2627,7 @@ This modules contains functions to scroll the viewport and reveal contained elem
2597
2627
  */
2598
2628
  up.on('up:framework:reset', reset);
2599
2629
  return {
2630
+ knife: eval(typeof Knife !== "undefined" && Knife !== null ? Knife.point : void 0),
2600
2631
  reveal: reveal,
2601
2632
  scroll: scroll,
2602
2633
  finishScrolling: finishScrolling,
@@ -2610,6 +2641,7 @@ This modules contains functions to scroll the viewport and reveal contained elem
2610
2641
  scrollTops: scrollTops,
2611
2642
  saveScroll: saveScroll,
2612
2643
  restoreScroll: restoreScroll,
2644
+ revealOrRestoreScroll: revealOrRestoreScroll,
2613
2645
  anchoredRight: anchoredRight,
2614
2646
  fixedChildren: fixedChildren
2615
2647
  };
@@ -2641,7 +2673,7 @@ We need to work on this page:
2641
2673
 
2642
2674
  (function() {
2643
2675
  up.flow = (function($) {
2644
- var autofocus, destroy, elementsInserted, findOldFragment, first, fragmentNotFound, implant, isRealElement, parseImplantSteps, parseResponse, reload, replace, reveal, setSource, source, swapElements, u;
2676
+ var autofocus, destroy, elementsInserted, findOldFragment, first, fragmentNotFound, implant, isRealElement, parseImplantSteps, parseResponse, reload, replace, setSource, source, swapElements, u;
2645
2677
  u = up.util;
2646
2678
  setSource = function(element, sourceUrl) {
2647
2679
  var $element;
@@ -2805,13 +2837,6 @@ We need to work on this page:
2805
2837
  }
2806
2838
  };
2807
2839
  };
2808
- reveal = function($element, options) {
2809
- if (options.reveal) {
2810
- return up.reveal($element);
2811
- } else {
2812
- return u.resolvedDeferred();
2813
- }
2814
- };
2815
2840
  elementsInserted = function($new, options) {
2816
2841
  if (typeof options.insert === "function") {
2817
2842
  options.insert($new);
@@ -2825,11 +2850,6 @@ We need to work on this page:
2825
2850
  if (options.source !== false) {
2826
2851
  setSource($new, options.source);
2827
2852
  }
2828
- if (options.restoreScroll) {
2829
- up.layout.restoreScroll({
2830
- around: $new
2831
- });
2832
- }
2833
2853
  autofocus($new);
2834
2854
  return up.hello($new);
2835
2855
  };
@@ -2843,7 +2863,7 @@ We need to work on this page:
2843
2863
  $old[insertionMethod]($wrapper);
2844
2864
  u.copyAttributes($new, $old);
2845
2865
  elementsInserted($wrapper.children(), options);
2846
- return reveal($wrapper, options).then(function() {
2866
+ return up.layout.revealOrRestoreScroll($wrapper, options).then(function() {
2847
2867
  return up.animate($wrapper, transition, options);
2848
2868
  }).then(function() {
2849
2869
  u.unwrapElement($wrapper);
@@ -3044,7 +3064,7 @@ We need to work on this page:
3044
3064
 
3045
3065
  (function() {
3046
3066
  up.motion = (function($) {
3047
- var GHOSTING_PROMISE_KEY, animate, animateOptions, animation, animations, assertIsDeferred, config, defaultAnimations, defaultTransitions, findAnimation, finish, finishGhosting, morph, none, prependCopy, reset, resolvableWhen, snapshot, transition, transitions, u, withGhosts;
3067
+ var GHOSTING_PROMISE_KEY, animate, animateOptions, animation, animations, assertIsDeferred, config, defaultAnimations, defaultTransitions, findAnimation, finish, finishGhosting, morph, none, prependCopy, reset, resolvableWhen, skipMorph, snapshot, transition, transitions, u, withGhosts;
3048
3068
  u = up.util;
3049
3069
  animations = {};
3050
3070
  defaultAnimations = {};
@@ -3055,6 +3075,7 @@ We need to work on this page:
3055
3075
  Sets default options for animations and transitions.
3056
3076
 
3057
3077
  @method up.motion.config
3078
+ @property
3058
3079
  @param {Number} [config.duration=300]
3059
3080
  @param {Number} [config.delay=0]
3060
3081
  @param {String} [config.easing='ease']
@@ -3198,11 +3219,7 @@ We need to work on this page:
3198
3219
  u.temporaryCss($old, {
3199
3220
  display: 'none'
3200
3221
  }, function() {
3201
- if (options.reveal) {
3202
- up.reveal($new, {
3203
- viewport: $viewport
3204
- });
3205
- }
3222
+ up.layout.revealOrRestoreScroll($new, options);
3206
3223
  newCopy = prependCopy($new, $viewport);
3207
3224
  return newScrollTop = $viewport.scrollTop();
3208
3225
  });
@@ -3302,20 +3319,20 @@ We need to work on this page:
3302
3319
  A promise for the transition's end.
3303
3320
  */
3304
3321
  morph = function(source, target, transitionOrName, options) {
3305
- var $new, $old, animation, parsedOptions, parts, transition;
3322
+ var $new, $old, animation, deferred, parsedOptions, parts, transition;
3306
3323
  $old = $(source);
3307
3324
  $new = $(target);
3325
+ parsedOptions = u.only(options, 'reveal', 'restoreScroll');
3326
+ parsedOptions = u.extend(parsedOptions, animateOptions(options));
3308
3327
  if (up.browser.canCssAnimation()) {
3309
- parsedOptions = u.only(options, 'reveal');
3310
- parsedOptions = u.extend(parsedOptions, animateOptions(options));
3311
3328
  finish($old);
3312
3329
  finish($new);
3313
3330
  if (transitionOrName === 'none' || transitionOrName === false || (animation = animations[transitionOrName])) {
3314
- $old.hide();
3315
- if (options.reveal) {
3316
- up.reveal($new);
3317
- }
3318
- return animate($new, animation || 'none', options);
3331
+ deferred = skipMorph($old, $new, parsedOptions);
3332
+ deferred.then(function() {
3333
+ return animate($new, animation || 'none', options);
3334
+ });
3335
+ return deferred;
3319
3336
  } else if (transition = u.presence(transitionOrName, u.isFunction) || transitions[transitionOrName]) {
3320
3337
  return withGhosts($old, $new, parsedOptions, function($oldGhost, $newGhost) {
3321
3338
  var transitionPromise;
@@ -3332,11 +3349,22 @@ We need to work on this page:
3332
3349
  return u.error("Unknown transition %o", transitionOrName);
3333
3350
  }
3334
3351
  } else {
3335
- $old.hide();
3336
- return u.resolvedDeferred();
3352
+ return skipMorph($old, $new, parsedOptions);
3337
3353
  }
3338
3354
  };
3339
3355
 
3356
+ /**
3357
+ Cause the side effects of a successful transitions, but instantly.
3358
+ We use this to skip morphing for old browsers, or when the developer
3359
+ decides to only animate the new element (i.e. no real ghosting or transition) .
3360
+
3361
+ @private
3362
+ */
3363
+ skipMorph = function($old, $new, options) {
3364
+ $old.hide();
3365
+ return up.layout.revealOrRestoreScroll($new, options);
3366
+ };
3367
+
3340
3368
  /**
3341
3369
  @private
3342
3370
  */
@@ -3706,6 +3734,7 @@ You can change (or remove) this delay like this:
3706
3734
 
3707
3735
  /**
3708
3736
  @method up.proxy.config
3737
+ @property
3709
3738
  @param {Number} [config.preloadDelay=75]
3710
3739
  The number of milliseconds to wait before [`[up-preload]`](#up-preload)
3711
3740
  starts preloading.
@@ -4797,9 +4826,10 @@ We need to work on this page:
4797
4826
 
4798
4827
  /**
4799
4828
  @method up.popup.config
4800
- @param {String} config.openAnimation
4801
- @param {String} config.closeAnimation
4802
- @param {String} config.position
4829
+ @property
4830
+ @param {String} [config.openAnimation]
4831
+ @param {String} [config.closeAnimation]
4832
+ @param {String} [config.position]
4803
4833
  */
4804
4834
  config = u.config({
4805
4835
  openAnimation: 'fade-in',
@@ -5105,6 +5135,7 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5105
5135
  Sets default options for future modals.
5106
5136
 
5107
5137
  @method up.modal.config
5138
+ @property
5108
5139
  @param {Number} [config.width]
5109
5140
  The width of the dialog as a CSS value like `'400px'` or `50%`.
5110
5141
 
@@ -5138,10 +5169,10 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5138
5169
  to both the dialog box and the overlay dimming the page.
5139
5170
  */
5140
5171
  config = u.config({
5141
- maxWidth: void 0,
5142
- minWidth: void 0,
5143
- width: void 0,
5144
- height: void 0,
5172
+ maxWidth: null,
5173
+ minWidth: null,
5174
+ width: null,
5175
+ height: null,
5145
5176
  openAnimation: 'fade-in',
5146
5177
  closeAnimation: 'fade-out',
5147
5178
  closeLabel: '×',
@@ -5250,7 +5281,7 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5250
5281
  animation has finished and the modal contents are fully visible.
5251
5282
 
5252
5283
  @method up.modal.follow
5253
- @param {Element|jQuery|String} elementOrSelector
5284
+ @param {Element|jQuery|String} linkOrSelector
5254
5285
  The link to follow.
5255
5286
  @param {String} [options.target]
5256
5287
  The selector to extract from the response and open in a modal dialog.
@@ -5276,9 +5307,9 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5276
5307
  @return {Promise}
5277
5308
  A promise that will be resolved when the modal has finished loading.
5278
5309
  */
5279
- follow = function($link, options) {
5310
+ follow = function(linkOrSelector, options) {
5280
5311
  options = u.options(options);
5281
- options.$link = $link;
5312
+ options.$link = $(linkOrSelector);
5282
5313
  return open(options);
5283
5314
  };
5284
5315
 
@@ -5491,7 +5522,7 @@ For small popup overlays ("dropdowns") see [up.popup](/up.popup) instead.
5491
5522
  if ($link.is('.up-current')) {
5492
5523
  return close();
5493
5524
  } else {
5494
- return open($link);
5525
+ return follow($link);
5495
5526
  }
5496
5527
  });
5497
5528
  up.on('click', 'body', function(event, $body) {
@@ -5684,7 +5715,7 @@ We need to work on this page:
5684
5715
  */
5685
5716
  up.compiler('[up-tooltip], [up-tooltip-html]', function($link) {
5686
5717
  $link.on('mouseover', function() {
5687
- return open($link);
5718
+ return attach($link);
5688
5719
  });
5689
5720
  return $link.on('mouseout', function() {
5690
5721
  return close();
@@ -5731,6 +5762,7 @@ by providing instant feedback for user interactions.
5731
5762
  Sets default options for this module.
5732
5763
 
5733
5764
  @method up.navigation.config
5765
+ @property
5734
5766
  @param {Number} [config.currentClasses]
5735
5767
  An array of classes to set on [links that point the current location](#up-current).
5736
5768
  */
@@ -5925,7 +5957,7 @@ by providing instant feedback for user interactions.
5925
5957
  unmarkActive();
5926
5958
  return locationChanged();
5927
5959
  });
5928
- up.on('up:fragment:destroy', function(event, $fragment) {
5960
+ up.on('up:fragment:destroyed', function(event, $fragment) {
5929
5961
  if ($fragment.is('.up-modal, .up-popup')) {
5930
5962
  return locationChanged();
5931
5963
  }
data/dist/up.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b,w,k,x,S,C,A,T,P,E,D,j,$,z,U,O,M,F,W,L,I,Q,N,R,H,q,B,J,G,X,_,K,V,Z,Y,tt,et,nt,rt,ot,ut,it,at,st,lt,pt,ct,ft,dt,mt,ht,vt,gt,yt,bt,wt,kt,xt,St,Ct,At,Tt,Pt,Et,Dt,jt,$t,zt,Ut,Ot,Mt;return ut=function(e){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],r?n:(r=!0,n=e.apply(null,o))}},u=function(t){return t=m(t),t.selector&&(t.headers={"X-Up-Selector":t.selector}),e.ajax(t)},K=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ct=function(t,n){var r,o,u;return r=null,V(t)?(r=e("<a>").attr({href:t}).get(0),F(r.hostname)&&(r.href=r.href)):r=zt(t),o=r.protocol+"//"+r.hostname,K(r.protocol,r.port)||(o+=":"+r.port),u=r.pathname,"/"!==u[0]&&(u="/"+u),(null!=n?n.stripTrailingSlash:void 0)===!0&&(u=u.replace(/\/$/,"")),o+=u,(null!=n?n.hash:void 0)===!0&&(o+=r.hash),(null!=n?n.search:void 0)!==!1&&(o+=r.search),o},pt=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,c=f=0,m=v.length;m>f;c=++f){for(a=v[c],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],p=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":p=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===c&&(o=n),r=n}return o},v=function(t,e){var n;return n=document.createElement(t),X(e)&&(n.innerHTML=e),n},w=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["debug",n].concat(t.call(e)))},Mt=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["warn",n].concat(t.call(e)))},A=function(){var n,r,o,u;throw r=1<=arguments.length?t.call(arguments,0):[],r[0]="[UP] "+r[0],(u=up.browser).puts.apply(u,["error"].concat(t.call(r))),o=P.apply(null,r),n=yt(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,P=function(){var e,n,r,u;return e=1<=arguments.length?t.call(arguments,0):[],u=e[0],n=0,r=80,u.replace(o,function(){var t,o;return n+=1,t=e[n],o=typeof t,"string"===o?(t=t.replace(/\s+/g," "),t.length>r&&(t=t.substr(0,r)+"\u2026"),t='"'+t+'"'):t="undefined"===o?"undefined":"number"===o||"function"===o?t.toString():JSON.stringify(t),t.length>r&&(t=t.substr(0,r)+" \u2026",("object"===o||"function"===o)&&(t+=" }")),t})},y=function(t){var e,n,r,o,u,i,a;for(w("Creating selector from element %o",t),n=(e=t.attr("class"))?e.split(" "):[],r=t.attr("id"),a=t.prop("tagName").toLowerCase(),r&&(a+="#"+r),o=0,i=n.length;i>o;o++)u=n[o],a+="."+u;return a},g=function(t){var e,n,r,o,u,i,a,s,l,p,c,f;return l=function(t){return"<"+t+"(?: [^>]*)?>"},i=function(t){return"</"+t+">"},e="(?:.|\\n)*?",u=function(t){return"("+t+")"},f=new RegExp(l("head")+e+l("title")+u(e)+i("title")+e+i("body"),"i"),o=new RegExp(l("body")+u(e)+i("body"),"i"),(r=t.match(o))?(s=document.createElement("html"),n=v("body",r[1]),s.appendChild(n),(c=t.match(f))&&(a=v("head"),s.appendChild(a),p=v("title",c[1]),a.appendChild(p)),s):v("div",t)},E=e.extend,$t=e.trim,x=function(t,e){var n,r,o,u,i;for(i=[],n=o=0,u=t.length;u>o;n=++o)r=t[n],i.push(e(r,n));return i},rt=x,U=function(t){return t},Dt=function(t,e){var n,r,o,u;for(u=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)u.push(e(n));return u},B=function(t){return null===t},Z=function(t){return void 0===t},L=function(t){return!Z(t)},q=function(t){return Z(t)||B(t)},N=function(t){return!q(t)},F=function(t){return q(t)||G(t)&&0===Object.keys(t).length||0===t.length},yt=function(t,e){return null==e&&(e=X),e(t)?t:null},X=function(t){return!F(t)},Q=function(t){return"function"==typeof t},V=function(t){return"string"==typeof t},J=function(t){return"number"==typeof t},R=function(t){return"object"==typeof t&&!!t},G=function(t){return R(t)||"function"==typeof t},I=function(t){return!(!t||1!==t.nodeType)},H=function(t){return t instanceof jQuery},_=function(t){return G(t)&&Q(t.then)},W=function(t){return _(t)&&Q(t.resolve)},O=function(t){return N(t)?t:void 0},M=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},jt=function(t){return Array.prototype.slice.call(t)},m=function(t){return M(t)?t.slice():E({},t)},zt=function(t){return H(t)?t.get(0):t},it=function(t,e){return E(m(t),e)},gt=function(t,e){var n,r,o,u;if(o=t?m(t):{},e)for(r in e)n=e[r],u=o[r],N(u)?G(n)&&G(u)&&(o[r]=gt(u,n)):o[r]=n;return o},vt=function(){var e,n,r,o,u,i;for(n=1<=arguments.length?t.call(arguments,0):[],u=void 0,r=0,o=n.length;o>r;r++)if(e=n[r],i=e,Q(i)&&(i=i()),N(i)){u=i;break}return u},k=function(t,e){var n,r,o,u;for(u=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=n;break}return u},i=function(t,e){var n;return n=k(t,e),L(n)},c=function(t){return At(t,N)},Ut=function(t){var e;return e={},At(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},At=function(t,e){var n;return n=[],x(t,function(t){return e(t)?n.push(t):void 0}),n},bt=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,u;for(u=[],t=0,o=r.length;o>t;t++)n=r[t],u.push(e.attr(n));return u}(),k(o,X)},lt=function(t){return setTimeout(t,0)},et=function(t){return t[t.length-1]},p=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ct=ut(function(){var t,n,r;return t=e("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),t.appendTo(document.body),n=t.get(0),r=n.offsetWidth-n.clientWidth,t.remove(),r}),mt=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Et=function(t,e,n){var r,o;return o=t.css(Object.keys(e)),t.css(e),r=function(){return t.css(o)},n?(n(),r()):mt(r)},z=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),F(n)?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},b=function(t,n,o){var u,i,a,s,l,p;return u=e(t),up.browser.canCssAnimation()?(o=gt(o,{duration:300,delay:0,easing:"ease"}),i=e.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":o.duration+"ms","transition-delay":o.delay+"ms","transition-timing-function":o.easing},l=z(u),p=Et(u,s),u.css(n),i.then(l),i.then(p),u.data(r,i),i.then(function(){return u.removeData(r)}),a=setTimeout(function(){return i.resolve()},o.duration+o.delay),i.then(function(){return clearTimeout(a)}),i):(u.css(n),xt())},r="up-animation-promise",j=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},ot=function(t,n){var r,o,u,i,a,s;return n=gt(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=t.position():(r=e(n.relative),a=t.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=t.offset(),o={left:i.left,top:i.top},n.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),n.full&&(s=p(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},h=function(t,e){var n,r,o,u,i;for(u=t.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],n.specified?i.push(e.attr(n.name,n.value)):i.push(void 0);return i},D=function(t,e){return t.find(e).addBack(e)},T=function(t){return 27===t.keyCode},Pt=function(t,e){return 0===t.indexOf(e)},C=function(t,e){return t.indexOf(e)===t.length-e.length},d=function(t,e){return t.indexOf(e)>=0},l=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},nt=function(t){return t.getResponseHeader("X-Up-Location")},at=function(t){return t.getResponseHeader("X-Up-Method")},ht=function(){var e,n,r,o,u,i;for(i=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],e={},n=0,u=o.length;u>n;n++)r=o[n],i.hasOwnProperty(r)&&(e[r]=i[r]);return e},Y=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},tt=function(t){var e;return e=Z(t.button)||0===t.button,e&&Y(t)},xt=function(){var t;return t=e.Deferred(),t.resolve(),t},St=function(){return xt().promise()},ft=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},kt=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return x(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},Tt=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],q(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},wt=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},S=function(){return e([])},st=function(t){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=t.length;u>o;o++)s=t[o],V(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(t){var n,r,o,u,i,s;for(r=S(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=t?t.find(s):e(s),r=r.add(n);return r},a.findWithSelf=function(t){var e;return e=a.find(t),a.doesMatch(t)&&(e=e.add(t)),e},a.doesMatch=function(t){var n;return n=e(t),i(a.parsed,function(t){return n.is(t)})},a.seekUp=function(t){var n,r,o;for(o=e(t),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||S()},a},s=function(e){var n,r,o,u,i,a,s,l,p,c,f,d;return null==e&&(e={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],e.log?(n[0]="["+e.log+"] "+n[0],w.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return q(e.size)?void 0:Q(e.size)?e.size():J(e.size)?e.size:A("Invalid size config: %o",e.size)},o=function(){return q(e.expiry)?void 0:Q(e.expiry)?e.expiry():J(e.expiry)?e.expiry:A("Invalid expiry config: %o",e.expiry)},p=function(t){return e.key?e.key(t):t.toString()},$t=function(){var t,e,n,r;return r=m(a()),n=l(),n&&r.length>n&&(t=null,e=null,x(r,function(n){var r,o;return r=f[n],o=r.timestamp,!e||e>o?(t=n,e=o):void 0}),t)?delete f[t]:void 0},n=function(t,e){var n;return n=u(t),L(n)?c(e,n):void 0},d=function(){return(new Date).valueOf()},c=function(t,e){var n;return n=p(t),f[n]={timestamp:d(),value:e}},wt=function(t){var e;return e=p(t),delete f[e]},i=function(t){var e,n;return e=o(),e?(n=d()-t.timestamp,n<o()):!0},u=function(t,e){var n,r;return null==e&&(e=void 0),r=p(t),(n=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),wt(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:c,remove:wt,clear:r,keys:a}},f=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return E(e,t)},e.reset(),Object.preventExtensions(e),e},Ot=function(t){var e,n;return t=zt(t),e=t.parentNode,n=jt(t.childNodes),x(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},dt=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},$=function(t,n){var r,o,u,i;return r=e(t),o=dt(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},a=function(t){var e,n,r;return e=t.toString(),r=new RegExp("\\(([^\\)]*)\\)"),(n=e.match(r))?n[1].split(/\s*,\s*/):A("Could not parse argument names of %o",t)},{argNames:a,offsetParent:dt,fixedToAbsolute:$,presentAttr:bt,createElement:v,normalizeUrl:ct,normalizeMethod:pt,createElementFromHtml:g,$createElementFromSelector:n,createSelectorFromElement:y,ajax:u,extend:E,copy:m,merge:it,options:gt,option:vt,error:A,debug:w,warn:Mt,each:x,map:rt,identity:U,times:Dt,any:i,detect:k,select:At,compact:c,uniq:Ut,last:et,isNull:B,isDefined:L,isUndefined:Z,isGiven:N,isMissing:q,isPresent:X,isBlank:F,presence:yt,isObject:G,isFunction:Q,isString:V,isElement:I,isJQuery:H,isPromise:_,isDeferred:W,isHash:R,ifGiven:O,isUnmodifiedKeyEvent:Y,isUnmodifiedMouseEvent:tt,nullJquery:ft,unJquery:zt,nextFrame:lt,measure:ot,temporaryCss:Et,cssAnimate:b,finishCssAnimate:j,forceCompositing:z,escapePressed:T,copyAttributes:h,findWithSelf:D,contains:d,startsWith:Pt,endsWith:C,isArray:M,toArray:jt,castedAttr:l,locationFromXhr:nt,methodFromXhr:at,clientSize:p,only:ht,trim:$t,resolvedPromise:St,resolvedDeferred:xt,resolvableWhen:kt,setMissingAttrs:Tt,remove:wt,memoize:ut,scrollbarWidth:Ct,config:f,cache:s,unwrapElement:Ot,multiSelector:st,emptyJQuery:S,evalConsoleTemplate:P}}($),up.error=up.util.error,up.warn=up.util.warn,up.debug=up.util.debug}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h;return m=up.util,c=function(t,n){var r,o,u,i,a,s;return null==n&&(n={}),a=m.option(n.method,"get").toLowerCase(),"get"===a?location.href=t:e.rails?(s=n.target,u=e.rails.csrfToken(),o=e.rails.csrfParam(),r=e("<form method='post' action='"+t+"'></form>"),i="<input name='_method' value='"+a+"' type='hidden' />",m.isDefined(o)&&m.isDefined(u)&&(i+="<input name='"+o+"' value='"+u+"' type='hidden' />"),s&&r.attr("target",s),r.hide().append(i).appendTo("body"),r.submit()):error("Can't fake a "+a.toUpperCase()+" request without Rails UJS")},d=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],m.isDefined(console[r])||(r="log"),o()?console[r].apply(console,e):(n=m.evalConsoleTemplate.apply(m,e),console[r](n))},h=function(){return location.href},u=m.memoize(function(){return m.isDefined(history.pushState)&&"get"===i()}),a=m.memoize(function(){return m.isUndefined(document.addEventListener)}),s=m.memoize(function(){return a()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),n=m.memoize(function(){return"transition"in document.documentElement.style}),r=m.memoize(function(){return"oninput"in document.createElement("input")}),o=m.memoize(function(){return!s()}),l=m.memoize(function(){var t,n,r,o;return o=e.fn.jquery,r=o.split("."),t=parseInt(r[0]),n=parseInt(r[1]),t>=2||1===t&&n>=9}),f=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,m.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},i=m.memoize(function(){return(f("_up_request_method")||"get").toLowerCase()}),p=function(){return!a()&&l()},{url:h,loadPage:c,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:p,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u;return u=up.util,n=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),u.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},r=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],r=n.apply(null,e),!r.isDefaultPrevented()},o=function(){return up.bus.emit("up:framework:reset")},{emit:n,nobodyPrevents:r,reset:o}}(jQuery),up.reset=up.bus.reset}.call(this),function(){var t=[].slice;up.magic=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b;return y=up.util,n="up-destroyable",r="up-destroyer",m=[],p=null,b=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,s(r)])}},d=function(){var n,r,o,u,i;return n=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(o=y.copy(n),u=o.length-1,r=o[u],o[u]=b(r),m.push(o),(i=e(document)).on.apply(i,o)):void 0},a=[],l=null,i=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(i=e.pop(),n=y.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return y.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),y.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(y.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=y.findWithSelf(t,i.selector),n.length?i.batch?s.push(o(i,n,n.get())):s.push(n.each(function(){return o(i,e(this),this)})):s.push(void 0);return s},c=function(t){return y.findWithSelf(t,"."+n).each(function(){var t,n;return t=e(this),(n=t.data(r))()})},s=function(t){var n,r;return n=e(t),r=n.attr("up-data"),y.isString(r)&&""!==y.trim(r)?JSON.parse(r):{}},g=function(){return p=y.copy(m),l=y.copy(a)},v=function(){var t,n,r,o;for(n=0,r=m.length;r>n;n++)t=m[n],y.contains(p,t)||(o=e(document)).off.apply(o,t);return m=y.copy(p),a=y.copy(l)},f=function(t){var n;return n=e(t),up.bus.emit("up:fragment:inserted",{$element:n}),n},h=function(t){return d("keydown","body",function(e){return y.escapePressed(e)?t(e):void 0})},d("ready",function(){return f(document.body)}),d("up:fragment:inserted",function(t){return u(t.$element)}),d("up:fragment:destroy",function(t){return c(t.$element)}),d("up:framework:boot",g),d("up:framework:reset",v),{compiler:i,on:d,hello:f,onEscape:h,data:s}}(jQuery),up.compiler=up.magic.compiler,up.on=up.magic.on,up.hello=up.magic.hello,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),p=void 0,i=void 0,m=function(){return n.reset(),p=void 0,i=void 0},a=function(t){return v.normalizeUrl(t,{hash:!0})},r=function(){return a(up.browser.url())},o=function(t){return a(t)===r()},s=function(t){return i&&(p=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},c=function(t,e){return u("push",t,e)},u=function(t,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=t+"State",a=e(),v.debug("Changing history to URL %o (%o)",n,t),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},e=function(){return{fromUp:!0}},h=function(t){var e,o;return o=r(),v.debug("Restoring state %o (now on "+o+")",t),e=n.popTargets.join(", "),up.replace(e,o,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})},l=function(t){var e;return v.debug("History state popped to URL %o",r()),s(r()),up.layout.saveScroll({url:p}),e=t.originalEvent.state,(null!=e?e.fromUp:void 0)?h(e):v.debug("Discarding unknown state %o",e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(t){return v.isPresent(p)?(v.setMissingAttrs(t,{"up-href":p,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:c,replace:d,url:r,previousUrl:function(){return p},normalizeUrl:a}}(jQuery)}.call(this),function(){var t=[].slice;up.layout=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b;return h=up.util,o=h.config({duration:0,viewports:[document,".up-modal","[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"}),a=h.cache({size:30,key:up.history.normalizeUrl}),l=function(){return o.reset(),a.clear()},n="up-scroll-promise",d=function(t,r,i){var a,s,l,p,c;return a=e(t),i=h.options(i),l=h.option(i.duration,o.duration),p=h.option(i.easing,o.easing),u(a),l>0?(s=e.Deferred(),a.data(n,s),s.then(function(){return a.removeData(n),a.finish()}),c={scrollTop:r},a.get(0)===document&&(a=e("html, body")),a.animate(c,{duration:l,easing:p,complete:function(){return s.resolve()}}),s):(a.scrollTop(r),h.resolvedDeferred())},u=function(t){return e(t).each(function(){var t;return(t=e(this).data(n))?t.resolve():void 0})},r=function(){return h.multiSelector(o.anchoredRight).select()},s=function(){var n,r,u,i;return u=function(t,n){var r,o;return r=e(t),o=r.css(n),h.isPresent(o)||h.error("Fixed element %o must have a CSS attribute %o",r,n),parseInt(o)+r.height()},r=function(){var t,n,r,a;for(r=e(o.fixedTop.join(", ")),a=[],t=0,n=r.length;n>t;t++)i=r[t],a.push(u(i,"top"));return a}(),n=function(){var t,n,r,a;for(r=e(o.fixedBottom.join(", ")),a=[],t=0,n=r.length;n>t;t++)i=r[t],a.push(u(i,"bottom"));return a}(),{top:Math.max.apply(Math,[0].concat(t.call(r))),bottom:Math.max.apply(Math,[0].concat(t.call(n)))}},c=function(t,n){var r,u,i,a,l,p,c,f,m,g,y,b,w,k;return n=h.options(n),r=e(t),u=n.viewport?e(n.viewport):v(r),b=h.option(n.snap,o.snap),k=u.is(document),w=k?h.clientSize().height:u.height(),m=u.scrollTop(),p=m,f=void 0,c=void 0,k?(c=s(),f=0):(c={top:0,bottom:0},f=m),g=function(){return p+c.top},y=function(){return p+w-c.bottom-1},i=h.measure(r,{relative:u}),a=i.top+f,l=a+Math.min(i.height,o.substance)-1,l>y()&&(p+=l-y()),(a<g()||n.top)&&(p=a-c.top),b>p&&(p=0),p!==m?d(u,p,n):h.resolvedDeferred()},g=function(){return h.multiSelector(o.viewports)},v=function(t){var n,r;return n=e(t),r=g().seekUp(n),r.length||h.error("Could not find viewport for %o",n),r},b=function(t){var n;return n=e(t),g().findWithSelf(n)},y=function(){return g().select()},m=function(){var t,n,r,u,i,a,s;for(a={},i=o.viewports,n=0,u=i.length;u>n;n++)s=i[n],t=e(s),t.length&&(r=s,s===document&&(r="document"),a[r]=t.scrollTop());return a},i=function(t){var n,r;return null==t&&(t=void 0),t||(t=document.body),r=e(t),n=r.find("[up-fixed]"),h.isPresent(o.fixedTop)&&(n=n.add(r.find(o.fixedTop.join(", ")))),h.isPresent(o.fixedBottom)&&(n=n.add(r.find(o.fixedBottom.join(", ")))),n},f=function(t){var e,n;return null==t&&(t={}),n=h.option(t.url,up.history.url()),e=h.option(t.tops,m()),a.set(n,e)},p=function(t){var e,n,r,o,u,i,s,l,p;null==t&&(t={}),o=void 0,t.around?(n=b(t.around),e=v(t.around),o=e.add(n)):o=y(),p=a.get(up.history.url()),i=[];for(u in p)l=p[u],s="document"===u?document:u,r=o.filter(s),i.push(up.scroll(r,l,{duration:0}));return i},up.on("up:framework:reset",l),{reveal:c,scroll:d,finishScrolling:u,config:o,defaults:function(){return h.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:v,viewportsWithin:b,viewports:y,scrollTops:m,saveScroll:f,restoreScroll:p,anchoredRight:r,fixedChildren:i}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g;return g=up.util,m=function(e,n){var r;return r=t(e),g.isPresent(n)&&(n=g.normalizeUrl(n)),r.attr("up-source",n)},h=function(e){var n;return n=t(e).closest("[up-source]"),g.presence(n.attr("up-source"))||up.browser.url()},f=function(e,n,r){var o,u,i;return g.debug("Replace %o with %o (options %o)",e,n,r),r=g.options(r),i=g.presence(e)?e:g.createSelectorFromElement(t(e)),up.browser.canPushState()||r.history===!1?(u={url:n,method:r.method,selector:i,cache:r.cache,preload:r.preload},o=up.proxy.ajax(u),o.done(function(t,e,o){var s,l;return(s=g.locationFromXhr(o))&&(g.debug("Location from server: %o",s),l={url:s,method:g.methodFromXhr(o),selector:i},up.proxy.alias(u,l),n=s),r.history!==!1&&(r.history=n),r.source!==!1&&(r.source=n),r.preload?void 0:a(i,t,r)}),o.fail(g.error),o):(r.preload||up.browser.loadPage(n,g.only(r,"method")),g.resolvedPromise())},a=function(t,e,n){var r,u,i,a,s,c,f,d;for(n=g.options(n,{historyMethod:"push"}),n.source=g.option(n.source,n.history),c=p(e),n.title||(n.title=c.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(t,n),f=[],i=0,a=s.length;a>i;i++)d=s[i],u=o(d.selector),r=c.find(d.selector).first(),f.push(v(u,r,d.pseudoClass,d.transition,n));return f},o=function(t){return u(".up-popup "+t)||u(".up-modal "+t)||u(t)||i(t)},i=function(t){var e;return e="Could not find selector %o in current body HTML","#"===e[0]&&(e+=" (avoid using IDs)"),g.error(e,t)},p=function(e){var n;return n=g.createElementFromHtml(e),{title:function(){var t;return null!=(t=n.querySelector("title"))?t.textContent:void 0},find:function(r){var o;return(o=n.querySelector(r))?t(o):g.error("Could not find selector %o in response %o",r,e)}}},d=function(t,e){return e.reveal?up.reveal(t):g.resolvedDeferred()},r=function(t,n){return"function"==typeof n.insert&&n.insert(t),n.history&&(n.title&&(document.title=n.title),up.history[n.historyMethod](n.history)),n.source!==!1&&m(t,n.source),n.restoreScroll&&up.layout.restoreScroll({around:t}),e(t),up.hello(t)},v=function(t,e,o,u,i){var a,s;return u||(u="none"),up.motion.finish(t),o?(s="before"===o?"prepend":"append",a=e.contents().wrap('<span class="up-insertion"></span>').parent(),t[s](a),g.copyAttributes(e,t),r(a.children(),i),d(a,i).then(function(){return up.animate(a,u,i)}).then(function(){g.unwrapElement(a)})):n(t,{animation:function(){return e.insertBefore(t),r(e,i),t.is("body")&&"none"!==u&&g.error("Cannot apply transitions to body-elements (%o)",u),up.morph(t,e,u,i)}})},l=function(t,e){var n,r,o,u,i,a,s,l,p,c,f;for(c=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),g.isPresent(c)&&(f=c.split(n)),a=[],o=u=0,i=r.length;i>u;o=++u)s=r[o],l=s.match(/^(.+?)(?:\:(before|after))?$/),p=f[o]||g.last(f),a.push({selector:l[1],pseudoClass:l[2],transition:p});return a},e=function(t){var e,n;return n="[autofocus]:last",e=g.findWithSelf(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},s=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},u=function(e){var n,r,o,u,i,a;for(u=t(e).get(),r=null,i=0,a=u.length;a>i;i++)if(o=u[i],n=t(o),s(n)){r=n;break}return r},n=function(e,n){var r,o,u;return r=t(e),up.bus.nobodyPrevents("up:fragment:destroy",{$element:r})?(n=g.options(n,{animation:"none"}),o=up.motion.animateOptions(n),r.addClass("up-destroying"),g.isPresent(n.url)&&up.history.push(n.url),g.isPresent(n.title)&&(document.title=n.title),u=g.presence(n.animation,g.isDeferred)||up.motion.animate(r,n.animation,o),u.then(function(){return up.bus.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},c=function(t,e){var n;return e=g.options(e,{cache:!1}),n=e.url||h(t),f(t,n,e)},up.on("ready",function(){return m(document.body,up.browser.url())}),{replace:f,reload:c,destroy:n,implant:a,first:u}}(jQuery),up.replace=up.flow.replace,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first}.call(this),function(){up.motion=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b,w,k,x;return k=up.util,u={},s={},w={},l={},a=k.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=k.copy(s),w=k.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),c(a),u=r(u),("none"===o||o===!1)&&m(),k.isFunction(o)?i(o(a,u),o):k.isString(o)?n(a,p(o),u):k.isHash(o)?k.cssAnimate(a,o,u):k.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=k.options(t),n={},n.easing=k.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(k.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(k.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},p=function(t){return u[t]||k.error("Unknown animation %o",t)},e="up-ghosting-promise",x=function(t,n,r,o){var u,i,a,s,l,p,c;return s=void 0,i=void 0,l=void 0,a=void 0,u=up.layout.viewportOf(t),k.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),k.temporaryCss(t,{display:"none"},function(){return r.reveal&&up.reveal(n,{viewport:u}),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),c=k.temporaryCss(n,{visibility:"hidden"}),p=o(s.$ghost,i.$ghost),t.data(e,p),n.data(e,p),p.then(function(){return t.removeData(e),n.removeData(e),s.$bounds.remove(),i.$bounds.remove(),c()}),p},c=function(e){return t(e).each(function(){var e;return e=t(this),k.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(k.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return k.isDeferred(t)?t:k.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,p,f,m,h,v;return p=t(e),l=t(o),up.browser.canCssAnimation()?(m=k.only(s,"reveal"),m=k.extend(m,r(s)),c(p),c(l),"none"===a||a===!1||(f=u[a])?(p.hide(),s.reveal&&up.reveal(l),n(l,f||"none",s)):(v=k.presence(a,k.isFunction)||w[a])?x(p,l,m,function(t,e){var n;return n=v(t,e,m),i(n,a)}):k.isString(a)&&a.indexOf("/")>=0?(h=a.split("/"),v=function(t,e,r){return g(n(t,h[0],r),n(e,h[1],r))},d(p,l,v,m)):k.error("Unknown transition %o",a)):(p.hide(),k.resolvedDeferred())},h=function(e,n){var r,o,u,i,a,s,l,p,c;for(i=k.measure(e,{relative:!0,inner:!0}),u=e.clone(),u.find("script").remove(),u.css({position:"static"===e.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),c=i.top,p=function(t){return 0!==t?(c+=t,r.css({top:c})):void 0},u.appendTo(r),r.insertBefore(e),p(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],k.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:p}},b=function(t,e){return w[t]=e},o=function(t,e){return u[t]=e},y=function(){return s=k.copy(u),l=k.copy(w)},g=k.resolvableWhen,m=k.resolvedDeferred,o("none",m),o("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),o("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),o("move-to-top",function(t,e){var r,o;return r=k.measure(t),o=r.top+r.height,t.css({"margin-top":"0px"}),n(t,{"margin-top":"-"+o+"px"},e)}),o("move-from-top",function(t,e){var r,o;return r=k.measure(t),o=r.top+r.height,t.css({"margin-top":"-"+o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-bottom",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().height-r.top,t.css({"margin-top":"0px"}),n(t,{"margin-top":o+"px"},e)}),o("move-from-bottom",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().height-r.top,t.css({"margin-top":o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-left",function(t,e){var r,o;return r=k.measure(t),o=r.left+r.width,t.css({"margin-left":"0px"}),n(t,{"margin-left":"-"+o+"px"},e)}),o("move-from-left",function(t,e){var r,o;return r=k.measure(t),o=r.left+r.width,t.css({"margin-left":"-"+o+"px"}),n(t,{"margin-left":"0px"},e)}),o("move-to-right",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().width-r.left,t.css({"margin-left":"0px"}),n(t,{"margin-left":o+"px"},e)}),o("move-from-right",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().width-r.left,t.css({"margin-left":o+"px"}),n(t,{"margin-left":"0px"},e)}),o("roll-down",function(t,e){var r,o;return r=t.height(),o=k.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),b("none",m),b("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),b("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),b("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),b("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),b("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",y),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:c,transition:b,animation:o,config:a,defaults:function(){return k.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:m,when:g,prependCopy: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(){up.proxy=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b,w,k,x,S,C,A,T,P,E,D;return D=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=D.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5}),l=function(t){return k(t),[t.url,t.method,t.data,t.selector].join("|")},s=D.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=s.get,P=s.set,A=s.remove,d=s.clear,c=function(){return clearTimeout(C),C=null},p=function(){return clearTimeout(i),i=null},T=function(){return e=null,c(),p(),x=0,m.reset(),a=!1,s.clear()},T(),o=s.alias,k=function(t){return t._normalized||(t.method=D.normalizeMethod(t.method),t.url&&(t.url=D.normalizeUrl(t.url)),t.selector||(t.selector="body"),t._normalized=!0),t},r=function(t){var e,n,r,o,u;return e=t.cache===!0,n=t.cache===!1,u=D.only(t,"url","method","data","selector","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),P(u,o),o.fail(function(){return A(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){
2
- return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.bus.emit("up:proxy:busy"),a=!0):void 0},m.busyDelay>0?i=setTimeout(t,m.busyDelay):t()):void 0},b=function(){return x-=1,v()&&a?(up.bus.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return D.debug("Loading URL %o",t.url),up.bus.emit("up:proxy:load",t),e=D.ajax(t),e.always(function(){return up.bus.emit("up:proxy:receive",t)}),e},g=function(t){return k(t),D.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(D.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,c(),n=function(){return S(t),e=null},E(n,r))},E=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=D.options(n),o=up.link.followMethod(r,n),g({method:o})?(D.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(D.debug("Won't preload %o due to unsafe method %o",r,o),D.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(t,e){return up.link.childClicked(t,e)?void 0:f(e)}),up.on("up:framework:reset",T),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:A,idle:v,busy:u,config:m,defaults:function(){return D.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery)}.call(this),function(){up.link=function($){var childClicked,follow,followMethod,makeFollowable,shouldProcessLinkEvent,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,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"),"body"),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),u.castedAttr(n,"up-animation")),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-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=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){return e=u.options(e),u.option(e.method,t.attr("up-method"),t.attr("data-method"),"get").toUpperCase()},up.on("click","a[up-target], [up-href][up-target]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.on("mousedown","a[up-instant], [up-href][up-instant]",function(t,e){return shouldProcessLinkEvent(t,e)?(t.preventDefault(),follow(e)):void 0}),childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},shouldProcessLinkEvent=function(t,e){return u.isUnmodifiedMouseEvent(t)&&!childClicked(t,e)},makeFollowable=function(t){var e;return e=$(t),u.isMissing(e.attr("up-target"))&&u.isMissing(e.attr("up-follow"))?e.attr("up-follow",""):void 0},up.on("click","a[up-follow], [up-href][up-follow]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.compiler("[up-expand]",function(t){var e,n,r,o,i,a,s,l;for(o=t.find("a, [up-href]").get(0),o||u.error("No link to expand within %o",t),l=/^up-/,a={},a["up-href"]=$(o).attr("href"),s=o.attributes,n=0,r=s.length;r>n;n++)e=s[n],i=e.name,i.match(l)&&(a[i]=e.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}),up.compiler("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),e={"up-preload":"true","up-instant":"true"},n===!0?e["up-follow"]="":e["up-target"]=n,u.setMissingAttrs(t,e),t.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,childClicked:childClicked,followMethod:followMethod}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){up.form=function($){var observe,submit,u;return u=up.util,submit=function(t,e){var n,r,o,i,a,s,l,p,c,f,d,m;return n=$(t).closest("form"),e=u.options(e),p=u.option(e.target,n.attr("up-target"),"body"),r=u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),i=u.option(e.history,u.castedAttr(n,"up-history"),!0),c=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),c),a=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),s={},s.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),s.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),s.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),s=u.extend(s,up.motion.animateOptions(e,n)),m=u.option(e.cache,u.castedAttr(n,"up-cache")),d=u.option(e.url,n.attr("action"),up.browser.url()),n.addClass("up-active"),up.browser.canPushState()||i===!1?(l={url:d,method:a,data:n.serialize(),selector:p,cache:m},f=function(t){var e;return d=void 0,u.isGiven(i)&&(i===!1||u.isString(i)?d=i:(e=u.locationFromXhr(t))?d=e:"GET"===l.type&&(d=l.url+"?"+l.data)),u.option(d,!1)},up.proxy.ajax(l).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(s,{history:f(n),transition:c}),up.flow.implant(p,t,r)}).fail(function(t,e,n){var i,a;return a=t.responseText,i=u.merge(s,{transition:o}),up.flow.implant(r,a,i)})):void n.get(0).submit()},observe=function(fieldOrSelector,options){var $field,callback,callbackPromise,callbackTimer,changeEvents,check,clearTimer,codeOnChange,delay,knownValue,nextCallback,runNextCallback;return $field=$(fieldOrSelector),options=u.options(options),delay=u.option($field.attr("up-delay"),options.delay,0),delay=parseInt(delay),knownValue=null,callback=null,callbackTimer=null,(codeOnChange=$field.attr("up-observe"))?callback=function(value,$field){return eval(codeOnChange)}:options.change?callback=options.change:u.error("up.observe: No change callback given"),callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var t;return nextCallback?(t=nextCallback(),nextCallback=null,t):void 0},check=function(){var t,e;return e=$field.val(),t=u.isNull(knownValue),knownValue===e||(knownValue=e,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($field.get(0),[e,$field])},callbackTimer=setTimeout(function(){return callbackPromise.then(function(){var t;return t=runNextCallback(),callbackPromise=u.isPromise(t)?t:u.resolvedPromise()})},delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$field.on(changeEvents,check),check(),clearTimer},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),{submit:submit,observe:observe}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h;return m=up.util,a=void 0,o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),c=function(){return r(),o.reset()},f=function(t,e,n){var r,o;return o=m.measure(t,{full:!0}),r=function(){switch(n){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.bottom+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return m.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r),l(e)},l=function(t){var e,n,r,o,u,i,a;if(n=m.measure(t,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((u=parseInt(t.css("left")))?t.css("left",u-r):(i=parseInt(t.css("right")))&&t.css("right",i+r)),o){if(a=parseInt(t.css("top")))return t.css("top",a-o);if(e=parseInt(t.css("bottom")))return t.css("bottom",e+o)}},p=function(){var e;return e=t(".up-popup"),e.attr("up-previous-url",up.browser.url()),e.attr("up-previous-title",document.title)},s=function(){var e;return e=t(".up-popup"),e.removeAttr("up-previous-url"),e.removeAttr("up-previous-title")},i=function(t,e,n){var r,o;return o=m.$createElementFromSelector(".up-popup"),n&&o.attr("up-sticky",""),r=m.$createElementFromSelector(e),r.appendTo(o),o.appendTo(document.body),p(),o.hide(),o},h=function(t,e,n,r,o){return e.show(),f(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,a,s,l,p,c,f,d,v;return u=t(e),n=m.options(n),v=m.option(n.url,u.attr("href")),f=m.option(n.target,u.attr("up-popup"),"body"),c=m.option(n.position,u.attr("up-position"),o.position),l=m.option(n.animation,u.attr("up-animation"),o.openAnimation),d=m.option(n.sticky,m.castedAttr(u,"up-sticky")),p=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),a=i(u,f,d),up.replace(f,v,{history:p,insert:function(){return h(u,a,c,l,s)}})},d=function(){return a},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-previous-url"),title:n.attr("up-previous-title")}),a=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(s(),r())},u=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.on("click","a[up-popup]",function(t,n){return t.preventDefault(),n.is(".up-current")?r():e(n)}),up.on("click","body",function(e,n){var o;return o=t(e.target),o.closest(".up-popup").length||o.closest("[up-popup]").length?void 0:r()}),up.on("up:fragment:inserted",function(t,e){var r;return u(e)?(r=e.attr("up-source"))?a=r:void 0:n()}),up.magic.onEscape(function(){return r()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-popup").length?(r(),t.preventDefault()):void 0}),up.on("up:framework:reset",c),{attach:e,close:r,source:d,config:o,defaults:function(){return m.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:u,open:function(){return up.warn("up.popup.open no longer exists. Please use up.popup.attach instead.")}}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y;return h=up.util,r=h.config({maxWidth:void 0,minWidth:void 0,width:void 0,height:void 0,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(t){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+t.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),i=void 0,c=function(){return n(),i=void 0,r.reset()},m=function(){var t;return t=r.template,h.isFunction(t)?t(r):t},p=function(){var e;return e=t(".up-modal"),e.attr("up-previous-url",up.browser.url()),e.attr("up-previous-title",document.title)},a=function(){var e;return e=t(".up-modal"),e.removeAttr("up-previous-url"),e.removeAttr("up-previous-title")},u=function(e){var n,r,o,u;return o=t(m()),e.sticky&&o.attr("up-sticky",""),o.attr("up-previous-url",up.browser.url()),o.attr("up-previous-title",document.title),r=o.find(".up-modal-dialog"),h.isPresent(e.width)&&r.css("width",e.width),h.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),h.isPresent(e.height)&&r.css("height",e.height),n=o.find(".up-modal-content"),u=h.$createElementFromSelector(e.selector),u.appendTo(n),o.appendTo(document.body),p(),o.hide(),o},v=[],f=function(){var e,n,r,o;return r=h.scrollbarWidth(),e=parseInt(t("body").css("padding-right")),n=r+e,o=h.temporaryCss(t("body"),{"padding-right":n+"px","overflow-y":"hidden"}),v.push(o),up.layout.anchoredRight().each(function(){var e,n,o,u;return e=t(this),n=parseInt(e.css("right")),o=r+n,u=h.temporaryCss(e,{right:o}),v.push(u)})},g=function(t,e,n){var r;return f(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.bus.emit("up:modal:opened")})},s=function(t,e){return e=h.options(e),e.$link=t,l(e)},y=function(t,e){return e=h.options(e),e.url=t,l(e)},l=function(e){var o,i,a,s,l,p,c,f,d,m,v;return e=h.options(e),o=h.option(e.$link,h.nullJquery()),m=h.option(e.url,o.attr("up-href"),o.attr("href")),f=h.option(e.target,o.attr("up-modal"),"body"),v=h.option(e.width,o.attr("up-width"),r.width),c=h.option(e.maxWidth,o.attr("up-max-width"),r.maxWidth),l=h.option(e.height,o.attr("up-height"),r.height),s=h.option(e.animation,o.attr("up-animation"),r.openAnimation),d=h.option(e.sticky,h.castedAttr(o,"up-sticky")),p=up.browser.canPushState()?h.option(e.history,h.castedAttr(o,"up-history"),!0):!1,a=up.motion.animateOptions(e,o),n(),up.bus.nobodyPrevents("up:modal:open",{url:m})?(i=u({selector:f,width:v,maxWidth:c,height:l,sticky:d}),up.replace(f,m,{history:p,insert:function(){return g(i,s,a)}})):t.Deferred()},d=function(){return i},n=function(e){var n,o;return n=t(".up-modal"),n.length?up.bus.nobodyPrevents("up:modal:close",{$element:n})?(e=h.options(e,{animation:r.closeAnimation,url:n.attr("up-previous-url"),title:n.attr("up-previous-title")}),i=void 0,o=up.destroy(n,e),o.then(function(){for(var t;t=v.pop();)t();return up.bus.emit("up:modal:closed")}),o):t.Deferred():h.resolvedDeferred()},e=function(){return t(".up-modal").is("[up-sticky]")?void 0:(a(),n())},o=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},up.on("click","a[up-modal]",function(t,e){return t.preventDefault(),e.is(".up-current")?n():l(e)}),up.on("click","body",function(e,r){var o;return o=t(e.target),o.closest(".up-modal-dialog").length||o.closest("[up-modal]").length?void 0:n()}),up.on("up:fragment:inserted",function(t,n){var r;if(o(n)){if(r=n.attr("up-source"))return i=r}else if(!up.popup.contains(n))return e()}),up.magic.onEscape(function(){return n()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(n(),t.preventDefault()):void 0}),up.on("up:framework:reset",c),{visit:y,follow:s,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:n,source:d,config:r,defaults:function(){return h.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:o}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u;return u=up.util,o=function(t,e,n){var r,o,i;return o=u.measure(t),i=u.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-i.width),top:o.top-i.height};case"bottom":return{left:o.left+.5*(o.width-i.width),top:o.top+o.height};default:return u.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},r=function(t){var e;return e=u.$createElementFromSelector(".up-tooltip"),u.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,i){var a,s,l,p,c,f,d;return null==i&&(i={}),a=t(e),c=u.option(i.html,a.attr("up-tooltip-html")),d=u.option(i.text,a.attr("up-tooltip"),a.attr("title")),f=u.option(i.position,a.attr("up-position"),"top"),p=u.option(i.animation,u.castedAttr(a,"up-animation"),"fade-in"),l=up.motion.animateOptions(i,a),n(),s=r({text:d,html:c}),o(a,s,f),up.animate(s,p,l)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=u.options(e,{animation:"fade-out"}),e=u.merge(e,up.motion.animateOptions(e)),up.destroy(n,e)):void 0},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseover",function(){return open(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(t,e){return n()}),up.on("up:framework:reset",n),up.magic.onEscape(function(){return n()}),{attach:e,close:n,open:function(){return u.error("up.tooltip.open no longer exists. Use up.tooltip.attach instead.")}}}(jQuery)}.call(this),function(){up.navigation=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),c=function(){return i.reset()},a=function(){var t;return t=i.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},e="up-active",n=["a","[up-href]","[up-alias]"],o=n.join(", "),u=function(){var t,e,r;for(r=[],t=0,e=n.length;e>t;t++)m=n[t],r.push(m+"[up-instant]");return r}().join(", "),r="."+e,p=function(t){return h.isPresent(t)?h.normalizeUrl(t,{search:!1,stripTrailingSlash:!0}):void 0},d=function(t){var e,n,r,o,u,i,a,s,l,c;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(e=i[n],l=h.presentAttr(t,e))for(c="up-alias"===e?l.split(" "):[l],r=0,u=c.length;u>r;r++)a=c[r],"#"!==a&&(a=p(a),s.push(a));return s},g=function(t){var e,n,r,o;return 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}},l=function(){var e,n;return e=g([p(up.browser.url()),p(up.modal.source()),p(up.popup.source())]),n=a(),h.each(t(o),function(r){var o,u;return o=t(r),u=d(o),e.matchesAny(u)?o.addClass(n):o.removeClass(n)})},f=function(t){return v(),t=s(t),t.addClass(e)},s=function(t){return h.presence(t.parents(o))||t},v=function(){return t(r).removeClass(e)},up.on("click",o,function(t,e){return h.isUnmodifiedMouseEvent(t)&&!e.is("[up-instant]")?f(e):void 0}),up.on("mousedown",u,function(t,e){return h.isUnmodifiedMouseEvent(t)?f(e):void 0}),up.on("up:fragment:inserted",function(){return v(),l()}),up.on("up:fragment:destroy",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",c),{config:i,defaults:function(){return h.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")}}}(jQuery)}.call(this),function(){up.browser.isSupported()&&(up.bus.emit("up:framework:boot"),up.bus.emit("up:framework:booted"))}.call(this),function(){}.call(this);
1
+ (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,E,P,A,O,$,D,j,U,z,R,M,L,W,F,I,_,Q,N,K,H,q,B,J,G,X,V,Y,Z,te,ee,ne,re,oe,ue,ie,ae,se,le,ce,pe,fe,de,me,he,ve,ge,ye,be,we,ke,xe,Se,Ce,Te,Ee,Pe,Ae,Oe,$e,De,je,Ue,ze,Re;return ue=function(e){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],r?n:(r=!0,n=e.apply(null,o))}},u=function(t){return t=m(t),t.selector&&(t.headers={"X-Up-Selector":t.selector}),e.ajax(t)},X=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},pe=function(t,n){var r,o,u;return r=null,V(t)?(r=e("<a>").attr({href:t}).get(0),M(r.hostname)&&(r.href=r.href)):r=je(t),o=r.protocol+"//"+r.hostname,X(r.protocol,r.port)||(o+=":"+r.port),u=r.pathname,"/"!==u[0]&&(u="/"+u),(null!=n?n.stripTrailingSlash:void 0)===!0&&(u=u.replace(/\/$/,"")),o+=u,(null!=n?n.hash:void 0)===!0&&(o+=r.hash),(null!=n?n.search:void 0)!==!1&&(o+=r.search),o},ce=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,p=f=0,m=v.length;m>f;p=++f){for(a=v[p],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],c=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),c&&(l+=' id="'+c+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===p&&(o=n),r=n}return o},v=function(t,e){var n;return n=document.createElement(t),J(e)&&(n.innerHTML=e),n},w=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["debug",n].concat(t.call(e)))},Re=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["warn",n].concat(t.call(e)))},T=function(){var n,r,o,u;throw r=1<=arguments.length?t.call(arguments,0):[],r[0]="[UP] "+r[0],(u=up.browser).puts.apply(u,["error"].concat(t.call(r))),o=P.apply(null,r),n=ye(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,P=function(){var e,n,r,u;return e=1<=arguments.length?t.call(arguments,0):[],u=e[0],n=0,r=80,u.replace(o,function(){var t,o;return n+=1,t=e[n],o=typeof t,"string"===o?(t=t.replace(/\s+/g," "),t.length>r&&(t=t.substr(0,r)+"\u2026"),t='"'+t+'"'):t="undefined"===o?"undefined":"number"===o||"function"===o?t.toString():JSON.stringify(t),t.length>r&&(t=t.substr(0,r)+" \u2026",("object"===o||"function"===o)&&(t+=" }")),t})},y=function(t){var e,n,r,o,u,i,a;for(w("Creating selector from element %o",t),n=(e=t.attr("class"))?e.split(" "):[],r=t.attr("id"),a=t.prop("tagName").toLowerCase(),r&&(a+="#"+r),o=0,i=n.length;i>o;o++)u=n[o],a+="."+u;return a},g=function(t){var e,n,r,o,u,i,a,s,l,c,p,f;return l=function(t){return"<"+t+"(?: [^>]*)?>"},i=function(t){return"</"+t+">"},e="(?:.|\\n)*?",u=function(t){return"("+t+")"},f=new RegExp(l("head")+e+l("title")+u(e)+i("title")+e+i("body"),"i"),o=new RegExp(l("body")+u(e)+i("body"),"i"),(r=t.match(o))?(s=document.createElement("html"),n=v("body",r[1]),s.appendChild(n),(p=t.match(f))&&(a=v("head"),s.appendChild(a),c=v("title",p[1]),a.appendChild(c)),s):v("div",t)},A=e.extend,De=e.trim,x=function(t,e){var n,r,o,u,i;for(i=[],n=o=0,u=t.length;u>o;n=++o)r=t[n],i.push(e(r,n));return i},re=x,U=function(t){return t},Oe=function(t,e){var n,r,o,u;for(u=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)u.push(e(n));return u},H=function(t){return null===t},Y=function(t){return void 0===t},W=function(t){return!Y(t)},K=function(t){return Y(t)||H(t)},_=function(t){return!K(t)},M=function(t){return K(t)||B(t)&&0===Object.keys(t).length||0===t.length},ye=function(t,e){return null==e&&(e=J),e(t)?t:null},J=function(t){return!M(t)},I=function(t){return"function"==typeof t},V=function(t){return"string"==typeof t},q=function(t){return"number"==typeof t},Q=function(t){return"object"==typeof t&&!!t},B=function(t){return Q(t)||"function"==typeof t},F=function(t){return!(!t||1!==t.nodeType)},N=function(t){return t instanceof jQuery},G=function(t){return B(t)&&I(t.then)},L=function(t){return G(t)&&I(t.resolve)},z=function(t){return _(t)?t:void 0},R=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},$e=function(t){return Array.prototype.slice.call(t)},m=function(t){return R(t)?t.slice():A({},t)},je=function(t){return N(t)?t.get(0):t},ie=function(t,e){return A(m(t),e)},ge=function(t,e){var n,r,o,u;if(o=t?m(t):{},e)for(r in e)n=e[r],u=o[r],_(u)?B(n)&&B(u)&&(o[r]=ge(u,n)):o[r]=n;return o},ve=function(){var e,n,r,o,u,i;for(n=1<=arguments.length?t.call(arguments,0):[],u=void 0,r=0,o=n.length;o>r;r++)if(e=n[r],i=e,I(i)&&(i=i()),_(i)){u=i;break}return u},k=function(t,e){var n,r,o,u;for(u=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=n;break}return u},i=function(t,e){var n;return n=k(t,e),W(n)},p=function(t){return Te(t,_)},Ue=function(t){var e;return e={},Te(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Te=function(t,e){var n;return n=[],x(t,function(t){return e(t)?n.push(t):void 0}),n},be=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,u;for(u=[],t=0,o=r.length;o>t;t++)n=r[t],u.push(e.attr(n));return u}(),k(o,J)},le=function(t){return setTimeout(t,0)},ee=function(t){return t[t.length-1]},c=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ce=ue(function(){var t,n,r;return t=e("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),t.appendTo(document.body),n=t.get(0),r=n.offsetWidth-n.clientWidth,t.remove(),r}),me=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Ae=function(t,e,n){var r,o;return o=t.css(Object.keys(e)),t.css(e),r=function(){return t.css(o)},n?(n(),r()):me(r)},j=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),M(n)?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},b=function(t,n,o){var u,i,a,s,l,c;return u=e(t),up.browser.canCssAnimation()?(o=ge(o,{duration:300,delay:0,easing:"ease"}),i=e.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":o.duration+"ms","transition-delay":o.delay+"ms","transition-timing-function":o.easing},l=j(u),c=Ae(u,s),u.css(n),i.then(l),i.then(c),u.data(r,i),i.then(function(){return u.removeData(r)}),a=setTimeout(function(){return i.resolve()},o.duration+o.delay),i.then(function(){return clearTimeout(a)}),i):(u.css(n),xe())},r="up-animation-promise",$=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},oe=function(t,n){var r,o,u,i,a,s;return n=ge(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=t.position():(r=e(n.relative),a=t.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=t.offset(),o={left:i.left,top:i.top},n.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),n.full&&(s=c(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},h=function(t,e){var n,r,o,u,i;for(u=t.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],i.push(n.specified?e.attr(n.name,n.value):void 0);return i},O=function(t,e){return t.find(e).addBack(e)},E=function(t){return 27===t.keyCode},Pe=function(t,e){return 0===t.indexOf(e)},C=function(t,e){return t.indexOf(e)===t.length-e.length},d=function(t,e){return t.indexOf(e)>=0},l=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},ne=function(t){return t.getResponseHeader("X-Up-Location")},ae=function(t){return t.getResponseHeader("X-Up-Method")},he=function(){var e,n,r,o,u,i;for(i=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],e={},n=0,u=o.length;u>n;n++)r=o[n],i.hasOwnProperty(r)&&(e[r]=i[r]);return e},Z=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},te=function(t){var e;return e=Y(t.button)||0===t.button,e&&Z(t)},xe=function(){var t;return t=e.Deferred(),t.resolve(),t},Se=function(){return xe().promise()},fe=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},ke=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return x(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},Ee=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],r.push(K(t.attr(n))?t.attr(n,o):void 0);return r},we=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},S=function(){return e([])},se=function(t){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=t.length;u>o;o++)s=t[o],V(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(t){var n,r,o,u,i,s;for(r=S(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=t?t.find(s):e(s),r=r.add(n);return r},a.findWithSelf=function(t){var e;return e=a.find(t),a.doesMatch(t)&&(e=e.add(t)),e},a.doesMatch=function(t){var n;return n=e(t),i(a.parsed,function(t){return n.is(t)})},a.seekUp=function(t){var n,r,o;for(o=e(t),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||S()},a},s=function(e){var n,r,o,u,i,a,s,l,c,p,f,d;return null==e&&(e={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],e.log?(n[0]="["+e.log+"] "+n[0],w.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return K(e.size)?void 0:I(e.size)?e.size():q(e.size)?e.size:T("Invalid size config: %o",e.size)},o=function(){return K(e.expiry)?void 0:I(e.expiry)?e.expiry():q(e.expiry)?e.expiry:T("Invalid expiry config: %o",e.expiry)},c=function(t){return e.key?e.key(t):t.toString()},De=function(){var t,e,n,r;return r=m(a()),n=l(),n&&r.length>n&&(t=null,e=null,x(r,function(n){var r,o;return r=f[n],o=r.timestamp,!e||e>o?(t=n,e=o):void 0}),t)?delete f[t]:void 0},n=function(t,e){var n;return n=u(t),W(n)?p(e,n):void 0},d=function(){return(new Date).valueOf()},p=function(t,e){var n;return n=c(t),f[n]={timestamp:d(),value:e}},we=function(t){var e;return e=c(t),delete f[e]},i=function(t){var e,n;return e=o(),e?(n=d()-t.timestamp,n<o()):!0},u=function(t,e){var n,r;return null==e&&(e=void 0),r=c(t),(n=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),we(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:p,remove:we,clear:r,keys:a}},f=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return A(e,t)},e.reset(),Object.preventExtensions(e),e},ze=function(t){var e,n;return t=je(t),e=t.parentNode,n=$e(t.childNodes),x(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},de=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},D=function(t,n){var r,o,u,i;return r=e(t),o=de(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},a=function(t){var e,n,r;return e=t.toString(),r=new RegExp("\\(([^\\)]*)\\)"),(n=e.match(r))?n[1].split(/\s*,\s*/):T("Could not parse argument names of %o",t)},{argNames:a,offsetParent:de,fixedToAbsolute:D,presentAttr:be,createElement:v,normalizeUrl:pe,normalizeMethod:ce,createElementFromHtml:g,$createElementFromSelector:n,createSelectorFromElement:y,ajax:u,extend:A,copy:m,merge:ie,options:ge,option:ve,error:T,debug:w,warn:Re,each:x,map:re,identity:U,times:Oe,any:i,detect:k,select:Te,compact:p,uniq:Ue,last:ee,isNull:H,isDefined:W,isUndefined:Y,isGiven:_,isMissing:K,isPresent:J,isBlank:M,presence:ye,isObject:B,isFunction:I,isString:V,isElement:F,isJQuery:N,isPromise:G,isDeferred:L,isHash:Q,ifGiven:z,isUnmodifiedKeyEvent:Z,isUnmodifiedMouseEvent:te,nullJquery:fe,unJquery:je,nextFrame:le,measure:oe,temporaryCss:Ae,cssAnimate:b,finishCssAnimate:$,forceCompositing:j,escapePressed:E,copyAttributes:h,findWithSelf:O,contains:d,startsWith:Pe,endsWith:C,isArray:R,toArray:$e,castedAttr:l,locationFromXhr:ne,methodFromXhr:ae,clientSize:c,only:he,trim:De,resolvedPromise:Se,resolvedDeferred:xe,resolvableWhen:ke,setMissingAttrs:Ee,remove:we,memoize:ue,scrollbarWidth:Ce,config:f,cache:s,unwrapElement:ze,multiSelector:se,emptyJQuery:S,evalConsoleTemplate:P}}($),up.error=up.util.error,up.warn=up.util.warn,up.debug=up.util.debug}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,p=function(t,n){var r,o,u,i,a,s;return null==n&&(n={}),a=m.option(n.method,"get").toLowerCase(),"get"===a?location.href=t:e.rails?(s=n.target,u=e.rails.csrfToken(),o=e.rails.csrfParam(),r=e("<form method='post' action='"+t+"'></form>"),i="<input name='_method' value='"+a+"' type='hidden' />",m.isDefined(o)&&m.isDefined(u)&&(i+="<input name='"+o+"' value='"+u+"' type='hidden' />"),s&&r.attr("target",s),r.hide().append(i).appendTo("body"),r.submit()):error("Can't fake a "+a.toUpperCase()+" request without Rails UJS")},d=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],m.isDefined(console[r])||(r="log"),o()?console[r].apply(console,e):(n=m.evalConsoleTemplate.apply(m,e),console[r](n))},h=function(){return location.href},u=m.memoize(function(){return m.isDefined(history.pushState)&&"get"===i()}),a=m.memoize(function(){return m.isUndefined(document.addEventListener)}),s=m.memoize(function(){return a()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),n=m.memoize(function(){return"transition"in document.documentElement.style}),r=m.memoize(function(){return"oninput"in document.createElement("input")}),o=m.memoize(function(){return!s()}),l=m.memoize(function(){var t,n,r,o;return o=e.fn.jquery,r=o.split("."),t=parseInt(r[0]),n=parseInt(r[1]),t>=2||1===t&&n>=9}),f=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,m.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},i=m.memoize(function(){return(f("_up_request_method")||"get").toLowerCase()}),c=function(){return!a()&&l()},{url:h,loadPage:p,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:c,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u;return u=up.util,n=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),u.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},r=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],r=n.apply(null,e),!r.isDefaultPrevented()},o=function(){return up.bus.emit("up:framework:reset")},{emit:n,nobodyPrevents:r,reset:o}}(jQuery),up.reset=up.bus.reset}.call(this),function(){var t=[].slice;up.magic=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b;return y=up.util,n="up-destroyable",r="up-destroyer",m=[],c=null,b=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,s(r)])}},d=function(){var n,r,o,u,i;return r=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(u=y.copy(r),i=u.length-1,o=u[i],u[i]=b(o),m.push(u),n=e(document),n.on.apply(n,u),function(){return n.off.apply(n,u)}):function(){}},a=[],l=null,i=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(i=e.pop(),n=y.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return y.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),y.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(y.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=y.findWithSelf(t,i.selector),s.push(n.length?i.batch?o(i,n,n.get()):n.each(function(){return o(i,e(this),this)}):void 0);return s},p=function(t){return y.findWithSelf(t,"."+n).each(function(){var t,n;return t=e(this),(n=t.data(r))()})},s=function(t){var n,r;return n=e(t),r=n.attr("up-data"),y.isString(r)&&""!==y.trim(r)?JSON.parse(r):{}},g=function(){return c=y.copy(m),l=y.copy(a)},v=function(){var t,n,r,o;for(n=0,r=m.length;r>n;n++)t=m[n],y.contains(c,t)||(o=e(document)).off.apply(o,t);return m=y.copy(c),a=y.copy(l)},f=function(t){var n;return n=e(t),up.bus.emit("up:fragment:inserted",{$element:n}),n},h=function(t){return d("keydown","body",function(e){return y.escapePressed(e)?t(e):void 0})},d("ready",function(){return f(document.body)}),d("up:fragment:inserted",function(t){return u(t.$element)}),d("up:fragment:destroy",function(t){return p(t.$element)}),d("up:framework:boot",g),d("up:framework:reset",v),{compiler:i,on:d,hello:f,onEscape:h,data:s}}(jQuery),up.compiler=up.magic.compiler,up.on=up.magic.on,up.hello=up.magic.hello,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=void 0,i=void 0},a=function(t){return v.normalizeUrl(t,{hash:!0})},r=function(){return a(up.browser.url())},o=function(t){return a(t)===r()},s=function(t){return i&&(c=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},p=function(t,e){return u("push",t,e)},u=function(t,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=t+"State",a=e(),v.debug("Changing history to URL %o (%o)",n,t),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},e=function(){return{fromUp:!0}},h=function(t){var e,o;return o=r(),v.debug("Restoring state %o (now on "+o+")",t),e=n.popTargets.join(", "),up.replace(e,o,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})},l=function(t){var e;return v.debug("History state popped to URL %o",r()),s(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,(null!=e?e.fromUp:void 0)?h(e):v.debug("Discarding unknown state %o",e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[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",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal","[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=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(t,e,n){var r,o,i,a,s;return r=$(t),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:e},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(e),u.resolvedDeferred())},finishScrolling=function(t){return $(t).each(function(){var t;return(t=$(this).data(SCROLL_PROMISE_KEY))?t.resolve():void 0})},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)||u.error("Fixed element %o must have a CSS attribute %o",n,e),parseInt(r)+n.height()},e=function(){var t,e,o,u;for(o=$(config.fixedTop.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"top"));return u}(),t=function(){var t,e,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"bottom"));return u}(),{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,r,o,i,a,s,l,c,p,f,d,m,h,v;return u.debug("Revealing %o",t),e=u.options(e),n=$(t),r=e.viewport?$(e.viewport):viewportOf(n),m=u.option(e.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||e.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,e):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t){var e,n;return e=$(t),n=viewportSelector().seekUp(e),n.length||u.error("Could not find viewport for %o",e),n},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().findWithSelf(e)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var t,e,n,r,o,u,i;for(u={},o=config.viewports,e=0,r=o.length;r>e;e++)i=o[e],t=$(i),t.length&&(n=i,i===document&&(n="document"),u[n]=t.scrollTop());return u},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()),u.debug("Saving scroll positions for URL %o: %o",n,e),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i,a,s,l,c;null==t&&(t={}),c=up.history.url(),o=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),o=e.add(n)):o=viewports(),l=lastScrollTops.get(c),u.debug("Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)",c,o,l);for(i in l)s=l[i],a="document"===i?document:i,r=o.filter(a),scroll(r,s,{duration:0});return u.resolvedDeferred()},revealOrRestoreScroll=function(t,e){var n;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?reveal(n):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},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}.call(this),function(){up.flow=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,d=function(e,n){var r;return r=t(e),v.isPresent(n)&&(n=v.normalizeUrl(n)),r.attr("up-source",n)},m=function(e){var n;return n=t(e).closest("[up-source]"),v.presence(n.attr("up-source"))||up.browser.url()},f=function(e,n,r){var o,u,i;return v.debug("Replace %o with %o (options %o)",e,n,r),r=v.options(r),i=v.presence(e)?e:v.createSelectorFromElement(t(e)),up.browser.canPushState()||r.history===!1?(u={url:n,method:r.method,selector:i,cache:r.cache,preload:r.preload},o=up.proxy.ajax(u),o.done(function(t,e,o){var s,l;return(s=v.locationFromXhr(o))&&(v.debug("Location from server: %o",s),l={url:s,method:v.methodFromXhr(o),selector:i},up.proxy.alias(u,l),n=s),r.history!==!1&&(r.history=n),r.source!==!1&&(r.source=n),r.preload?void 0:a(i,t,r)}),o.fail(v.error),o):(r.preload||up.browser.loadPage(n,v.only(r,"method")),v.resolvedPromise())},a=function(t,e,n){var r,u,i,a,s,p,f,d;for(n=v.options(n,{historyMethod:"push"}),n.source=v.option(n.source,n.history),p=c(e),n.title||(n.title=p.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(t,n),f=[],i=0,a=s.length;a>i;i++)d=s[i],u=o(d.selector),r=p.find(d.selector).first(),f.push(h(u,r,d.pseudoClass,d.transition,n));return f},o=function(t){return u(".up-popup "+t)||u(".up-modal "+t)||u(t)||i(t)},i=function(t){var e;return e="Could not find selector %o in current body HTML","#"===e[0]&&(e+=" (avoid using IDs)"),v.error(e,t)},c=function(e){var n;return n=v.createElementFromHtml(e),{title:function(){var t;return null!=(t=n.querySelector("title"))?t.textContent:void 0},find:function(r){var o;return(o=n.querySelector(r))?t(o):v.error("Could not find selector %o in response %o",r,e)}}},r=function(t,n){return"function"==typeof n.insert&&n.insert(t),n.history&&(n.title&&(document.title=n.title),up.history[n.historyMethod](n.history)),n.source!==!1&&d(t,n.source),e(t),up.hello(t)},h=function(t,e,o,u,i){var a,s;return u||(u="none"),up.motion.finish(t),o?(s="before"===o?"prepend":"append",a=e.contents().wrap('<span class="up-insertion"></span>').parent(),t[s](a),v.copyAttributes(e,t),r(a.children(),i),up.layout.revealOrRestoreScroll(a,i).then(function(){return up.animate(a,u,i)}).then(function(){v.unwrapElement(a)})):n(t,{animation:function(){return e.insertBefore(t),r(e,i),t.is("body")&&"none"!==u&&v.error("Cannot apply transitions to body-elements (%o)",u),up.morph(t,e,u,i)}})},l=function(t,e){var n,r,o,u,i,a,s,l,c,p,f;for(p=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),v.isPresent(p)&&(f=p.split(n)),a=[],o=u=0,i=r.length;i>u;o=++u)s=r[o],l=s.match(/^(.+?)(?:\:(before|after))?$/),c=f[o]||v.last(f),a.push({selector:l[1],pseudoClass:l[2],transition:c});return a},e=function(t){var e,n;return n="[autofocus]:last",e=v.findWithSelf(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},s=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},u=function(e){var n,r,o,u,i,a;for(u=t(e).get(),r=null,i=0,a=u.length;a>i;i++)if(o=u[i],n=t(o),s(n)){r=n;break}return r},n=function(e,n){var r,o,u;return r=t(e),up.bus.nobodyPrevents("up:fragment:destroy",{$element:r})?(n=v.options(n,{animation:"none"}),o=up.motion.animateOptions(n),r.addClass("up-destroying"),v.isPresent(n.url)&&up.history.push(n.url),v.isPresent(n.title)&&(document.title=n.title),u=v.presence(n.animation,v.isDeferred)||up.motion.animate(r,n.animation,o),u.then(function(){return up.bus.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},p=function(t,e){var n;return e=v.options(e,{cache:!1}),n=e.url||m(t),f(t,n,e)},up.on("ready",function(){return d(document.body,up.browser.url())}),{replace:f,reload:p,destroy:n,implant:a,first:u}}(jQuery),up.replace=up.flow.replace,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first}.call(this),function(){up.motion=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S;return x=up.util,u={},s={},k={},l={},a=x.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=x.copy(s),k=x.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),p(a),u=r(u),("none"===o||o===!1)&&m(),x.isFunction(o)?i(o(a,u),o):x.isString(o)?n(a,c(o),u):x.isHash(o)?x.cssAnimate(a,o,u):x.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=x.options(t),n={},n.easing=x.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(x.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(x.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},c=function(t){return u[t]||x.error("Unknown animation %o",t)},e="up-ghosting-promise",S=function(t,n,r,o){var u,i,a,s,l,c,p;return s=void 0,i=void 0,l=void 0,a=void 0,u=up.layout.viewportOf(t),x.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),x.temporaryCss(t,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),p=x.temporaryCss(n,{visibility:"hidden"}),c=o(s.$ghost,i.$ghost),t.data(e,c),n.data(e,c),c.then(function(){return t.removeData(e),n.removeData(e),s.$bounds.remove(),i.$bounds.remove(),p()}),c},p=function(e){return t(e).each(function(){var e;return e=t(this),x.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(x.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return x.isDeferred(t)?t:x.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,c,f,m,h,v,b;return c=t(e),l=t(o),h=x.only(s,"reveal","restoreScroll"),h=x.extend(h,r(s)),up.browser.canCssAnimation()?(p(c),p(l),"none"===a||a===!1||(f=u[a])?(m=y(c,l,h),m.then(function(){return n(l,f||"none",s)}),m):(b=x.presence(a,x.isFunction)||k[a])?S(c,l,h,function(t,e){var n;return n=b(t,e,h),i(n,a)}):x.isString(a)&&a.indexOf("/")>=0?(v=a.split("/"),b=function(t,e,r){return g(n(t,v[0],r),n(e,v[1],r))},d(c,l,b,h)):x.error("Unknown transition %o",a)):y(c,l,h)},y=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},h=function(e,n){var r,o,u,i,a,s,l,c,p;for(i=x.measure(e,{relative:!0,inner:!0}),u=e.clone(),u.find("script").remove(),u.css({position:"static"===e.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),p=i.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(e),c(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],x.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},w=function(t,e){return k[t]=e},o=function(t,e){return u[t]=e},b=function(){return s=x.copy(u),l=x.copy(k)},g=x.resolvableWhen,m=x.resolvedDeferred,o("none",m),o("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),o("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),o("move-to-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css({"margin-top":"0px"}),n(t,{"margin-top":"-"+o+"px"},e)}),o("move-from-top",function(t,e){var r,o;return r=x.measure(t),o=r.top+r.height,t.css({"margin-top":"-"+o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css({"margin-top":"0px"}),n(t,{"margin-top":o+"px"},e)}),o("move-from-bottom",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().height-r.top,t.css({"margin-top":o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css({"margin-left":"0px"}),n(t,{"margin-left":"-"+o+"px"},e)}),o("move-from-left",function(t,e){var r,o;return r=x.measure(t),o=r.left+r.width,t.css({"margin-left":"-"+o+"px"}),n(t,{"margin-left":"0px"},e)}),o("move-to-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":"0px"}),n(t,{"margin-left":o+"px"},e)}),o("move-from-right",function(t,e){var r,o;return r=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":o+"px"}),n(t,{"margin-left":"0px"},e)}),o("roll-down",function(t,e){var r,o;return r=t.height(),o=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),w("none",m),w("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),w("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),w("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),w("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),w("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",b),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:p,transition:w,animation:o,config:a,defaults:function(){return x.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:m,when:g,prependCopy:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate
2
+ }.call(this),function(){up.proxy=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,E,P,A,O;return O=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=O.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5}),l=function(t){return k(t),[t.url,t.method,t.data,t.selector].join("|")},s=O.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=s.get,P=s.set,T=s.remove,d=s.clear,p=function(){return clearTimeout(C),C=null},c=function(){return clearTimeout(i),i=null},E=function(){return e=null,p(),c(),x=0,m.reset(),a=!1,s.clear()},E(),o=s.alias,k=function(t){return t._normalized||(t.method=O.normalizeMethod(t.method),t.url&&(t.url=O.normalizeUrl(t.url)),t.selector||(t.selector="body"),t._normalized=!0),t},r=function(t){var e,n,r,o,u;return e=t.cache===!0,n=t.cache===!1,u=O.only(t,"url","method","data","selector","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),P(u,o),o.fail(function(){return T(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.bus.emit("up:proxy:busy"),a=!0):void 0},m.busyDelay>0?i=setTimeout(t,m.busyDelay):t()):void 0},b=function(){return x-=1,v()&&a?(up.bus.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return O.debug("Loading URL %o",t.url),up.bus.emit("up:proxy:load",t),e=O.ajax(t),e.always(function(){return up.bus.emit("up:proxy:receive",t)}),e},g=function(t){return k(t),O.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(O.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,p(),n=function(){return S(t),e=null},A(n,r))},A=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=O.options(n),o=up.link.followMethod(r,n),g({method:o})?(O.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(O.debug("Won't preload %o due to unsafe method %o",r,o),O.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(t,e){return up.link.childClicked(t,e)?void 0:f(e)}),up.on("up:framework:reset",E),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:T,idle:v,busy:u,config:m,defaults:function(){return O.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery)}.call(this),function(){up.link=function($){var childClicked,follow,followMethod,makeFollowable,shouldProcessLinkEvent,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,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"),"body"),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),u.castedAttr(n,"up-animation")),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-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=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){return e=u.options(e),u.option(e.method,t.attr("up-method"),t.attr("data-method"),"get").toUpperCase()},up.on("click","a[up-target], [up-href][up-target]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.on("mousedown","a[up-instant], [up-href][up-instant]",function(t,e){return shouldProcessLinkEvent(t,e)?(t.preventDefault(),follow(e)):void 0}),childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},shouldProcessLinkEvent=function(t,e){return u.isUnmodifiedMouseEvent(t)&&!childClicked(t,e)},makeFollowable=function(t){var e;return e=$(t),u.isMissing(e.attr("up-target"))&&u.isMissing(e.attr("up-follow"))?e.attr("up-follow",""):void 0},up.on("click","a[up-follow], [up-href][up-follow]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.compiler("[up-expand]",function(t){var e,n,r,o,i,a,s,l;for(o=t.find("a, [up-href]").get(0),o||u.error("No link to expand within %o",t),l=/^up-/,a={},a["up-href"]=$(o).attr("href"),s=o.attributes,n=0,r=s.length;r>n;n++)e=s[n],i=e.name,i.match(l)&&(a[i]=e.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}),up.compiler("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),e={"up-preload":"true","up-instant":"true"},n===!0?e["up-follow"]="":e["up-target"]=n,u.setMissingAttrs(t,e),t.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,childClicked:childClicked,followMethod:followMethod}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){up.form=function($){var observe,submit,u;return u=up.util,submit=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m;return n=$(t).closest("form"),e=u.options(e),c=u.option(e.target,n.attr("up-target"),"body"),r=u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),i=u.option(e.history,u.castedAttr(n,"up-history"),!0),p=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),p),a=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),s={},s.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),s.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),s.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),s=u.extend(s,up.motion.animateOptions(e,n)),m=u.option(e.cache,u.castedAttr(n,"up-cache")),d=u.option(e.url,n.attr("action"),up.browser.url()),n.addClass("up-active"),up.browser.canPushState()||i===!1?(l={url:d,method:a,data:n.serialize(),selector:c,cache:m},f=function(t){var e;return d=void 0,u.isGiven(i)&&(i===!1||u.isString(i)?d=i:(e=u.locationFromXhr(t))?d=e:"GET"===l.type&&(d=l.url+"?"+l.data)),u.option(d,!1)},up.proxy.ajax(l).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(s,{history:f(n),transition:p}),up.flow.implant(c,t,r)}).fail(function(t){var e,n;return n=t.responseText,e=u.merge(s,{transition:o}),up.flow.implant(r,n,e)})):void n.get(0).submit()},observe=function(fieldOrSelector,options){var $field,callback,callbackPromise,callbackTimer,changeEvents,check,clearTimer,codeOnChange,delay,knownValue,nextCallback,runNextCallback;return $field=$(fieldOrSelector),options=u.options(options),delay=u.option($field.attr("up-delay"),options.delay,0),delay=parseInt(delay),knownValue=null,callback=null,callbackTimer=null,(codeOnChange=$field.attr("up-observe"))?callback=function(value,$field){return eval(codeOnChange)}:options.change?callback=options.change:u.error("up.observe: No change callback given"),callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var t;return nextCallback?(t=nextCallback(),nextCallback=null,t):void 0},check=function(){var t,e;return e=$field.val(),t=u.isNull(knownValue),knownValue===e||(knownValue=e,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($field.get(0),[e,$field])},callbackTimer=setTimeout(function(){return callbackPromise.then(function(){var t;return t=runNextCallback(),callbackPromise=u.isPromise(t)?t:u.resolvedPromise()})},delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$field.on(changeEvents,check),check(),clearTimer},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),{submit:submit,observe:observe}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,a=void 0,o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),p=function(){return r(),o.reset()},f=function(t,e,n){var r,o;return o=m.measure(t,{full:!0}),r=function(){switch(n){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.bottom+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return m.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r),l(e)},l=function(t){var e,n,r,o,u,i,a;if(n=m.measure(t,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((u=parseInt(t.css("left")))?t.css("left",u-r):(i=parseInt(t.css("right")))&&t.css("right",i+r)),o){if(a=parseInt(t.css("top")))return t.css("top",a-o);if(e=parseInt(t.css("bottom")))return t.css("bottom",e+o)}},c=function(){var e;return e=t(".up-popup"),e.attr("up-previous-url",up.browser.url()),e.attr("up-previous-title",document.title)},s=function(){var e;return e=t(".up-popup"),e.removeAttr("up-previous-url"),e.removeAttr("up-previous-title")},i=function(t,e,n){var r,o;return o=m.$createElementFromSelector(".up-popup"),n&&o.attr("up-sticky",""),r=m.$createElementFromSelector(e),r.appendTo(o),o.appendTo(document.body),c(),o.hide(),o},h=function(t,e,n,r,o){return e.show(),f(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,a,s,l,c,p,f,d,v;return u=t(e),n=m.options(n),v=m.option(n.url,u.attr("href")),f=m.option(n.target,u.attr("up-popup"),"body"),p=m.option(n.position,u.attr("up-position"),o.position),l=m.option(n.animation,u.attr("up-animation"),o.openAnimation),d=m.option(n.sticky,m.castedAttr(u,"up-sticky")),c=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),a=i(u,f,d),up.replace(f,v,{history:c,insert:function(){return h(u,a,p,l,s)}})},d=function(){return a},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-previous-url"),title:n.attr("up-previous-title")}),a=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(s(),r())},u=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.on("click","a[up-popup]",function(t,n){return t.preventDefault(),n.is(".up-current")?r():e(n)}),up.on("click","body",function(e){var n;return n=t(e.target),n.closest(".up-popup").length||n.closest("[up-popup]").length?void 0:r()}),up.on("up:fragment:inserted",function(t,e){var r;return u(e)?(r=e.attr("up-source"))?a=r:void 0:n()}),up.magic.onEscape(function(){return r()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-popup").length?(r(),t.preventDefault()):void 0}),up.on("up:framework:reset",p),{attach:e,close:r,source:d,config:o,defaults:function(){return m.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:u,open:function(){return up.warn("up.popup.open no longer exists. Please use up.popup.attach instead.")}}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y;return h=up.util,r=h.config({maxWidth:null,minWidth:null,width:null,height:null,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(t){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+t.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),i=void 0,p=function(){return n(),i=void 0,r.reset()},m=function(){var t;return t=r.template,h.isFunction(t)?t(r):t},c=function(){var e;return e=t(".up-modal"),e.attr("up-previous-url",up.browser.url()),e.attr("up-previous-title",document.title)},a=function(){var e;return e=t(".up-modal"),e.removeAttr("up-previous-url"),e.removeAttr("up-previous-title")},u=function(e){var n,r,o,u;return o=t(m()),e.sticky&&o.attr("up-sticky",""),o.attr("up-previous-url",up.browser.url()),o.attr("up-previous-title",document.title),r=o.find(".up-modal-dialog"),h.isPresent(e.width)&&r.css("width",e.width),h.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),h.isPresent(e.height)&&r.css("height",e.height),n=o.find(".up-modal-content"),u=h.$createElementFromSelector(e.selector),u.appendTo(n),o.appendTo(document.body),c(),o.hide(),o},v=[],f=function(){var e,n,r,o;return r=h.scrollbarWidth(),e=parseInt(t("body").css("padding-right")),n=r+e,o=h.temporaryCss(t("body"),{"padding-right":n+"px","overflow-y":"hidden"}),v.push(o),up.layout.anchoredRight().each(function(){var e,n,o,u;return e=t(this),n=parseInt(e.css("right")),o=r+n,u=h.temporaryCss(e,{right:o}),v.push(u)})},g=function(t,e,n){var r;return f(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.bus.emit("up:modal:opened")})},s=function(e,n){return n=h.options(n),n.$link=t(e),l(n)},y=function(t,e){return e=h.options(e),e.url=t,l(e)},l=function(e){var o,i,a,s,l,c,p,f,d,m,v;return e=h.options(e),o=h.option(e.$link,h.nullJquery()),m=h.option(e.url,o.attr("up-href"),o.attr("href")),f=h.option(e.target,o.attr("up-modal"),"body"),v=h.option(e.width,o.attr("up-width"),r.width),p=h.option(e.maxWidth,o.attr("up-max-width"),r.maxWidth),l=h.option(e.height,o.attr("up-height"),r.height),s=h.option(e.animation,o.attr("up-animation"),r.openAnimation),d=h.option(e.sticky,h.castedAttr(o,"up-sticky")),c=up.browser.canPushState()?h.option(e.history,h.castedAttr(o,"up-history"),!0):!1,a=up.motion.animateOptions(e,o),n(),up.bus.nobodyPrevents("up:modal:open",{url:m})?(i=u({selector:f,width:v,maxWidth:p,height:l,sticky:d}),up.replace(f,m,{history:c,insert:function(){return g(i,s,a)}})):t.Deferred()},d=function(){return i},n=function(e){var n,o;return n=t(".up-modal"),n.length?up.bus.nobodyPrevents("up:modal:close",{$element:n})?(e=h.options(e,{animation:r.closeAnimation,url:n.attr("up-previous-url"),title:n.attr("up-previous-title")}),i=void 0,o=up.destroy(n,e),o.then(function(){for(var t;t=v.pop();)t();return up.bus.emit("up:modal:closed")}),o):t.Deferred():h.resolvedDeferred()},e=function(){return t(".up-modal").is("[up-sticky]")?void 0:(a(),n())},o=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},up.on("click","a[up-modal]",function(t,e){return t.preventDefault(),e.is(".up-current")?n():s(e)}),up.on("click","body",function(e){var r;return r=t(e.target),r.closest(".up-modal-dialog").length||r.closest("[up-modal]").length?void 0:n()}),up.on("up:fragment:inserted",function(t,n){var r;if(o(n)){if(r=n.attr("up-source"))return i=r}else if(!up.popup.contains(n))return e()}),up.magic.onEscape(function(){return n()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(n(),t.preventDefault()):void 0}),up.on("up:framework:reset",p),{visit:y,follow:s,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:n,source:d,config:r,defaults:function(){return h.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:o}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u;return u=up.util,o=function(t,e,n){var r,o,i;return o=u.measure(t),i=u.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-i.width),top:o.top-i.height};case"bottom":return{left:o.left+.5*(o.width-i.width),top:o.top+o.height};default:return u.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},r=function(t){var e;return e=u.$createElementFromSelector(".up-tooltip"),u.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,i){var a,s,l,c,p,f,d;return null==i&&(i={}),a=t(e),p=u.option(i.html,a.attr("up-tooltip-html")),d=u.option(i.text,a.attr("up-tooltip"),a.attr("title")),f=u.option(i.position,a.attr("up-position"),"top"),c=u.option(i.animation,u.castedAttr(a,"up-animation"),"fade-in"),l=up.motion.animateOptions(i,a),n(),s=r({text:d,html:p}),o(a,s,f),up.animate(s,c,l)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=u.options(e,{animation:"fade-out"}),e=u.merge(e,up.motion.animateOptions(e)),up.destroy(n,e)):void 0},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseover",function(){return e(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(){return n()}),up.on("up:framework:reset",n),up.magic.onEscape(function(){return n()}),{attach:e,close:n,open:function(){return u.error("up.tooltip.open no longer exists. Use up.tooltip.attach instead.")}}}(jQuery)}.call(this),function(){up.navigation=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),p=function(){return i.reset()},a=function(){var t;return t=i.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},e="up-active",n=["a","[up-href]","[up-alias]"],o=n.join(", "),u=function(){var t,e,r;for(r=[],t=0,e=n.length;e>t;t++)m=n[t],r.push(m+"[up-instant]");return r}().join(", "),r="."+e,c=function(t){return h.isPresent(t)?h.normalizeUrl(t,{search:!1,stripTrailingSlash:!0}):void 0},d=function(t){var e,n,r,o,u,i,a,s,l,p;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(e=i[n],l=h.presentAttr(t,e))for(p="up-alias"===e?l.split(" "):[l],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=c(a),s.push(a));return s},g=function(t){var e,n,r,o;return 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}},l=function(){var e,n;return e=g([c(up.browser.url()),c(up.modal.source()),c(up.popup.source())]),n=a(),h.each(t(o),function(r){var o,u;return o=t(r),u=d(o),e.matchesAny(u)?o.addClass(n):o.removeClass(n)})},f=function(t){return v(),t=s(t),t.addClass(e)},s=function(t){return h.presence(t.parents(o))||t},v=function(){return t(r).removeClass(e)},up.on("click",o,function(t,e){return h.isUnmodifiedMouseEvent(t)&&!e.is("[up-instant]")?f(e):void 0}),up.on("mousedown",u,function(t,e){return h.isUnmodifiedMouseEvent(t)?f(e):void 0}),up.on("up:fragment:inserted",function(){return v(),l()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",p),{config:i,defaults:function(){return h.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")}}}(jQuery)}.call(this),function(){up.browser.isSupported()&&(up.bus.emit("up:framework:boot"),up.bus.emit("up:framework:booted"))}.call(this),function(){}.call(this);
@@ -65,7 +65,7 @@ up.bus = (($) ->
65
65
  Emits an event with the given name and property.
66
66
  Returns whether any event listener has prevented the default action.
67
67
 
68
- @method nobodyPrevents
68
+ @method up.bus.nobodyPrevents
69
69
  @protected
70
70
  ###
71
71
  nobodyPrevents = (args...) ->
@@ -167,12 +167,6 @@ up.flow = (($) ->
167
167
  else
168
168
  u.error("Could not find selector %o in response %o", selector, html)
169
169
 
170
- reveal = ($element, options) ->
171
- if options.reveal
172
- up.reveal($element)
173
- else
174
- u.resolvedDeferred()
175
-
176
170
  elementsInserted = ($new, options) ->
177
171
  options.insert?($new)
178
172
  if options.history
@@ -182,8 +176,6 @@ up.flow = (($) ->
182
176
  # offer reload functionality.
183
177
  unless options.source is false
184
178
  setSource($new, options.source)
185
- if options.restoreScroll
186
- up.layout.restoreScroll(around: $new)
187
179
  autofocus($new)
188
180
  # The fragment should be readiet before animating,
189
181
  # so transitions see .up-current classes
@@ -211,7 +203,7 @@ up.flow = (($) ->
211
203
  elementsInserted($wrapper.children(), options)
212
204
 
213
205
  # Reveal element that was being prepended/appended.
214
- reveal($wrapper, options)
206
+ up.layout.revealOrRestoreScroll($wrapper, options)
215
207
  .then ->
216
208
  # Since we're adding content instead of replacing, we'll only
217
209
  # animate $new instead of morphing between $old and $new
@@ -18,6 +18,7 @@ up.history = (($) ->
18
18
 
19
19
  ###*
20
20
  @method up.history.config
21
+ @property
21
22
  @param {Array<String>} [config.popTargets=['body']]
22
23
  An array of CSS selectors to replace when the user goes
23
24
  back in history.
@@ -14,6 +14,7 @@ up.layout = (($) ->
14
14
  Configures the application layout.
15
15
 
16
16
  @method up.layout.config
17
+ @property
17
18
  @param {Array<String>} [config.viewports]
18
19
  An array of CSS selectors that find viewports
19
20
  (containers that scroll their contents).
@@ -207,6 +208,7 @@ up.layout = (($) ->
207
208
  A promise that will be resolved when the element is revealed.
208
209
  ###
209
210
  reveal = (elementOrSelector, options) ->
211
+ u.debug('Revealing %o', elementOrSelector)
210
212
  options = u.options(options)
211
213
  $element = $(elementOrSelector)
212
214
  $viewport = if options.viewport then $(options.viewport) else viewportOf($element)
@@ -348,6 +350,7 @@ up.layout = (($) ->
348
350
  saveScroll = (options = {}) ->
349
351
  url = u.option(options.url, up.history.url())
350
352
  tops = u.option(options.tops, scrollTops())
353
+ u.debug('Saving scroll positions for URL %o: %o', url, tops)
351
354
  lastScrollTops.set(url, tops)
352
355
 
353
356
  ###*
@@ -362,6 +365,8 @@ up.layout = (($) ->
362
365
  ###
363
366
  restoreScroll = (options = {}) ->
364
367
 
368
+ url = up.history.url()
369
+
365
370
  $viewports = undefined
366
371
 
367
372
  if options.around
@@ -371,12 +376,33 @@ up.layout = (($) ->
371
376
  else
372
377
  $viewports = viewports()
373
378
 
374
- tops = lastScrollTops.get(up.history.url())
379
+ tops = lastScrollTops.get(url)
380
+
381
+ u.debug('Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)', url, $viewports, tops)
375
382
 
376
383
  for key, scrollTop of tops
377
384
  right = if key == 'document' then document else key
378
385
  $matchingViewport = $viewports.filter(right)
379
- up.scroll($matchingViewport, scrollTop, duration: 0)
386
+ scroll($matchingViewport, scrollTop, duration: 0)
387
+
388
+ # Since scrolling happens without animation, we don't need to
389
+ # join promises from the up.scroll call above
390
+ u.resolvedDeferred()
391
+
392
+ ###*
393
+ @protected
394
+ @method up.layout.revealOrRestoreScroll
395
+ @return {Deferred} A promise for when the revealing or scroll restauration ends
396
+ ###
397
+ revealOrRestoreScroll = (selectorOrElement, options) ->
398
+ $element = $(selectorOrElement)
399
+ if options.restoreScroll
400
+ restoreScroll(around: $element)
401
+ else if options.reveal
402
+ reveal($element)
403
+ else
404
+ u.resolvedDeferred()
405
+
380
406
 
381
407
  ###*
382
408
  Marks this element as a scrolling container. Apply this ttribute if your app uses
@@ -460,6 +486,7 @@ up.layout = (($) ->
460
486
 
461
487
  up.on 'up:framework:reset', reset
462
488
 
489
+ knife: eval(Knife?.point)
463
490
  reveal: reveal
464
491
  scroll: scroll
465
492
  finishScrolling: finishScrolling
@@ -471,6 +498,7 @@ up.layout = (($) ->
471
498
  scrollTops: scrollTops
472
499
  saveScroll: saveScroll
473
500
  restoreScroll: restoreScroll
501
+ revealOrRestoreScroll: revealOrRestoreScroll
474
502
  anchoredRight: anchoredRight
475
503
  fixedChildren: fixedChildren
476
504
 
@@ -78,6 +78,8 @@ up.magic = (($) ->
78
78
  The function takes the affected element as the first argument (as a jQuery object).
79
79
  If the element has an `up-data` attribute, its value is parsed as JSON
80
80
  and passed as a second argument.
81
+ @return {Function}
82
+ A function that unbinds the event listeners when called.
81
83
  ###
82
84
  liveDescriptions = []
83
85
  defaultLiveDescriptions = null
@@ -92,8 +94,9 @@ up.magic = (($) ->
92
94
  upListener.apply($me.get(0), [event, $me, data($me)])
93
95
 
94
96
  live = (args...) ->
95
- # Silently discard any event handlers that are registered on unsupported browsers
96
- return unless up.browser.isSupported()
97
+ # Silently discard any event handlers that are registered on unsupported
98
+ # browsers and return a no-op destructor
99
+ return (->) unless up.browser.isSupported()
97
100
 
98
101
  description = u.copy(args)
99
102
  lastIndex = description.length - 1
@@ -104,7 +107,11 @@ up.magic = (($) ->
104
107
  # clean up after ourselves during a reset
105
108
  liveDescriptions.push(description)
106
109
 
107
- $(document).on(description...)
110
+ $document = $(document)
111
+ $document.on(description...)
112
+
113
+ # Return destructor
114
+ -> $document.off(description...)
108
115
 
109
116
  ###*
110
117
  Registers a function to be called whenever an element with
@@ -17,6 +17,7 @@ up.modal = (($) ->
17
17
  Sets default options for future modals.
18
18
 
19
19
  @method up.modal.config
20
+ @property
20
21
  @param {Number} [config.width]
21
22
  The width of the dialog as a CSS value like `'400px'` or `50%`.
22
23
 
@@ -50,10 +51,10 @@ up.modal = (($) ->
50
51
  to both the dialog box and the overlay dimming the page.
51
52
  ###
52
53
  config = u.config
53
- maxWidth: undefined
54
- minWidth: undefined
55
- width: undefined
56
- height: undefined
54
+ maxWidth: null
55
+ minWidth: null
56
+ width: null
57
+ height: null
57
58
  openAnimation: 'fade-in'
58
59
  closeAnimation: 'fade-out'
59
60
  closeLabel: '×'
@@ -155,7 +156,7 @@ up.modal = (($) ->
155
156
  animation has finished and the modal contents are fully visible.
156
157
 
157
158
  @method up.modal.follow
158
- @param {Element|jQuery|String} elementOrSelector
159
+ @param {Element|jQuery|String} linkOrSelector
159
160
  The link to follow.
160
161
  @param {String} [options.target]
161
162
  The selector to extract from the response and open in a modal dialog.
@@ -181,9 +182,9 @@ up.modal = (($) ->
181
182
  @return {Promise}
182
183
  A promise that will be resolved when the modal has finished loading.
183
184
  ###
184
- follow = ($link, options) ->
185
+ follow = (linkOrSelector, options) ->
185
186
  options = u.options(options)
186
- options.$link = $link
187
+ options.$link = $(linkOrSelector)
187
188
  open(options)
188
189
 
189
190
 
@@ -382,7 +383,7 @@ up.modal = (($) ->
382
383
  if $link.is('.up-current')
383
384
  close()
384
385
  else
385
- open($link)
386
+ follow($link)
386
387
  )
387
388
 
388
389
  # Close the modal when someone clicks outside the dialog
@@ -38,6 +38,7 @@ up.motion = (($) ->
38
38
  Sets default options for animations and transitions.
39
39
 
40
40
  @method up.motion.config
41
+ @property
41
42
  @param {Number} [config.duration=300]
42
43
  @param {Number} [config.delay=0]
43
44
  @param {String} [config.easing='ease']
@@ -175,7 +176,7 @@ up.motion = (($) ->
175
176
 
176
177
  u.temporaryCss $old, display: 'none', ->
177
178
  # Within this block, $old is hidden but $new is visible
178
- up.reveal($new, viewport: $viewport) if options.reveal
179
+ up.layout.revealOrRestoreScroll($new, options)
179
180
  newCopy = prependCopy($new, $viewport)
180
181
  newScrollTop = $viewport.scrollTop()
181
182
 
@@ -286,19 +287,17 @@ up.motion = (($) ->
286
287
  $old = $(source)
287
288
  $new = $(target)
288
289
 
289
- if up.browser.canCssAnimation()
290
- parsedOptions = u.only(options, 'reveal')
291
- parsedOptions = u.extend(parsedOptions, animateOptions(options))
290
+ parsedOptions = u.only(options, 'reveal', 'restoreScroll')
291
+ parsedOptions = u.extend(parsedOptions, animateOptions(options))
292
292
 
293
+ if up.browser.canCssAnimation()
293
294
  finish($old)
294
295
  finish($new)
295
296
 
296
297
  if transitionOrName == 'none' || transitionOrName == false || animation = animations[transitionOrName]
297
- $old.hide()
298
- # Since we can not longer rely on withGhosts to process options.reveal
299
- # in this branch, we need to do it ourselves.
300
- up.reveal($new) if options.reveal
301
- animate($new, animation || 'none', options)
298
+ deferred = skipMorph($old, $new, parsedOptions)
299
+ deferred.then -> animate($new, animation || 'none', options)
300
+ deferred
302
301
  else if transition = u.presence(transitionOrName, u.isFunction) || transitions[transitionOrName]
303
302
  withGhosts $old, $new, parsedOptions, ($oldGhost, $newGhost) ->
304
303
  transitionPromise = transition($oldGhost, $newGhost, parsedOptions)
@@ -314,10 +313,21 @@ up.motion = (($) ->
314
313
  else
315
314
  u.error("Unknown transition %o", transitionOrName)
316
315
  else
317
- # Skip ghosting and all the other stuff that can go wrong in ancient browsers.
318
- # We simple hide the old element, which would be the side effect of withGhosts(...) above.
319
- $old.hide()
320
- u.resolvedDeferred()
316
+ skipMorph($old, $new, parsedOptions)
317
+
318
+ ###*
319
+ Cause the side effects of a successful transitions, but instantly.
320
+ We use this to skip morphing for old browsers, or when the developer
321
+ decides to only animate the new element (i.e. no real ghosting or transition) .
322
+
323
+ @private
324
+ ###
325
+ skipMorph = ($old, $new, options) ->
326
+ # Simply hide the old element, which would be the side effect of withGhosts(...) below.
327
+ $old.hide()
328
+ # Since we cannot rely on withGhosts to control the scroll position
329
+ # in this branch, we need to do it ourselves.
330
+ up.layout.revealOrRestoreScroll($new, options)
321
331
 
322
332
  ###*
323
333
  @private
@@ -19,6 +19,7 @@ up.navigation = (($) ->
19
19
  Sets default options for this module.
20
20
 
21
21
  @method up.navigation.config
22
+ @property
22
23
  @param {Number} [config.currentClasses]
23
24
  An array of classes to set on [links that point the current location](#up-current).
24
25
  ###
@@ -80,6 +81,7 @@ up.navigation = (($) ->
80
81
  matchesAny: matchesAny
81
82
 
82
83
  locationChanged = ->
84
+
83
85
  currentUrls = urlSet([
84
86
  normalizeUrl(up.browser.url()),
85
87
  normalizeUrl(up.modal.source()),
@@ -199,7 +201,7 @@ up.navigation = (($) ->
199
201
  # location bar).
200
202
  locationChanged()
201
203
 
202
- up.on 'up:fragment:destroy', (event, $fragment) ->
204
+ up.on 'up:fragment:destroyed', (event, $fragment) ->
203
205
  # If the destroyed fragment is a modal or popup container
204
206
  # this changes which URLs we consider currents.
205
207
  # Also modals and popups restore their previous history
@@ -29,9 +29,10 @@ up.popup = (($) ->
29
29
 
30
30
  ###*
31
31
  @method up.popup.config
32
- @param {String} config.openAnimation
33
- @param {String} config.closeAnimation
34
- @param {String} config.position
32
+ @property
33
+ @param {String} [config.openAnimation]
34
+ @param {String} [config.closeAnimation]
35
+ @param {String} [config.position]
35
36
  ###
36
37
  config = u.config
37
38
  openAnimation: 'fade-in'
@@ -61,6 +61,7 @@ up.proxy = (($) ->
61
61
 
62
62
  ###*
63
63
  @method up.proxy.config
64
+ @property
64
65
  @param {Number} [config.preloadDelay=75]
65
66
  The number of milliseconds to wait before [`[up-preload]`](#up-preload)
66
67
  starts preloading.
@@ -110,7 +110,7 @@ up.tooltip = (($) ->
110
110
  up.compiler('[up-tooltip], [up-tooltip-html]', ($link) ->
111
111
  # Don't register these events on document since *every*
112
112
  # mouse move interaction bubbles up to the document.
113
- $link.on('mouseover', -> open($link))
113
+ $link.on('mouseover', -> attach($link))
114
114
  $link.on('mouseout', -> close())
115
115
  )
116
116
 
@@ -1,5 +1,5 @@
1
1
  module Upjs
2
2
  module Rails
3
- VERSION = '0.12.0'
3
+ VERSION = '0.12.1'
4
4
  end
5
5
  end
@@ -64,7 +64,6 @@ describe 'up.flow', ->
64
64
  @respond()
65
65
  @request.then ->
66
66
  expect($('.before')).toHaveText('old-before')
67
- console.log("foooo", $('.middle').text())
68
67
  expect($('.middle')).toHaveText('new-middleold-middle')
69
68
  expect($('.after')).toHaveText('old-after')
70
69
  done()
@@ -114,13 +113,43 @@ describe 'up.flow', ->
114
113
  expect(window.scriptTagExecuted).toHaveBeenCalledWith('middle')
115
114
  done()
116
115
 
117
- it 'restores the scroll positions of all viewports within the target with options.restoreScroll'
116
+ describe 'with { restoreScroll: true } option', ->
117
+
118
+ it 'restores the scroll positions of all viewports around the target', ->
119
+
120
+ $viewport = affix('div[up-viewport] .element').css
121
+ 'height': '100px'
122
+ 'width': '100px'
123
+ 'overflow-y': 'scroll'
124
+
125
+ respond = =>
126
+ @lastRequest().respondWith
127
+ status: 200
128
+ contentType: 'text/html'
129
+ responseText: '<div class="element" style="height: 300px"></div>'
130
+
131
+ up.replace('.element', '/foo')
132
+ respond()
133
+
134
+ $viewport.scrollTop(65)
135
+
136
+ up.replace('.element', '/bar')
137
+ respond()
138
+
139
+ $viewport.scrollTop(0)
140
+
141
+ up.replace('.element', '/foo', restoreScroll: true)
142
+ # No need to respond because /foo has been cached before
143
+
144
+ expect($viewport.scrollTop()).toEqual(65)
145
+
118
146
 
119
147
  describe 'with { reveal: true } option', ->
120
148
 
121
149
  beforeEach ->
122
150
  @revealedHTML = ''
123
- spyOn(up, 'reveal').and.callFake ($revealedElement) =>
151
+
152
+ @revealMock = up.layout.knife.mock('reveal').and.callFake ($revealedElement) =>
124
153
  @revealedHTML = $revealedElement.get(0).outerHTML
125
154
  u.resolvedDeferred()
126
155
 
@@ -128,7 +157,7 @@ describe 'up.flow', ->
128
157
  @request = up.replace('.middle', '/path', reveal: true)
129
158
  @respond()
130
159
  @request.then =>
131
- expect(up.reveal).not.toHaveBeenCalledWith(@oldMiddle)
160
+ expect(@revealMock).not.toHaveBeenCalledWith(@oldMiddle)
132
161
  expect(@revealedHTML).toContain('new-middle')
133
162
  done()
134
163
 
@@ -136,7 +165,7 @@ describe 'up.flow', ->
136
165
  @request = up.replace('.middle:after', '/path', reveal: true)
137
166
  @respond()
138
167
  @request.then =>
139
- expect(up.reveal).not.toHaveBeenCalledWith(@oldMiddle)
168
+ expect(@revealMock).not.toHaveBeenCalledWith(@oldMiddle)
140
169
  # Text nodes are wrapped in a .up-insertion container so we can
141
170
  # animate them and measure their position/size for scrolling.
142
171
  # This is not possible for container-less text nodes.
@@ -149,7 +178,7 @@ describe 'up.flow', ->
149
178
  @request = up.replace('.middle:before', '/path', reveal: true)
150
179
  @respond()
151
180
  @request.then =>
152
- expect(up.reveal).not.toHaveBeenCalledWith(@oldMiddle)
181
+ expect(@revealMock).not.toHaveBeenCalledWith(@oldMiddle)
153
182
  # Text nodes are wrapped in a .up-insertion container so we can
154
183
  # animate them and measure their position/size for scrolling.
155
184
  # This is not possible for container-less text nodes.
@@ -94,6 +94,47 @@ describe 'up.link', ->
94
94
 
95
95
  done()
96
96
 
97
+ describe 'with { restoreScroll: true } option', ->
98
+
99
+ it 'does not reveal, but instead restores the scroll positions of all viewports around the target', ->
100
+
101
+ $viewport = affix('div[up-viewport] .element').css
102
+ 'height': '100px'
103
+ 'width': '100px'
104
+ 'overflow-y': 'scroll'
105
+
106
+ followLink = (options = {}) ->
107
+ $link = $viewport.find('.link')
108
+ up.follow($link, options)
109
+
110
+ respond = (linkDestination) =>
111
+ @lastRequest().respondWith
112
+ status: 200
113
+ contentType: 'text/html'
114
+ responseText: """
115
+ <div class="element" style="height: 300px">
116
+ <a class="link" href="#{linkDestination}" up-target=".element">Link</a>
117
+ </div>
118
+ """
119
+
120
+ up.replace('.element', '/foo')
121
+ # Provide the content at /foo with a link to /bar in the HTML
122
+ respond('/bar')
123
+
124
+ $viewport.scrollTop(65)
125
+
126
+ # Follow the link to /bar
127
+ followLink()
128
+
129
+ # Provide the content at /bar with a link back to /foo in the HTML
130
+ respond('/foo')
131
+
132
+ # Follow the link back to /foo, restoring the scroll position of 65px
133
+ followLink(restoreScroll: true)
134
+ # No need to respond because /foo has been cached before
135
+
136
+ expect($viewport.scrollTop()).toEqual(65)
137
+
97
138
  else
98
139
 
99
140
  it 'follows the given link', ->
@@ -78,7 +78,6 @@ describe 'up.navigation', ->
78
78
  $link = affix('a[href="/foo"][up-target=".main"]')
79
79
  affix('.main')
80
80
  $link.click()
81
- # console.log($link)
82
81
  expect($link).toHaveClass('up-active')
83
82
  @lastRequest().respondWith
84
83
  status: 200
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upjs-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails