Version Description
Download this release
Release Info
Developer | averta |
Plugin | Master Slider – Responsive Touch Slider |
Version | 2.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.4.4 to 2.0.4
- README.txt +29 -4
- admin/class-master-slider-admin.php +1 -1
- admin/includes/classes/class-msp-admin-assets.php +48 -0
- admin/includes/classes/class-msp-parser.php +20 -3
- admin/views/slider-panel/css/codemirror.css +64 -10
- admin/views/slider-panel/css/msp-components.css +1 -6
- admin/views/slider-panel/css/msp-style.css +1098 -162
- admin/views/slider-panel/css/reset.css +6 -2
- admin/views/slider-panel/images/bg.jpg +0 -0
- admin/views/slider-panel/images/image-layer.png +0 -0
- admin/views/slider-panel/images/layertypes/button.png +0 -0
- admin/views/slider-panel/images/layertypes/hotspot.png +0 -0
- admin/views/slider-panel/images/layertypes/image.png +0 -0
- admin/views/slider-panel/images/layertypes/text.png +0 -0
- admin/views/slider-panel/images/layertypes/video.png +0 -0
- admin/views/slider-panel/images/sample.png +0 -0
- admin/views/slider-panel/images/templates/3d-flow-carousel.png +0 -0
- admin/views/slider-panel/images/templates/3d-wave-carousel.png +0 -0
- admin/views/slider-panel/images/templates/custom.gif +0 -0
- admin/views/slider-panel/images/templates/display.png +0 -0
- admin/views/slider-panel/images/templates/flat-display.png +0 -0
- admin/views/slider-panel/images/templates/flat-laptop.png +0 -0
- admin/views/slider-panel/images/templates/flat-phone-land.png +0 -0
- admin/views/slider-panel/images/templates/flat-phone.png +0 -0
- admin/views/slider-panel/images/templates/flat-tablet-land.png +0 -0
- admin/views/slider-panel/images/templates/flat-tablet.png +0 -0
- admin/views/slider-panel/images/templates/full-screen.png +0 -0
- admin/views/slider-panel/images/templates/image-gallery.png +0 -0
- admin/views/slider-panel/images/templates/laptop.png +0 -0
- admin/views/slider-panel/images/templates/partial-1.png +0 -0
- admin/views/slider-panel/images/templates/partial-2.png +0 -0
- admin/views/slider-panel/images/templates/partial-3.png +0 -0
- admin/views/slider-panel/images/templates/phone-land.png +0 -0
- admin/views/slider-panel/images/templates/phone.png +0 -0
- admin/views/slider-panel/images/templates/slider-bottom-thumbs.png +0 -0
- admin/views/slider-panel/images/templates/slider-horizontal-tabs.png +0 -0
- admin/views/slider-panel/images/templates/slider-left-thumbs.png +0 -0
- admin/views/slider-panel/images/templates/slider-right-thumbs.png +0 -0
- admin/views/slider-panel/images/templates/slider-top-thumbs.png +0 -0
- admin/views/slider-panel/images/templates/slider-vertical-tabs.png +0 -0
- admin/views/slider-panel/images/templates/staff-1.png +0 -0
- admin/views/slider-panel/images/templates/staff-2.png +0 -0
- admin/views/slider-panel/images/templates/staff-3.png +0 -0
- admin/views/slider-panel/images/templates/staff-4.png +0 -0
- admin/views/slider-panel/images/templates/staff-5.png +0 -0
- admin/views/slider-panel/images/templates/staff-6.png +0 -0
- admin/views/slider-panel/images/templates/tablet-land.png +0 -0
- admin/views/slider-panel/images/templates/tablet.png +0 -0
- admin/views/slider-panel/images/templates/vertical-slider.png +0 -0
- admin/views/slider-panel/images/time-ruler.png +0 -0
- admin/views/slider-panel/images/ui-spritesheet.png +0 -0
- admin/views/slider-panel/images/video-layer.png +0 -0
- admin/views/slider-panel/index.php +86 -40
- admin/views/slider-panel/js/ember-model.js +2036 -0
- admin/views/slider-panel/js/ember-model.min.js +3 -5
- admin/views/slider-panel/js/ember-model.min.js.map +1 -0
- admin/views/slider-panel/js/ember.min.js +3 -3
- admin/views/slider-panel/js/handlebars.min.js +8 -1
- admin/views/slider-panel/js/masterslider.wp.init.js +1 -0
- admin/views/slider-panel/js/masterslider.wp.js +9 -6
- admin/views/slider-panel/js/msp.required.js +10 -24
README.txt
CHANGED
@@ -6,9 +6,9 @@ License URI: http://www.gnu.org/licenses/gpl.html
|
|
6 |
Tags: banner rotator, carousel, content slider, gallery, image slider, responsive slider, showcase, slideshow, swipe, touch slider, video gallery, SEO, vertical slide, HTML5 slider, hardware accelerate, css3, animation, mobile slider, iOS, android, video slider, youtube slider, horizontal slider, vertical slider, fullwidth slider, fullscreen slider, post slider, photo slider, online album, mobile slider, WordPress slider,wpml, ,ultisite, wistia, woocommerce, product slider, woocommerce slider, portfolio, gallery
|
7 |
Requires at least: 3.8
|
8 |
Tested up to: 4.1.0
|
9 |
-
Stable tag:
|
10 |
|
11 |
-
The
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -226,6 +226,31 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/master-sl
|
|
226 |
|
227 |
== Changelog ==
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
= Version 1.4.4 / (8.1.2015) =
|
230 |
- Addressed a bug which stopped the sliders in some WordPress site
|
231 |
|
@@ -309,5 +334,5 @@ Bugs can be reported in our [support forums](http://wordpress.org/tags/master-sl
|
|
309 |
|
310 |
== Upgrade Notice ==
|
311 |
|
312 |
-
=
|
313 |
-
-
|
6 |
Tags: banner rotator, carousel, content slider, gallery, image slider, responsive slider, showcase, slideshow, swipe, touch slider, video gallery, SEO, vertical slide, HTML5 slider, hardware accelerate, css3, animation, mobile slider, iOS, android, video slider, youtube slider, horizontal slider, vertical slider, fullwidth slider, fullscreen slider, post slider, photo slider, online album, mobile slider, WordPress slider,wpml, ,ultisite, wistia, woocommerce, product slider, woocommerce slider, portfolio, gallery
|
7 |
Requires at least: 3.8
|
8 |
Tested up to: 4.1.0
|
9 |
+
Stable tag: 2.0.4
|
10 |
|
11 |
+
The most advanced responsive HTML5 WordPress slider plugin with touch swipe navigation that works smoothly on devices too.
|
12 |
|
13 |
== Description ==
|
14 |
|
226 |
|
227 |
== Changelog ==
|
228 |
|
229 |
+
= Version 2.0.4 / (1.2.2015) =
|
230 |
+
- [New]: New API added to let developers change default values in admin panel
|
231 |
+
|
232 |
+
= Version 2.0.0 / (28.1.2015) =
|
233 |
+
- [New]: Introducing multiple image Upload
|
234 |
+
- [New]: Autoplay option for video slides added
|
235 |
+
- [New]: Custom css editor added to admin panel
|
236 |
+
- [Improvement]: Major improvement in linking slides
|
237 |
+
- [Improvement]: Some improvement in API for managing front end assets
|
238 |
+
- [Improvement]: improvement in aligning the content of tab control
|
239 |
+
- [Improvement]: User interface improvement
|
240 |
+
- [Improvement]: Lots of improvement in slider performance
|
241 |
+
- [Improvement]: Adding compatibility with wheel navigation by Magic Mouse or Trackpad in OS X
|
242 |
+
- [Fix]: Addressed and issue with rendering issue in latest version of Firefox
|
243 |
+
- [Fix]: An issue with slide link in latest version of Firefox fixed
|
244 |
+
- [Fix]: An conflict with modal window in WordPress 4.1 fixed
|
245 |
+
- [Fix]: An issue with a missing file fixed
|
246 |
+
- [Fix]: An issue with slider fallbacks fixed
|
247 |
+
- [Fix]: An issue with wheel navigation with non-loop slider fixed
|
248 |
+
- [Fix]: Fixed unexpected js errors when swipe navigation is disabled
|
249 |
+
- [Fix]: An issue removeEventListener method fixed
|
250 |
+
- [Update]: Annoying glow on buttons and links in admin panel removed
|
251 |
+
- [Update]: Slider base styles updated
|
252 |
+
- [Update]: Translate files updated
|
253 |
+
|
254 |
= Version 1.4.4 / (8.1.2015) =
|
255 |
- Addressed a bug which stopped the sliders in some WordPress site
|
256 |
|
334 |
|
335 |
== Upgrade Notice ==
|
336 |
|
337 |
+
= 2.0.4 =
|
338 |
+
- [New]: New API added to let developers change default values in admin panel
|
admin/class-master-slider-admin.php
CHANGED
@@ -127,7 +127,7 @@ class Master_Slider_Admin {
|
|
127 |
return false;
|
128 |
|
129 |
msp_save_custom_styles();
|
130 |
-
msp_flush_all_sliders_cache();
|
131 |
update_option( 'masterslider_lite_plugin_version', MSWP_AVERTA_VERSION );
|
132 |
do_action( 'masterslider_after_plugin_updated' );
|
133 |
|
127 |
return false;
|
128 |
|
129 |
msp_save_custom_styles();
|
130 |
+
// msp_flush_all_sliders_cache(); 2.0.0
|
131 |
update_option( 'masterslider_lite_plugin_version', MSWP_AVERTA_VERSION );
|
132 |
do_action( 'masterslider_after_plugin_updated' );
|
133 |
|
admin/includes/classes/class-msp-admin-assets.php
CHANGED
@@ -163,6 +163,54 @@ class MSP_Admin_Assets {
|
|
163 |
// define panel directory path
|
164 |
wp_localize_script( 'jquery', '__MSP_PATH', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/' );
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
do_action( 'masterslider_admin_add_panel_variables', $slider_type );
|
167 |
}
|
168 |
|
163 |
// define panel directory path
|
164 |
wp_localize_script( 'jquery', '__MSP_PATH', MSWP_AVERTA_ADMIN_URL . '/views/slider-panel/' );
|
165 |
|
166 |
+
$slider_panel_default_setting = array(
|
167 |
+
|
168 |
+
'width' => 1000,
|
169 |
+
'height' => 500,
|
170 |
+
|
171 |
+
'autoCrop' => false,
|
172 |
+
'autoplay' => false,
|
173 |
+
'layout' => 'boxed',
|
174 |
+
'autoHeight' => false,
|
175 |
+
'transition' => 'basic',
|
176 |
+
'speed' => 20,
|
177 |
+
'className' => '',
|
178 |
+
|
179 |
+
|
180 |
+
'start' => 1,
|
181 |
+
'space' => 0,
|
182 |
+
|
183 |
+
'grabCursor' => true,
|
184 |
+
'swipe' => true,
|
185 |
+
|
186 |
+
'wheel' => false,
|
187 |
+
'mouse' => true,
|
188 |
+
|
189 |
+
'loop' => false,
|
190 |
+
'shuffle' => false,
|
191 |
+
'preload' => '-1',
|
192 |
+
|
193 |
+
'overPause' => true,
|
194 |
+
'endPause' => false,
|
195 |
+
|
196 |
+
'hideLayers' => false,
|
197 |
+
'dir' => 'h',
|
198 |
+
'parallaxMode' => 'swipe',
|
199 |
+
'centerControls'=> true,
|
200 |
+
'instantShowLayers' => false,
|
201 |
+
|
202 |
+
'skin' => 'ms-skin-default',
|
203 |
+
'duration' => 3,
|
204 |
+
'slideFillMode' => 'fill',
|
205 |
+
'sliderVideoFillMode' => 'fill',
|
206 |
+
'slideVideoLoop'=> true,
|
207 |
+
'slideVideoMute'=> true,
|
208 |
+
'slideVideoAutopause'=> false,
|
209 |
+
'layerContent' => 'Lorem Ipsum'
|
210 |
+
);
|
211 |
+
|
212 |
+
wp_localize_script( 'jquery', '__MSP_DEF_OPTIONS', apply_filters( 'masterslider_panel_default_setting', $slider_panel_default_setting ) );
|
213 |
+
|
214 |
do_action( 'masterslider_admin_add_panel_variables', $slider_type );
|
215 |
}
|
216 |
|
admin/includes/classes/class-msp-parser.php
CHANGED
@@ -76,6 +76,8 @@ class MSP_Parser {
|
|
76 |
'class' => isset( $setting['className'] ) ? (string) $setting['className'] : '', // a class that adds to slider wrapper
|
77 |
'margin' => 0,
|
78 |
|
|
|
|
|
79 |
'inline_style' => isset( $setting['inlineStyle'] ) ? esc_attr( $setting['inlineStyle'] ) : '',
|
80 |
'bg_color' => isset( $setting['bgColor'] ) ? (string) $setting['bgColor'] : '',
|
81 |
'bg_image' => isset( $setting['bgImage'] ) ? msp_get_the_relative_media_url( $setting['bgImage'] ) : '',
|
@@ -312,9 +314,16 @@ class MSP_Parser {
|
|
312 |
|
313 |
'title' => '', // image title
|
314 |
'alt' => isset( $slide['bgAlt'] ) ? esc_attr($slide['bgAlt']) : '', // image alternative text
|
315 |
-
|
316 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
'video' => isset( $slide['video'] ) ? esc_attr( $slide['video'] ) : '', // youtube or vimeo video link
|
|
|
318 |
|
319 |
'info' => wp_slash( do_shortcode( $info ) ), // image alternative text
|
320 |
|
@@ -330,7 +339,10 @@ class MSP_Parser {
|
|
330 |
'tab' => 'true' == $slider_setting['thumbs'] && 'tabs' == $slider_setting['thumbs_type'] ? str_replace( '"', '"e;', $info ) : '',
|
331 |
'delay' => isset( $slide['duration'] ) ? (string) $slide['duration'] : '', // data-delay
|
332 |
'bgalign' => isset( $slide['fillMode'] ) ? (string) $slide['fillMode'] : 'fill', // data-fill-mode
|
333 |
-
'bgcolor' => isset( $slide['bgColor'] ) ? (string) $slide['bgColor'] : ''
|
|
|
|
|
|
|
334 |
);
|
335 |
|
336 |
return $slides;
|
@@ -771,6 +783,11 @@ class MSP_Parser {
|
|
771 |
|
772 |
public function get_styles( $force_new_parse = false ) {
|
773 |
$styles_list = $this->get_styles_list();
|
|
|
|
|
|
|
|
|
|
|
774 |
return implode( $this->join_char, $styles_list );
|
775 |
}
|
776 |
|
76 |
'class' => isset( $setting['className'] ) ? (string) $setting['className'] : '', // a class that adds to slider wrapper
|
77 |
'margin' => 0,
|
78 |
|
79 |
+
'custom_style' => isset( $setting['customStyle'] ) ? esc_attr( $setting['customStyle'] ) : '',
|
80 |
+
|
81 |
'inline_style' => isset( $setting['inlineStyle'] ) ? esc_attr( $setting['inlineStyle'] ) : '',
|
82 |
'bg_color' => isset( $setting['bgColor'] ) ? (string) $setting['bgColor'] : '',
|
83 |
'bg_image' => isset( $setting['bgImage'] ) ? msp_get_the_relative_media_url( $setting['bgImage'] ) : '',
|
314 |
|
315 |
'title' => '', // image title
|
316 |
'alt' => isset( $slide['bgAlt'] ) ? esc_attr($slide['bgAlt']) : '', // image alternative text
|
317 |
+
|
318 |
+
'link' => isset( $slide['link'] ) ? esc_attr( $slide['link'] ) : '',
|
319 |
+
'target' => isset( $slide['linkTarget']) ? (string) $slide['linkTarget'] : '',
|
320 |
+
'link_title' => isset( $slide['linkTitle'] ) ? (string) $slide['linkTitle'] : '',
|
321 |
+
'link_class' => isset( $slide['linkClass'] ) ? (string) $slide['linkClass'] : '',
|
322 |
+
'link_id' => isset( $slide['linkId'] ) ? (string) $slide['linkId'] : '',
|
323 |
+
'link_rel' => isset( $slide['linkRel'] ) ? (string) $slide['linkRel'] : '',
|
324 |
+
|
325 |
'video' => isset( $slide['video'] ) ? esc_attr( $slide['video'] ) : '', // youtube or vimeo video link
|
326 |
+
'auto_play_video' => $this->is_key_true( $slide, 'autoplayVideo', 'false' ), // autoplay for youtube or vimeo videos
|
327 |
|
328 |
'info' => wp_slash( do_shortcode( $info ) ), // image alternative text
|
329 |
|
339 |
'tab' => 'true' == $slider_setting['thumbs'] && 'tabs' == $slider_setting['thumbs_type'] ? str_replace( '"', '"e;', $info ) : '',
|
340 |
'delay' => isset( $slide['duration'] ) ? (string) $slide['duration'] : '', // data-delay
|
341 |
'bgalign' => isset( $slide['fillMode'] ) ? (string) $slide['fillMode'] : 'fill', // data-fill-mode
|
342 |
+
'bgcolor' => isset( $slide['bgColor'] ) ? (string) $slide['bgColor'] : '',
|
343 |
+
|
344 |
+
'pattern' => isset( $slide['pattern'] ) ? (string) $slide['pattern'] : '',
|
345 |
+
'tintcolor' => isset( $slide['colorOverlay'] ) ? (string) $slide['colorOverlay'] : '',
|
346 |
);
|
347 |
|
348 |
return $slides;
|
783 |
|
784 |
public function get_styles( $force_new_parse = false ) {
|
785 |
$styles_list = $this->get_styles_list();
|
786 |
+
|
787 |
+
// custom css code for sliders added
|
788 |
+
$setting = $this->get_slider_setting();
|
789 |
+
$styles_list[] = $setting['custom_style'];
|
790 |
+
|
791 |
return implode( $this->join_char, $styles_list );
|
792 |
}
|
793 |
|
admin/views/slider-panel/css/codemirror.css
CHANGED
@@ -40,26 +40,54 @@
|
|
40 |
box-sizing: content-box;
|
41 |
}
|
42 |
|
|
|
|
|
|
|
43 |
/* CURSOR */
|
44 |
|
45 |
.CodeMirror div.CodeMirror-cursor {
|
46 |
border-left: 1px solid black;
|
47 |
-
z-index: 3;
|
48 |
}
|
49 |
/* Shown when moving in bi-directional text */
|
50 |
.CodeMirror div.CodeMirror-secondarycursor {
|
51 |
border-left: 1px solid silver;
|
52 |
}
|
53 |
-
.CodeMirror.cm-
|
54 |
width: auto;
|
55 |
border: 0;
|
56 |
background: #7e7;
|
|
|
|
|
57 |
z-index: 1;
|
58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
/* Can style cursor different in overwrite (non-insert) mode */
|
60 |
-
.CodeMirror div.CodeMirror-cursor
|
61 |
|
62 |
-
.cm-tab { display: inline-block; }
|
63 |
|
64 |
.CodeMirror-ruler {
|
65 |
border-left: 1px solid #ccc;
|
@@ -72,11 +100,12 @@
|
|
72 |
.cm-s-default .cm-atom {color: #219;}
|
73 |
.cm-s-default .cm-number {color: #164;}
|
74 |
.cm-s-default .cm-def {color: #00f;}
|
75 |
-
.cm-s-default .cm-variable
|
|
|
|
|
|
|
76 |
.cm-s-default .cm-variable-2 {color: #05a;}
|
77 |
.cm-s-default .cm-variable-3 {color: #085;}
|
78 |
-
.cm-s-default .cm-property {color: black;}
|
79 |
-
.cm-s-default .cm-operator {color: black;}
|
80 |
.cm-s-default .cm-comment {color: #a50;}
|
81 |
.cm-s-default .cm-string {color: #a11;}
|
82 |
.cm-s-default .cm-string-2 {color: #f50;}
|
@@ -96,12 +125,16 @@
|
|
96 |
.cm-header, .cm-strong {font-weight: bold;}
|
97 |
.cm-em {font-style: italic;}
|
98 |
.cm-link {text-decoration: underline;}
|
|
|
99 |
|
100 |
.cm-s-default .cm-error {color: #f00;}
|
101 |
.cm-invalidchar {color: #f00;}
|
102 |
|
|
|
|
|
103 |
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
104 |
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
|
105 |
.CodeMirror-activeline-background {background: #e8f2ff;}
|
106 |
|
107 |
/* STOP */
|
@@ -177,6 +210,11 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
177 |
*zoom:1;
|
178 |
*display:inline;
|
179 |
}
|
|
|
|
|
|
|
|
|
|
|
180 |
.CodeMirror-gutter-elt {
|
181 |
position: absolute;
|
182 |
cursor: default;
|
@@ -185,6 +223,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
185 |
|
186 |
.CodeMirror-lines {
|
187 |
cursor: text;
|
|
|
188 |
}
|
189 |
.CodeMirror pre {
|
190 |
/* Reset some styles that the rest of the page might have set */
|
@@ -237,16 +276,22 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
237 |
|
238 |
.CodeMirror div.CodeMirror-cursor {
|
239 |
position: absolute;
|
240 |
-
visibility: hidden;
|
241 |
border-right: none;
|
242 |
width: 0;
|
243 |
}
|
244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
visibility: visible;
|
246 |
}
|
247 |
|
248 |
.CodeMirror-selected { background: #d9d9d9; }
|
249 |
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
|
|
250 |
|
251 |
.cm-searching {
|
252 |
background: #ffa;
|
@@ -256,9 +301,18 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|
256 |
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
257 |
.CodeMirror span { *vertical-align: text-bottom; }
|
258 |
|
|
|
|
|
|
|
259 |
@media print {
|
260 |
/* Hide the cursor when printing */
|
261 |
-
.CodeMirror div.CodeMirror-
|
262 |
visibility: hidden;
|
263 |
}
|
264 |
}
|
|
|
|
|
|
|
|
|
|
|
|
40 |
box-sizing: content-box;
|
41 |
}
|
42 |
|
43 |
+
.CodeMirror-guttermarker { color: black; }
|
44 |
+
.CodeMirror-guttermarker-subtle { color: #999; }
|
45 |
+
|
46 |
/* CURSOR */
|
47 |
|
48 |
.CodeMirror div.CodeMirror-cursor {
|
49 |
border-left: 1px solid black;
|
|
|
50 |
}
|
51 |
/* Shown when moving in bi-directional text */
|
52 |
.CodeMirror div.CodeMirror-secondarycursor {
|
53 |
border-left: 1px solid silver;
|
54 |
}
|
55 |
+
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
56 |
width: auto;
|
57 |
border: 0;
|
58 |
background: #7e7;
|
59 |
+
}
|
60 |
+
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
61 |
z-index: 1;
|
62 |
}
|
63 |
+
|
64 |
+
.cm-animate-fat-cursor {
|
65 |
+
width: auto;
|
66 |
+
border: 0;
|
67 |
+
-webkit-animation: blink 1.06s steps(1) infinite;
|
68 |
+
-moz-animation: blink 1.06s steps(1) infinite;
|
69 |
+
animation: blink 1.06s steps(1) infinite;
|
70 |
+
}
|
71 |
+
@-moz-keyframes blink {
|
72 |
+
0% { background: #7e7; }
|
73 |
+
50% { background: none; }
|
74 |
+
100% { background: #7e7; }
|
75 |
+
}
|
76 |
+
@-webkit-keyframes blink {
|
77 |
+
0% { background: #7e7; }
|
78 |
+
50% { background: none; }
|
79 |
+
100% { background: #7e7; }
|
80 |
+
}
|
81 |
+
@keyframes blink {
|
82 |
+
0% { background: #7e7; }
|
83 |
+
50% { background: none; }
|
84 |
+
100% { background: #7e7; }
|
85 |
+
}
|
86 |
+
|
87 |
/* Can style cursor different in overwrite (non-insert) mode */
|
88 |
+
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
89 |
|
90 |
+
.cm-tab { display: inline-block; text-decoration: inherit; }
|
91 |
|
92 |
.CodeMirror-ruler {
|
93 |
border-left: 1px solid #ccc;
|
100 |
.cm-s-default .cm-atom {color: #219;}
|
101 |
.cm-s-default .cm-number {color: #164;}
|
102 |
.cm-s-default .cm-def {color: #00f;}
|
103 |
+
.cm-s-default .cm-variable,
|
104 |
+
.cm-s-default .cm-punctuation,
|
105 |
+
.cm-s-default .cm-property,
|
106 |
+
.cm-s-default .cm-operator {}
|
107 |
.cm-s-default .cm-variable-2 {color: #05a;}
|
108 |
.cm-s-default .cm-variable-3 {color: #085;}
|
|
|
|
|
109 |
.cm-s-default .cm-comment {color: #a50;}
|
110 |
.cm-s-default .cm-string {color: #a11;}
|
111 |
.cm-s-default .cm-string-2 {color: #f50;}
|
125 |
.cm-header, .cm-strong {font-weight: bold;}
|
126 |
.cm-em {font-style: italic;}
|
127 |
.cm-link {text-decoration: underline;}
|
128 |
+
.cm-strikethrough {text-decoration: line-through;}
|
129 |
|
130 |
.cm-s-default .cm-error {color: #f00;}
|
131 |
.cm-invalidchar {color: #f00;}
|
132 |
|
133 |
+
/* Default styles for common addons */
|
134 |
+
|
135 |
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
136 |
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
137 |
+
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
138 |
.CodeMirror-activeline-background {background: #e8f2ff;}
|
139 |
|
140 |
/* STOP */
|
210 |
*zoom:1;
|
211 |
*display:inline;
|
212 |
}
|
213 |
+
.CodeMirror-gutter-wrapper {
|
214 |
+
position: absolute;
|
215 |
+
z-index: 4;
|
216 |
+
height: 100%;
|
217 |
+
}
|
218 |
.CodeMirror-gutter-elt {
|
219 |
position: absolute;
|
220 |
cursor: default;
|
223 |
|
224 |
.CodeMirror-lines {
|
225 |
cursor: text;
|
226 |
+
min-height: 1px; /* prevents collapsing before first draw */
|
227 |
}
|
228 |
.CodeMirror pre {
|
229 |
/* Reset some styles that the rest of the page might have set */
|
276 |
|
277 |
.CodeMirror div.CodeMirror-cursor {
|
278 |
position: absolute;
|
|
|
279 |
border-right: none;
|
280 |
width: 0;
|
281 |
}
|
282 |
+
|
283 |
+
div.CodeMirror-cursors {
|
284 |
+
visibility: hidden;
|
285 |
+
position: relative;
|
286 |
+
z-index: 3;
|
287 |
+
}
|
288 |
+
.CodeMirror-focused div.CodeMirror-cursors {
|
289 |
visibility: visible;
|
290 |
}
|
291 |
|
292 |
.CodeMirror-selected { background: #d9d9d9; }
|
293 |
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
294 |
+
.CodeMirror-crosshair { cursor: crosshair; }
|
295 |
|
296 |
.cm-searching {
|
297 |
background: #ffa;
|
301 |
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
302 |
.CodeMirror span { *vertical-align: text-bottom; }
|
303 |
|
304 |
+
/* Used to force a border model for a node */
|
305 |
+
.cm-force-border { padding-right: .1px; }
|
306 |
+
|
307 |
@media print {
|
308 |
/* Hide the cursor when printing */
|
309 |
+
.CodeMirror div.CodeMirror-cursors {
|
310 |
visibility: hidden;
|
311 |
}
|
312 |
}
|
313 |
+
|
314 |
+
/* See issue #2901 */
|
315 |
+
.cm-tab-wrap-hack:after { content: ''; }
|
316 |
+
|
317 |
+
/* Help users use markselection to safely style text background */
|
318 |
+
span.CodeMirror-selectedtext { background: none; }
|
admin/views/slider-panel/css/msp-components.css
CHANGED
@@ -35,9 +35,6 @@
|
|
35 |
position: relative;
|
36 |
left:0;
|
37 |
-webkit-transition: all 0.25s;
|
38 |
-
-moz-transition: all 0.25s;
|
39 |
-
-ms-transition: all 0.25s;
|
40 |
-
-o-transition: all 0.25s;
|
41 |
transition: all 0.25s;
|
42 |
}
|
43 |
.msp-switchbox.switched .msp-switch-cont{left:40px;}
|
@@ -53,9 +50,6 @@
|
|
53 |
border-radius: 44px;
|
54 |
border:solid 1px #dedede;
|
55 |
-webkit-transition: all 0.25s;
|
56 |
-
-moz-transition: all 0.25s;
|
57 |
-
-ms-transition: all 0.25s;
|
58 |
-
-o-transition: all 0.25s;
|
59 |
transition: all 0.25s;
|
60 |
}
|
61 |
|
@@ -94,6 +88,7 @@
|
|
94 |
height: auto;
|
95 |
box-shadow: none;
|
96 |
padding: 8px;
|
|
|
97 |
outline: none;
|
98 |
}
|
99 |
|
35 |
position: relative;
|
36 |
left:0;
|
37 |
-webkit-transition: all 0.25s;
|
|
|
|
|
|
|
38 |
transition: all 0.25s;
|
39 |
}
|
40 |
.msp-switchbox.switched .msp-switch-cont{left:40px;}
|
50 |
border-radius: 44px;
|
51 |
border:solid 1px #dedede;
|
52 |
-webkit-transition: all 0.25s;
|
|
|
|
|
|
|
53 |
transition: all 0.25s;
|
54 |
}
|
55 |
|
88 |
height: auto;
|
89 |
box-shadow: none;
|
90 |
padding: 8px;
|
91 |
+
height: 34px;
|
92 |
outline: none;
|
93 |
}
|
94 |
|
admin/views/slider-panel/css/msp-style.css
CHANGED
@@ -220,113 +220,13 @@
|
|
220 |
background-position: -101px -76px;
|
221 |
}
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
position:
|
227 |
-
|
228 |
-
|
229 |
-
width: 100%;
|
230 |
-
padding-bottom: 20px;
|
231 |
-
}
|
232 |
-
|
233 |
-
.msp-template-figure {
|
234 |
-
float: left;
|
235 |
-
margin: 20px 0 0 20px;
|
236 |
-
width: 276px;
|
237 |
-
position: relative;
|
238 |
-
cursor: pointer;
|
239 |
-
}
|
240 |
-
|
241 |
-
.msp-template-figure>img {
|
242 |
-
border: solid 1px #dedede;
|
243 |
-
float: left;
|
244 |
-
width: 100%;
|
245 |
-
}
|
246 |
-
|
247 |
-
.msp-template-caption {
|
248 |
-
border: solid 1px #dedede;
|
249 |
-
text-align: center;
|
250 |
-
vertical-align: middle;
|
251 |
-
width: 100%;
|
252 |
-
float: left;
|
253 |
-
box-shadow: 0 -3px #F3F3F3 inset;
|
254 |
-
margin-top: -1px;
|
255 |
-
padding: 14px 0;
|
256 |
-
}
|
257 |
-
|
258 |
-
.msp-template-figure.selected>img {
|
259 |
-
border-color: #278AAE;
|
260 |
-
}
|
261 |
-
|
262 |
-
.selected .msp-template-caption {
|
263 |
-
background: #2ea2cc;
|
264 |
-
border-color: #278AAE;
|
265 |
-
color: white;
|
266 |
-
box-shadow: 0 -3px #278AAE inset;
|
267 |
-
}
|
268 |
-
|
269 |
-
.msp-templte-selected {
|
270 |
-
position: absolute;
|
271 |
-
top: 0;
|
272 |
-
right: -1px;
|
273 |
-
width: 22px;
|
274 |
-
height: 22px;
|
275 |
-
background: url(../images/ui-spritesheet.png) -194px -146px no-repeat #2EA2CC;
|
276 |
-
}
|
277 |
-
|
278 |
-
.msp-templates-bottom {
|
279 |
-
position: absolute;
|
280 |
-
border-top: solid 1px #dedede;
|
281 |
-
bottom: 15px;
|
282 |
-
width: 100%;
|
283 |
-
padding-top: 16px;
|
284 |
-
}
|
285 |
-
|
286 |
-
button.msp-tempalte-save {
|
287 |
-
width: 885px;
|
288 |
-
}
|
289 |
-
|
290 |
-
button.msp-applyeffect {
|
291 |
-
margin-right: 10px !important;
|
292 |
-
text-transform: uppercase;
|
293 |
-
font-weight: 900 !important;
|
294 |
-
border-bottom-width: 5px !important;
|
295 |
-
margin-left: 20px;
|
296 |
-
padding: 13px 0 10px;
|
297 |
-
width: 475px;
|
298 |
-
font-size: 15px;
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
/*Choose Template in slider Settings*/
|
303 |
-
.msp-choose-template>.msp-img-box {
|
304 |
-
float: left;
|
305 |
-
border: solid 1px #dedede;
|
306 |
-
width: 217px;
|
307 |
-
margin-right: 20px;
|
308 |
-
}
|
309 |
-
.msp-choose-template {
|
310 |
-
display: inline-block;
|
311 |
-
vertical-align: top;
|
312 |
-
}
|
313 |
-
.msp-choose-template>.msp-img-box>img {
|
314 |
-
display: block;
|
315 |
-
width: 100%;
|
316 |
-
cursor: pointer;
|
317 |
-
}
|
318 |
-
.float-left {
|
319 |
-
float: left;
|
320 |
-
}
|
321 |
-
|
322 |
-
.msp-template-name {
|
323 |
-
display: block;
|
324 |
-
font-weight: 600;
|
325 |
-
margin: 14px 0;
|
326 |
}
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
/*------------------------------*/
|
331 |
/* Main Navigation */
|
332 |
.msp-main-nav ul {list-style: none; margin:0;padding: 0;}
|
@@ -345,6 +245,14 @@ button.msp-applyeffect {
|
|
345 |
position: relative;
|
346 |
}
|
347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
.msp-main-nav ul li a>.msp-ico{
|
349 |
display: inline-block;
|
350 |
margin-left: 10px;
|
@@ -1043,90 +951,1118 @@ button.msp-img-btn {
|
|
1043 |
vertical-align: bottom;
|
1044 |
}
|
1045 |
|
1046 |
-
/*
|
1047 |
-
|
1048 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1049 |
}
|
1050 |
|
1051 |
-
.msp-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1052 |
position: relative;
|
|
|
|
|
|
|
|
|
1053 |
border: solid 1px #DEDEDE;
|
1054 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1055 |
overflow: hidden;
|
1056 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1057 |
}
|
1058 |
|
1059 |
-
.msp-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
margin-top: 20px;
|
1064 |
-
border-top: solid 1px #f1f1f1;
|
1065 |
}
|
1066 |
|
1067 |
-
|
1068 |
-
|
1069 |
-
-
|
1070 |
-
-
|
1071 |
-
|
1072 |
-
|
|
|
|
|
|
|
1073 |
}
|
1074 |
|
1075 |
-
.msp-
|
1076 |
-
position: absolute;
|
1077 |
-
z-index: 0;
|
1078 |
-
width: 100%;
|
1079 |
height: 100%;
|
|
|
|
|
1080 |
top: 0;
|
1081 |
}
|
1082 |
|
1083 |
-
|
1084 |
-
.msp-slide-stage p , .msp-slide-stage h1 , .msp-slide-stage h2 ,
|
1085 |
-
.msp-slide-stage h3 , .msp-slide-stage h4 , .msp-slide-stage h5
|
1086 |
-
{margin: 0; padding:0; font:inherit; color:inherit;}
|
1087 |
-
|
1088 |
-
.msp-stage-bg{
|
1089 |
-
overflow: hidden;
|
1090 |
-
width: 100%;
|
1091 |
height: 100%;
|
|
|
|
|
|
|
|
|
1092 |
}
|
1093 |
|
1094 |
-
.msp-
|
|
|
|
|
1095 |
position: relative;
|
1096 |
}
|
1097 |
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
|
|
|
|
|
|
|
|
|
|
1102 |
}
|
1103 |
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
padding: 0px 30px 0px 0px;
|
1111 |
-
border-bottom: solid 3px #656565;
|
1112 |
-
position: relative;
|
1113 |
-
cursor: default;
|
1114 |
-
margin-top: 10px;
|
1115 |
}
|
1116 |
|
1117 |
-
.msp-
|
1118 |
-
|
|
|
|
|
|
|
|
|
1119 |
}
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
|
|
|
|
1125 |
}
|
1126 |
|
1127 |
-
.msp-
|
1128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1129 |
float: left;
|
1130 |
border-right: solid 1px #FFF;
|
1131 |
padding: 5px 16px;
|
1132 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
background-position: -101px -76px;
|
221 |
}
|
222 |
|
223 |
+
.msp-ico.msp-ico-pro {
|
224 |
+
width: 20px;
|
225 |
+
height: 25px;
|
226 |
+
background-position: -226px -253px;
|
227 |
+
vertical-align: top !important;
|
228 |
+
top: -3px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
}
|
|
|
|
|
|
|
230 |
/*------------------------------*/
|
231 |
/* Main Navigation */
|
232 |
.msp-main-nav ul {list-style: none; margin:0;padding: 0;}
|
245 |
position: relative;
|
246 |
}
|
247 |
|
248 |
+
.msp-main-nav ul li.msp-upgrade-btn a {
|
249 |
+
background-color: #5EBE27;
|
250 |
+
border-bottom-color: #52A820;
|
251 |
+
}
|
252 |
+
|
253 |
+
.msp-main-nav ul li.msp-upgrade-btn a:hover {
|
254 |
+
background-color: #5FC524;
|
255 |
+
}
|
256 |
.msp-main-nav ul li a>.msp-ico{
|
257 |
display: inline-block;
|
258 |
margin-left: 10px;
|
951 |
vertical-align: bottom;
|
952 |
}
|
953 |
|
954 |
+
/* Add layer Dropdown*/
|
955 |
+
|
956 |
+
.msp-addlayer {
|
957 |
+
display: inline-block;
|
958 |
+
width: 200px;
|
959 |
+
vertical-align: middle;
|
960 |
+
}
|
961 |
+
.msp-addlayer button.msp-addlayer-btn {
|
962 |
+
float: left;
|
963 |
+
line-height: normal;
|
964 |
}
|
965 |
|
966 |
+
.msp-addlayer-dd {
|
967 |
+
float: left;
|
968 |
+
}
|
969 |
+
.msp-addlayer-dd .dd-selected {
|
970 |
+
padding: 0;
|
971 |
+
height: 34px;
|
972 |
+
}
|
973 |
+
|
974 |
+
|
975 |
+
.msp-addlayer .msp-ico {
|
976 |
+
display: inline-block;
|
977 |
+
vertical-align: bottom;
|
978 |
+
}
|
979 |
+
|
980 |
+
.msp-addlayer-dd .dd-selected-image {
|
981 |
+
padding: 4px 0 3px 6px;
|
982 |
+
}
|
983 |
+
|
984 |
+
/* Preview Slide Btn */
|
985 |
+
|
986 |
+
.msp-preview-slide {
|
987 |
+
display: inline-block;
|
988 |
+
height: 32px;
|
989 |
+
width: 150px;
|
990 |
+
vertical-align: top;
|
991 |
+
color: white;
|
992 |
+
}
|
993 |
+
|
994 |
+
.msp-preview-btn{
|
995 |
+
display: block;
|
996 |
+
width: 34px;
|
997 |
+
height: 100%;
|
998 |
+
background: #2EA2CC;
|
999 |
+
border-bottom: solid 3px #278AAE;
|
1000 |
+
cursor: pointer;
|
1001 |
+
margin-right: 1px;
|
1002 |
+
float: left;
|
1003 |
+
}
|
1004 |
+
|
1005 |
+
.msp-preview-btn-text{
|
1006 |
+
display: block;
|
1007 |
+
float: left;
|
1008 |
+
width: 97px;
|
1009 |
+
background: #2EA2CC;
|
1010 |
+
color: #FFF;
|
1011 |
+
padding: 8px 0 6px 17px;
|
1012 |
+
border-bottom: solid 3px #278AAE;
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
.msp-preview-btn-text:hover {
|
1016 |
+
color: white;
|
1017 |
+
}
|
1018 |
+
.msp-preview-btn.msp-pause-btn,
|
1019 |
+
.msp-preview-btn-text.msp-exit-preview {
|
1020 |
+
background-color: #cc2e2e;
|
1021 |
+
border-bottom-color: #ad2626;
|
1022 |
+
box-shadow: 0px 0px 17px #F00;
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
.msp-preview-slide .msp-ico {
|
1026 |
+
display: block;
|
1027 |
+
margin: 11px 12px 11px 14px;
|
1028 |
+
float: left;
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
.msp-preview-slide-text {
|
1032 |
+
float: left;
|
1033 |
+
margin: 7px 0 0 17px;
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
/* Timeline */
|
1037 |
+
|
1038 |
+
.msp-timeline-cont {
|
1039 |
+
width: 100%;
|
1040 |
+
margin-top: 20px;
|
1041 |
position: relative;
|
1042 |
+
}
|
1043 |
+
.msp-tl-headbar {
|
1044 |
+
height: 37px;
|
1045 |
+
background: #fafafa;
|
1046 |
border: solid 1px #DEDEDE;
|
1047 |
+
position: relative;
|
1048 |
+
}
|
1049 |
+
.msp-tl-controls {
|
1050 |
+
width: 240px;
|
1051 |
+
height: 100%;
|
1052 |
+
border-right: solid 1px #dedede;
|
1053 |
+
float: left;
|
1054 |
+
position: relative;
|
1055 |
+
}
|
1056 |
+
|
1057 |
+
.msp-tl-timeruler-cont {
|
1058 |
+
float: left;
|
1059 |
+
height: 100%;
|
1060 |
+
position: absolute;
|
1061 |
+
left: 241px;
|
1062 |
+
right: 0;
|
1063 |
overflow: hidden;
|
1064 |
+
}
|
1065 |
+
.msp-tl-ruler {
|
1066 |
+
width: 2000px;
|
1067 |
+
height: 100%;
|
1068 |
+
margin: 0 20px;
|
1069 |
+
border-right: solid 1px #DEDEDE;
|
1070 |
+
background: url(../images/time-ruler.png) repeat-x bottom left;
|
1071 |
}
|
1072 |
|
1073 |
+
.msp-tl-ruler-frameindicator {
|
1074 |
+
position: absolute;
|
1075 |
+
height: 100%;
|
1076 |
+
top: 0;
|
|
|
|
|
1077 |
}
|
1078 |
|
1079 |
+
.msp-tl-ruler-frameindicator .ui-slider-handle {
|
1080 |
+
position: absolute;
|
1081 |
+
z-index: 2;
|
1082 |
+
margin-left: -6px;
|
1083 |
+
bottom: 0;
|
1084 |
+
width: 14px;
|
1085 |
+
height: 26px;
|
1086 |
+
background: url(../images/ui-spritesheet.png) -126px -151px;
|
1087 |
+
cursor: default;
|
1088 |
}
|
1089 |
|
1090 |
+
.msp-tl-delayindicator {
|
|
|
|
|
|
|
1091 |
height: 100%;
|
1092 |
+
position: absolute;
|
1093 |
+
border-right: dashed 1px #AFAFAF;
|
1094 |
top: 0;
|
1095 |
}
|
1096 |
|
1097 |
+
.msp-tl-frameindicator {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1098 |
height: 100%;
|
1099 |
+
position: absolute;
|
1100 |
+
border-right: solid 1px #ed1c24;
|
1101 |
+
opacity: 0.5;
|
1102 |
+
top: 0;
|
1103 |
}
|
1104 |
|
1105 |
+
.msp-tl-layars-cont {
|
1106 |
+
border: solid 1px #dedede;
|
1107 |
+
border-top: none;
|
1108 |
position: relative;
|
1109 |
}
|
1110 |
|
1111 |
+
.mps-tl-lable {
|
1112 |
+
margin-right: 59px;
|
1113 |
+
margin-left: -19px;
|
1114 |
+
margin-top: 8px;
|
1115 |
+
font-size: 11px;
|
1116 |
+
color: gray;
|
1117 |
+
display: inline-block;
|
1118 |
+
width: 40px;
|
1119 |
+
text-align: center;
|
1120 |
}
|
1121 |
|
1122 |
+
.msp-container input[type="text"].msp-lt-layer-rename {
|
1123 |
+
float: left;
|
1124 |
+
padding: 0px 4px;
|
1125 |
+
width: 90px;
|
1126 |
+
height: 24px ;
|
1127 |
+
box-shadow: none ;
|
|
|
|
|
|
|
|
|
|
|
1128 |
}
|
1129 |
|
1130 |
+
.msp-tl-layers-list {
|
1131 |
+
height: 100%;
|
1132 |
+
width: 240px;
|
1133 |
+
border-right: solid 1px #dedede;
|
1134 |
+
float: left;
|
1135 |
+
overflow: hidden;
|
1136 |
}
|
1137 |
+
.msp-tl-frames-cont {
|
1138 |
+
position: absolute;
|
1139 |
+
left: 241px;
|
1140 |
+
right: 0;
|
1141 |
+
float: left;
|
1142 |
+
height: 100%;
|
1143 |
+
overflow: auto;
|
1144 |
}
|
1145 |
|
1146 |
+
.msp-tl-controls ul {
|
1147 |
+
padding: 0;
|
1148 |
+
list-style: none;
|
1149 |
+
margin: 11px;
|
1150 |
+
}
|
1151 |
+
.msp-tl-controls ul li {
|
1152 |
+
float: left;
|
1153 |
+
}
|
1154 |
+
|
1155 |
+
.msp-tl-current-time {
|
1156 |
+
position: absolute;
|
1157 |
+
right: 0;
|
1158 |
+
top: 0;
|
1159 |
+
line-height: 37px;
|
1160 |
+
margin: 0 13px;
|
1161 |
+
font-weight: bold;
|
1162 |
+
font-size: 1.2em;
|
1163 |
+
color: #666;
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
.msp-tl-layers-list ul {
|
1167 |
+
padding: 0;
|
1168 |
+
list-style: none;
|
1169 |
+
margin: 0;
|
1170 |
+
}
|
1171 |
+
|
1172 |
+
.msp-layer-botspace{
|
1173 |
+
height: 10px;
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
.msp-layer-row li {
|
1177 |
+
float: left;
|
1178 |
+
}
|
1179 |
+
.msp-layer-label {
|
1180 |
+
position: absolute;
|
1181 |
+
top: 5px;
|
1182 |
+
left: 63px;
|
1183 |
+
}
|
1184 |
+
.msp-layer-row {
|
1185 |
+
position: relative;
|
1186 |
+
height: 35px;
|
1187 |
+
background: white;
|
1188 |
+
border-bottom: solid 1px #dedede;
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
.msp-layer-row.active {
|
1192 |
+
-webkit-box-shadow: 1px 0px 0px 1px #2EA2CC inset;
|
1193 |
+
-moz-box-shadow: 1px 0px 0px 1px #2EA2CC inset;
|
1194 |
+
box-shadow: 1px 0px 0px 1px #2EA2CC inset;
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
.msp-layer-label img {
|
1198 |
+
float: left;
|
1199 |
+
}
|
1200 |
+
.msp-layer-labeltext {
|
1201 |
+
line-height: 27px;
|
1202 |
+
margin-left: 4px;
|
1203 |
+
white-space:nowrap;
|
1204 |
+
-ms-text-overflow: ellipsis;
|
1205 |
+
text-overflow: ellipsis;
|
1206 |
+
overflow:hidden;
|
1207 |
+
width: 7em;
|
1208 |
+
display: block;
|
1209 |
+
float: left;
|
1210 |
+
color: #666;
|
1211 |
+
}
|
1212 |
+
|
1213 |
+
.msp-layers-srtplaceholder{
|
1214 |
+
width: 100%;
|
1215 |
+
height:1px !important;
|
1216 |
+
background:#2EA2CC;
|
1217 |
+
}
|
1218 |
+
|
1219 |
+
.msp-layer-row ul {
|
1220 |
+
margin: 11px;
|
1221 |
+
position: absolute;
|
1222 |
+
}
|
1223 |
+
.msp-layer-row ul li {
|
1224 |
+
margin-right: 0px;
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
.msp-layer-controls {
|
1228 |
+
position: absolute;
|
1229 |
+
right: 0;
|
1230 |
+
margin: 11px 11px 0 0;
|
1231 |
+
}
|
1232 |
+
.msp-layer-controls a {
|
1233 |
+
margin: 0 2px;
|
1234 |
+
}
|
1235 |
+
|
1236 |
+
.msp-tl-frames-cont ul {
|
1237 |
+
margin: 0;
|
1238 |
+
padding: 0;
|
1239 |
+
list-style: none;
|
1240 |
+
}
|
1241 |
+
.msp-frames-row {
|
1242 |
+
height: 35px;
|
1243 |
+
padding-left: 20px;
|
1244 |
+
border-bottom: solid 1px #dedede;
|
1245 |
+
border-right: solid 1px #dedede;
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
.msp-frames-row.active {
|
1249 |
+
-webkit-box-shadow: -1px 0px 0px 1px #2EA2CC inset;
|
1250 |
+
-moz-box-shadow: -1px 0px 0px 1px #2EA2CC inset;
|
1251 |
+
box-shadow: -1px 0px 0px 1px #2EA2CC inset;
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
.msp-timeline-range{
|
1255 |
+
position: relative;
|
1256 |
+
top: 8px;
|
1257 |
+
left: -2px;
|
1258 |
+
height: 10px;
|
1259 |
+
white-space: nowrap;
|
1260 |
+
|
1261 |
+
}
|
1262 |
+
|
1263 |
+
.msp-range{
|
1264 |
+
display: inline-block;
|
1265 |
+
background: gray;
|
1266 |
+
height: 10px;
|
1267 |
+
border-radius: 5px;
|
1268 |
+
white-space: normal;
|
1269 |
+
cursor: w-resize;
|
1270 |
+
min-width: 2px;
|
1271 |
+
margin-right: 1px;
|
1272 |
+
}
|
1273 |
+
|
1274 |
+
.msp-timeline-range.avt-disabled .msp-range{
|
1275 |
+
cursor: default !important;
|
1276 |
+
}
|
1277 |
+
|
1278 |
+
.msp-range-delay { background: url(../images/patt.png) #dcdada;}
|
1279 |
+
.msp-range-show { background: #2ea2cc;}
|
1280 |
+
.msp-range-wating { background: url(../images/patt.png) #fff3b6;}
|
1281 |
+
.msp-range-hide { background: #e46161;}
|
1282 |
+
|
1283 |
+
.avt-range-tooltip {
|
1284 |
+
position: absolute;
|
1285 |
+
z-index: 1000;
|
1286 |
+
padding: 2px 5px;
|
1287 |
+
background: #278AAE;
|
1288 |
+
margin: -30px 0 0 -3px;
|
1289 |
+
color: #FFF;
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
.avt-range-tooltip:after {
|
1293 |
+
content: '';
|
1294 |
+
display: block;
|
1295 |
+
border-top: solid 10px #278AAE;
|
1296 |
+
position: absolute;
|
1297 |
+
border-left: solid 10px rgba(0, 0, 0, 0);
|
1298 |
+
}
|
1299 |
+
|
1300 |
+
.msp-tl-resizehandle {
|
1301 |
+
width: 100%;
|
1302 |
+
text-align: center;
|
1303 |
+
color: gray;
|
1304 |
+
font-size: 25px;
|
1305 |
+
cursor: n-resize;
|
1306 |
+
line-height: 0;
|
1307 |
+
height: 17px;
|
1308 |
+
position: absolute;
|
1309 |
+
bottom: -17px;
|
1310 |
+
}
|
1311 |
+
|
1312 |
+
.ps-scrollbar-x {
|
1313 |
+
position: relative; /* please don't change 'position' */ /* there must be 'bottom' for ps-scrollbar-x */
|
1314 |
+
height: 11px;
|
1315 |
+
background-color: #FAFAFA;
|
1316 |
+
border: solid 1px #CACACA;
|
1317 |
+
}
|
1318 |
+
|
1319 |
+
.ps-scrollbar-y {
|
1320 |
+
position: relative; /* please don't change 'position' */
|
1321 |
+
width: 11px;
|
1322 |
+
background-color: #fafafa; border: solid 1px #CACACA;
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
/*Stage*/
|
1326 |
+
.msp-stage-top-toolbar{
|
1327 |
+
margin-top: 10px;
|
1328 |
+
}
|
1329 |
+
|
1330 |
+
.msp-slide-stage {
|
1331 |
+
position: relative;
|
1332 |
+
border: solid 1px #DEDEDE;
|
1333 |
+
margin: 0px auto;
|
1334 |
+
overflow: hidden;
|
1335 |
+
color: black;
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
.msp-stage-pattern {
|
1339 |
+
width: 100%;
|
1340 |
+
height: 100%;
|
1341 |
+
position: absolute;
|
1342 |
+
top: 0;
|
1343 |
+
}
|
1344 |
+
|
1345 |
+
.msp-stage-msg {
|
1346 |
+
padding: 10px 20px;
|
1347 |
+
background: rgb(255, 255, 255);
|
1348 |
+
margin-bottom: -20px;
|
1349 |
+
margin-top: 20px;
|
1350 |
+
border-top: solid 1px #f1f1f1;
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
/*disable native selection*/
|
1354 |
+
.msp-slide-stage, .msp-slide-stage *{
|
1355 |
+
-webkit-user-select: none;
|
1356 |
+
-moz-user-select: none;
|
1357 |
+
-ms-user-select: none;
|
1358 |
+
user-select: none;
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
.msp-stage-snapbox{
|
1362 |
+
position: absolute;
|
1363 |
+
z-index: 0;
|
1364 |
+
width: 100%;
|
1365 |
+
height: 100%;
|
1366 |
+
top: 0;
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
.msp-solo-plane {
|
1370 |
+
width: 100%;
|
1371 |
+
height: 100%;
|
1372 |
+
background: url(../images/patt.png) rgba(0, 0, 0, 0.5);
|
1373 |
+
position: absolute;
|
1374 |
+
top: 0;
|
1375 |
+
z-index: 500;
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
/* reset default styles in stage */
|
1379 |
+
.msp-slide-stage p , .msp-slide-stage h1 , .msp-slide-stage h2 ,
|
1380 |
+
.msp-slide-stage h3 , .msp-slide-stage h4 , .msp-slide-stage h5
|
1381 |
+
{margin: 0; padding:0; font:inherit; color:inherit;}
|
1382 |
+
|
1383 |
+
.msp-stage-bg{
|
1384 |
+
overflow: hidden;
|
1385 |
+
width: 100%;
|
1386 |
+
height: 100%;
|
1387 |
+
}
|
1388 |
+
|
1389 |
+
.msp-stage-bg>img{
|
1390 |
+
position: relative;
|
1391 |
+
}
|
1392 |
+
|
1393 |
+
@-webkit-keyframes pulse {
|
1394 |
+
0% { outline-color: rgba(0, 0, 204,0.2); }
|
1395 |
+
50% { outline-color: rgba(0, 0, 204,1); }
|
1396 |
+
100% { outline-color: rgba(0, 0, 204,0.2); }
|
1397 |
+
}
|
1398 |
+
|
1399 |
+
.msp-stage-layer {
|
1400 |
+
position: absolute;
|
1401 |
+
left: 0;
|
1402 |
+
top: 0;
|
1403 |
+
cursor: default;
|
1404 |
+
}
|
1405 |
+
|
1406 |
+
.msp-stage-layer img{
|
1407 |
+
display: block;
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
.msp-stage-videolayer {
|
1411 |
+
background: black;
|
1412 |
+
overflow: hidden;
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
.msp-stage-videoicon {
|
1416 |
+
top: 50%;
|
1417 |
+
left: 50%;
|
1418 |
+
position: relative;
|
1419 |
+
margin-top: -27px;
|
1420 |
+
margin-left: -23px;
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
.msp-stage-hotspot {
|
1424 |
+
width: 14px;
|
1425 |
+
height: 14px;
|
1426 |
+
border-radius: 15px;
|
1427 |
+
border: 2px solid #BBB;
|
1428 |
+
background: #FFF;
|
1429 |
+
margin: -8px 0px 0px -8px; position: absolute;
|
1430 |
+
}
|
1431 |
+
|
1432 |
+
.msp-stage-layer.active .msp-stage-hotspot,
|
1433 |
+
.msp-stage-layer.active {
|
1434 |
+
-webkit-animation: pulse 1s infinite ease-out;
|
1435 |
+
animation: pulse 4s infinite ease-in-out;
|
1436 |
+
outline-width: 1px;
|
1437 |
+
outline-style: dashed;
|
1438 |
+
}
|
1439 |
+
|
1440 |
+
/* CKEditor style */
|
1441 |
+
.msp-container .cke_chrome{
|
1442 |
+
box-shadow: none;
|
1443 |
+
}
|
1444 |
+
|
1445 |
+
.msp-container .cke_toolgroup,
|
1446 |
+
.msp-container .cke_combo_button{
|
1447 |
+
border-radius: 0;
|
1448 |
+
}
|
1449 |
+
|
1450 |
+
/*style and effect editor*/
|
1451 |
+
.mps-style-editor,
|
1452 |
+
.mps-button-editor,
|
1453 |
+
.mps-effect-editor {
|
1454 |
+
min-height: 450px;
|
1455 |
+
position: relative;
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
.bgToggle {
|
1459 |
+
width: 15px;
|
1460 |
+
height: 15px;
|
1461 |
+
position: absolute;
|
1462 |
+
bottom: 10px;
|
1463 |
+
left: 10px;
|
1464 |
+
cursor: pointer;
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
.msp-section-handle {
|
1468 |
+
height: 45px;
|
1469 |
+
border-bottom: solid 1px #dedede;
|
1470 |
+
}
|
1471 |
+
|
1472 |
+
.msp-section-title {
|
1473 |
+
color: #2EA2CC;
|
1474 |
+
position: relative;
|
1475 |
+
top: 13px;
|
1476 |
+
left: 20px;
|
1477 |
+
font-size: 1.2em;
|
1478 |
+
}
|
1479 |
+
|
1480 |
+
|
1481 |
+
.left-box {
|
1482 |
+
position: absolute;
|
1483 |
+
width: 780px;
|
1484 |
+
left: 0;
|
1485 |
+
top: 0;
|
1486 |
+
bottom: 0;
|
1487 |
+
}
|
1488 |
+
|
1489 |
+
.msp-style-list,
|
1490 |
+
.msp-effect-list {
|
1491 |
+
position: absolute;
|
1492 |
+
width: 220px;
|
1493 |
+
border-left: solid 1px #dedede;
|
1494 |
+
right: 0;
|
1495 |
+
height: 100%;
|
1496 |
+
}
|
1497 |
+
|
1498 |
+
.msp-style-list .msp-section-handle,
|
1499 |
+
.msp-effect-list .msp-section-handle {
|
1500 |
+
top: -46px;
|
1501 |
+
left: -1px;
|
1502 |
+
border-left: solid 1px #DEDEDE;
|
1503 |
+
position: absolute;
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
.msp-style-list .msp-section-content,
|
1507 |
+
.msp-effect-list .msp-section-content { height: 100%; }
|
1508 |
+
|
1509 |
+
.msp-style-list-cont,
|
1510 |
+
.msp-effect-list-cont {
|
1511 |
+
overflow: auto;
|
1512 |
+
height: 100%;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
.msp-style-preview-cont,
|
1516 |
+
.msp-effect-preview-cont {
|
1517 |
+
height: 200px;
|
1518 |
+
border-bottom: solid 1px #dedede;
|
1519 |
+
position: relative;
|
1520 |
+
overflow: hidden;
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
.mps-button-editor .msp-style-preview-cont{
|
1524 |
+
height: 150px;
|
1525 |
+
}
|
1526 |
+
|
1527 |
+
|
1528 |
+
.msp-effect-preview-cont {
|
1529 |
+
height: 265px;
|
1530 |
+
}
|
1531 |
+
|
1532 |
+
.msp-style-sample,
|
1533 |
+
.msp-effect-sample,
|
1534 |
+
.msp-effect-guide {
|
1535 |
+
position: absolute;
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
.msp-effect-sample,
|
1539 |
+
.msp-effect-guide {
|
1540 |
+
background: url(../images/sample.png) no-repeat;
|
1541 |
+
border: solid 1px #E9E9E9;
|
1542 |
+
width: 120px;
|
1543 |
+
height: 108px;
|
1544 |
+
}
|
1545 |
+
|
1546 |
+
.msp-effect-guide{
|
1547 |
+
border: dashed 1px #2ea2cc;
|
1548 |
+
opacity: 0.4;
|
1549 |
+
}
|
1550 |
+
|
1551 |
+
.msp-style-properties .msp-section-content,
|
1552 |
+
.msp-effect-properties .msp-section-content {
|
1553 |
+
position: absolute;
|
1554 |
+
top: 1px;
|
1555 |
+
bottom: 0;
|
1556 |
+
width: 100%;
|
1557 |
+
overflow: auto;
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
.msp-style-properties,
|
1561 |
+
.msp-effect-properties {
|
1562 |
+
position: absolute;
|
1563 |
+
bottom: 0;
|
1564 |
+
top: 200px;
|
1565 |
+
width: 100%;
|
1566 |
+
}
|
1567 |
+
|
1568 |
+
.msp-applystyle-cont,
|
1569 |
+
.msp-applyeffect-cont {
|
1570 |
+
position: absolute;
|
1571 |
+
bottom: 0;
|
1572 |
+
width: 100%;
|
1573 |
+
padding: 10px 0;
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
.msp-style-row,
|
1577 |
+
.msp-effect-row {
|
1578 |
+
padding: 9px 0 9px 20px;
|
1579 |
+
border-bottom: solid 1px #dedede;
|
1580 |
+
font-size: 0.89em;
|
1581 |
+
cursor: pointer;
|
1582 |
+
position: relative;
|
1583 |
+
}
|
1584 |
+
|
1585 |
+
.msp-style-row.active,
|
1586 |
+
.msp-effect-row.active {
|
1587 |
+
box-shadow: 0 0 0px 1px #2EA2CC inset;
|
1588 |
+
}
|
1589 |
+
|
1590 |
+
.msp-style-remove,
|
1591 |
+
.msp-effect-remove {
|
1592 |
+
position: absolute;
|
1593 |
+
right: 15px;
|
1594 |
+
top: 10px;
|
1595 |
+
}
|
1596 |
+
|
1597 |
+
.msp-save-status {
|
1598 |
+
display: inline-block;
|
1599 |
+
margin-left: 5px;
|
1600 |
+
}
|
1601 |
+
|
1602 |
+
button.msp-savepreset, button.msp-applystyle, button.msp-applyeffect {
|
1603 |
+
padding: 13px 0 10px;
|
1604 |
+
margin-right: 10px !important;
|
1605 |
+
text-transform: uppercase;
|
1606 |
+
font-weight: 900 !important;
|
1607 |
+
border-bottom-width: 5px !important;
|
1608 |
+
margin-left: 20px;
|
1609 |
+
width: 479px;
|
1610 |
+
font-size: 15px;
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
button.msp-applyeffect {
|
1614 |
+
padding: 13px 0 10px;
|
1615 |
+
width: 475px;
|
1616 |
+
}
|
1617 |
+
|
1618 |
+
button.msp-savepreset {
|
1619 |
+
padding: 13px 0 10px;
|
1620 |
+
width: 253px;
|
1621 |
+
margin-left: 0;
|
1622 |
+
}
|
1623 |
+
|
1624 |
+
.msp-preview-controls {
|
1625 |
+
height: 32px;
|
1626 |
+
position: absolute;
|
1627 |
+
left: 20px;
|
1628 |
+
bottom: 10px;
|
1629 |
+
z-index: 10;
|
1630 |
+
}
|
1631 |
+
|
1632 |
+
.msp-effect-review-btn{
|
1633 |
+
height: 23px;
|
1634 |
+
width: 26px;
|
1635 |
+
border-radius:100%;
|
1636 |
+
-webkit-user-select: none;
|
1637 |
+
-moz-user-select: none;
|
1638 |
+
-ms-user-select: none;
|
1639 |
+
user-select: none;
|
1640 |
+
}
|
1641 |
+
|
1642 |
+
.msp-effect-review-btn .msp-ico-whiteplay{
|
1643 |
+
top: 5px;
|
1644 |
+
left: 10px;
|
1645 |
+
position: relative;
|
1646 |
+
}
|
1647 |
+
|
1648 |
+
.msp-effect-review-btn .msp-ico-whitepause{
|
1649 |
+
top: 6px;
|
1650 |
+
left: 9px;
|
1651 |
+
position: relative;
|
1652 |
+
}
|
1653 |
+
|
1654 |
+
.msp-ui-slider {
|
1655 |
+
width: 150px;
|
1656 |
+
background: #dedede;
|
1657 |
+
height: 5px;
|
1658 |
+
border-radius: 50px;
|
1659 |
+
border: solid 6px transparent;
|
1660 |
+
background-clip: padding-box;
|
1661 |
+
position: relative;
|
1662 |
+
display: inline-block;
|
1663 |
+
}
|
1664 |
+
|
1665 |
+
.msp-ui-slider .ui-slider-handle {
|
1666 |
+
display: block;
|
1667 |
+
position: absolute;
|
1668 |
+
width: 16px;
|
1669 |
+
height: 16px;
|
1670 |
+
border-radius: 100%;
|
1671 |
+
background-color: #2EA2CC;
|
1672 |
+
border: solid 1px white;
|
1673 |
+
top: -6px;
|
1674 |
+
margin-left: -8px;
|
1675 |
+
}
|
1676 |
+
.msp-ui-slider .ui-slider-handle:after {
|
1677 |
+
content: '';
|
1678 |
+
display: block;
|
1679 |
+
position: absolute;
|
1680 |
+
width: 0px;
|
1681 |
+
height: 0px;
|
1682 |
+
border: solid #FFF 2px;
|
1683 |
+
border-radius: 100%;
|
1684 |
+
top: 6px;
|
1685 |
+
left: 6px;
|
1686 |
+
}
|
1687 |
+
|
1688 |
+
.msp-effect-timeline-slider {
|
1689 |
+
margin-left: 5px;
|
1690 |
+
margin-top: 5px;
|
1691 |
+
}
|
1692 |
+
|
1693 |
+
/*Slider controls*/
|
1694 |
+
.msp-control-btn {
|
1695 |
+
float: left;
|
1696 |
+
background: #777777;
|
1697 |
+
margin-right: 10px;
|
1698 |
+
color: white;
|
1699 |
+
padding: 0px 30px 0px 0px;
|
1700 |
+
border-bottom: solid 3px #656565;
|
1701 |
+
position: relative;
|
1702 |
+
cursor: default;
|
1703 |
+
margin-top: 10px;
|
1704 |
+
}
|
1705 |
+
|
1706 |
+
.msp-control-btn:hover {
|
1707 |
+
background: #818181;
|
1708 |
+
}
|
1709 |
+
|
1710 |
+
.msp-control-removes {
|
1711 |
+
position: absolute;
|
1712 |
+
right: 7px;
|
1713 |
+
top: 5px;
|
1714 |
+
}
|
1715 |
+
|
1716 |
+
.msp-control-label {
|
1717 |
+
display: block;
|
1718 |
float: left;
|
1719 |
border-right: solid 1px #FFF;
|
1720 |
padding: 5px 16px;
|
1721 |
+
}
|
1722 |
+
|
1723 |
+
/*templates*/
|
1724 |
+
.msp-templates-list {
|
1725 |
+
overflow: auto;
|
1726 |
+
position: absolute;
|
1727 |
+
top: 124px;
|
1728 |
+
bottom: 80px;
|
1729 |
+
width: 100%;
|
1730 |
+
padding-bottom: 20px;
|
1731 |
+
}
|
1732 |
+
|
1733 |
+
.msp-template-figure {
|
1734 |
+
float: left;
|
1735 |
+
margin: 20px 0 0 20px;
|
1736 |
+
width: 276px;
|
1737 |
+
position: relative;
|
1738 |
+
cursor: pointer;
|
1739 |
+
}
|
1740 |
+
|
1741 |
+
.msp-template-figure>img {
|
1742 |
+
border: solid 1px #dedede;
|
1743 |
+
float: left;
|
1744 |
+
width: 100%;
|
1745 |
+
}
|
1746 |
+
|
1747 |
+
.msp-template-caption {
|
1748 |
+
border: solid 1px #dedede;
|
1749 |
+
text-align: center;
|
1750 |
+
vertical-align: middle;
|
1751 |
+
width: 100%;
|
1752 |
+
float: left;
|
1753 |
+
box-shadow: 0 -3px #F3F3F3 inset;
|
1754 |
+
margin-top: -1px;
|
1755 |
+
padding: 14px 0;
|
1756 |
+
}
|
1757 |
+
|
1758 |
+
.msp-template-figure.selected>img {
|
1759 |
+
border-color: #278AAE;
|
1760 |
+
}
|
1761 |
+
|
1762 |
+
.selected .msp-template-caption {
|
1763 |
+
background: #2ea2cc;
|
1764 |
+
border-color: #278AAE;
|
1765 |
+
color: white;
|
1766 |
+
box-shadow: 0 -3px #278AAE inset;
|
1767 |
+
}
|
1768 |
+
|
1769 |
+
.msp-templte-selected {
|
1770 |
+
position: absolute;
|
1771 |
+
top: 0;
|
1772 |
+
right: -1px;
|
1773 |
+
width: 22px;
|
1774 |
+
height: 22px;
|
1775 |
+
background: url(../images/ui-spritesheet.png) -194px -146px no-repeat #2EA2CC;
|
1776 |
+
}
|
1777 |
+
|
1778 |
+
.msp-templates-bottom {
|
1779 |
+
position: absolute;
|
1780 |
+
border-top: solid 1px #dedede;
|
1781 |
+
bottom: 15px;
|
1782 |
+
width: 100%;
|
1783 |
+
padding-top: 16px;
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
button.msp-tempalte-save {
|
1787 |
+
width: 885px;
|
1788 |
+
}
|
1789 |
+
|
1790 |
+
|
1791 |
+
/*Choose Template in slider Settings*/
|
1792 |
+
.msp-choose-template>.msp-img-box {
|
1793 |
+
float: left;
|
1794 |
+
border: solid 1px #dedede;
|
1795 |
+
width: 217px;
|
1796 |
+
margin-right: 20px;
|
1797 |
+
}
|
1798 |
+
.msp-choose-template {
|
1799 |
+
display: inline-block;
|
1800 |
+
vertical-align: top;
|
1801 |
+
}
|
1802 |
+
.msp-choose-template>.msp-img-box>img {
|
1803 |
+
display: block;
|
1804 |
+
width: 100%;
|
1805 |
+
cursor: pointer;
|
1806 |
+
}
|
1807 |
+
.float-left {
|
1808 |
+
float: left;
|
1809 |
+
}
|
1810 |
+
|
1811 |
+
.msp-template-name {
|
1812 |
+
display: block;
|
1813 |
+
font-weight: 600;
|
1814 |
+
margin: 14px 0;
|
1815 |
+
}
|
1816 |
+
|
1817 |
+
/*Posts preview in post slider*/
|
1818 |
+
|
1819 |
+
.msp-posts-loading {
|
1820 |
+
margin:20px;
|
1821 |
+
}
|
1822 |
+
|
1823 |
+
.msp-posts-preview {
|
1824 |
+
height: 400px;
|
1825 |
+
overflow: auto;
|
1826 |
+
margin-bottom: -20px;
|
1827 |
+
}
|
1828 |
+
|
1829 |
+
.msp-post {
|
1830 |
+
border-bottom: solid 1px #f1f1f1;
|
1831 |
+
}
|
1832 |
+
|
1833 |
+
.msp-post figure {
|
1834 |
+
margin: 20px 0 20px 20px;
|
1835 |
+
display: table;
|
1836 |
+
}
|
1837 |
+
|
1838 |
+
.msp-post .msp-entry-media {
|
1839 |
+
float: left;
|
1840 |
+
margin-right: 20px;
|
1841 |
+
}
|
1842 |
+
|
1843 |
+
.msp-post .msp-entry-media>img {
|
1844 |
+
border: solid 1px #dedede;
|
1845 |
+
}
|
1846 |
+
|
1847 |
+
.msp-post figcaption {
|
1848 |
+
float: left;
|
1849 |
+
}
|
1850 |
+
|
1851 |
+
.msp-post .msp-entry-title {
|
1852 |
+
margin: 0 0 10px 0;
|
1853 |
+
font-weight: 600;
|
1854 |
+
font-size: 1.1em;
|
1855 |
+
}
|
1856 |
+
|
1857 |
+
.msp-post .msp-entry-content>p {
|
1858 |
+
margin-bottom: 0;
|
1859 |
+
}
|
1860 |
+
|
1861 |
+
.msp-post .ps-post-id {
|
1862 |
+
color: #336FAF;
|
1863 |
+
}
|
1864 |
+
|
1865 |
+
/*----------------------------------------------------------*/
|
1866 |
+
/* Button Layer */
|
1867 |
+
.msp-buttons-container {
|
1868 |
+
max-width: 890px;
|
1869 |
+
border: solid 1px #dedede;
|
1870 |
+
padding: 5px;
|
1871 |
+
overflow: auto;
|
1872 |
+
height: 362px;
|
1873 |
+
width: 100%;
|
1874 |
+
}
|
1875 |
+
|
1876 |
+
.msp-button-container {
|
1877 |
+
display: table;
|
1878 |
+
margin: 3px 2px;
|
1879 |
+
cursor: pointer;
|
1880 |
+
float: left;
|
1881 |
+
width: 170px;
|
1882 |
+
height: 85px;
|
1883 |
+
}
|
1884 |
+
|
1885 |
+
.msp-button-cell{
|
1886 |
+
display: table-cell;
|
1887 |
+
vertical-align: middle;
|
1888 |
+
text-align: center;
|
1889 |
+
border: solid 1px #dedede;
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
.msp-button-cell.active {
|
1893 |
+
border-color: #33AFDB;
|
1894 |
+
}
|
1895 |
+
|
1896 |
+
.ms-btn {
|
1897 |
+
text-decoration: none;
|
1898 |
+
display: inline-block;
|
1899 |
+
color:black;
|
1900 |
+
position: relative;
|
1901 |
+
padding: 8px 15px;
|
1902 |
+
cursor: pointer;
|
1903 |
+
white-space: nowrap;
|
1904 |
+
}
|
1905 |
+
|
1906 |
+
.ms-default-btn{
|
1907 |
+
background: #0074A2;
|
1908 |
+
border-radius: 5px;
|
1909 |
+
color: #FFF;
|
1910 |
+
}
|
1911 |
+
|
1912 |
+
.ms-default-btn:hover{background-color: #0098D5;}
|
1913 |
+
.ms-default-btn:active{top:1px;}
|
1914 |
+
|
1915 |
+
.ms-btn-s{
|
1916 |
+
padding: 14px 17px;
|
1917 |
+
font-size: 80%;
|
1918 |
+
line-height: 0;
|
1919 |
+
}
|
1920 |
+
|
1921 |
+
.ms-btn-m{
|
1922 |
+
padding: 12px 40px;
|
1923 |
+
}
|
1924 |
+
|
1925 |
+
.ms-btn-n{
|
1926 |
+
padding: 8px 25px;
|
1927 |
+
font-size: 95%;
|
1928 |
+
}
|
1929 |
+
|
1930 |
+
.ms-btn-l{
|
1931 |
+
padding: 17px 50px;
|
1932 |
+
font-size: 120%;
|
1933 |
+
}
|
1934 |
+
|
1935 |
+
.ms-btn-box{}
|
1936 |
+
.ms-btn-round{border-radius: 5px;}
|
1937 |
+
.ms-btn-circle{border-radius: 100px;}
|
1938 |
+
.ms-btn-outline-box{}
|
1939 |
+
.ms-btn-outline-round{border-radius: 5px;}
|
1940 |
+
.ms-btn-outline-circle{border-radius: 100px;}
|
1941 |
+
|
1942 |
+
/*----------------------------------------------------------------------*/
|
1943 |
+
|
1944 |
+
.msp-action-list {
|
1945 |
+
display: inline-block;
|
1946 |
+
}
|
1947 |
+
|
1948 |
+
.msp-selection{
|
1949 |
+
position: relative;
|
1950 |
+
}
|
1951 |
+
|
1952 |
+
@-webkit-keyframes selection {
|
1953 |
+
0% { background-position: 0 0 }
|
1954 |
+
100% { background-position: 120px 120px }
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
.msp-selection .border {
|
1958 |
+
background-image: -webkit-gradient(linear, 0 0, 100% 100%,
|
1959 |
+
color-stop(.25, #FFF),
|
1960 |
+
color-stop(.25, rgba(0, 0, 0, 0)),
|
1961 |
+
color-stop(.5, rgba(0, 0, 0, 0)),
|
1962 |
+
color-stop(.5, #FFF),
|
1963 |
+
color-stop(0.75, #FFF),
|
1964 |
+
color-stop(.75, rgba(0, 0, 0, 0)),
|
1965 |
+
to(rgba(0, 0, 0, 0))
|
1966 |
+
);
|
1967 |
+
background-size: 30px 30px;
|
1968 |
+
position: absolute;
|
1969 |
+
background-color: #2EA2CC;
|
1970 |
+
-webkit-animation: selection 6s infinite linear;
|
1971 |
+
animation: selection 6s infinite ease-in-out;
|
1972 |
+
}
|
1973 |
+
|
1974 |
+
.msp-selection .border.border-left{
|
1975 |
+
height: 100%;
|
1976 |
+
width: 1px;
|
1977 |
+
left:-1px;
|
1978 |
+
}
|
1979 |
+
|
1980 |
+
.msp-selection .border.border-right{
|
1981 |
+
height: 100%;
|
1982 |
+
width: 1px;
|
1983 |
+
right:-1px;
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
.msp-selection .border.border-top{
|
1987 |
+
width: 100%;
|
1988 |
+
height: 1px;
|
1989 |
+
top:-1px;
|
1990 |
+
}
|
1991 |
+
|
1992 |
+
.msp-selection .border.border-bottom{
|
1993 |
+
width: 100%;
|
1994 |
+
height: 1px;
|
1995 |
+
bottom:-1px;
|
1996 |
+
}
|
1997 |
+
|
1998 |
+
/*
|
1999 |
+
Pattern Picker
|
2000 |
+
*/
|
2001 |
+
|
2002 |
+
.ms-pattern.ms-patt-1 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABRJREFUeNpiYICA/wzoDGTwHyDAADXxAv4Eq8S5AAAAAElFTkSuQmCC);}
|
2003 |
+
.ms-pattern.ms-patt-2 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABhJREFUeNpiYECA/wxogLAANoBdF0CAAQD+agT8l3ocpQAAAABJRU5ErkJggg==);}
|
2004 |
+
.ms-pattern.ms-patt-3 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACxJREFUeNqU0EENAAAMwkD8m+4s7PhCCmHbGijxE0jS1HOOhxJSUhf9eAIMAI/CEe94Ny14AAAAAElFTkSuQmCC);}
|
2005 |
+
.ms-pattern.ms-patt-4 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABhJREFUeNpiYGBg+M+ABfxHo3Fz/gMEGACtlgX7j8MuyAAAAABJRU5ErkJggg==);}
|
2006 |
+
.ms-pattern.ms-patt-5 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAYAAABWKLW/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABNJREFUeNpiYECA/3CCAV0UIMAANfEC/mOKn1cAAAAASUVORK5CYII=);}
|
2007 |
+
.ms-pattern.ms-patt-6 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAABhJREFUeNpiYGBg2MTAwMDgAwAAAP//AwAEggD/4yQTzwAAAABJRU5ErkJggg==);}
|
2008 |
+
.ms-pattern.ms-patt-7 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpiYMAE/+EEAy5Z0iUAAgwA/moE/KMl2lgAAAAASUVORK5CYII=);}
|
2009 |
+
.ms-pattern.ms-patt-8 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAICAYAAAA4GpVBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABRJREFUeNpiYGBg+M+ACdDFAAIMADP0Af/w5VDVAAAAAElFTkSuQmCC);}
|
2010 |
+
.ms-pattern.ms-patt-9 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiYGBg+M9AGQAIMABABAEA80yJjQAAAABJRU5ErkJggg==);}
|
2011 |
+
.ms-pattern.ms-patt-10 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpiYGBg+A/FcMDEQH0AEGAAxksCAb3vCDgAAAAASUVORK5CYII=);}
|
2012 |
+
.ms-pattern.ms-patt-11 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABxJREFUeNpiZGBg+M+AChhBBBMDDkC6BOkAIMAAlXQBCO9f4icAAAAASUVORK5CYII=);}
|
2013 |
+
.ms-pattern.ms-patt-12 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABtJREFUeNpiYGBg+M8AATAaDnAKYEgQBgABBgB6/AT8h9ybfgAAAABJRU5ErkJggg==);}
|
2014 |
+
.ms-pattern.ms-patt-13 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB1JREFUeNpiYGBg+M+ABJig9H90AbggI7oWgAADAI5xBAIRYsxUAAAAAElFTkSuQmCC);}
|
2015 |
+
.ms-pattern.ms-patt-14 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAICAYAAAAx8TU7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpiYGBg+M+AA9BSgkQBgAADAJIyB/kDCjAnAAAAAElFTkSuQmCC);}
|
2016 |
+
.ms-pattern.ms-patt-15 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB9JREFUeNpiYGBg+M9ABPhPjPh/YjT9J2AipiRAgAEAhjsH+Utd9Z4AAAAASUVORK5CYII=);}
|
2017 |
+
/* white patterns */
|
2018 |
+
.ms-pattern.ms-patt-16 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFAQMAAABCXz8WAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABJJREFUCNdjaGBwZFBiEGHgAAAHPwEAP8TPrwAAAABJRU5ErkJggg==);}
|
2019 |
+
.ms-pattern.ms-patt-17 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAIAQMAAAALP6d4AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABZJREFUCNdjaGBwYFBgEGDgAGIFBgcADegBabpJ4LsAAAAASUVORK5CYII=);}
|
2020 |
+
.ms-pattern.ms-patt-18 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAEAQMAAACTPww9AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABBJREFUCNdjaGA4wPCA4QMACtgDEQ8Bqx8AAAAASUVORK5CYII=);}
|
2021 |
+
.ms-pattern.ms-patt-19 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFAQMAAAC3obSmAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAA9JREFUCNdjWMDgAMRAAAAKigGBlYsMggAAAABJRU5ErkJggg==);}
|
2022 |
+
.ms-pattern.ms-patt-20 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGAQMAAADaAn0LAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAA1JREFUCNdj+ACFQAAAHgwDwds/+0oAAAAASUVORK5CYII=);}
|
2023 |
+
.ms-pattern.ms-patt-21 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFAQMAAAC3obSmAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAA1JREFUCNdjOACEYAAADAoBgRrgDF0AAAAASUVORK5CYII=);}
|
2024 |
+
.ms-pattern.ms-patt-22 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAEAQMAAACTPww9AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjaGAAAwADiACBhux1cwAAAABJRU5ErkJggg==);}
|
2025 |
+
.ms-pattern.ms-patt-23 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAIAQMAAAAC1AcCAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjaGAAAxgNAAsQAQHPxScOAAAAAElFTkSuQmCC);}
|
2026 |
+
.ms-pattern.ms-patt-24 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAABAQMAAADZzn0AAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAApJREFUCNdj6AAAAIoAiVWdWYwAAAAASUVORK5CYII=);}
|
2027 |
+
.ms-pattern.ms-patt-25 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFAQMAAAC3obSmAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABJJREFUCNdj4GBoYHBgUGAQAAAFggD5HRIFwAAAAABJRU5ErkJggg==);}
|
2028 |
+
.ms-pattern.ms-patt-26 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADAQMAAABs5if8AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjUGBoYHAAAAJmAOF0EZC+AAAAAElFTkSuQmCC);}
|
2029 |
+
.ms-pattern.ms-patt-27 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAEAQMAAACTPww9AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABBJREFUCNdjaGAIYFBgCAAABcgBQeTzXGUAAAAASUVORK5CYII=);}
|
2030 |
+
.ms-pattern.ms-patt-28 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKAQMAAAC3/F3+AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAACBJREFUCNdjaGBgcHBgUGhgEGRg4GJgYAGRQDZQBCgOAC/KAvtspwwJAAAAAElFTkSuQmCC);}
|
2031 |
+
.ms-pattern.ms-patt-29 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFAQMAAAC3obSmAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAABJJREFUCNdjUGBwYGhg4GAQAAAFkgD5MUFnfgAAAABJRU5ErkJggg==);}
|
2032 |
+
.ms-pattern.ms-patt-30 {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADAQMAAABs5if8AAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAA5JREFUCNdjcGBoYFAAAALmAOHcBT11AAAAAElFTkSuQmCC);}
|
2033 |
+
|
2034 |
+
|
2035 |
+
|
2036 |
+
.msp-pattern-picker {
|
2037 |
+
display: inline-block;
|
2038 |
+
vertical-align: middle;
|
2039 |
+
}
|
2040 |
+
|
2041 |
+
.ms-pattern-preview {
|
2042 |
+
width: 20px;
|
2043 |
+
height: 20px;
|
2044 |
+
float: left;
|
2045 |
+
margin: 0 9px 0 1px;
|
2046 |
+
border: solid 1px #dedede;
|
2047 |
+
}
|
2048 |
+
|
2049 |
+
.msp-patterns-box {
|
2050 |
+
width: 296px;
|
2051 |
+
z-index: 100;
|
2052 |
+
position: absolute;
|
2053 |
+
border: solid 1px #dedede;
|
2054 |
+
background: white;
|
2055 |
+
padding: 5px;
|
2056 |
+
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.07);
|
2057 |
+
}
|
2058 |
+
|
2059 |
+
.msp-pattern-prev.ms-pattern {
|
2060 |
+
float: left;
|
2061 |
+
width: 25px;
|
2062 |
+
height: 25px;
|
2063 |
+
border: solid 1px #dedede;
|
2064 |
+
margin: 5px;
|
2065 |
+
cursor: pointer;
|
2066 |
+
}
|
2067 |
+
|
2068 |
+
.msp-pattern-prev.ms-pattern:hover{border-color: #B3B3B3;}
|
admin/views/slider-panel/css/reset.css
CHANGED
@@ -28,8 +28,12 @@ html,body { height:100%;}
|
|
28 |
border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;}
|
29 |
.msp-container .no-boxshadow input:invalid, .msp-container .no-boxshadow textarea:invalid { background-color: #f0dddd; }
|
30 |
.msp-container ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
|
31 |
-
|
32 |
.msp-container button { width: auto; overflow: visible; }
|
|
|
|
|
|
|
|
|
33 |
/**
|
34 |
======================================
|
35 |
$Domument
|
@@ -54,4 +58,4 @@ html,body { height:100%;}
|
|
54 |
.msp-container .right { float: right; }
|
55 |
.msp-container .center { margin-left: auto; margin-right: auto; display: block; clear: both; }
|
56 |
.clear { clear: both; display: block; font-size: 0; height: 0; line-height: 0; width:100%;}
|
57 |
-
/*-----------------
|
28 |
border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;}
|
29 |
.msp-container .no-boxshadow input:invalid, .msp-container .no-boxshadow textarea:invalid { background-color: #f0dddd; }
|
30 |
.msp-container ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
|
31 |
+
/*.msp-container a:link { -webkit-tap-highlight-color: #FF5E99; }*/
|
32 |
.msp-container button { width: auto; overflow: visible; }
|
33 |
+
.msp-container a:focus{
|
34 |
+
-webkit-box-shadow: none;
|
35 |
+
box-shadow: none;
|
36 |
+
}
|
37 |
/**
|
38 |
======================================
|
39 |
$Domument
|
58 |
.msp-container .right { float: right; }
|
59 |
.msp-container .center { margin-left: auto; margin-right: auto; display: block; clear: both; }
|
60 |
.clear { clear: both; display: block; font-size: 0; height: 0; line-height: 0; width:100%;}
|
61 |
+
/*----------------- */
|
admin/views/slider-panel/images/bg.jpg
ADDED
Binary file
|
admin/views/slider-panel/images/image-layer.png
ADDED
Binary file
|
admin/views/slider-panel/images/layertypes/button.png
ADDED
Binary file
|
admin/views/slider-panel/images/layertypes/hotspot.png
ADDED
Binary file
|
admin/views/slider-panel/images/layertypes/image.png
ADDED
Binary file
|
admin/views/slider-panel/images/layertypes/text.png
ADDED
Binary file
|
admin/views/slider-panel/images/layertypes/video.png
ADDED
Binary file
|
admin/views/slider-panel/images/sample.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/3d-flow-carousel.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/3d-wave-carousel.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/custom.gif
ADDED
Binary file
|
admin/views/slider-panel/images/templates/display.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/flat-display.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/flat-laptop.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/flat-phone-land.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/flat-phone.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/flat-tablet-land.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/flat-tablet.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/full-screen.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/image-gallery.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/laptop.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/partial-1.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/partial-2.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/partial-3.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/phone-land.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/phone.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/slider-bottom-thumbs.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/slider-horizontal-tabs.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/slider-left-thumbs.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/slider-right-thumbs.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/slider-top-thumbs.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/slider-vertical-tabs.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/staff-1.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/staff-2.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/staff-3.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/staff-4.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/staff-5.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/staff-6.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/tablet-land.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/tablet.png
ADDED
Binary file
|
admin/views/slider-panel/images/templates/vertical-slider.png
ADDED
Binary file
|
admin/views/slider-panel/images/time-ruler.png
ADDED
Binary file
|
admin/views/slider-panel/images/ui-spritesheet.png
CHANGED
Binary file
|
admin/views/slider-panel/images/video-layer.png
ADDED
Binary file
|
admin/views/slider-panel/index.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Represents the view for slider panel.
|
4 |
*
|
5 |
-
* @package MasterSlider
|
6 |
* @author averta [averta.net]
|
7 |
* @license LICENSE.txt
|
8 |
* @link http://masterslider.com
|
@@ -12,7 +12,9 @@
|
|
12 |
?>
|
13 |
|
14 |
<!-- markup for slider panel page here. -->
|
15 |
-
|
|
|
|
|
16 |
<div id="panelLoading" class="msp-loading">
|
17 |
<img src="<?php echo MSWP_AVERTA_ADMIN_URL . '/views/slider-panel'; ?>/images/loading.gif">
|
18 |
<?php _e('Loading data...', MSWP_TEXT_DOMAIN); ?>
|
@@ -24,6 +26,7 @@
|
|
24 |
|
25 |
<!-- Application Template -->
|
26 |
<script type="text/x-handlebars">
|
|
|
27 |
{{#if hasError}}
|
28 |
<div class="msp-error-cont">
|
29 |
{{partial errorTemplate}}
|
@@ -32,9 +35,14 @@
|
|
32 |
<nav class="msp-main-nav">
|
33 |
<ul>
|
34 |
<li>{{#link-to 'settings'}} <?php _e('Slider Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-settings"></span>{{/link-to}}</li>
|
|
|
|
|
|
|
|
|
35 |
<li>{{#link-to 'slides'}} <?php _e('Slides', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-slides"></span>{{/link-to}}</li>
|
36 |
<li>{{#link-to 'controls'}} <?php _e('Slider Controls', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-controls"></span>{{/link-to}}</li>
|
37 |
<li>{{#link-to 'callbacks'}} <?php _e('Slider Callbacks', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-api"></span>{{/link-to}}</li>
|
|
|
38 |
</ul>
|
39 |
</nav>
|
40 |
<div class="clear"></div>
|
@@ -101,9 +109,9 @@
|
|
101 |
|
102 |
{{/meta-box}}
|
103 |
|
104 |
-
{{#meta-box title="<?php _e('Slider
|
105 |
-
|
106 |
<div class="msp-metabox-row">
|
|
|
107 |
<h4><?php _e('Change slider transition, transition speed and space between slides', MSWP_TEXT_DOMAIN); ?></h4>
|
108 |
|
109 |
<div class="msp-metabox-indented">
|
@@ -126,13 +134,14 @@
|
|
126 |
</div>
|
127 |
</div>
|
128 |
{{/meta-box}}
|
|
|
129 |
|
130 |
{{#meta-box title="<?php _e('Navigation', MSWP_TEXT_DOMAIN); ?>"}}
|
131 |
|
132 |
<div class="msp-metabox-row">
|
133 |
<h4><?php _e('Slideshow behavior and sorting slides', MSWP_TEXT_DOMAIN); ?></h4>
|
134 |
<div class="msp-metabox-indented">
|
135 |
-
{{switch-box value=autoplay}}<label><?php _e('Slideshow', MSWP_TEXT_DOMAIN); ?></label>
|
136 |
<span class="msp-form-space"></span>
|
137 |
{{switch-box value=loop}}<label><?php _e('Loop navigation', MSWP_TEXT_DOMAIN); ?> </label>
|
138 |
<span class="msp-form-space"></span>
|
@@ -144,7 +153,7 @@
|
|
144 |
{{switch-box value=shuffle}}<label><?php _e('Random order', MSWP_TEXT_DOMAIN); ?></label>
|
145 |
</div>
|
146 |
<div class="msp-metabox-indented">
|
147 |
-
<label><?php _e('Start with slide', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=start min=1}}
|
148 |
</div>
|
149 |
<h4><?php _e('Slider navigation methods', MSWP_TEXT_DOMAIN); ?></h4>
|
150 |
<div class="msp-metabox-indented">
|
@@ -183,6 +192,21 @@
|
|
183 |
{{#each skin in sliderSkins}}
|
184 |
<option {{bind-attr value=skin.class}}>{{skin.label}}</option>
|
185 |
{{/each}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
{{/dropdwon-List}}
|
187 |
</div>
|
188 |
<div class="msp-metabox-indented">
|
@@ -194,55 +218,64 @@
|
|
194 |
<span class="msp-form-space"></span>
|
195 |
<label><?php _e('Background color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=bgColor}}
|
196 |
</div>
|
197 |
-
<h4><?php _e('Slider custom class name and
|
198 |
<div class="msp-metabox-indented">
|
199 |
<label><?php _e('Class name :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=className}}
|
200 |
</div>
|
201 |
-
|
202 |
<label><?php _e('Inline style :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=inlineStyle size="50"}}
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
</div>
|
|
|
204 |
</div>
|
205 |
|
206 |
{{/meta-box}}
|
207 |
</script>
|
208 |
-
|
209 |
<!-- Slides Page -->
|
210 |
<script type="text/x-handlebars" id="slides">
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
219 |
</script>
|
220 |
-
|
221 |
<!-- Slide Settings Partial -->
|
222 |
<script type="text/x-handlebars" id="slide-settings">
|
223 |
|
224 |
{{#tabs-panel id="slide-settings"}}
|
225 |
-
|
226 |
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
|
237 |
-
<ul class="tabs-content">
|
238 |
-
<li id="sl-bg">{{partial 'slide-background'}}</li>
|
239 |
-
<li id="sl-val">{{partial 'slide-video-and-link'}}</li>
|
240 |
-
<li id="sl-inf">{{partial 'slide-info'}}</li>
|
241 |
-
<li id="sl-misc">{{partial 'slide-misc'}}</li>
|
242 |
-
</ul>
|
243 |
{{/tabs-panel}}
|
244 |
|
245 |
-
|
246 |
<div class="msp-metabox-row">
|
247 |
<div class="msp-metabox-indented">
|
248 |
<label><?php _e('Slide duration :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input class="msp-number-input" min=0 max=300 step="0.1" value=currentSlide.duration}} s
|
@@ -250,8 +283,7 @@
|
|
250 |
</div>
|
251 |
<hr class="msp-metabox-hr">
|
252 |
{{view MSPanel.StageArea}}
|
253 |
-
{{/meta-box}}
|
254 |
-
|
255 |
</script>
|
256 |
|
257 |
<!-- Slide Background Settings Partial -->
|
@@ -259,7 +291,7 @@
|
|
259 |
<div class="msp-metabox-row">
|
260 |
<h4><?php _e('Choose slide background and thumbnail', MSWP_TEXT_DOMAIN); ?></h4>
|
261 |
<div class="msp-metabox-indented">
|
262 |
-
<label><?php _e('Background :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.ImgSelect value=currentSlide.bg thumb=currentSlide.bgThumb}}
|
263 |
<span class="msp-form-space"></span>
|
264 |
<label><?php _e('Fillmode :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.Fillmode value=currentSlide.fillMode}}
|
265 |
<span class="msp-form-space"></span>
|
@@ -267,7 +299,6 @@
|
|
267 |
</div>
|
268 |
</div>
|
269 |
</script>
|
270 |
-
|
271 |
<!-- Slide Embeded Video and Link -->
|
272 |
<script type="text/x-handlebars" id="slide-video-and-link">
|
273 |
<div class="msp-metabox-row">
|
@@ -276,9 +307,19 @@
|
|
276 |
<label><?php _e('URL :', MSWP_TEXT_DOMAIN); ?> </label> {{input class="msp-path-input" value=currentSlide.link}}
|
277 |
{{view MSPanel.URLTarget value=currentSlide.linkTarget }}
|
278 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
<h4><?php _e('Youtube or Vimeo video as slide', MSWP_TEXT_DOMAIN); ?></h4>
|
280 |
<div class="msp-metabox-indented">
|
281 |
-
<label><?php _e('Video embed
|
282 |
<span class="msp-form-space"></span>
|
283 |
<label><?php _e('Autoplay video :', MSWP_TEXT_DOMAIN); ?> </label> {{switch-box value=currentSlide.autoplayVideo}}
|
284 |
</div>
|
@@ -323,9 +364,14 @@
|
|
323 |
<span class="msp-form-space"></span>
|
324 |
<label><?php _e('Alt text :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=30 value=currentSlide.bgAlt}}
|
325 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
</div>
|
327 |
</script>
|
328 |
-
|
329 |
<!-- Slider Controls -->
|
330 |
<script type="text/x-handlebars" id="controls">
|
331 |
{{#if controllers.application.disableControls}}
|
2 |
/**
|
3 |
* Represents the view for slider panel.
|
4 |
*
|
5 |
+
* @package MasterSlider
|
6 |
* @author averta [averta.net]
|
7 |
* @license LICENSE.txt
|
8 |
* @link http://masterslider.com
|
12 |
?>
|
13 |
|
14 |
<!-- markup for slider panel page here. -->
|
15 |
+
<div id="msp-header">
|
16 |
+
<div class="msp-logo"><a href="?page=masterslider"><img src="<?php echo MSWP_AVERTA_ADMIN_URL . '/views/slider-panel'; ?>/images/masterslider.gif" ></a></div>
|
17 |
+
</div>
|
18 |
<div id="panelLoading" class="msp-loading">
|
19 |
<img src="<?php echo MSWP_AVERTA_ADMIN_URL . '/views/slider-panel'; ?>/images/loading.gif">
|
20 |
<?php _e('Loading data...', MSWP_TEXT_DOMAIN); ?>
|
26 |
|
27 |
<!-- Application Template -->
|
28 |
<script type="text/x-handlebars">
|
29 |
+
|
30 |
{{#if hasError}}
|
31 |
<div class="msp-error-cont">
|
32 |
{{partial errorTemplate}}
|
35 |
<nav class="msp-main-nav">
|
36 |
<ul>
|
37 |
<li>{{#link-to 'settings'}} <?php _e('Slider Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-settings"></span>{{/link-to}}</li>
|
38 |
+
{{#if isFlickr }}<li>{{#link-to 'flickr'}} <?php _e('Flickr Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-flickr"></span>{{/link-to}}</li>{{/if}}
|
39 |
+
{{#if isFacebook }}<li>{{#link-to 'facebook'}} <?php _e('Facebook Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-facebook"></span>{{/link-to}}</li>{{/if}}
|
40 |
+
{{#if isPost }}<li>{{#link-to 'post'}} <?php _e('Posts Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-posts"></span>{{/link-to}}</li>{{/if}}
|
41 |
+
{{#if isWcproduct }}<li>{{#link-to 'wcproduct'}} <?php _e('Product Slider Settings', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-wooc"></span>{{/link-to}}</li>{{/if}}
|
42 |
<li>{{#link-to 'slides'}} <?php _e('Slides', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-slides"></span>{{/link-to}}</li>
|
43 |
<li>{{#link-to 'controls'}} <?php _e('Slider Controls', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-controls"></span>{{/link-to}}</li>
|
44 |
<li>{{#link-to 'callbacks'}} <?php _e('Slider Callbacks', MSWP_TEXT_DOMAIN); ?> <span class="msp-ico msp-ico-api"></span>{{/link-to}}</li>
|
45 |
+
<li class="msp-upgrade-btn"> <a href="http://avt.li/mslpan" target="_blank">Upgrade to PRO <span class="msp-ico msp-ico-pro"></span></a></li>
|
46 |
</ul>
|
47 |
</nav>
|
48 |
<div class="clear"></div>
|
109 |
|
110 |
{{/meta-box}}
|
111 |
|
112 |
+
{{#meta-box title="<?php _e('Slider Transition', MSWP_TEXT_DOMAIN); ?>"}}
|
|
|
113 |
<div class="msp-metabox-row">
|
114 |
+
|
115 |
<h4><?php _e('Change slider transition, transition speed and space between slides', MSWP_TEXT_DOMAIN); ?></h4>
|
116 |
|
117 |
<div class="msp-metabox-indented">
|
134 |
</div>
|
135 |
</div>
|
136 |
{{/meta-box}}
|
137 |
+
|
138 |
|
139 |
{{#meta-box title="<?php _e('Navigation', MSWP_TEXT_DOMAIN); ?>"}}
|
140 |
|
141 |
<div class="msp-metabox-row">
|
142 |
<h4><?php _e('Slideshow behavior and sorting slides', MSWP_TEXT_DOMAIN); ?></h4>
|
143 |
<div class="msp-metabox-indented">
|
144 |
+
{{switch-box value=autoplay}}<label><?php _e('Autoplay (Slideshow)', MSWP_TEXT_DOMAIN); ?></label>
|
145 |
<span class="msp-form-space"></span>
|
146 |
{{switch-box value=loop}}<label><?php _e('Loop navigation', MSWP_TEXT_DOMAIN); ?> </label>
|
147 |
<span class="msp-form-space"></span>
|
153 |
{{switch-box value=shuffle}}<label><?php _e('Random order', MSWP_TEXT_DOMAIN); ?></label>
|
154 |
</div>
|
155 |
<div class="msp-metabox-indented">
|
156 |
+
<label><?php _e('Start with slide :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input value=start min=1}}
|
157 |
</div>
|
158 |
<h4><?php _e('Slider navigation methods', MSWP_TEXT_DOMAIN); ?></h4>
|
159 |
<div class="msp-metabox-indented">
|
192 |
{{#each skin in sliderSkins}}
|
193 |
<option {{bind-attr value=skin.class}}>{{skin.label}}</option>
|
194 |
{{/each}}
|
195 |
+
|
196 |
+
{{!--
|
197 |
+
<option value="ms-skin-default"><?php _e('Default', MSWP_TEXT_DOMAIN); ?></option>
|
198 |
+
<option value="ms-skin-light-2"><?php _e('Light 2', MSWP_TEXT_DOMAIN); ?></option>
|
199 |
+
<option value="ms-skin-light-3"><?php _e('Light 3', MSWP_TEXT_DOMAIN); ?></option>
|
200 |
+
<option value="ms-skin-light-4"><?php _e('Light 4', MSWP_TEXT_DOMAIN); ?></option>
|
201 |
+
<option value="ms-skin-light-5"><?php _e('Light 5', MSWP_TEXT_DOMAIN); ?></option>
|
202 |
+
<option value="ms-skin-light-6"><?php _e('Light 6', MSWP_TEXT_DOMAIN); ?></option>
|
203 |
+
<option value="ms-skin-light-6 round-skin"><?php _e('Light 6 Round', MSWP_TEXT_DOMAIN); ?></option>
|
204 |
+
<option value="ms-skin-contrast"><?php _e('Contrast', MSWP_TEXT_DOMAIN); ?></option>
|
205 |
+
<option value="ms-skin-black-1"><?php _e('Black 1', MSWP_TEXT_DOMAIN); ?></option>
|
206 |
+
<option value="ms-skin-black-2"><?php _e('Black 2', MSWP_TEXT_DOMAIN); ?></option>
|
207 |
+
<option value="ms-skin-black-2 round-skin"><?php _e('Black 2 Round', MSWP_TEXT_DOMAIN); ?></option>
|
208 |
+
<option value="ms-skin-metro"><?php _e('Metro', MSWP_TEXT_DOMAIN); ?></option>
|
209 |
+
--}}
|
210 |
{{/dropdwon-List}}
|
211 |
</div>
|
212 |
<div class="msp-metabox-indented">
|
218 |
<span class="msp-form-space"></span>
|
219 |
<label><?php _e('Background color :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=bgColor}}
|
220 |
</div>
|
221 |
+
<h4><?php _e('Slider custom class name and style', MSWP_TEXT_DOMAIN); ?></h4>
|
222 |
<div class="msp-metabox-indented">
|
223 |
<label><?php _e('Class name :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=className}}
|
224 |
</div>
|
225 |
+
{{!--<div class="msp-metabox-indented">
|
226 |
<label><?php _e('Inline style :', MSWP_TEXT_DOMAIN); ?> </label> {{input value=inlineStyle size="50"}}
|
227 |
+
</div>--}}
|
228 |
+
<div class="msp-metabox-indented">
|
229 |
+
<label><?php _e('Slider custom styles :', MSWP_TEXT_DOMAIN); ?> </label>
|
230 |
+
</div>
|
231 |
+
<div class="msp-metabox-indented">
|
232 |
+
{{#code-mirror width="880" height="250" mode="css" value=customStyle}}{{/code-mirror}}
|
233 |
</div>
|
234 |
+
|
235 |
</div>
|
236 |
|
237 |
{{/meta-box}}
|
238 |
</script>
|
|
|
239 |
<!-- Slides Page -->
|
240 |
<script type="text/x-handlebars" id="slides">
|
241 |
+
{{#if customSlider}}
|
242 |
+
<!-- Slides List -->
|
243 |
+
{{#meta-box title="<?php _e('Slides', MSWP_TEXT_DOMAIN); ?>"}}
|
244 |
+
<div class="msp-metabox-row">
|
245 |
+
{{view MSPanel.SlideList}}
|
246 |
+
</div>
|
247 |
+
{{/meta-box}}
|
248 |
+
{{#if length}}
|
249 |
+
{{partial "slide-settings"}}
|
250 |
+
{{/if}}
|
251 |
+
{{/if}}
|
252 |
</script>
|
|
|
253 |
<!-- Slide Settings Partial -->
|
254 |
<script type="text/x-handlebars" id="slide-settings">
|
255 |
|
256 |
{{#tabs-panel id="slide-settings"}}
|
257 |
+
<div class="msp-metabox-handle">
|
258 |
|
259 |
+
<ul class="tabs">
|
260 |
+
<li class="active"><a href="#sl-bg"><?php _e('Background', MSWP_TEXT_DOMAIN); ?></a></li>
|
261 |
+
<li><a href="#sl-val"><?php _e('Video and Link', MSWP_TEXT_DOMAIN); ?></a></li>
|
262 |
+
<li><a href="#sl-inf"><?php _e('Slide Info', MSWP_TEXT_DOMAIN); ?></a></li>
|
263 |
+
<li><a href="#sl-misc"><?php _e('Misc', MSWP_TEXT_DOMAIN); ?></a></li>
|
264 |
+
</ul>
|
265 |
|
266 |
+
<div class="msp-metabox-toggle"></div>
|
267 |
+
</div>
|
268 |
+
|
269 |
+
<ul class="tabs-content">
|
270 |
+
<li id="sl-bg">{{partial 'slide-background'}}</li>
|
271 |
+
<li id="sl-val">{{partial 'slide-video-and-link'}}</li>
|
272 |
+
<li id="sl-inf">{{partial 'slide-info'}}</li>
|
273 |
+
<li id="sl-misc">{{partial 'slide-misc'}}</li>
|
274 |
+
</ul>
|
275 |
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
{{/tabs-panel}}
|
277 |
|
278 |
+
{{#meta-box title="Slide"}}
|
279 |
<div class="msp-metabox-row">
|
280 |
<div class="msp-metabox-indented">
|
281 |
<label><?php _e('Slide duration :', MSWP_TEXT_DOMAIN); ?> </label> {{number-input class="msp-number-input" min=0 max=300 step="0.1" value=currentSlide.duration}} s
|
283 |
</div>
|
284 |
<hr class="msp-metabox-hr">
|
285 |
{{view MSPanel.StageArea}}
|
286 |
+
{{/meta-box}}
|
|
|
287 |
</script>
|
288 |
|
289 |
<!-- Slide Background Settings Partial -->
|
291 |
<div class="msp-metabox-row">
|
292 |
<h4><?php _e('Choose slide background and thumbnail', MSWP_TEXT_DOMAIN); ?></h4>
|
293 |
<div class="msp-metabox-indented">
|
294 |
+
<label><?php _e('Background :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.ImgSelect value=currentSlide.bg thumb=currentSlide.bgThumb }}
|
295 |
<span class="msp-form-space"></span>
|
296 |
<label><?php _e('Fillmode :', MSWP_TEXT_DOMAIN); ?> </label> {{view MSPanel.Fillmode value=currentSlide.fillMode}}
|
297 |
<span class="msp-form-space"></span>
|
299 |
</div>
|
300 |
</div>
|
301 |
</script>
|
|
|
302 |
<!-- Slide Embeded Video and Link -->
|
303 |
<script type="text/x-handlebars" id="slide-video-and-link">
|
304 |
<div class="msp-metabox-row">
|
307 |
<label><?php _e('URL :', MSWP_TEXT_DOMAIN); ?> </label> {{input class="msp-path-input" value=currentSlide.link}}
|
308 |
{{view MSPanel.URLTarget value=currentSlide.linkTarget }}
|
309 |
</div>
|
310 |
+
<div class="msp-metabox-indented">
|
311 |
+
<label><?php _e('Link id :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=20 value=currentSlide.linkId}}
|
312 |
+
<span class="msp-form-space"></span>
|
313 |
+
<label><?php _e('Link class :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=20 value=currentSlide.linkClass}}
|
314 |
+
</div>
|
315 |
+
<div class="msp-metabox-indented">
|
316 |
+
<label><?php _e('Link rel :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=20 value=currentSlide.linkRel}}
|
317 |
+
<span class="msp-form-space"></span>
|
318 |
+
<label><?php _e('Link title :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=20 value=currentSlide.linkTitle}}
|
319 |
+
</div>
|
320 |
<h4><?php _e('Youtube or Vimeo video as slide', MSWP_TEXT_DOMAIN); ?></h4>
|
321 |
<div class="msp-metabox-indented">
|
322 |
+
<label><?php _e('Video embed src :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=60 value=currentSlide.video}}
|
323 |
<span class="msp-form-space"></span>
|
324 |
<label><?php _e('Autoplay video :', MSWP_TEXT_DOMAIN); ?> </label> {{switch-box value=currentSlide.autoplayVideo}}
|
325 |
</div>
|
364 |
<span class="msp-form-space"></span>
|
365 |
<label><?php _e('Alt text :', MSWP_TEXT_DOMAIN); ?> </label> {{input size=30 value=currentSlide.bgAlt}}
|
366 |
</div>
|
367 |
+
<h4><?php _e('Slide color and pattern overlay ', MSWP_TEXT_DOMAIN); ?></h4>
|
368 |
+
<div class="msp-metabox-indented">
|
369 |
+
<label><?php _e('Color overlay :', MSWP_TEXT_DOMAIN); ?> </label> {{color-picker value=currentSlide.colorOverlay}}
|
370 |
+
<div class="msp-form-space-med"></div>
|
371 |
+
<label><?php _e('Pattern overlay :', MSWP_TEXT_DOMAIN); ?> </label> {{pattern-picker value=currentSlide.pattern}}
|
372 |
+
</div>
|
373 |
</div>
|
374 |
</script>
|
|
|
375 |
<!-- Slider Controls -->
|
376 |
<script type="text/x-handlebars" id="controls">
|
377 |
{{#if controllers.application.disableControls}}
|
admin/views/slider-panel/js/ember-model.js
ADDED
@@ -0,0 +1,2036 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
|
3 |
+
var VERSION = '0.0.14';
|
4 |
+
|
5 |
+
if (Ember.libraries) {
|
6 |
+
Ember.libraries.register('Ember Model', VERSION);
|
7 |
+
}
|
8 |
+
|
9 |
+
|
10 |
+
})();
|
11 |
+
|
12 |
+
(function() {
|
13 |
+
|
14 |
+
function mustImplement(message) {
|
15 |
+
var fn = function() {
|
16 |
+
var className = this.constructor.toString();
|
17 |
+
|
18 |
+
throw new Error(message.replace('{{className}}', className));
|
19 |
+
};
|
20 |
+
fn.isUnimplemented = true;
|
21 |
+
return fn;
|
22 |
+
}
|
23 |
+
|
24 |
+
Ember.Adapter = Ember.Object.extend({
|
25 |
+
find: mustImplement('{{className}} must implement find'),
|
26 |
+
findQuery: mustImplement('{{className}} must implement findQuery'),
|
27 |
+
findMany: mustImplement('{{className}} must implement findMany'),
|
28 |
+
findAll: mustImplement('{{className}} must implement findAll'),
|
29 |
+
createRecord: mustImplement('{{className}} must implement createRecord'),
|
30 |
+
saveRecord: mustImplement('{{className}} must implement saveRecord'),
|
31 |
+
deleteRecord: mustImplement('{{className}} must implement deleteRecord'),
|
32 |
+
|
33 |
+
load: function(record, id, data) {
|
34 |
+
record.load(id, data);
|
35 |
+
}
|
36 |
+
});
|
37 |
+
|
38 |
+
|
39 |
+
})();
|
40 |
+
|
41 |
+
(function() {
|
42 |
+
|
43 |
+
var get = Ember.get,
|
44 |
+
set = Ember.set;
|
45 |
+
|
46 |
+
Ember.FixtureAdapter = Ember.Adapter.extend({
|
47 |
+
_counter: 0,
|
48 |
+
_findData: function(klass, id) {
|
49 |
+
var fixtures = klass.FIXTURES,
|
50 |
+
idAsString = id.toString(),
|
51 |
+
primaryKey = get(klass, 'primaryKey'),
|
52 |
+
data = Ember.A(fixtures).find(function(el) { return (el[primaryKey]).toString() === idAsString; });
|
53 |
+
|
54 |
+
return data;
|
55 |
+
},
|
56 |
+
|
57 |
+
_setPrimaryKey: function(record) {
|
58 |
+
var klass = record.constructor,
|
59 |
+
fixtures = klass.FIXTURES,
|
60 |
+
primaryKey = get(klass, 'primaryKey');
|
61 |
+
|
62 |
+
|
63 |
+
if(record.get(primaryKey)) {
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
|
67 |
+
set(record, primaryKey, this._generatePrimaryKey());
|
68 |
+
},
|
69 |
+
|
70 |
+
_generatePrimaryKey: function() {
|
71 |
+
var counter = this.get("_counter");
|
72 |
+
|
73 |
+
this.set("_counter", counter + 1);
|
74 |
+
|
75 |
+
return "fixture-" + counter;
|
76 |
+
},
|
77 |
+
|
78 |
+
find: function(record, id) {
|
79 |
+
var data = this._findData(record.constructor, id);
|
80 |
+
|
81 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
82 |
+
Ember.run.later(this, function() {
|
83 |
+
Ember.run(record, record.load, id, data);
|
84 |
+
resolve(record);
|
85 |
+
}, 0);
|
86 |
+
});
|
87 |
+
},
|
88 |
+
|
89 |
+
findMany: function(klass, records, ids) {
|
90 |
+
var fixtures = klass.FIXTURES,
|
91 |
+
requestedData = [];
|
92 |
+
|
93 |
+
for (var i = 0, l = ids.length; i < l; i++) {
|
94 |
+
requestedData.push(this._findData(klass, ids[i]));
|
95 |
+
}
|
96 |
+
|
97 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
98 |
+
Ember.run.later(this, function() {
|
99 |
+
Ember.run(records, records.load, klass, requestedData);
|
100 |
+
resolve(records);
|
101 |
+
}, 0);
|
102 |
+
});
|
103 |
+
},
|
104 |
+
|
105 |
+
findAll: function(klass, records) {
|
106 |
+
var fixtures = klass.FIXTURES;
|
107 |
+
|
108 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
109 |
+
Ember.run.later(this, function() {
|
110 |
+
Ember.run(records, records.load, klass, fixtures);
|
111 |
+
resolve(records);
|
112 |
+
}, 0);
|
113 |
+
});
|
114 |
+
},
|
115 |
+
|
116 |
+
createRecord: function(record) {
|
117 |
+
var klass = record.constructor,
|
118 |
+
fixtures = klass.FIXTURES,
|
119 |
+
self = this;
|
120 |
+
|
121 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
122 |
+
Ember.run.later(this, function() {
|
123 |
+
var rootKey = record.constructor.rootKey,
|
124 |
+
json;
|
125 |
+
|
126 |
+
self._setPrimaryKey(record);
|
127 |
+
json = rootKey ? record.toJSON()[rootKey] : record.toJSON();
|
128 |
+
fixtures.push(klass.findFromCacheOrLoad(json));
|
129 |
+
record.didCreateRecord();
|
130 |
+
resolve(record);
|
131 |
+
}, 0);
|
132 |
+
});
|
133 |
+
},
|
134 |
+
|
135 |
+
saveRecord: function(record) {
|
136 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
137 |
+
Ember.run.later(this, function() {
|
138 |
+
record.didSaveRecord();
|
139 |
+
resolve(record);
|
140 |
+
}, 0);
|
141 |
+
});
|
142 |
+
},
|
143 |
+
|
144 |
+
deleteRecord: function(record) {
|
145 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
146 |
+
Ember.run.later(this, function() {
|
147 |
+
record.didDeleteRecord();
|
148 |
+
resolve(record);
|
149 |
+
}, 0);
|
150 |
+
});
|
151 |
+
}
|
152 |
+
});
|
153 |
+
|
154 |
+
|
155 |
+
})();
|
156 |
+
|
157 |
+
(function() {
|
158 |
+
|
159 |
+
var get = Ember.get,
|
160 |
+
set = Ember.set;
|
161 |
+
|
162 |
+
Ember.RecordArray = Ember.ArrayProxy.extend(Ember.Evented, {
|
163 |
+
isLoaded: false,
|
164 |
+
isLoading: Ember.computed.not('isLoaded'),
|
165 |
+
|
166 |
+
load: function(klass, data) {
|
167 |
+
set(this, 'content', this.materializeData(klass, data));
|
168 |
+
this.notifyLoaded();
|
169 |
+
},
|
170 |
+
|
171 |
+
loadForFindMany: function(klass) {
|
172 |
+
var self = this;
|
173 |
+
var content = get(this, '_ids').map(function(id) { return klass.cachedRecordForId(id, self.container); });
|
174 |
+
set(this, 'content', Ember.A(content));
|
175 |
+
this.notifyLoaded();
|
176 |
+
},
|
177 |
+
|
178 |
+
notifyLoaded: function() {
|
179 |
+
set(this, 'isLoaded', true);
|
180 |
+
this.trigger('didLoad');
|
181 |
+
},
|
182 |
+
|
183 |
+
materializeData: function(klass, data) {
|
184 |
+
var self = this;
|
185 |
+
return Ember.A(data.map(function(el) {
|
186 |
+
return klass.findFromCacheOrLoad(el, self.container); // FIXME
|
187 |
+
}));
|
188 |
+
},
|
189 |
+
|
190 |
+
reload: function() {
|
191 |
+
var modelClass = this.get('modelClass'),
|
192 |
+
self = this,
|
193 |
+
promises;
|
194 |
+
|
195 |
+
set(this, 'isLoaded', false);
|
196 |
+
if (modelClass._findAllRecordArray === this) {
|
197 |
+
return modelClass.adapter.findAll(modelClass, this);
|
198 |
+
} else if (this._query) {
|
199 |
+
return modelClass.adapter.findQuery(modelClass, this, this._query);
|
200 |
+
} else {
|
201 |
+
promises = this.map(function(record) {
|
202 |
+
return record.reload();
|
203 |
+
});
|
204 |
+
return Ember.RSVP.all(promises).then(function(data) {
|
205 |
+
self.notifyLoaded();
|
206 |
+
});
|
207 |
+
}
|
208 |
+
}
|
209 |
+
});
|
210 |
+
|
211 |
+
|
212 |
+
})();
|
213 |
+
|
214 |
+
(function() {
|
215 |
+
|
216 |
+
var get = Ember.get;
|
217 |
+
|
218 |
+
Ember.FilteredRecordArray = Ember.RecordArray.extend({
|
219 |
+
init: function() {
|
220 |
+
if (!get(this, 'modelClass')) {
|
221 |
+
throw new Error('FilteredRecordArrays must be created with a modelClass');
|
222 |
+
}
|
223 |
+
if (!get(this, 'filterFunction')) {
|
224 |
+
throw new Error('FilteredRecordArrays must be created with a filterFunction');
|
225 |
+
}
|
226 |
+
if (!get(this, 'filterProperties')) {
|
227 |
+
throw new Error('FilteredRecordArrays must be created with filterProperties');
|
228 |
+
}
|
229 |
+
|
230 |
+
var modelClass = get(this, 'modelClass');
|
231 |
+
modelClass.registerRecordArray(this);
|
232 |
+
|
233 |
+
this.registerObservers();
|
234 |
+
this.updateFilter();
|
235 |
+
|
236 |
+
this._super();
|
237 |
+
},
|
238 |
+
|
239 |
+
updateFilter: function() {
|
240 |
+
var self = this,
|
241 |
+
results = [];
|
242 |
+
get(this, 'modelClass').forEachCachedRecord(function(record) {
|
243 |
+
if (self.filterFunction(record)) {
|
244 |
+
results.push(record);
|
245 |
+
}
|
246 |
+
});
|
247 |
+
this.set('content', Ember.A(results));
|
248 |
+
},
|
249 |
+
|
250 |
+
updateFilterForRecord: function(record) {
|
251 |
+
var results = get(this, 'content');
|
252 |
+
if (this.filterFunction(record) && !results.contains(record)) {
|
253 |
+
results.pushObject(record);
|
254 |
+
}
|
255 |
+
},
|
256 |
+
|
257 |
+
registerObservers: function() {
|
258 |
+
var self = this;
|
259 |
+
get(this, 'modelClass').forEachCachedRecord(function(record) {
|
260 |
+
self.registerObserversOnRecord(record);
|
261 |
+
});
|
262 |
+
},
|
263 |
+
|
264 |
+
registerObserversOnRecord: function(record) {
|
265 |
+
var self = this,
|
266 |
+
filterProperties = get(this, 'filterProperties');
|
267 |
+
|
268 |
+
for (var i = 0, l = get(filterProperties, 'length'); i < l; i++) {
|
269 |
+
record.addObserver(filterProperties[i], self, 'updateFilterForRecord');
|
270 |
+
}
|
271 |
+
}
|
272 |
+
});
|
273 |
+
|
274 |
+
})();
|
275 |
+
|
276 |
+
(function() {
|
277 |
+
|
278 |
+
var get = Ember.get, set = Ember.set;
|
279 |
+
|
280 |
+
Ember.ManyArray = Ember.RecordArray.extend({
|
281 |
+
_records: null,
|
282 |
+
originalContent: null,
|
283 |
+
_modifiedRecords: null,
|
284 |
+
|
285 |
+
unloadObject: function(record) {
|
286 |
+
var obj = get(this, 'content').findBy('clientId', record._reference.clientId);
|
287 |
+
get(this, 'content').removeObject(obj);
|
288 |
+
|
289 |
+
var originalObj = get(this, 'originalContent').findBy('clientId', record._reference.clientId);
|
290 |
+
get(this, 'originalContent').removeObject(originalObj);
|
291 |
+
},
|
292 |
+
|
293 |
+
isDirty: function() {
|
294 |
+
var originalContent = get(this, 'originalContent'),
|
295 |
+
originalContentLength = get(originalContent, 'length'),
|
296 |
+
content = get(this, 'content'),
|
297 |
+
contentLength = get(content, 'length');
|
298 |
+
|
299 |
+
if (originalContentLength !== contentLength) { return true; }
|
300 |
+
|
301 |
+
if (this._modifiedRecords && this._modifiedRecords.length) { return true; }
|
302 |
+
|
303 |
+
var isDirty = false;
|
304 |
+
|
305 |
+
for (var i = 0, l = contentLength; i < l; i++) {
|
306 |
+
if (!originalContent.contains(content[i])) {
|
307 |
+
isDirty = true;
|
308 |
+
break;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
|
312 |
+
return isDirty;
|
313 |
+
}.property('content.[]', 'originalContent.[]', '_modifiedRecords.[]'),
|
314 |
+
|
315 |
+
objectAtContent: function(idx) {
|
316 |
+
var content = get(this, 'content');
|
317 |
+
|
318 |
+
if (!content.length) { return; }
|
319 |
+
|
320 |
+
// need to add observer if it wasn't materialized before
|
321 |
+
var observerNeeded = (content[idx].record) ? false : true;
|
322 |
+
|
323 |
+
var record = this.materializeRecord(idx, this.container);
|
324 |
+
|
325 |
+
if (observerNeeded) {
|
326 |
+
var isDirtyRecord = record.get('isDirty'), isNewRecord = record.get('isNew');
|
327 |
+
if (isDirtyRecord || isNewRecord) { this._modifiedRecords.pushObject(content[idx]); }
|
328 |
+
Ember.addObserver(content[idx], 'record.isDirty', this, 'recordStateChanged');
|
329 |
+
record.registerParentHasManyArray(this);
|
330 |
+
}
|
331 |
+
|
332 |
+
return record;
|
333 |
+
},
|
334 |
+
|
335 |
+
save: function() {
|
336 |
+
// TODO: loop over dirty records only
|
337 |
+
return Ember.RSVP.all(this.map(function(record) {
|
338 |
+
return record.save();
|
339 |
+
}));
|
340 |
+
},
|
341 |
+
|
342 |
+
replaceContent: function(index, removed, added) {
|
343 |
+
added = Ember.EnumerableUtils.map(added, function(record) {
|
344 |
+
return record._reference;
|
345 |
+
}, this);
|
346 |
+
|
347 |
+
this._super(index, removed, added);
|
348 |
+
},
|
349 |
+
|
350 |
+
_contentWillChange: function() {
|
351 |
+
var content = get(this, 'content');
|
352 |
+
|
353 |
+
if (content) {
|
354 |
+
this.arrayWillChange(content, 0, get(content, 'length'), 0);
|
355 |
+
content.removeArrayObserver(this);
|
356 |
+
this._setupOriginalContent(content);
|
357 |
+
}
|
358 |
+
}.observesBefore('content'),
|
359 |
+
|
360 |
+
_contentDidChange: function() {
|
361 |
+
var content = get(this, 'content');
|
362 |
+
if (content) {
|
363 |
+
content.addArrayObserver(this);
|
364 |
+
this.arrayDidChange(content, 0, 0, get(content, 'length'));
|
365 |
+
}
|
366 |
+
}.observes('content'),
|
367 |
+
|
368 |
+
arrayWillChange: function(item, idx, removedCnt, addedCnt) {
|
369 |
+
var content = item;
|
370 |
+
for (var i = idx; i < idx+removedCnt; i++) {
|
371 |
+
var currentItem = content[i];
|
372 |
+
if (currentItem && currentItem.record) {
|
373 |
+
this._modifiedRecords.removeObject(currentItem);
|
374 |
+
currentItem.record.unregisterParentHasManyArray(this);
|
375 |
+
Ember.removeObserver(currentItem, 'record.isDirty', this, 'recordStateChanged');
|
376 |
+
}
|
377 |
+
}
|
378 |
+
},
|
379 |
+
|
380 |
+
arrayDidChange: function(item, idx, removedCnt, addedCnt) {
|
381 |
+
var parent = get(this, 'parent'), relationshipKey = get(this, 'relationshipKey'),
|
382 |
+
isDirty = get(this, 'isDirty');
|
383 |
+
|
384 |
+
var content = item;
|
385 |
+
for (var i = idx; i < idx+addedCnt; i++) {
|
386 |
+
var currentItem = content[i];
|
387 |
+
if (currentItem && currentItem.record) {
|
388 |
+
var isDirtyRecord = currentItem.record.get('isDirty'), isNewRecord = currentItem.record.get('isNew'); // why newly created object is not dirty?
|
389 |
+
if (isDirtyRecord || isNewRecord) { this._modifiedRecords.pushObject(currentItem); }
|
390 |
+
Ember.addObserver(currentItem, 'record.isDirty', this, 'recordStateChanged');
|
391 |
+
currentItem.record.registerParentHasManyArray(this);
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
if (isDirty) {
|
396 |
+
parent._relationshipBecameDirty(relationshipKey);
|
397 |
+
} else {
|
398 |
+
parent._relationshipBecameClean(relationshipKey);
|
399 |
+
}
|
400 |
+
},
|
401 |
+
|
402 |
+
load: function(content) {
|
403 |
+
Ember.setProperties(this, {
|
404 |
+
content: content,
|
405 |
+
originalContent: content.slice()
|
406 |
+
});
|
407 |
+
set(this, '_modifiedRecords', []);
|
408 |
+
},
|
409 |
+
|
410 |
+
revert: function() {
|
411 |
+
this._setupOriginalContent();
|
412 |
+
},
|
413 |
+
|
414 |
+
_setupOriginalContent: function(content) {
|
415 |
+
content = content || get(this, 'content');
|
416 |
+
if (content) {
|
417 |
+
set(this, 'originalContent', content.slice());
|
418 |
+
}
|
419 |
+
set(this, '_modifiedRecords', []);
|
420 |
+
},
|
421 |
+
|
422 |
+
init: function() {
|
423 |
+
this._super();
|
424 |
+
this._setupOriginalContent();
|
425 |
+
this._contentDidChange();
|
426 |
+
},
|
427 |
+
|
428 |
+
recordStateChanged: function(obj, keyName) {
|
429 |
+
var parent = get(this, 'parent'), relationshipKey = get(this, 'relationshipKey');
|
430 |
+
|
431 |
+
if (obj.record.get('isDirty')) {
|
432 |
+
if (this._modifiedRecords.indexOf(obj) === -1) { this._modifiedRecords.pushObject(obj); }
|
433 |
+
parent._relationshipBecameDirty(relationshipKey);
|
434 |
+
} else {
|
435 |
+
if (this._modifiedRecords.indexOf(obj) > -1) { this._modifiedRecords.removeObject(obj); }
|
436 |
+
if (!this.get('isDirty')) {
|
437 |
+
parent._relationshipBecameClean(relationshipKey);
|
438 |
+
}
|
439 |
+
}
|
440 |
+
}
|
441 |
+
});
|
442 |
+
|
443 |
+
Ember.HasManyArray = Ember.ManyArray.extend({
|
444 |
+
materializeRecord: function(idx, container) {
|
445 |
+
var klass = get(this, 'modelClass'),
|
446 |
+
content = get(this, 'content'),
|
447 |
+
reference = content.objectAt(idx),
|
448 |
+
record = reference.record;
|
449 |
+
|
450 |
+
if (record) {
|
451 |
+
if (! record.container) {
|
452 |
+
record.container = container;
|
453 |
+
}
|
454 |
+
return record;
|
455 |
+
}
|
456 |
+
return klass._findFetchById(reference.id, false, container);
|
457 |
+
},
|
458 |
+
|
459 |
+
toJSON: function() {
|
460 |
+
var ids = [], content = this.get('content');
|
461 |
+
|
462 |
+
content.forEach(function(reference) {
|
463 |
+
if (reference.id) {
|
464 |
+
ids.push(reference.id);
|
465 |
+
}
|
466 |
+
});
|
467 |
+
|
468 |
+
return ids;
|
469 |
+
}
|
470 |
+
});
|
471 |
+
|
472 |
+
Ember.EmbeddedHasManyArray = Ember.ManyArray.extend({
|
473 |
+
create: function(attrs) {
|
474 |
+
var klass = get(this, 'modelClass'),
|
475 |
+
record = klass.create(attrs);
|
476 |
+
|
477 |
+
this.pushObject(record);
|
478 |
+
|
479 |
+
return record; // FIXME: inject parent's id
|
480 |
+
},
|
481 |
+
|
482 |
+
materializeRecord: function(idx, container) {
|
483 |
+
var klass = get(this, 'modelClass'),
|
484 |
+
primaryKey = get(klass, 'primaryKey'),
|
485 |
+
content = get(this, 'content'),
|
486 |
+
reference = content.objectAt(idx),
|
487 |
+
attrs = reference.data;
|
488 |
+
|
489 |
+
var record;
|
490 |
+
if (reference.record) {
|
491 |
+
record = reference.record;
|
492 |
+
} else {
|
493 |
+
record = klass.create({ _reference: reference, container: container });
|
494 |
+
reference.record = record;
|
495 |
+
if (attrs) {
|
496 |
+
record.load(attrs[primaryKey], attrs);
|
497 |
+
}
|
498 |
+
}
|
499 |
+
|
500 |
+
record.container = container;
|
501 |
+
return record;
|
502 |
+
},
|
503 |
+
|
504 |
+
toJSON: function() {
|
505 |
+
return this.map(function(record) {
|
506 |
+
return record.toJSON();
|
507 |
+
});
|
508 |
+
}
|
509 |
+
});
|
510 |
+
|
511 |
+
|
512 |
+
})();
|
513 |
+
|
514 |
+
(function() {
|
515 |
+
|
516 |
+
var get = Ember.get,
|
517 |
+
set = Ember.set,
|
518 |
+
setProperties = Ember.setProperties,
|
519 |
+
meta = Ember.meta,
|
520 |
+
underscore = Ember.String.underscore;
|
521 |
+
|
522 |
+
function contains(array, element) {
|
523 |
+
for (var i = 0, l = array.length; i < l; i++) {
|
524 |
+
if (array[i] === element) { return true; }
|
525 |
+
}
|
526 |
+
return false;
|
527 |
+
}
|
528 |
+
|
529 |
+
function concatUnique(toArray, fromArray) {
|
530 |
+
var e;
|
531 |
+
for (var i = 0, l = fromArray.length; i < l; i++) {
|
532 |
+
e = fromArray[i];
|
533 |
+
if (!contains(toArray, e)) { toArray.push(e); }
|
534 |
+
}
|
535 |
+
return toArray;
|
536 |
+
}
|
537 |
+
|
538 |
+
function hasCachedValue(object, key) {
|
539 |
+
var objectMeta = meta(object, false);
|
540 |
+
if (objectMeta) {
|
541 |
+
return key in objectMeta.cache;
|
542 |
+
}
|
543 |
+
}
|
544 |
+
|
545 |
+
Ember.run.queues.push('data');
|
546 |
+
|
547 |
+
Ember.Model = Ember.Object.extend(Ember.Evented, {
|
548 |
+
isLoaded: true,
|
549 |
+
isLoading: Ember.computed.not('isLoaded'),
|
550 |
+
isNew: true,
|
551 |
+
isDeleted: false,
|
552 |
+
_dirtyAttributes: null,
|
553 |
+
|
554 |
+
/**
|
555 |
+
Called when attribute is accessed.
|
556 |
+
|
557 |
+
@method getAttr
|
558 |
+
@param key {String} key which is being accessed
|
559 |
+
@param value {Object} value, which will be returned from getter by default
|
560 |
+
*/
|
561 |
+
getAttr: function(key, value) {
|
562 |
+
return value;
|
563 |
+
},
|
564 |
+
|
565 |
+
isDirty: function() {
|
566 |
+
var dirtyAttributes = get(this, '_dirtyAttributes');
|
567 |
+
return dirtyAttributes && dirtyAttributes.length !== 0 || false;
|
568 |
+
}.property('_dirtyAttributes.length'),
|
569 |
+
|
570 |
+
_relationshipBecameDirty: function(name) {
|
571 |
+
var dirtyAttributes = get(this, '_dirtyAttributes');
|
572 |
+
if (!dirtyAttributes.contains(name)) { dirtyAttributes.pushObject(name); }
|
573 |
+
},
|
574 |
+
|
575 |
+
_relationshipBecameClean: function(name) {
|
576 |
+
var dirtyAttributes = get(this, '_dirtyAttributes');
|
577 |
+
dirtyAttributes.removeObject(name);
|
578 |
+
},
|
579 |
+
|
580 |
+
dataKey: function(key) {
|
581 |
+
var camelizeKeys = get(this.constructor, 'camelizeKeys');
|
582 |
+
var meta = this.constructor.metaForProperty(key);
|
583 |
+
if (meta.options && meta.options.key) {
|
584 |
+
return camelizeKeys ? underscore(meta.options.key) : meta.options.key;
|
585 |
+
}
|
586 |
+
return camelizeKeys ? underscore(key) : key;
|
587 |
+
},
|
588 |
+
|
589 |
+
init: function() {
|
590 |
+
this._createReference();
|
591 |
+
if (!this._dirtyAttributes) {
|
592 |
+
set(this, '_dirtyAttributes', []);
|
593 |
+
}
|
594 |
+
this._super();
|
595 |
+
},
|
596 |
+
|
597 |
+
_createReference: function() {
|
598 |
+
var reference = this._reference,
|
599 |
+
id = this.getPrimaryKey();
|
600 |
+
|
601 |
+
if (!reference) {
|
602 |
+
reference = this.constructor._getOrCreateReferenceForId(id);
|
603 |
+
reference.record = this;
|
604 |
+
this._reference = reference;
|
605 |
+
} else if (reference.id !== id) {
|
606 |
+
reference.id = id;
|
607 |
+
this.constructor._cacheReference(reference);
|
608 |
+
}
|
609 |
+
|
610 |
+
if (!reference.id) {
|
611 |
+
reference.id = id;
|
612 |
+
}
|
613 |
+
|
614 |
+
return reference;
|
615 |
+
},
|
616 |
+
|
617 |
+
getPrimaryKey: function() {
|
618 |
+
return get(this, get(this.constructor, 'primaryKey'));
|
619 |
+
},
|
620 |
+
|
621 |
+
load: function(id, hash) {
|
622 |
+
var data = {};
|
623 |
+
data[get(this.constructor, 'primaryKey')] = id;
|
624 |
+
set(this, '_data', Ember.merge(data, hash));
|
625 |
+
this.getWithDefault('_dirtyAttributes', []).clear();
|
626 |
+
|
627 |
+
this._reloadHasManys();
|
628 |
+
|
629 |
+
// eagerly load embedded data
|
630 |
+
var relationships = this.constructor._relationships || [], meta = Ember.meta(this), relationshipKey, relationship, relationshipMeta, relationshipData, relationshipType;
|
631 |
+
for (var i = 0, l = relationships.length; i < l; i++) {
|
632 |
+
relationshipKey = relationships[i];
|
633 |
+
relationship = meta.descs[relationshipKey];
|
634 |
+
relationshipMeta = relationship.meta();
|
635 |
+
|
636 |
+
if (relationshipMeta.options.embedded) {
|
637 |
+
relationshipType = relationshipMeta.type;
|
638 |
+
if (typeof relationshipType === "string") {
|
639 |
+
relationshipType = Ember.get(Ember.lookup, relationshipType) || this.container.lookupFactory('model:'+ relationshipType);
|
640 |
+
}
|
641 |
+
|
642 |
+
relationshipData = data[relationshipKey];
|
643 |
+
if (relationshipData) {
|
644 |
+
relationshipType.load(relationshipData);
|
645 |
+
}
|
646 |
+
}
|
647 |
+
}
|
648 |
+
|
649 |
+
set(this, 'isNew', false);
|
650 |
+
set(this, 'isLoaded', true);
|
651 |
+
this._createReference();
|
652 |
+
this.trigger('didLoad');
|
653 |
+
},
|
654 |
+
|
655 |
+
didDefineProperty: function(proto, key, value) {
|
656 |
+
if (value instanceof Ember.Descriptor) {
|
657 |
+
var meta = value.meta();
|
658 |
+
var klass = proto.constructor;
|
659 |
+
|
660 |
+
if (meta.isAttribute) {
|
661 |
+
if (!klass._attributes) { klass._attributes = []; }
|
662 |
+
klass._attributes.push(key);
|
663 |
+
} else if (meta.isRelationship) {
|
664 |
+
if (!klass._relationships) { klass._relationships = []; }
|
665 |
+
klass._relationships.push(key);
|
666 |
+
meta.relationshipKey = key;
|
667 |
+
}
|
668 |
+
}
|
669 |
+
},
|
670 |
+
|
671 |
+
serializeHasMany: function(key, meta) {
|
672 |
+
return this.get(key).toJSON();
|
673 |
+
},
|
674 |
+
|
675 |
+
serializeBelongsTo: function(key, meta) {
|
676 |
+
if (meta.options.embedded) {
|
677 |
+
var record = this.get(key);
|
678 |
+
return record ? record.toJSON() : null;
|
679 |
+
} else {
|
680 |
+
var primaryKey = get(meta.getType(this), 'primaryKey');
|
681 |
+
return this.get(key + '.' + primaryKey);
|
682 |
+
}
|
683 |
+
},
|
684 |
+
|
685 |
+
toJSON: function() {
|
686 |
+
var key, meta,
|
687 |
+
json = {},
|
688 |
+
attributes = this.constructor.getAttributes(),
|
689 |
+
relationships = this.constructor.getRelationships(),
|
690 |
+
properties = attributes ? this.getProperties(attributes) : {},
|
691 |
+
rootKey = get(this.constructor, 'rootKey');
|
692 |
+
|
693 |
+
for (key in properties) {
|
694 |
+
meta = this.constructor.metaForProperty(key);
|
695 |
+
if (meta.type && meta.type.serialize) {
|
696 |
+
json[this.dataKey(key)] = meta.type.serialize(properties[key]);
|
697 |
+
} else if (meta.type && Ember.Model.dataTypes[meta.type]) {
|
698 |
+
json[this.dataKey(key)] = Ember.Model.dataTypes[meta.type].serialize(properties[key]);
|
699 |
+
} else {
|
700 |
+
json[this.dataKey(key)] = properties[key];
|
701 |
+
}
|
702 |
+
}
|
703 |
+
|
704 |
+
if (relationships) {
|
705 |
+
var data, relationshipKey;
|
706 |
+
|
707 |
+
for(var i = 0; i < relationships.length; i++) {
|
708 |
+
key = relationships[i];
|
709 |
+
meta = this.constructor.metaForProperty(key);
|
710 |
+
relationshipKey = meta.options.key || key;
|
711 |
+
|
712 |
+
if (meta.kind === 'belongsTo') {
|
713 |
+
data = this.serializeBelongsTo(key, meta);
|
714 |
+
} else {
|
715 |
+
data = this.serializeHasMany(key, meta);
|
716 |
+
}
|
717 |
+
|
718 |
+
json[relationshipKey] = data;
|
719 |
+
|
720 |
+
}
|
721 |
+
}
|
722 |
+
|
723 |
+
if (rootKey) {
|
724 |
+
var jsonRoot = {};
|
725 |
+
jsonRoot[rootKey] = json;
|
726 |
+
return jsonRoot;
|
727 |
+
} else {
|
728 |
+
return json;
|
729 |
+
}
|
730 |
+
},
|
731 |
+
|
732 |
+
save: function() {
|
733 |
+
var adapter = this.constructor.adapter;
|
734 |
+
set(this, 'isSaving', true);
|
735 |
+
if (get(this, 'isNew')) {
|
736 |
+
return adapter.createRecord(this);
|
737 |
+
} else if (get(this, 'isDirty')) {
|
738 |
+
return adapter.saveRecord(this);
|
739 |
+
} else { // noop, return a resolved promise
|
740 |
+
var self = this,
|
741 |
+
promise = new Ember.RSVP.Promise(function(resolve, reject) {
|
742 |
+
resolve(self);
|
743 |
+
});
|
744 |
+
set(this, 'isSaving', false);
|
745 |
+
return promise;
|
746 |
+
}
|
747 |
+
},
|
748 |
+
|
749 |
+
reload: function() {
|
750 |
+
this.getWithDefault('_dirtyAttributes', []).clear();
|
751 |
+
return this.constructor.reload(this.get(get(this.constructor, 'primaryKey')), this.container);
|
752 |
+
},
|
753 |
+
|
754 |
+
revert: function() {
|
755 |
+
this.getWithDefault('_dirtyAttributes', []).clear();
|
756 |
+
this.notifyPropertyChange('_data');
|
757 |
+
this._reloadHasManys(true);
|
758 |
+
},
|
759 |
+
|
760 |
+
didCreateRecord: function() {
|
761 |
+
var primaryKey = get(this.constructor, 'primaryKey'),
|
762 |
+
id = get(this, primaryKey);
|
763 |
+
|
764 |
+
set(this, 'isNew', false);
|
765 |
+
|
766 |
+
set(this, '_dirtyAttributes', []);
|
767 |
+
this.constructor.addToRecordArrays(this);
|
768 |
+
this.trigger('didCreateRecord');
|
769 |
+
this.didSaveRecord();
|
770 |
+
},
|
771 |
+
|
772 |
+
didSaveRecord: function() {
|
773 |
+
set(this, 'isSaving', false);
|
774 |
+
this.trigger('didSaveRecord');
|
775 |
+
if (this.get('isDirty')) { this._copyDirtyAttributesToData(); }
|
776 |
+
},
|
777 |
+
|
778 |
+
deleteRecord: function() {
|
779 |
+
return this.constructor.adapter.deleteRecord(this);
|
780 |
+
},
|
781 |
+
|
782 |
+
didDeleteRecord: function() {
|
783 |
+
this.constructor.removeFromRecordArrays(this);
|
784 |
+
set(this, 'isDeleted', true);
|
785 |
+
this.trigger('didDeleteRecord');
|
786 |
+
},
|
787 |
+
|
788 |
+
_copyDirtyAttributesToData: function() {
|
789 |
+
if (!this._dirtyAttributes) { return; }
|
790 |
+
var dirtyAttributes = this._dirtyAttributes,
|
791 |
+
data = get(this, '_data'),
|
792 |
+
key;
|
793 |
+
|
794 |
+
if (!data) {
|
795 |
+
data = {};
|
796 |
+
set(this, '_data', data);
|
797 |
+
}
|
798 |
+
for (var i = 0, l = dirtyAttributes.length; i < l; i++) {
|
799 |
+
// TODO: merge Object.create'd object into prototype
|
800 |
+
key = dirtyAttributes[i];
|
801 |
+
data[this.dataKey(key)] = this.cacheFor(key);
|
802 |
+
}
|
803 |
+
set(this, '_dirtyAttributes', []);
|
804 |
+
this._resetDirtyStateInNestedObjects(this); // we need to reset isDirty state to all child objects in embedded relationships
|
805 |
+
},
|
806 |
+
|
807 |
+
_resetDirtyStateInNestedObjects: function(object) {
|
808 |
+
var i, obj;
|
809 |
+
if (object._hasManyArrays) {
|
810 |
+
for (i = 0; i < object._hasManyArrays.length; i++) {
|
811 |
+
var array = object._hasManyArrays[i];
|
812 |
+
array.revert();
|
813 |
+
if (array.embedded) {
|
814 |
+
for (var j = 0; j < array.get('length'); j++) {
|
815 |
+
obj = array.objectAt(j);
|
816 |
+
obj._copyDirtyAttributesToData();
|
817 |
+
}
|
818 |
+
}
|
819 |
+
}
|
820 |
+
}
|
821 |
+
|
822 |
+
if (object._belongsTo) {
|
823 |
+
for (i = 0; i < object._belongsTo.length; i++) {
|
824 |
+
var belongsTo = object._belongsTo[i];
|
825 |
+
if (belongsTo.options.embedded) {
|
826 |
+
obj = this.get(belongsTo.relationshipKey);
|
827 |
+
if (obj) {
|
828 |
+
obj._copyDirtyAttributesToData();
|
829 |
+
}
|
830 |
+
}
|
831 |
+
}
|
832 |
+
}
|
833 |
+
},
|
834 |
+
|
835 |
+
_registerHasManyArray: function(array) {
|
836 |
+
if (!this._hasManyArrays) { this._hasManyArrays = Ember.A([]); }
|
837 |
+
|
838 |
+
this._hasManyArrays.pushObject(array);
|
839 |
+
},
|
840 |
+
|
841 |
+
registerParentHasManyArray: function(array) {
|
842 |
+
if (!this._parentHasManyArrays) { this._parentHasManyArrays = Ember.A([]); }
|
843 |
+
|
844 |
+
this._parentHasManyArrays.pushObject(array);
|
845 |
+
},
|
846 |
+
|
847 |
+
unregisterParentHasManyArray: function(array) {
|
848 |
+
if (!this._parentHasManyArrays) { return; }
|
849 |
+
|
850 |
+
this._parentHasManyArrays.removeObject(array);
|
851 |
+
},
|
852 |
+
|
853 |
+
_reloadHasManys: function(reverting) {
|
854 |
+
if (!this._hasManyArrays) { return; }
|
855 |
+
var i, j;
|
856 |
+
for (i = 0; i < this._hasManyArrays.length; i++) {
|
857 |
+
var array = this._hasManyArrays[i],
|
858 |
+
hasManyContent = this._getHasManyContent(get(array, 'key'), get(array, 'modelClass'), get(array, 'embedded'));
|
859 |
+
if (!reverting) {
|
860 |
+
for (j = 0; j < array.get('length'); j++) {
|
861 |
+
if (array.objectAt(j).get('isNew') && !array.objectAt(j).get('isDeleted')) {
|
862 |
+
hasManyContent.addObject(array.objectAt(j)._reference);
|
863 |
+
}
|
864 |
+
}
|
865 |
+
}
|
866 |
+
array.load(hasManyContent);
|
867 |
+
}
|
868 |
+
},
|
869 |
+
|
870 |
+
_getHasManyContent: function(key, type, embedded) {
|
871 |
+
var content = get(this, '_data.' + key);
|
872 |
+
|
873 |
+
if (content) {
|
874 |
+
var mapFunction, primaryKey, reference;
|
875 |
+
if (embedded) {
|
876 |
+
primaryKey = get(type, 'primaryKey');
|
877 |
+
mapFunction = function(attrs) {
|
878 |
+
reference = type._getOrCreateReferenceForId(attrs[primaryKey]);
|
879 |
+
reference.data = attrs;
|
880 |
+
return reference;
|
881 |
+
};
|
882 |
+
} else {
|
883 |
+
mapFunction = function(id) { return type._getOrCreateReferenceForId(id); };
|
884 |
+
}
|
885 |
+
content = Ember.EnumerableUtils.map(content, mapFunction);
|
886 |
+
}
|
887 |
+
|
888 |
+
return Ember.A(content || []);
|
889 |
+
},
|
890 |
+
|
891 |
+
_registerBelongsTo: function(key) {
|
892 |
+
if (!this._belongsTo) { this._belongsTo = Ember.A([]); }
|
893 |
+
|
894 |
+
this._belongsTo.pushObject(key);
|
895 |
+
}
|
896 |
+
});
|
897 |
+
|
898 |
+
Ember.Model.reopenClass({
|
899 |
+
primaryKey: 'id',
|
900 |
+
|
901 |
+
adapter: Ember.Adapter.create(),
|
902 |
+
|
903 |
+
_clientIdCounter: 1,
|
904 |
+
|
905 |
+
getAttributes: function() {
|
906 |
+
this.proto(); // force class "compilation" if it hasn't been done.
|
907 |
+
var attributes = this._attributes || [];
|
908 |
+
if (typeof this.superclass.getAttributes === 'function') {
|
909 |
+
attributes = this.superclass.getAttributes().concat(attributes);
|
910 |
+
}
|
911 |
+
return attributes;
|
912 |
+
},
|
913 |
+
|
914 |
+
getRelationships: function() {
|
915 |
+
this.proto(); // force class "compilation" if it hasn't been done.
|
916 |
+
var relationships = this._relationships || [];
|
917 |
+
if (typeof this.superclass.getRelationships === 'function') {
|
918 |
+
relationships = this.superclass.getRelationships().concat(relationships);
|
919 |
+
}
|
920 |
+
return relationships;
|
921 |
+
},
|
922 |
+
|
923 |
+
fetch: function(id) {
|
924 |
+
if (!arguments.length) {
|
925 |
+
return this._findFetchAll(true);
|
926 |
+
} else if (Ember.isArray(id)) {
|
927 |
+
return this._findFetchMany(id, true);
|
928 |
+
} else if (typeof id === 'object') {
|
929 |
+
return this._findFetchQuery(id, true);
|
930 |
+
} else {
|
931 |
+
return this._findFetchById(id, true);
|
932 |
+
}
|
933 |
+
},
|
934 |
+
|
935 |
+
find: function(id) {
|
936 |
+
if (!arguments.length) {
|
937 |
+
return this._findFetchAll(false);
|
938 |
+
} else if (Ember.isArray(id)) {
|
939 |
+
return this._findFetchMany(id, false);
|
940 |
+
} else if (typeof id === 'object') {
|
941 |
+
return this._findFetchQuery(id, false);
|
942 |
+
} else {
|
943 |
+
return this._findFetchById(id, false);
|
944 |
+
}
|
945 |
+
},
|
946 |
+
|
947 |
+
findQuery: function(params) {
|
948 |
+
return this._findFetchQuery(params, false);
|
949 |
+
},
|
950 |
+
|
951 |
+
fetchQuery: function(params) {
|
952 |
+
return this._findFetchQuery(params, true);
|
953 |
+
},
|
954 |
+
|
955 |
+
_findFetchQuery: function(params, isFetch, container) {
|
956 |
+
var records = Ember.RecordArray.create({modelClass: this, _query: params, container: container});
|
957 |
+
|
958 |
+
var promise = this.adapter.findQuery(this, records, params);
|
959 |
+
|
960 |
+
return isFetch ? promise : records;
|
961 |
+
},
|
962 |
+
|
963 |
+
findMany: function(ids) {
|
964 |
+
return this._findFetchMany(ids, false);
|
965 |
+
},
|
966 |
+
|
967 |
+
fetchMany: function(ids) {
|
968 |
+
return this._findFetchMany(ids, true);
|
969 |
+
},
|
970 |
+
|
971 |
+
_findFetchMany: function(ids, isFetch, container) {
|
972 |
+
Ember.assert("findFetchMany requires an array", Ember.isArray(ids));
|
973 |
+
|
974 |
+
var records = Ember.RecordArray.create({_ids: ids, modelClass: this, container: container}),
|
975 |
+
deferred;
|
976 |
+
|
977 |
+
if (!this.recordArrays) { this.recordArrays = []; }
|
978 |
+
this.recordArrays.push(records);
|
979 |
+
|
980 |
+
if (this._currentBatchIds) {
|
981 |
+
concatUnique(this._currentBatchIds, ids);
|
982 |
+
this._currentBatchRecordArrays.push(records);
|
983 |
+
} else {
|
984 |
+
this._currentBatchIds = concatUnique([], ids);
|
985 |
+
this._currentBatchRecordArrays = [records];
|
986 |
+
}
|
987 |
+
|
988 |
+
if (isFetch) {
|
989 |
+
deferred = Ember.RSVP.defer();
|
990 |
+
Ember.set(deferred, 'resolveWith', records);
|
991 |
+
|
992 |
+
if (!this._currentBatchDeferreds) { this._currentBatchDeferreds = []; }
|
993 |
+
this._currentBatchDeferreds.push(deferred);
|
994 |
+
}
|
995 |
+
|
996 |
+
Ember.run.scheduleOnce('data', this, this._executeBatch, container);
|
997 |
+
|
998 |
+
return isFetch ? deferred.promise : records;
|
999 |
+
},
|
1000 |
+
|
1001 |
+
findAll: function() {
|
1002 |
+
return this._findFetchAll(false);
|
1003 |
+
},
|
1004 |
+
|
1005 |
+
fetchAll: function() {
|
1006 |
+
return this._findFetchAll(true);
|
1007 |
+
},
|
1008 |
+
|
1009 |
+
_findFetchAll: function(isFetch, container) {
|
1010 |
+
var self = this;
|
1011 |
+
|
1012 |
+
var currentFetchPromise = this._currentFindFetchAllPromise;
|
1013 |
+
if (isFetch && currentFetchPromise) {
|
1014 |
+
return currentFetchPromise;
|
1015 |
+
} else if (this._findAllRecordArray) {
|
1016 |
+
if (isFetch) {
|
1017 |
+
return new Ember.RSVP.Promise(function(resolve) {
|
1018 |
+
resolve(self._findAllRecordArray);
|
1019 |
+
});
|
1020 |
+
} else {
|
1021 |
+
return this._findAllRecordArray;
|
1022 |
+
}
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
var records = this._findAllRecordArray = Ember.RecordArray.create({modelClass: this, container: container});
|
1026 |
+
|
1027 |
+
var promise = this._currentFindFetchAllPromise = this.adapter.findAll(this, records);
|
1028 |
+
|
1029 |
+
promise['finally'](function() {
|
1030 |
+
self._currentFindFetchAllPromise = null;
|
1031 |
+
});
|
1032 |
+
|
1033 |
+
// Remove the cached record array if the promise is rejected
|
1034 |
+
if (promise.then) {
|
1035 |
+
promise.then(null, function() {
|
1036 |
+
self._findAllRecordArray = null;
|
1037 |
+
return Ember.RSVP.reject.apply(null, arguments);
|
1038 |
+
});
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
return isFetch ? promise : records;
|
1042 |
+
},
|
1043 |
+
|
1044 |
+
findById: function(id) {
|
1045 |
+
return this._findFetchById(id, false);
|
1046 |
+
},
|
1047 |
+
|
1048 |
+
fetchById: function(id) {
|
1049 |
+
return this._findFetchById(id, true);
|
1050 |
+
},
|
1051 |
+
|
1052 |
+
_findFetchById: function(id, isFetch, container) {
|
1053 |
+
var record = this.cachedRecordForId(id, container),
|
1054 |
+
isLoaded = get(record, 'isLoaded'),
|
1055 |
+
adapter = get(this, 'adapter'),
|
1056 |
+
deferredOrPromise;
|
1057 |
+
|
1058 |
+
if (isLoaded) {
|
1059 |
+
if (isFetch) {
|
1060 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
1061 |
+
resolve(record);
|
1062 |
+
});
|
1063 |
+
} else {
|
1064 |
+
return record;
|
1065 |
+
}
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
deferredOrPromise = this._fetchById(record, id);
|
1069 |
+
|
1070 |
+
return isFetch ? deferredOrPromise : record;
|
1071 |
+
},
|
1072 |
+
|
1073 |
+
_currentBatchIds: null,
|
1074 |
+
_currentBatchRecordArrays: null,
|
1075 |
+
_currentBatchDeferreds: null,
|
1076 |
+
|
1077 |
+
reload: function(id, container) {
|
1078 |
+
var record = this.cachedRecordForId(id, container);
|
1079 |
+
record.set('isLoaded', false);
|
1080 |
+
return this._fetchById(record, id);
|
1081 |
+
},
|
1082 |
+
|
1083 |
+
_fetchById: function(record, id) {
|
1084 |
+
var adapter = get(this, 'adapter'),
|
1085 |
+
deferred;
|
1086 |
+
|
1087 |
+
if (adapter.findMany && !adapter.findMany.isUnimplemented) {
|
1088 |
+
if (this._currentBatchIds) {
|
1089 |
+
if (!contains(this._currentBatchIds, id)) { this._currentBatchIds.push(id); }
|
1090 |
+
} else {
|
1091 |
+
this._currentBatchIds = [id];
|
1092 |
+
this._currentBatchRecordArrays = [];
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
deferred = Ember.RSVP.defer();
|
1096 |
+
|
1097 |
+
//Attached the record to the deferred so we can resolve it later.
|
1098 |
+
Ember.set(deferred, 'resolveWith', record);
|
1099 |
+
|
1100 |
+
if (!this._currentBatchDeferreds) { this._currentBatchDeferreds = []; }
|
1101 |
+
this._currentBatchDeferreds.push(deferred);
|
1102 |
+
|
1103 |
+
Ember.run.scheduleOnce('data', this, this._executeBatch, record.container);
|
1104 |
+
|
1105 |
+
return deferred.promise;
|
1106 |
+
} else {
|
1107 |
+
return adapter.find(record, id);
|
1108 |
+
}
|
1109 |
+
},
|
1110 |
+
|
1111 |
+
_executeBatch: function(container) {
|
1112 |
+
var batchIds = this._currentBatchIds,
|
1113 |
+
batchRecordArrays = this._currentBatchRecordArrays,
|
1114 |
+
batchDeferreds = this._currentBatchDeferreds,
|
1115 |
+
self = this,
|
1116 |
+
requestIds = [],
|
1117 |
+
promise,
|
1118 |
+
i;
|
1119 |
+
|
1120 |
+
this._currentBatchIds = null;
|
1121 |
+
this._currentBatchRecordArrays = null;
|
1122 |
+
this._currentBatchDeferreds = null;
|
1123 |
+
|
1124 |
+
for (i = 0; i < batchIds.length; i++) {
|
1125 |
+
if (!this.cachedRecordForId(batchIds[i]).get('isLoaded')) {
|
1126 |
+
requestIds.push(batchIds[i]);
|
1127 |
+
}
|
1128 |
+
}
|
1129 |
+
|
1130 |
+
if (requestIds.length === 1) {
|
1131 |
+
promise = get(this, 'adapter').find(this.cachedRecordForId(requestIds[0], container), requestIds[0]);
|
1132 |
+
} else {
|
1133 |
+
var recordArray = Ember.RecordArray.create({_ids: batchIds, container: container});
|
1134 |
+
if (requestIds.length === 0) {
|
1135 |
+
promise = new Ember.RSVP.Promise(function(resolve, reject) { resolve(recordArray); });
|
1136 |
+
recordArray.notifyLoaded();
|
1137 |
+
} else {
|
1138 |
+
promise = get(this, 'adapter').findMany(this, recordArray, requestIds);
|
1139 |
+
}
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
promise.then(function() {
|
1143 |
+
for (var i = 0, l = batchRecordArrays.length; i < l; i++) {
|
1144 |
+
batchRecordArrays[i].loadForFindMany(self);
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
if (batchDeferreds) {
|
1148 |
+
for (i = 0, l = batchDeferreds.length; i < l; i++) {
|
1149 |
+
var resolveWith = Ember.get(batchDeferreds[i], 'resolveWith');
|
1150 |
+
batchDeferreds[i].resolve(resolveWith);
|
1151 |
+
}
|
1152 |
+
}
|
1153 |
+
}).then(null, function(errorXHR) {
|
1154 |
+
if (batchDeferreds) {
|
1155 |
+
for (var i = 0, l = batchDeferreds.length; i < l; i++) {
|
1156 |
+
batchDeferreds[i].reject(errorXHR);
|
1157 |
+
}
|
1158 |
+
}
|
1159 |
+
});
|
1160 |
+
},
|
1161 |
+
|
1162 |
+
getCachedReferenceRecord: function(id, container){
|
1163 |
+
var ref = this._getReferenceById(id);
|
1164 |
+
if(ref && ref.record) {
|
1165 |
+
if (! ref.record.container) {
|
1166 |
+
ref.record.container = container;
|
1167 |
+
}
|
1168 |
+
return ref.record;
|
1169 |
+
}
|
1170 |
+
return undefined;
|
1171 |
+
},
|
1172 |
+
|
1173 |
+
cachedRecordForId: function(id, container) {
|
1174 |
+
var record;
|
1175 |
+
if (!this.transient) {
|
1176 |
+
record = this.getCachedReferenceRecord(id, container);
|
1177 |
+
}
|
1178 |
+
|
1179 |
+
if (!record) {
|
1180 |
+
var primaryKey = get(this, 'primaryKey'),
|
1181 |
+
attrs = {isLoaded: false};
|
1182 |
+
|
1183 |
+
attrs[primaryKey] = id;
|
1184 |
+
attrs.container = container;
|
1185 |
+
record = this.create(attrs);
|
1186 |
+
if (!this.transient) {
|
1187 |
+
var sideloadedData = this.sideloadedData && this.sideloadedData[id];
|
1188 |
+
if (sideloadedData) {
|
1189 |
+
record.load(id, sideloadedData);
|
1190 |
+
}
|
1191 |
+
}
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
return record;
|
1195 |
+
},
|
1196 |
+
|
1197 |
+
|
1198 |
+
addToRecordArrays: function(record) {
|
1199 |
+
if (this._findAllRecordArray) {
|
1200 |
+
this._findAllRecordArray.addObject(record);
|
1201 |
+
}
|
1202 |
+
if (this.recordArrays) {
|
1203 |
+
this.recordArrays.forEach(function(recordArray) {
|
1204 |
+
if (recordArray instanceof Ember.FilteredRecordArray) {
|
1205 |
+
recordArray.registerObserversOnRecord(record);
|
1206 |
+
recordArray.updateFilter();
|
1207 |
+
} else {
|
1208 |
+
recordArray.addObject(record);
|
1209 |
+
}
|
1210 |
+
});
|
1211 |
+
}
|
1212 |
+
},
|
1213 |
+
|
1214 |
+
unload: function (record) {
|
1215 |
+
this.removeFromHasManyArrays(record);
|
1216 |
+
this.removeFromRecordArrays(record);
|
1217 |
+
var primaryKey = record.get(get(this, 'primaryKey'));
|
1218 |
+
this.removeFromCache(primaryKey);
|
1219 |
+
},
|
1220 |
+
|
1221 |
+
clearCache: function () {
|
1222 |
+
this.sideloadedData = undefined;
|
1223 |
+
this._referenceCache = undefined;
|
1224 |
+
this._findAllRecordArray = undefined;
|
1225 |
+
},
|
1226 |
+
|
1227 |
+
removeFromCache: function (key) {
|
1228 |
+
if (this.sideloadedData && this.sideloadedData[key]) {
|
1229 |
+
delete this.sideloadedData[key];
|
1230 |
+
}
|
1231 |
+
if(this._referenceCache && this._referenceCache[key]) {
|
1232 |
+
delete this._referenceCache[key];
|
1233 |
+
}
|
1234 |
+
},
|
1235 |
+
|
1236 |
+
removeFromHasManyArrays: function(record) {
|
1237 |
+
if (record._parentHasManyArrays) {
|
1238 |
+
record._parentHasManyArrays.forEach(function(hasManyArray) {
|
1239 |
+
hasManyArray.unloadObject(record);
|
1240 |
+
});
|
1241 |
+
record._parentHasManyArrays = null;
|
1242 |
+
}
|
1243 |
+
},
|
1244 |
+
|
1245 |
+
removeFromRecordArrays: function(record) {
|
1246 |
+
if (this._findAllRecordArray) {
|
1247 |
+
this._findAllRecordArray.removeObject(record);
|
1248 |
+
}
|
1249 |
+
if (this.recordArrays) {
|
1250 |
+
this.recordArrays.forEach(function(recordArray) {
|
1251 |
+
recordArray.removeObject(record);
|
1252 |
+
});
|
1253 |
+
}
|
1254 |
+
},
|
1255 |
+
|
1256 |
+
// FIXME
|
1257 |
+
findFromCacheOrLoad: function(data, container) {
|
1258 |
+
var record;
|
1259 |
+
if (!data[get(this, 'primaryKey')]) {
|
1260 |
+
record = this.create({isLoaded: false, container: container});
|
1261 |
+
} else {
|
1262 |
+
record = this.cachedRecordForId(data[get(this, 'primaryKey')], container);
|
1263 |
+
}
|
1264 |
+
// set(record, 'data', data);
|
1265 |
+
record.load(data[get(this, 'primaryKey')], data);
|
1266 |
+
return record;
|
1267 |
+
},
|
1268 |
+
|
1269 |
+
registerRecordArray: function(recordArray) {
|
1270 |
+
if (!this.recordArrays) { this.recordArrays = []; }
|
1271 |
+
this.recordArrays.push(recordArray);
|
1272 |
+
},
|
1273 |
+
|
1274 |
+
unregisterRecordArray: function(recordArray) {
|
1275 |
+
if (!this.recordArrays) { return; }
|
1276 |
+
Ember.A(this.recordArrays).removeObject(recordArray);
|
1277 |
+
},
|
1278 |
+
|
1279 |
+
forEachCachedRecord: function(callback) {
|
1280 |
+
if (!this._referenceCache) { return; }
|
1281 |
+
var ids = Object.keys(this._referenceCache);
|
1282 |
+
ids.map(function(id) {
|
1283 |
+
return this._getReferenceById(id).record;
|
1284 |
+
}, this).forEach(callback);
|
1285 |
+
},
|
1286 |
+
|
1287 |
+
load: function(hashes, container) {
|
1288 |
+
if (Ember.typeOf(hashes) !== 'array') { hashes = [hashes]; }
|
1289 |
+
|
1290 |
+
if (!this.sideloadedData) { this.sideloadedData = {}; }
|
1291 |
+
|
1292 |
+
for (var i = 0, l = hashes.length; i < l; i++) {
|
1293 |
+
var hash = hashes[i],
|
1294 |
+
primaryKey = hash[get(this, 'primaryKey')],
|
1295 |
+
record = this.getCachedReferenceRecord(primaryKey, container);
|
1296 |
+
|
1297 |
+
if (record) {
|
1298 |
+
record.load(primaryKey, hash);
|
1299 |
+
} else {
|
1300 |
+
this.sideloadedData[primaryKey] = hash;
|
1301 |
+
}
|
1302 |
+
}
|
1303 |
+
},
|
1304 |
+
|
1305 |
+
_getReferenceById: function(id) {
|
1306 |
+
if (!this._referenceCache) { this._referenceCache = {}; }
|
1307 |
+
return this._referenceCache[id];
|
1308 |
+
},
|
1309 |
+
|
1310 |
+
_getOrCreateReferenceForId: function(id) {
|
1311 |
+
var reference = this._getReferenceById(id);
|
1312 |
+
|
1313 |
+
if (!reference) {
|
1314 |
+
reference = this._createReference(id);
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
return reference;
|
1318 |
+
},
|
1319 |
+
|
1320 |
+
_createReference: function(id) {
|
1321 |
+
if (!this._referenceCache) { this._referenceCache = {}; }
|
1322 |
+
|
1323 |
+
Ember.assert('The id ' + id + ' has already been used with another record of type ' + this.toString() + '.', !id || !this._referenceCache[id]);
|
1324 |
+
|
1325 |
+
var reference = {
|
1326 |
+
id: id,
|
1327 |
+
clientId: this._clientIdCounter++
|
1328 |
+
};
|
1329 |
+
|
1330 |
+
this._cacheReference(reference);
|
1331 |
+
|
1332 |
+
return reference;
|
1333 |
+
},
|
1334 |
+
|
1335 |
+
_cacheReference: function(reference) {
|
1336 |
+
if (!this._referenceCache) { this._referenceCache = {}; }
|
1337 |
+
|
1338 |
+
// if we're creating an item, this process will be done
|
1339 |
+
// later, once the object has been persisted.
|
1340 |
+
if (!Ember.isEmpty(reference.id)) {
|
1341 |
+
this._referenceCache[reference.id] = reference;
|
1342 |
+
}
|
1343 |
+
}
|
1344 |
+
});
|
1345 |
+
|
1346 |
+
|
1347 |
+
})();
|
1348 |
+
|
1349 |
+
(function() {
|
1350 |
+
|
1351 |
+
var get = Ember.get;
|
1352 |
+
|
1353 |
+
function getType(record) {
|
1354 |
+
var type = this.type;
|
1355 |
+
|
1356 |
+
if (typeof this.type === "string" && this.type) {
|
1357 |
+
this.type = get(Ember.lookup, this.type);
|
1358 |
+
|
1359 |
+
if (!this.type) {
|
1360 |
+
var store = record.container.lookup('store:main');
|
1361 |
+
this.type = store.modelFor(type);
|
1362 |
+
this.type.reopenClass({ adapter: store.adapterFor(type) });
|
1363 |
+
}
|
1364 |
+
}
|
1365 |
+
|
1366 |
+
return this.type;
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
Ember.hasMany = function(type, options) {
|
1370 |
+
options = options || {};
|
1371 |
+
|
1372 |
+
var meta = { type: type, isRelationship: true, options: options, kind: 'hasMany', getType: getType};
|
1373 |
+
|
1374 |
+
return Ember.computed(function(propertyKey, newContentArray, existingArray) {
|
1375 |
+
type = meta.getType(this);
|
1376 |
+
Ember.assert("Type cannot be empty", !Ember.isEmpty(type));
|
1377 |
+
|
1378 |
+
var key = options.key || propertyKey;
|
1379 |
+
|
1380 |
+
if (arguments.length > 1) {
|
1381 |
+
return existingArray.setObjects(newContentArray);
|
1382 |
+
} else {
|
1383 |
+
return this.getHasMany(key, type, meta, this.container);
|
1384 |
+
}
|
1385 |
+
}).property().meta(meta);
|
1386 |
+
};
|
1387 |
+
|
1388 |
+
Ember.Model.reopen({
|
1389 |
+
getHasMany: function(key, type, meta, container) {
|
1390 |
+
var embedded = meta.options.embedded,
|
1391 |
+
collectionClass = embedded ? Ember.EmbeddedHasManyArray : Ember.HasManyArray;
|
1392 |
+
|
1393 |
+
var collection = collectionClass.create({
|
1394 |
+
parent: this,
|
1395 |
+
modelClass: type,
|
1396 |
+
content: this._getHasManyContent(key, type, embedded),
|
1397 |
+
embedded: embedded,
|
1398 |
+
key: key,
|
1399 |
+
relationshipKey: meta.relationshipKey,
|
1400 |
+
container: container
|
1401 |
+
});
|
1402 |
+
|
1403 |
+
this._registerHasManyArray(collection);
|
1404 |
+
|
1405 |
+
return collection;
|
1406 |
+
}
|
1407 |
+
});
|
1408 |
+
|
1409 |
+
|
1410 |
+
})();
|
1411 |
+
|
1412 |
+
(function() {
|
1413 |
+
|
1414 |
+
var get = Ember.get,
|
1415 |
+
set = Ember.set;
|
1416 |
+
|
1417 |
+
function storeFor(record) {
|
1418 |
+
if (record.container) {
|
1419 |
+
return record.container.lookup('store:main');
|
1420 |
+
}
|
1421 |
+
|
1422 |
+
return null;
|
1423 |
+
}
|
1424 |
+
|
1425 |
+
function getType(record) {
|
1426 |
+
var type = this.type;
|
1427 |
+
|
1428 |
+
if (typeof this.type === "string" && this.type) {
|
1429 |
+
type = Ember.get(Ember.lookup, this.type);
|
1430 |
+
|
1431 |
+
if (!type) {
|
1432 |
+
var store = storeFor(record);
|
1433 |
+
type = store.modelFor(this.type);
|
1434 |
+
type.reopenClass({ adapter: store.adapterFor(this.type) });
|
1435 |
+
}
|
1436 |
+
}
|
1437 |
+
|
1438 |
+
return type;
|
1439 |
+
}
|
1440 |
+
|
1441 |
+
Ember.belongsTo = function(type, options) {
|
1442 |
+
options = options || {};
|
1443 |
+
|
1444 |
+
var meta = { type: type, isRelationship: true, options: options, kind: 'belongsTo', getType: getType};
|
1445 |
+
|
1446 |
+
return Ember.computed(function(propertyKey, value, oldValue) {
|
1447 |
+
type = meta.getType(this);
|
1448 |
+
Ember.assert("Type cannot be empty.", !Ember.isEmpty(type));
|
1449 |
+
|
1450 |
+
var key = options.key || propertyKey;
|
1451 |
+
|
1452 |
+
var dirtyAttributes = get(this, '_dirtyAttributes'),
|
1453 |
+
createdDirtyAttributes = false,
|
1454 |
+
self = this;
|
1455 |
+
|
1456 |
+
var dirtyChanged = function(sender) {
|
1457 |
+
if (sender.get('isDirty')) {
|
1458 |
+
self._relationshipBecameDirty(propertyKey);
|
1459 |
+
} else {
|
1460 |
+
self._relationshipBecameClean(propertyKey);
|
1461 |
+
}
|
1462 |
+
};
|
1463 |
+
|
1464 |
+
if (!dirtyAttributes) {
|
1465 |
+
dirtyAttributes = [];
|
1466 |
+
createdDirtyAttributes = true;
|
1467 |
+
}
|
1468 |
+
|
1469 |
+
if (arguments.length > 1) {
|
1470 |
+
|
1471 |
+
if (value) {
|
1472 |
+
Ember.assert(Ember.String.fmt('Attempted to set property of type: %@ with a value of type: %@',
|
1473 |
+
[value.constructor, type]),
|
1474 |
+
value instanceof type);
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
if (oldValue !== value) {
|
1478 |
+
dirtyAttributes.pushObject(propertyKey);
|
1479 |
+
} else {
|
1480 |
+
dirtyAttributes.removeObject(propertyKey);
|
1481 |
+
}
|
1482 |
+
|
1483 |
+
if (createdDirtyAttributes) {
|
1484 |
+
set(this, '_dirtyAttributes', dirtyAttributes);
|
1485 |
+
}
|
1486 |
+
|
1487 |
+
if (meta.options.embedded) {
|
1488 |
+
if (oldValue) {
|
1489 |
+
oldValue.removeObserver('isDirty', dirtyChanged);
|
1490 |
+
}
|
1491 |
+
if (value) {
|
1492 |
+
value.addObserver('isDirty', dirtyChanged);
|
1493 |
+
}
|
1494 |
+
}
|
1495 |
+
|
1496 |
+
return value === undefined ? null : value;
|
1497 |
+
} else {
|
1498 |
+
var store = storeFor(this);
|
1499 |
+
value = this.getBelongsTo(key, type, meta, store);
|
1500 |
+
this._registerBelongsTo(meta);
|
1501 |
+
if (value !== null && meta.options.embedded) {
|
1502 |
+
value.get('isDirty'); // getter must be called before adding observer
|
1503 |
+
value.addObserver('isDirty', dirtyChanged);
|
1504 |
+
}
|
1505 |
+
return value;
|
1506 |
+
}
|
1507 |
+
}).property('_data').meta(meta);
|
1508 |
+
};
|
1509 |
+
|
1510 |
+
Ember.Model.reopen({
|
1511 |
+
getBelongsTo: function(key, type, meta, store) {
|
1512 |
+
var idOrAttrs = get(this, '_data.' + key),
|
1513 |
+
record;
|
1514 |
+
|
1515 |
+
if (Ember.isNone(idOrAttrs)) {
|
1516 |
+
return null;
|
1517 |
+
}
|
1518 |
+
|
1519 |
+
if (meta.options.embedded) {
|
1520 |
+
var primaryKey = get(type, 'primaryKey'),
|
1521 |
+
id = idOrAttrs[primaryKey];
|
1522 |
+
record = type.create({ isLoaded: false, id: id, container: this.container });
|
1523 |
+
record.load(id, idOrAttrs);
|
1524 |
+
} else {
|
1525 |
+
if (store) {
|
1526 |
+
record = store._findSync(meta.type, idOrAttrs);
|
1527 |
+
} else {
|
1528 |
+
record = type.find(idOrAttrs);
|
1529 |
+
}
|
1530 |
+
}
|
1531 |
+
|
1532 |
+
return record;
|
1533 |
+
}
|
1534 |
+
});
|
1535 |
+
|
1536 |
+
|
1537 |
+
})();
|
1538 |
+
|
1539 |
+
(function() {
|
1540 |
+
|
1541 |
+
var get = Ember.get,
|
1542 |
+
set = Ember.set,
|
1543 |
+
meta = Ember.meta;
|
1544 |
+
|
1545 |
+
Ember.Model.dataTypes = {};
|
1546 |
+
|
1547 |
+
Ember.Model.dataTypes[Date] = {
|
1548 |
+
deserialize: function(string) {
|
1549 |
+
if (!string) { return null; }
|
1550 |
+
return new Date(string);
|
1551 |
+
},
|
1552 |
+
serialize: function (date) {
|
1553 |
+
if (!date) { return null; }
|
1554 |
+
return date.toISOString();
|
1555 |
+
},
|
1556 |
+
isEqual: function(obj1, obj2) {
|
1557 |
+
if (obj1 instanceof Date) { obj1 = this.serialize(obj1); }
|
1558 |
+
if (obj2 instanceof Date) { obj2 = this.serialize(obj2); }
|
1559 |
+
return obj1 === obj2;
|
1560 |
+
}
|
1561 |
+
};
|
1562 |
+
|
1563 |
+
Ember.Model.dataTypes[Number] = {
|
1564 |
+
deserialize: function(string) {
|
1565 |
+
if (!string && string !== 0) { return null; }
|
1566 |
+
return Number(string);
|
1567 |
+
},
|
1568 |
+
serialize: function (number) {
|
1569 |
+
if (!number && number !== 0) { return null; }
|
1570 |
+
return Number(number);
|
1571 |
+
}
|
1572 |
+
};
|
1573 |
+
|
1574 |
+
function deserialize(value, type) {
|
1575 |
+
if (type && type.deserialize) {
|
1576 |
+
return type.deserialize(value);
|
1577 |
+
} else if (type && Ember.Model.dataTypes[type]) {
|
1578 |
+
return Ember.Model.dataTypes[type].deserialize(value);
|
1579 |
+
} else {
|
1580 |
+
return value;
|
1581 |
+
}
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
function serialize(value, type) {
|
1585 |
+
if (type && type.serialize) {
|
1586 |
+
return type.serialize(value);
|
1587 |
+
} else if (type && Ember.Model.dataTypes[type]) {
|
1588 |
+
return Ember.Model.dataTypes[type].serialize(value);
|
1589 |
+
} else {
|
1590 |
+
return value;
|
1591 |
+
}
|
1592 |
+
}
|
1593 |
+
|
1594 |
+
Ember.attr = function(type, options) {
|
1595 |
+
return Ember.computed(function(key, value) {
|
1596 |
+
var data = get(this, '_data'),
|
1597 |
+
dataKey = this.dataKey(key),
|
1598 |
+
dataValue = data && get(data, dataKey),
|
1599 |
+
beingCreated = meta(this).proto === this,
|
1600 |
+
dirtyAttributes = get(this, '_dirtyAttributes'),
|
1601 |
+
createdDirtyAttributes = false;
|
1602 |
+
|
1603 |
+
if (!dirtyAttributes) {
|
1604 |
+
dirtyAttributes = [];
|
1605 |
+
createdDirtyAttributes = true;
|
1606 |
+
}
|
1607 |
+
|
1608 |
+
if (arguments.length === 2) {
|
1609 |
+
if (beingCreated) {
|
1610 |
+
if (!data) {
|
1611 |
+
data = {};
|
1612 |
+
set(this, '_data', data);
|
1613 |
+
}
|
1614 |
+
dataValue = data[dataKey] = value;
|
1615 |
+
}
|
1616 |
+
|
1617 |
+
if (dataValue !== serialize(value, type)) {
|
1618 |
+
dirtyAttributes.pushObject(key);
|
1619 |
+
} else {
|
1620 |
+
dirtyAttributes.removeObject(key);
|
1621 |
+
}
|
1622 |
+
|
1623 |
+
if (createdDirtyAttributes) {
|
1624 |
+
set(this, '_dirtyAttributes', dirtyAttributes);
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
return value;
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
if (dataValue==null && options && options.defaultValue!=null) {
|
1631 |
+
return Ember.copy(options.defaultValue);
|
1632 |
+
}
|
1633 |
+
|
1634 |
+
return this.getAttr(key, deserialize(dataValue, type));
|
1635 |
+
}).property('_data').meta({isAttribute: true, type: type, options: options});
|
1636 |
+
};
|
1637 |
+
|
1638 |
+
|
1639 |
+
})();
|
1640 |
+
|
1641 |
+
(function() {
|
1642 |
+
|
1643 |
+
var get = Ember.get;
|
1644 |
+
|
1645 |
+
Ember.RESTAdapter = Ember.Adapter.extend({
|
1646 |
+
find: function(record, id) {
|
1647 |
+
var url = this.buildURL(record.constructor, id),
|
1648 |
+
self = this;
|
1649 |
+
|
1650 |
+
return this.ajax(url).then(function(data) {
|
1651 |
+
self.didFind(record, id, data);
|
1652 |
+
return record;
|
1653 |
+
});
|
1654 |
+
},
|
1655 |
+
|
1656 |
+
didFind: function(record, id, data) {
|
1657 |
+
var rootKey = get(record.constructor, 'rootKey'),
|
1658 |
+
dataToLoad = rootKey ? get(data, rootKey) : data;
|
1659 |
+
|
1660 |
+
record.load(id, dataToLoad);
|
1661 |
+
},
|
1662 |
+
|
1663 |
+
findAll: function(klass, records) {
|
1664 |
+
var url = this.buildURL(klass),
|
1665 |
+
self = this;
|
1666 |
+
|
1667 |
+
return this.ajax(url).then(function(data) {
|
1668 |
+
self.didFindAll(klass, records, data);
|
1669 |
+
return records;
|
1670 |
+
});
|
1671 |
+
},
|
1672 |
+
|
1673 |
+
didFindAll: function(klass, records, data) {
|
1674 |
+
var collectionKey = get(klass, 'collectionKey'),
|
1675 |
+
dataToLoad = collectionKey ? get(data, collectionKey) : data;
|
1676 |
+
|
1677 |
+
records.load(klass, dataToLoad);
|
1678 |
+
},
|
1679 |
+
|
1680 |
+
findQuery: function(klass, records, params) {
|
1681 |
+
var url = this.buildURL(klass),
|
1682 |
+
self = this;
|
1683 |
+
|
1684 |
+
return this.ajax(url, params).then(function(data) {
|
1685 |
+
self.didFindQuery(klass, records, params, data);
|
1686 |
+
return records;
|
1687 |
+
});
|
1688 |
+
},
|
1689 |
+
|
1690 |
+
didFindQuery: function(klass, records, params, data) {
|
1691 |
+
var collectionKey = get(klass, 'collectionKey'),
|
1692 |
+
dataToLoad = collectionKey ? get(data, collectionKey) : data;
|
1693 |
+
|
1694 |
+
records.load(klass, dataToLoad);
|
1695 |
+
},
|
1696 |
+
|
1697 |
+
createRecord: function(record) {
|
1698 |
+
var url = this.buildURL(record.constructor),
|
1699 |
+
self = this;
|
1700 |
+
|
1701 |
+
return this.ajax(url, record.toJSON(), "POST").then(function(data) {
|
1702 |
+
self.didCreateRecord(record, data);
|
1703 |
+
return record;
|
1704 |
+
});
|
1705 |
+
},
|
1706 |
+
|
1707 |
+
didCreateRecord: function(record, data) {
|
1708 |
+
this._loadRecordFromData(record, data);
|
1709 |
+
record.didCreateRecord();
|
1710 |
+
},
|
1711 |
+
|
1712 |
+
saveRecord: function(record) {
|
1713 |
+
var primaryKey = get(record.constructor, 'primaryKey'),
|
1714 |
+
url = this.buildURL(record.constructor, get(record, primaryKey)),
|
1715 |
+
self = this;
|
1716 |
+
|
1717 |
+
return this.ajax(url, record.toJSON(), "PUT").then(function(data) { // TODO: Some APIs may or may not return data
|
1718 |
+
self.didSaveRecord(record, data);
|
1719 |
+
return record;
|
1720 |
+
});
|
1721 |
+
},
|
1722 |
+
|
1723 |
+
didSaveRecord: function(record, data) {
|
1724 |
+
this._loadRecordFromData(record, data);
|
1725 |
+
record.didSaveRecord();
|
1726 |
+
},
|
1727 |
+
|
1728 |
+
deleteRecord: function(record) {
|
1729 |
+
var primaryKey = get(record.constructor, 'primaryKey'),
|
1730 |
+
url = this.buildURL(record.constructor, get(record, primaryKey)),
|
1731 |
+
self = this;
|
1732 |
+
|
1733 |
+
return this.ajax(url, record.toJSON(), "DELETE").then(function(data) { // TODO: Some APIs may or may not return data
|
1734 |
+
self.didDeleteRecord(record, data);
|
1735 |
+
});
|
1736 |
+
},
|
1737 |
+
|
1738 |
+
didDeleteRecord: function(record, data) {
|
1739 |
+
record.didDeleteRecord();
|
1740 |
+
},
|
1741 |
+
|
1742 |
+
ajax: function(url, params, method, settings) {
|
1743 |
+
return this._ajax(url, params, (method || "GET"), settings);
|
1744 |
+
},
|
1745 |
+
|
1746 |
+
buildURL: function(klass, id) {
|
1747 |
+
var urlRoot = get(klass, 'url');
|
1748 |
+
var urlSuffix = get(klass, 'urlSuffix') || '';
|
1749 |
+
if (!urlRoot) { throw new Error('Ember.RESTAdapter requires a `url` property to be specified'); }
|
1750 |
+
|
1751 |
+
if (!Ember.isEmpty(id)) {
|
1752 |
+
return urlRoot + "/" + id + urlSuffix;
|
1753 |
+
} else {
|
1754 |
+
return urlRoot + urlSuffix;
|
1755 |
+
}
|
1756 |
+
},
|
1757 |
+
|
1758 |
+
ajaxSettings: function(url, method) {
|
1759 |
+
return {
|
1760 |
+
url: url,
|
1761 |
+
type: method,
|
1762 |
+
dataType: "json"
|
1763 |
+
};
|
1764 |
+
},
|
1765 |
+
|
1766 |
+
_ajax: function(url, params, method, settings) {
|
1767 |
+
if (!settings) {
|
1768 |
+
settings = this.ajaxSettings(url, method);
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
return new Ember.RSVP.Promise(function(resolve, reject) {
|
1772 |
+
if (params) {
|
1773 |
+
if (method === "GET") {
|
1774 |
+
settings.data = params;
|
1775 |
+
} else {
|
1776 |
+
settings.contentType = "application/json; charset=utf-8";
|
1777 |
+
settings.data = JSON.stringify(params);
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
|
1781 |
+
settings.success = function(json) {
|
1782 |
+
Ember.run(null, resolve, json);
|
1783 |
+
};
|
1784 |
+
|
1785 |
+
settings.error = function(jqXHR, textStatus, errorThrown) {
|
1786 |
+
// https://github.com/ebryn/ember-model/issues/202
|
1787 |
+
if (jqXHR && typeof jqXHR === 'object') {
|
1788 |
+
jqXHR.then = null;
|
1789 |
+
}
|
1790 |
+
|
1791 |
+
Ember.run(null, reject, jqXHR);
|
1792 |
+
};
|
1793 |
+
|
1794 |
+
|
1795 |
+
Ember.$.ajax(settings);
|
1796 |
+
});
|
1797 |
+
},
|
1798 |
+
|
1799 |
+
_loadRecordFromData: function(record, data) {
|
1800 |
+
var rootKey = get(record.constructor, 'rootKey'),
|
1801 |
+
primaryKey = get(record.constructor, 'primaryKey');
|
1802 |
+
// handle HEAD response where no data is provided by server
|
1803 |
+
if (data) {
|
1804 |
+
data = rootKey ? get(data, rootKey) : data;
|
1805 |
+
if (!Ember.isEmpty(data)) {
|
1806 |
+
record.load(data[primaryKey], data);
|
1807 |
+
}
|
1808 |
+
}
|
1809 |
+
}
|
1810 |
+
});
|
1811 |
+
|
1812 |
+
|
1813 |
+
})();
|
1814 |
+
|
1815 |
+
(function() {
|
1816 |
+
|
1817 |
+
var get = Ember.get;
|
1818 |
+
|
1819 |
+
Ember.loadPromise = function(target) {
|
1820 |
+
if (Ember.isNone(target)) {
|
1821 |
+
return null;
|
1822 |
+
} else if (target.then) {
|
1823 |
+
return target;
|
1824 |
+
} else {
|
1825 |
+
var deferred = Ember.RSVP.defer();
|
1826 |
+
|
1827 |
+
if (get(target, 'isLoaded') && !get(target, 'isNew')) {
|
1828 |
+
deferred.resolve(target);
|
1829 |
+
} else {
|
1830 |
+
target.one('didLoad', this, function() {
|
1831 |
+
deferred.resolve(target);
|
1832 |
+
});
|
1833 |
+
}
|
1834 |
+
|
1835 |
+
return deferred.promise;
|
1836 |
+
}
|
1837 |
+
};
|
1838 |
+
|
1839 |
+
|
1840 |
+
})();
|
1841 |
+
|
1842 |
+
(function() {
|
1843 |
+
|
1844 |
+
// This is a debug adapter for the Ember Extension, don't let the fact this is called an "adapter" confuse you.
|
1845 |
+
// Most copied from: https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/debug/debug_adapter.js
|
1846 |
+
|
1847 |
+
if (!Ember.DataAdapter) { return; }
|
1848 |
+
|
1849 |
+
var get = Ember.get, capitalize = Ember.String.capitalize, underscore = Ember.String.underscore;
|
1850 |
+
|
1851 |
+
var DebugAdapter = Ember.DataAdapter.extend({
|
1852 |
+
getFilters: function() {
|
1853 |
+
return [
|
1854 |
+
{ name: 'isNew', desc: 'New' },
|
1855 |
+
{ name: 'isModified', desc: 'Modified' },
|
1856 |
+
{ name: 'isClean', desc: 'Clean' }
|
1857 |
+
];
|
1858 |
+
},
|
1859 |
+
|
1860 |
+
detect: function(klass) {
|
1861 |
+
return klass !== Ember.Model && Ember.Model.detect(klass);
|
1862 |
+
},
|
1863 |
+
|
1864 |
+
columnsForType: function(type) {
|
1865 |
+
var columns = [], count = 0, self = this;
|
1866 |
+
type.getAttributes().forEach(function(name, meta) {
|
1867 |
+
if (count++ > self.attributeLimit) { return false; }
|
1868 |
+
var desc = capitalize(underscore(name).replace('_', ' '));
|
1869 |
+
columns.push({ name: name, desc: desc });
|
1870 |
+
});
|
1871 |
+
return columns;
|
1872 |
+
},
|
1873 |
+
|
1874 |
+
getRecords: function(type) {
|
1875 |
+
var records = [];
|
1876 |
+
type.forEachCachedRecord(function(record) { records.push(record); });
|
1877 |
+
return records;
|
1878 |
+
},
|
1879 |
+
|
1880 |
+
getRecordColumnValues: function(record) {
|
1881 |
+
var self = this, count = 0,
|
1882 |
+
columnValues = { id: get(record, 'id') };
|
1883 |
+
|
1884 |
+
record.constructor.getAttributes().forEach(function(key) {
|
1885 |
+
if (count++ > self.attributeLimit) {
|
1886 |
+
return false;
|
1887 |
+
}
|
1888 |
+
var value = get(record, key);
|
1889 |
+
columnValues[key] = value;
|
1890 |
+
});
|
1891 |
+
return columnValues;
|
1892 |
+
},
|
1893 |
+
|
1894 |
+
getRecordKeywords: function(record) {
|
1895 |
+
var keywords = [], keys = Ember.A(['id']);
|
1896 |
+
record.constructor.getAttributes().forEach(function(key) {
|
1897 |
+
keys.push(key);
|
1898 |
+
});
|
1899 |
+
keys.forEach(function(key) {
|
1900 |
+
keywords.push(get(record, key));
|
1901 |
+
});
|
1902 |
+
return keywords;
|
1903 |
+
},
|
1904 |
+
|
1905 |
+
getRecordFilterValues: function(record) {
|
1906 |
+
return {
|
1907 |
+
isNew: record.get('isNew'),
|
1908 |
+
isModified: record.get('isDirty') && !record.get('isNew'),
|
1909 |
+
isClean: !record.get('isDirty')
|
1910 |
+
};
|
1911 |
+
},
|
1912 |
+
|
1913 |
+
getRecordColor: function(record) {
|
1914 |
+
var color = 'black';
|
1915 |
+
if (record.get('isNew')) {
|
1916 |
+
color = 'green';
|
1917 |
+
} else if (record.get('isDirty')) {
|
1918 |
+
color = 'blue';
|
1919 |
+
}
|
1920 |
+
return color;
|
1921 |
+
},
|
1922 |
+
|
1923 |
+
observeRecord: function(record, recordUpdated) {
|
1924 |
+
var releaseMethods = Ember.A(), self = this,
|
1925 |
+
keysToObserve = Ember.A(['id', 'isNew', 'isDirty']);
|
1926 |
+
|
1927 |
+
record.constructor.getAttributes().forEach(function(key) {
|
1928 |
+
keysToObserve.push(key);
|
1929 |
+
});
|
1930 |
+
|
1931 |
+
keysToObserve.forEach(function(key) {
|
1932 |
+
var handler = function() {
|
1933 |
+
recordUpdated(self.wrapRecord(record));
|
1934 |
+
};
|
1935 |
+
Ember.addObserver(record, key, handler);
|
1936 |
+
releaseMethods.push(function() {
|
1937 |
+
Ember.removeObserver(record, key, handler);
|
1938 |
+
});
|
1939 |
+
});
|
1940 |
+
|
1941 |
+
var release = function() {
|
1942 |
+
releaseMethods.forEach(function(fn) { fn(); } );
|
1943 |
+
};
|
1944 |
+
|
1945 |
+
return release;
|
1946 |
+
}
|
1947 |
+
});
|
1948 |
+
|
1949 |
+
Ember.onLoad('Ember.Application', function(Application) {
|
1950 |
+
Application.initializer({
|
1951 |
+
name: "data-adapter",
|
1952 |
+
|
1953 |
+
initialize: function(container, application) {
|
1954 |
+
application.register('data-adapter:main', DebugAdapter);
|
1955 |
+
}
|
1956 |
+
});
|
1957 |
+
});
|
1958 |
+
|
1959 |
+
|
1960 |
+
})();
|
1961 |
+
|
1962 |
+
(function() {
|
1963 |
+
|
1964 |
+
function NIL() {}
|
1965 |
+
|
1966 |
+
Ember.Model.Store = Ember.Object.extend({
|
1967 |
+
container: null,
|
1968 |
+
|
1969 |
+
modelFor: function(type) {
|
1970 |
+
return this.container.lookupFactory('model:'+type);
|
1971 |
+
},
|
1972 |
+
|
1973 |
+
adapterFor: function(type) {
|
1974 |
+
var adapter = this.modelFor(type).adapter,
|
1975 |
+
container = this.container;
|
1976 |
+
|
1977 |
+
if (adapter && adapter !== Ember.Model.adapter) {
|
1978 |
+
return adapter;
|
1979 |
+
} else {
|
1980 |
+
adapter = container.lookupFactory('adapter:'+ type) ||
|
1981 |
+
container.lookupFactory('adapter:application') ||
|
1982 |
+
container.lookupFactory('adapter:REST');
|
1983 |
+
|
1984 |
+
return adapter ? adapter.create() : adapter;
|
1985 |
+
}
|
1986 |
+
},
|
1987 |
+
|
1988 |
+
createRecord: function(type, props) {
|
1989 |
+
var klass = this.modelFor(type);
|
1990 |
+
klass.reopenClass({adapter: this.adapterFor(type)});
|
1991 |
+
return klass.create(Ember.merge({container: this.container}, props));
|
1992 |
+
},
|
1993 |
+
|
1994 |
+
find: function(type, id) {
|
1995 |
+
if (arguments.length === 1) { id = NIL; }
|
1996 |
+
return this._find(type, id, true);
|
1997 |
+
},
|
1998 |
+
|
1999 |
+
_find: function(type, id, async) {
|
2000 |
+
var klass = this.modelFor(type);
|
2001 |
+
|
2002 |
+
// if (!klass.adapter) {
|
2003 |
+
klass.reopenClass({adapter: this.adapterFor(type)});
|
2004 |
+
// }
|
2005 |
+
|
2006 |
+
if (id === NIL) {
|
2007 |
+
return klass._findFetchAll(async, this.container);
|
2008 |
+
} else if (Ember.isArray(id)) {
|
2009 |
+
return klass._findFetchMany(id, async, this.container);
|
2010 |
+
} else if (typeof id === 'object') {
|
2011 |
+
return klass._findFetchQuery(id, async, this.container);
|
2012 |
+
} else {
|
2013 |
+
return klass._findFetchById(id, async, this.container);
|
2014 |
+
}
|
2015 |
+
},
|
2016 |
+
|
2017 |
+
_findSync: function(type, id) {
|
2018 |
+
return this._find(type, id, false);
|
2019 |
+
}
|
2020 |
+
});
|
2021 |
+
|
2022 |
+
Ember.onLoad('Ember.Application', function(Application) {
|
2023 |
+
Application.initializer({
|
2024 |
+
name: "store",
|
2025 |
+
|
2026 |
+
initialize: function(container, application) {
|
2027 |
+
application.register('store:main', container.lookupFactory('store:application') || Ember.Model.Store);
|
2028 |
+
|
2029 |
+
application.inject('route', 'store', 'store:main');
|
2030 |
+
application.inject('controller', 'store', 'store:main');
|
2031 |
+
}
|
2032 |
+
});
|
2033 |
+
});
|
2034 |
+
|
2035 |
+
|
2036 |
+
})();
|
admin/views/slider-panel/js/ember-model.min.js
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
/*!
|
2 |
-
|
3 |
-
|
4 |
-
*/
|
5 |
-
(function(){Ember.libraries&&Ember.libraries.register("Ember Model","0.0.11")})(),function(){function n(n){var t=function(){var t=this.constructor.toString();throw new Error(n.replace("{{className}}",t));};return t.isUnimplemented=!0,t}Ember.Adapter=Ember.Object.extend({find:n("{{className}} must implement find"),findQuery:n("{{className}} must implement findQuery"),findMany:n("{{className}} must implement findMany"),findAll:n("{{className}} must implement findAll"),createRecord:n("{{className}} must implement createRecord"),saveRecord:n("{{className}} must implement saveRecord"),deleteRecord:n("{{className}} must implement deleteRecord"),load:function(n,t,i){n.load(t,i)}})}(),function(){var n=Ember.get;Ember.FixtureAdapter=Ember.Adapter.extend({_findData:function(t,i){var r=t.FIXTURES,u=i.toString(),f=n(t,"primaryKey");return Ember.A(r).find(function(n){return n[f].toString()===u})},find:function(n,t){var i=this._findData(n.constructor,t);return new Ember.RSVP.Promise(function(r){Ember.run.later(this,function(){Ember.run(n,n.load,t,i),r(n)},0)})},findMany:function(n,t,i){for(var e=n.FIXTURES,u=[],r=0,f=i.length;r<f;r++)u.push(this._findData(n,i[r]));return new Ember.RSVP.Promise(function(i){Ember.run.later(this,function(){Ember.run(t,t.load,n,u),i(t)},0)})},findAll:function(n,t){var i=n.FIXTURES;return new Ember.RSVP.Promise(function(r){Ember.run.later(this,function(){Ember.run(t,t.load,n,i),r(t)},0)})},createRecord:function(n){var t=n.constructor,i=t.FIXTURES;return new Ember.RSVP.Promise(function(r){Ember.run.later(this,function(){i.push(t.findFromCacheOrLoad(n.toJSON())),n.didCreateRecord(),r(n)},0)})},saveRecord:function(n){return new Ember.RSVP.Promise(function(t){Ember.run.later(this,function(){n.didSaveRecord(),t(n)},0)})},deleteRecord:function(n){return new Ember.RSVP.Promise(function(t){Ember.run.later(this,function(){n.didDeleteRecord(),t(n)},0)})}})}(),function(){var t=Ember.get,n=Ember.set;Ember.RecordArray=Ember.ArrayProxy.extend(Ember.Evented,{isLoaded:!1,isLoading:Ember.computed.not("isLoaded"),load:function(t,i){n(this,"content",this.materializeData(t,i)),this.notifyLoaded()},loadForFindMany:function(i){var r=t(this,"_ids").map(function(n){return i.cachedRecordForId(n)});n(this,"content",Ember.A(r)),this.notifyLoaded()},notifyLoaded:function(){n(this,"isLoaded",!0),this.trigger("didLoad")},materializeData:function(n,t){return Ember.A(t.map(function(t){return n.findFromCacheOrLoad(t)}))},reload:function(){var t=this.get("modelClass"),r=this,i;return n(this,"isLoaded",!1),t._findAllRecordArray===this?t.adapter.findAll(t,this):this._query?t.adapter.findQuery(t,this,this._query):(i=this.map(function(n){return n.reload()}),Ember.RSVP.all(i).then(function(){r.notifyLoaded()}))}})}(),function(){var n=Ember.get;Ember.FilteredRecordArray=Ember.RecordArray.extend({init:function(){if(!n(this,"modelClass"))throw new Error("FilteredRecordArrays must be created with a modelClass");if(!n(this,"filterFunction"))throw new Error("FilteredRecordArrays must be created with a filterFunction");if(!n(this,"filterProperties"))throw new Error("FilteredRecordArrays must be created with filterProperties");var t=n(this,"modelClass");t.registerRecordArray(this),this.registerObservers(),this.updateFilter(),this._super()},updateFilter:function(){var i=this,t=[];n(this,"modelClass").forEachCachedRecord(function(n){i.filterFunction(n)&&t.push(n)}),this.set("content",Ember.A(t))},updateFilterForRecord:function(t){var i=n(this,"content");this.filterFunction(t)&&!i.contains(t)&&i.pushObject(t)},registerObservers:function(){var t=this;n(this,"modelClass").forEachCachedRecord(function(n){t.registerObserversOnRecord(n)})},registerObserversOnRecord:function(t){for(var f=this,r=n(this,"filterProperties"),i=0,u=n(r,"length");i<u;i++)t.addObserver(r[i],f,"updateFilterForRecord")}})}(),function(){var n=Ember.get,t=Ember.set;Ember.ManyArray=Ember.RecordArray.extend({_records:null,originalContent:[],isDirty:function(){var r=n(this,"originalContent"),o=n(r,"length"),u=n(this,"content"),f=n(u,"length"),i,t,e;if(o!==f)return!0;for(i=!1,t=0,e=f;t<e;t++)if(!r.contains(u[t])){i=!0;break}return i}.property("content.[]","originalContent"),objectAtContent:function(t){var i=n(this,"content");if(i.length)return this.materializeRecord(t)},save:function(){return Ember.RSVP.all(this.map(function(n){return n.save()}))},replaceContent:function(n,t,i){i=Ember.EnumerableUtils.map(i,function(n){return n._reference},this),this._super(n,t,i)},_contentWillChange:function(){var t=n(this,"content");t&&(t.removeArrayObserver(this),this._setupOriginalContent(t))}.observesBefore("content"),_contentDidChange:function(){var t=n(this,"content");t&&(t.addArrayObserver(this),this.arrayDidChange(t,0,0,n(t,"length")))}.observes("content"),arrayWillChange:function(){},arrayDidChange:function(){var t=n(this,"parent"),i=n(this,"relationshipKey"),r=n(this,"isDirty");r?t._relationshipBecameDirty(i):t._relationshipBecameClean(i)},_setupOriginalContent:function(i){i=i||n(this,"content"),i&&t(this,"originalContent",i.slice())},init:function(){this._super(),this._setupOriginalContent(),this._contentDidChange()}}),Ember.HasManyArray=Ember.ManyArray.extend({materializeRecord:function(t){var r=n(this,"modelClass"),u=n(this,"content"),i=u.objectAt(t);return i.record?i.record:r.find(i.id)},toJSON:function(){var n=[],t=this.get("content");return t.forEach(function(t){t.id!==undefined&&n.push(t.id)}),n}}),Ember.EmbeddedHasManyArray=Ember.ManyArray.extend({create:function(t){var r=n(this,"modelClass"),i=r.create(t);return this.pushObject(i),i},materializeRecord:function(t){var f=n(this,"modelClass"),e=n(f,"primaryKey"),o=n(this,"content"),i=o.objectAt(t),u=i.data,r;return i.record?i.record:(r=f.create({_reference:i}),i.record=r,u&&r.load(u[e],u),r)},toJSON:function(){return this.map(function(n){return n.toJSON()})}})}(),function(){function r(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return!0;return!1}function u(n,t){for(var u,i=0,f=t.length;i<f;i++)u=t[i],r(n,u)||n.push(u);return n}var n=Ember.get,t=Ember.set,e=Ember.setProperties,f=Ember.meta,i=Ember.String.underscore;Ember.run.queues.push("data"),Ember.Model=Ember.Object.extend(Ember.Evented,{isLoaded:!0,isLoading:Ember.computed.not("isLoaded"),isNew:!0,isDeleted:!1,_dirtyAttributes:null,getAttr:function(n,t){return t},isDirty:function(){var t=n(this,"_dirtyAttributes");return t&&t.length!==0||!1}.property("_dirtyAttributes.length"),_relationshipBecameDirty:function(t){var i=n(this,"_dirtyAttributes");i.contains(t)||i.pushObject(t)},_relationshipBecameClean:function(t){var i=n(this,"_dirtyAttributes");i.removeObject(t)},dataKey:function(t){var u=n(this.constructor,"camelizeKeys"),r=this.constructor.metaForProperty(t);return r.options&&r.options.key?u?i(r.options.key):r.options.key:u?i(t):t},init:function(){this._createReference(),this._dirtyAttributes||t(this,"_dirtyAttributes",[]),this._super()},_createReference:function(){var n=this._reference,t=this.getPrimaryKey();return n?n.id!==t&&(n.id=t,this.constructor._cacheReference(n)):(n=this.constructor._getOrCreateReferenceForId(t),n.record=this,this._reference=n),n.id||(n.id=t),n},getPrimaryKey:function(){return n(this,n(this.constructor,"primaryKey"))},load:function(i,r){var e={},o,l,s,a,h,c,u,f,v;for(e[n(this.constructor,"primaryKey")]=i,t(this,"_data",Ember.merge(e,r)),o=this.constructor._relationships||[],l=Ember.meta(this),f=0,v=o.length;f<v;f++)s=o[f],a=l.descs[s],h=a.meta(),h.options.embedded&&(u=h.type,typeof u=="string"&&(u=Ember.get(Ember.lookup,u)),c=e[s],c&&u.load(c));t(this,"isLoaded",!0),t(this,"isNew",!1),this._createReference(),this.trigger("didLoad")},didDefineProperty:function(n,t,i){if(i instanceof Ember.Descriptor){var u=i.meta(),r=n.constructor;u.isAttribute?(r._attributes||(r._attributes=[]),r._attributes.push(t)):u.isRelationship&&(r._relationships||(r._relationships=[]),r._relationships.push(t),u.relationshipKey=t)}},serializeHasMany:function(n){var t=this.get(n);return this.get(n).toJSON()},serializeBelongsTo:function(t,i){var r,u;return i.options.embedded?(r=this.get(t),r?r.toJSON():null):(u=n(i.getType(),"primaryKey"),this.get(t+"."+u))},toJSON:function(){var i,t,r={},s=this.constructor.getAttributes(),e=this.constructor.getRelationships(),u=s?this.getProperties(s):{},h=n(this.constructor,"rootKey"),c,l,f,o;for(i in u)t=this.constructor.metaForProperty(i),r[this.dataKey(i)]=t.type&&t.type.serialize?t.type.serialize(u[i]):t.type&&Ember.Model.dataTypes[t.type]?Ember.Model.dataTypes[t.type].serialize(u[i]):u[i];if(e)for(f=0;f<e.length;f++)i=e[f],t=this.constructor.metaForProperty(i),l=t.options.key||i,c=t.kind==="belongsTo"?this.serializeBelongsTo(i,t):this.serializeHasMany(i,t),r[l]=c;return h?(o={},o[h]=r,o):r},save:function(){var i=this.constructor.adapter,r,u;return t(this,"isSaving",!0),n(this,"isNew")?i.createRecord(this):n(this,"isDirty")?i.saveRecord(this):(r=this,u=new Ember.RSVP.Promise(function(n){n(r)}),t(this,"isSaving",!1),u)},reload:function(){return this.getWithDefault("_dirtyAttributes",[]).clear(),this.constructor.reload(this.get(n(this.constructor,"primaryKey")))},revert:function(){this.getWithDefault("_dirtyAttributes",[]).clear(),this.notifyPropertyChange("_data")},didCreateRecord:function(){var i=n(this.constructor,"primaryKey"),r=n(this,i);t(this,"isNew",!1),t(this,"_dirtyAttributes",[]),this.constructor.addToRecordArrays(this),this.trigger("didCreateRecord"),this.didSaveRecord()},didSaveRecord:function(){t(this,"isSaving",!1),this.trigger("didSaveRecord"),this.get("isDirty")&&this._copyDirtyAttributesToData()},deleteRecord:function(){return this.constructor.adapter.deleteRecord(this)},didDeleteRecord:function(){this.constructor.removeFromRecordArrays(this),t(this,"isDeleted",!0),this.trigger("didDeleteRecord")},_copyDirtyAttributesToData:function(){var u,i,f,r,e;if(this._dirtyAttributes){for(u=this._dirtyAttributes,i=n(this,"_data"),i||(i={},t(this,"_data",i)),r=0,e=u.length;r<e;r++)f=u[r],i[this.dataKey(f)]=this.cacheFor(f);t(this,"_dirtyAttributes",[])}},dataDidChange:Ember.observer(function(){this._reloadHasManys()},"_data"),_registerHasManyArray:function(n){this._hasManyArrays||(this._hasManyArrays=Ember.A([])),this._hasManyArrays.pushObject(n)},_reloadHasManys:function(){var u,r,i,f;if(this._hasManyArrays)for(u=0;u<this._hasManyArrays.length;u++){for(i=this._hasManyArrays[u],f=this._getHasManyContent(n(i,"key"),n(i,"modelClass"),n(i,"embedded")),r=0;r<i.get("length");r++)i.objectAt(r).get("isNew")&&f.addObject(i.objectAt(r)._reference);t(i,"content",f)}},_getHasManyContent:function(t,i,r){var u=n(this,"_data."+t),f,o,e;return u&&(r?(o=n(i,"primaryKey"),f=function(n){return e=i._getOrCreateReferenceForId(n[o]),e.data=n,e}):f=function(n){return i._getOrCreateReferenceForId(n)},u=Ember.EnumerableUtils.map(u,f)),Ember.A(u||[])}}),Ember.Model.reopenClass({primaryKey:"id",adapter:Ember.Adapter.create(),_clientIdCounter:1,getAttributes:function(){this.proto();var n=this._attributes||[];return typeof this.superclass.getAttributes=="function"&&(n=this.superclass.getAttributes().concat(n)),n},getRelationships:function(){this.proto();var n=this._relationships||[];return typeof this.superclass.getRelationships=="function"&&(n=this.superclass.getRelationships().concat(n)),n},fetch:function(n){return arguments.length?Ember.isArray(n)?this._findFetchMany(n,!0):typeof n=="object"?this._findFetchQuery(n,!0):this._findFetchById(n,!0):this._findFetchAll(!0)},find:function(n){return arguments.length?Ember.isArray(n)?this._findFetchMany(n,!1):typeof n=="object"?this._findFetchQuery(n,!1):this._findFetchById(n,!1):this._findFetchAll(!1)},findQuery:function(n){return this._findFetchQuery(n,!1)},fetchQuery:function(n){return this._findFetchQuery(n,!0)},_findFetchQuery:function(n,t){var i=Ember.RecordArray.create({modelClass:this,_query:n}),r=this.adapter.findQuery(this,i,n);return t?r:i},findMany:function(n){return this._findFetchMany(n,!1)},fetchMany:function(n){return this._findFetchMany(n,!0)},_findFetchMany:function(n,t){Ember.assert("findFetchMany requires an array",Ember.isArray(n));var i=Ember.RecordArray.create({_ids:n,modelClass:this}),r;return this.recordArrays||(this.recordArrays=[]),this.recordArrays.push(i),this._currentBatchIds?(u(this._currentBatchIds,n),this._currentBatchRecordArrays.push(i)):(this._currentBatchIds=u([],n),this._currentBatchRecordArrays=[i]),t&&(r=Ember.Deferred.create(),Ember.set(r,"resolveWith",i),this._currentBatchDeferreds||(this._currentBatchDeferreds=[]),this._currentBatchDeferreds.push(r)),Ember.run.scheduleOnce("data",this,this._executeBatch),t?r:i},findAll:function(){return this._findFetchAll(!1)},fetchAll:function(){return this._findFetchAll(!0)},_findFetchAll:function(n){var r=this,i,t;return this._findAllRecordArray?n?new Ember.RSVP.Promise(function(n){n(r._findAllRecordArray)}):this._findAllRecordArray:(i=this._findAllRecordArray=Ember.RecordArray.create({modelClass:this}),t=this.adapter.findAll(this,i),t.then&&t.then(null,function(){return r._findAllRecordArray=null,Ember.RSVP.reject.apply(null,arguments)}),n?t:i)},findById:function(n){return this._findFetchById(n,!1)},fetchById:function(n){return this._findFetchById(n,!0)},_findFetchById:function(t,i){var r=this.cachedRecordForId(t),f=n(r,"isLoaded"),e=n(this,"adapter"),u;return f?i?new Ember.RSVP.Promise(function(n){n(r)}):r:(u=this._fetchById(r,t),i?u:r)},_currentBatchIds:null,_currentBatchRecordArrays:null,_currentBatchDeferreds:null,reload:function(n){var t=this.cachedRecordForId(n);return t.set("isLoaded",!1),this._fetchById(t,n)},_fetchById:function(t,i){var f=n(this,"adapter"),u;return f.findMany&&!f.findMany.isUnimplemented?(this._currentBatchIds?r(this._currentBatchIds,i)||this._currentBatchIds.push(i):(this._currentBatchIds=[i],this._currentBatchRecordArrays=[]),u=Ember.Deferred.create(),Ember.set(u,"resolveWith",t),this._currentBatchDeferreds||(this._currentBatchDeferreds=[]),this._currentBatchDeferreds.push(u),Ember.run.scheduleOnce("data",this,this._executeBatch),u):f.find(t,i)},_executeBatch:function(){var u=this._currentBatchIds,o=this._currentBatchRecordArrays,t=this._currentBatchDeferreds,s=this,i=[],f,r,e;for(this._currentBatchIds=null,this._currentBatchRecordArrays=null,this._currentBatchDeferreds=null,r=0;r<u.length;r++)this.cachedRecordForId(u[r]).get("isLoaded")||i.push(u[r]);i.length===1?f=n(this,"adapter").find(this.cachedRecordForId(i[0]),i[0]):(e=Ember.RecordArray.create({_ids:u}),i.length===0?(f=new Ember.RSVP.Promise(function(n){n(e)}),e.notifyLoaded()):f=n(this,"adapter").findMany(this,e,i)),f.then(function(){for(var r,n=0,i=o.length;n<i;n++)o[n].loadForFindMany(s);if(t)for(n=0,i=t.length;n<i;n++)r=Ember.get(t[n],"resolveWith"),t[n].resolve(r)}).then(null,function(n){if(t)for(var i=0,r=t.length;i<r;i++)t[i].reject(n)})},getCachedReferenceRecord:function(n){var t=this._getReferenceById(n);return t?t.record:undefined},cachedRecordForId:function(t){var i=this.getCachedReferenceRecord(t),f,r,u;return i||(f=n(this,"primaryKey"),r={isLoaded:!1},r[f]=t,i=this.create(r),u=this.sideloadedData&&this.sideloadedData[t],u&&i.load(t,u)),i},addToRecordArrays:function(n){this._findAllRecordArray&&this._findAllRecordArray.pushObject(n),this.recordArrays&&this.recordArrays.forEach(function(t){t instanceof Ember.FilteredRecordArray?(t.registerObserversOnRecord(n),t.updateFilter()):t.pushObject(n)})},unload:function(t){this.removeFromRecordArrays(t);var i=t.get(n(this,"primaryKey"));this.removeFromCache(i)},clearCache:function(){this.sideloadedData=undefined,this._referenceCache=undefined},removeFromCache:function(n){this.sideloadedData&&this.sideloadedData[n]&&delete this.sideloadedData[n],this._referenceCache&&this._referenceCache[n]&&delete this._referenceCache[n]},removeFromRecordArrays:function(n){this._findAllRecordArray&&this._findAllRecordArray.removeObject(n),this.recordArrays&&this.recordArrays.forEach(function(t){t.removeObject(n)})},findFromCacheOrLoad:function(t){var i;return i=t[n(this,"primaryKey")]?this.cachedRecordForId(t[n(this,"primaryKey")]):this.create({isLoaded:!1}),i.load(t[n(this,"primaryKey")],t),i},registerRecordArray:function(n){this.recordArrays||(this.recordArrays=[]),this.recordArrays.push(n)},unregisterRecordArray:function(n){this.recordArrays&&Ember.A(this.recordArrays).removeObject(n)},forEachCachedRecord:function(n){if(this._referenceCache){var t=Object.keys(this._referenceCache);t.map(function(n){return this._getReferenceById(n).record},this).forEach(n)}},load:function(t){var i,f;for(Ember.typeOf(t)!=="array"&&(t=[t]),this.sideloadedData||(this.sideloadedData={}),i=0,f=t.length;i<f;i++){var r=t[i],u=r[n(this,"primaryKey")],e=this.getCachedReferenceRecord(u);e?e.load(u,r):this.sideloadedData[u]=r}},_getReferenceById:function(n){return this._referenceCache||(this._referenceCache={}),this._referenceCache[n]},_getOrCreateReferenceForId:function(n){var t=this._getReferenceById(n);return t||(t=this._createReference(n)),t},_createReference:function(n){this._referenceCache||(this._referenceCache={}),Ember.assert("The id "+n+" has alread been used with another record of type "+this.toString()+".",!n||!this._referenceCache[n]);var t={id:n,clientId:this._clientIdCounter++};return this._cacheReference(t),t},_cacheReference:function(n){this._referenceCache||(this._referenceCache={}),n.id&&(this._referenceCache[n.id]=n)}})}(),function(){var n=Ember.get;Ember.hasMany=function(n,t){t=t||{};var i={type:n,isRelationship:!0,options:t,kind:"hasMany"},r=t.key;return Ember.computed(function(){return typeof n=="string"&&(n=Ember.get(Ember.lookup,n)),this.getHasMany(r,n,i)}).property().meta(i)},Ember.Model.reopen({getHasMany:function(n,t,i){var r=i.options.embedded,f=r?Ember.EmbeddedHasManyArray:Ember.HasManyArray,u=f.create({parent:this,modelClass:t,content:this._getHasManyContent(n,t,r),embedded:r,key:n,relationshipKey:i.relationshipKey});return this._registerHasManyArray(u),u}})}(),function(){function i(){return typeof this.type=="string"&&(this.type=Ember.get(Ember.lookup,this.type)),this.type}var n=Ember.get,t=Ember.set;Ember.belongsTo=function(r,u){u=u||{};var f={type:r,isRelationship:!0,options:u,kind:"belongsTo",getType:i},e=u.key;return Ember.computed(function(i,u,o){r=f.getType();var s=n(this,"_dirtyAttributes"),h=!1;return s||(s=[],h=!0),arguments.length>1?(u&&(Ember.assert(Ember.String.fmt("Attempted to set property of type: %@ with a value of type: %@",[u.constructor,r]),u instanceof r),o!==u?s.pushObject(i):s.removeObject(i),h&&t(this,"_dirtyAttributes",s)),u===undefined?null:u):this.getBelongsTo(e,r,f)}).property("_data").meta(f)},Ember.Model.reopen({getBelongsTo:function(t,i,r){var u=n(this,"_data."+t),f,o,e;return Ember.isNone(u)?null:(r.options.embedded?(o=n(i,"primaryKey"),e=u[o],f=i.create({isLoaded:!1,id:e}),f.load(e,u)):f=i.find(u),f)}})}(),function(){function r(n,t){return t&&t.deserialize?t.deserialize(n):t&&Ember.Model.dataTypes[t]?Ember.Model.dataTypes[t].deserialize(n):n}function u(n,t){return t&&t.serialize?t.serialize(n):t&&Ember.Model.dataTypes[t]?Ember.Model.dataTypes[t].serialize(n):n}var n=Ember.get,t=Ember.set,i=Ember.meta;Ember.Model.dataTypes={},Ember.Model.dataTypes[Date]={deserialize:function(n){return n?new Date(n):null},serialize:function(n){return n?n.toISOString():null},isEqual:function(n,t){return n instanceof Date&&(n=this.serialize(n)),t instanceof Date&&(t=this.serialize(t)),n===t}},Ember.Model.dataTypes[Number]={deserialize:function(n){return!n&&n!==0?null:Number(n)},serialize:function(n){return!n&&n!==0?null:Number(n)}},Ember.attr=function(f,e){return Ember.computed(function(o,s){var h=n(this,"_data"),a=this.dataKey(o),l=h&&n(h,a),y=i(this).proto===this,c=n(this,"_dirtyAttributes"),v=!1;return(c||(c=[],v=!0),arguments.length===2)?(y&&(h||(h={},t(this,"_data",h)),l=h[a]=s),l!==u(s,f)?c.pushObject(o):c.removeObject(o),v&&t(this,"_dirtyAttributes",c),s):l==null&&e&&e.defaultValue!=null?Ember.copy(e.defaultValue):this.getAttr(o,r(l,f))}).property("_data").meta({isAttribute:!0,type:f,options:e})}}(),function(){var n=Ember.get;Ember.RESTAdapter=Ember.Adapter.extend({find:function(n,t){var i=this.buildURL(n.constructor,t),r=this;return this.ajax(i).then(function(i){return r.didFind(n,t,i),n})},didFind:function(t,i,r){var u=n(t.constructor,"rootKey"),f=u?r[u]:r;t.load(i,f)},findAll:function(n,t){var i=this.buildURL(n),r=this;return this.ajax(i).then(function(i){return r.didFindAll(n,t,i),t})},didFindAll:function(t,i,r){var u=n(t,"collectionKey"),f=u?r[u]:r;i.load(t,f)},findQuery:function(n,t,i){var r=this.buildURL(n),u=this;return this.ajax(r,i).then(function(r){return u.didFindQuery(n,t,i,r),t})},didFindQuery:function(t,i,r,u){var f=n(t,"collectionKey"),e=f?u[f]:u;i.load(t,e)},createRecord:function(n){var t=this.buildURL(n.constructor),i=this;return this.ajax(t,n.toJSON(),"POST").then(function(t){return i.didCreateRecord(n,t),n})},didCreateRecord:function(t,i){var r=n(t.constructor,"rootKey"),f=n(t.constructor,"primaryKey"),u=r?i[r]:i;t.load(u[f],u),t.didCreateRecord()},saveRecord:function(t){var i=n(t.constructor,"primaryKey"),r=this.buildURL(t.constructor,n(t,i)),u=this;return this.ajax(r,t.toJSON(),"PUT").then(function(n){return u.didSaveRecord(t,n),t})},didSaveRecord:function(n){n.didSaveRecord()},deleteRecord:function(t){var i=n(t.constructor,"primaryKey"),r=this.buildURL(t.constructor,n(t,i)),u=this;return this.ajax(r,t.toJSON(),"DELETE").then(function(n){u.didDeleteRecord(t,n)})},didDeleteRecord:function(n){n.didDeleteRecord()},ajax:function(n,t,i,r){return this._ajax(n,t,i||"GET",r)},buildURL:function(t,i){var r=n(t,"url");if(!r)throw new Error("Ember.RESTAdapter requires a `url` property to be specified");return Ember.isEmpty(i)?r+".json":r+"/"+i+".json"},ajaxSettings:function(n,t){return{url:n,type:t,dataType:"json"}},_ajax:function(n,t,i,r){return r||(r=this.ajaxSettings(n,i)),new Ember.RSVP.Promise(function(n,u){t&&(i==="GET"?r.data=t:(r.contentType="application/json; charset=utf-8",r.data=JSON.stringify(t))),r.success=function(t){Ember.run(null,n,t)},r.error=function(n){n&&(n.then=null),Ember.run(null,u,n)},Ember.$.ajax(r)})}})}(),function(){var n=Ember.get;Ember.LoadPromise=Ember.Object.extend(Ember.DeferredMixin,{init:function(){this._super.apply(this,arguments);var t=n(this,"target");if(n(t,"isLoaded")&&!n(t,"isNew"))this.resolve(t);else t.one("didLoad",this,function(){this.resolve(t)})}}),Ember.loadPromise=function(n){return Ember.isNone(n)?null:n.then?n:Ember.LoadPromise.create({target:n})}}(),function(){if(Ember.DataAdapter){var n=Ember.get,t=Ember.String.capitalize,i=Ember.String.underscore,r=Ember.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(n){return n!==Ember.Model&&Ember.Model.detect(n)},columnsForType:function(n){var r=[],u=0,f=this;return n.getAttributes().forEach(function(n){if(u++>f.attributeLimit)return!1;var e=t(i(n).replace("_"," "));r.push({name:n,desc:e})}),r},getRecords:function(n){var t=[];return n.forEachCachedRecord(function(n){t.push(n)}),t},getRecordColumnValues:function(t){var r=this,u=0,i={id:n(t,"id")};return t.constructor.getAttributes().forEach(function(f){if(u++>r.attributeLimit)return!1;var e=n(t,f);i[f]=e}),i},getRecordKeywords:function(t){var i=[],r=Ember.A(["id"]);return t.constructor.getAttributes().forEach(function(n){r.push(n)}),r.forEach(function(r){i.push(n(t,r))}),i},getRecordFilterValues:function(n){return{isNew:n.get("isNew"),isModified:n.get("isDirty")&&!n.get("isNew"),isClean:!n.get("isDirty")}},getRecordColor:function(n){var t="black";return n.get("isNew")?t="green":n.get("isDirty")&&(t="blue"),t},observeRecord:function(n,t){var i=Ember.A(),u=this,r=Ember.A(["id","isNew","isDirty"]);return n.constructor.getAttributes().forEach(function(n){r.push(n)}),r.forEach(function(r){var f=function(){t(u.wrapRecord(n))};Ember.addObserver(n,r,f),i.push(function(){Ember.removeObserver(n,r,f)})}),function(){i.forEach(function(n){n()})}}});Ember.onLoad("Ember.Application",function(n){n.initializer({name:"dataAdapter",initialize:function(n,t){t.register("dataAdapter:main",r)}})})}}()
|
1 |
+
!function(){var VERSION="0.0.14";Ember.libraries&&Ember.libraries.register("Ember Model",VERSION)}(),function(){function mustImplement(message){var fn=function(){var className=this.constructor.toString();throw new Error(message.replace("{{className}}",className))};return fn.isUnimplemented=!0,fn}Ember.Adapter=Ember.Object.extend({find:mustImplement("{{className}} must implement find"),findQuery:mustImplement("{{className}} must implement findQuery"),findMany:mustImplement("{{className}} must implement findMany"),findAll:mustImplement("{{className}} must implement findAll"),createRecord:mustImplement("{{className}} must implement createRecord"),saveRecord:mustImplement("{{className}} must implement saveRecord"),deleteRecord:mustImplement("{{className}} must implement deleteRecord"),load:function(record,id,data){record.load(id,data)}})}(),function(){var get=Ember.get,set=Ember.set;Ember.FixtureAdapter=Ember.Adapter.extend({_counter:0,_findData:function(klass,id){var fixtures=klass.FIXTURES,idAsString=id.toString(),primaryKey=get(klass,"primaryKey"),data=Ember.A(fixtures).find(function(el){return el[primaryKey].toString()===idAsString});return data},_setPrimaryKey:function(record){var klass=record.constructor,primaryKey=(klass.FIXTURES,get(klass,"primaryKey"));record.get(primaryKey)||set(record,primaryKey,this._generatePrimaryKey())},_generatePrimaryKey:function(){var counter=this.get("_counter");return this.set("_counter",counter+1),"fixture-"+counter},find:function(record,id){var data=this._findData(record.constructor,id);return new Ember.RSVP.Promise(function(resolve){Ember.run.later(this,function(){Ember.run(record,record.load,id,data),resolve(record)},0)})},findMany:function(klass,records,ids){for(var requestedData=(klass.FIXTURES,[]),i=0,l=ids.length;l>i;i++)requestedData.push(this._findData(klass,ids[i]));return new Ember.RSVP.Promise(function(resolve){Ember.run.later(this,function(){Ember.run(records,records.load,klass,requestedData),resolve(records)},0)})},findAll:function(klass,records){var fixtures=klass.FIXTURES;return new Ember.RSVP.Promise(function(resolve){Ember.run.later(this,function(){Ember.run(records,records.load,klass,fixtures),resolve(records)},0)})},createRecord:function(record){var klass=record.constructor,fixtures=klass.FIXTURES,self=this;return new Ember.RSVP.Promise(function(resolve){Ember.run.later(this,function(){var json,rootKey=record.constructor.rootKey;self._setPrimaryKey(record),json=rootKey?record.toJSON()[rootKey]:record.toJSON(),fixtures.push(klass.findFromCacheOrLoad(json)),record.didCreateRecord(),resolve(record)},0)})},saveRecord:function(record){return new Ember.RSVP.Promise(function(resolve){Ember.run.later(this,function(){record.didSaveRecord(),resolve(record)},0)})},deleteRecord:function(record){return new Ember.RSVP.Promise(function(resolve){Ember.run.later(this,function(){record.didDeleteRecord(),resolve(record)},0)})}})}(),function(){var get=Ember.get,set=Ember.set;Ember.RecordArray=Ember.ArrayProxy.extend(Ember.Evented,{isLoaded:!1,isLoading:Ember.computed.not("isLoaded"),load:function(klass,data){set(this,"content",this.materializeData(klass,data)),this.notifyLoaded()},loadForFindMany:function(klass){var self=this,content=get(this,"_ids").map(function(id){return klass.cachedRecordForId(id,self.container)});set(this,"content",Ember.A(content)),this.notifyLoaded()},notifyLoaded:function(){set(this,"isLoaded",!0),this.trigger("didLoad")},materializeData:function(klass,data){var self=this;return Ember.A(data.map(function(el){return klass.findFromCacheOrLoad(el,self.container)}))},reload:function(){var promises,modelClass=this.get("modelClass"),self=this;return set(this,"isLoaded",!1),modelClass._findAllRecordArray===this?modelClass.adapter.findAll(modelClass,this):this._query?modelClass.adapter.findQuery(modelClass,this,this._query):(promises=this.map(function(record){return record.reload()}),Ember.RSVP.all(promises).then(function(){self.notifyLoaded()}))}})}(),function(){var get=Ember.get;Ember.FilteredRecordArray=Ember.RecordArray.extend({init:function(){if(!get(this,"modelClass"))throw new Error("FilteredRecordArrays must be created with a modelClass");if(!get(this,"filterFunction"))throw new Error("FilteredRecordArrays must be created with a filterFunction");if(!get(this,"filterProperties"))throw new Error("FilteredRecordArrays must be created with filterProperties");var modelClass=get(this,"modelClass");modelClass.registerRecordArray(this),this.registerObservers(),this.updateFilter(),this._super()},updateFilter:function(){var self=this,results=[];get(this,"modelClass").forEachCachedRecord(function(record){self.filterFunction(record)&&results.push(record)}),this.set("content",Ember.A(results))},updateFilterForRecord:function(record){var results=get(this,"content");this.filterFunction(record)&&!results.contains(record)&&results.pushObject(record)},registerObservers:function(){var self=this;get(this,"modelClass").forEachCachedRecord(function(record){self.registerObserversOnRecord(record)})},registerObserversOnRecord:function(record){for(var self=this,filterProperties=get(this,"filterProperties"),i=0,l=get(filterProperties,"length");l>i;i++)record.addObserver(filterProperties[i],self,"updateFilterForRecord")}})}(),function(){var get=Ember.get,set=Ember.set;Ember.ManyArray=Ember.RecordArray.extend({_records:null,originalContent:null,_modifiedRecords:null,unloadObject:function(record){var obj=get(this,"content").findBy("clientId",record._reference.clientId);get(this,"content").removeObject(obj);var originalObj=get(this,"originalContent").findBy("clientId",record._reference.clientId);get(this,"originalContent").removeObject(originalObj)},isDirty:function(){var originalContent=get(this,"originalContent"),originalContentLength=get(originalContent,"length"),content=get(this,"content"),contentLength=get(content,"length");if(originalContentLength!==contentLength)return!0;if(this._modifiedRecords&&this._modifiedRecords.length)return!0;for(var isDirty=!1,i=0,l=contentLength;l>i;i++)if(!originalContent.contains(content[i])){isDirty=!0;break}return isDirty}.property("content.[]","originalContent.[]","_modifiedRecords.[]"),objectAtContent:function(idx){var content=get(this,"content");if(content.length){var observerNeeded=content[idx].record?!1:!0,record=this.materializeRecord(idx,this.container);if(observerNeeded){var isDirtyRecord=record.get("isDirty"),isNewRecord=record.get("isNew");(isDirtyRecord||isNewRecord)&&this._modifiedRecords.pushObject(content[idx]),Ember.addObserver(content[idx],"record.isDirty",this,"recordStateChanged"),record.registerParentHasManyArray(this)}return record}},save:function(){return Ember.RSVP.all(this.map(function(record){return record.save()}))},replaceContent:function(index,removed,added){added=Ember.EnumerableUtils.map(added,function(record){return record._reference},this),this._super(index,removed,added)},_contentWillChange:function(){var content=get(this,"content");content&&(this.arrayWillChange(content,0,get(content,"length"),0),content.removeArrayObserver(this),this._setupOriginalContent(content))}.observesBefore("content"),_contentDidChange:function(){var content=get(this,"content");content&&(content.addArrayObserver(this),this.arrayDidChange(content,0,0,get(content,"length")))}.observes("content"),arrayWillChange:function(item,idx,removedCnt){for(var content=item,i=idx;idx+removedCnt>i;i++){var currentItem=content[i];currentItem&¤tItem.record&&(this._modifiedRecords.removeObject(currentItem),currentItem.record.unregisterParentHasManyArray(this),Ember.removeObserver(currentItem,"record.isDirty",this,"recordStateChanged"))}},arrayDidChange:function(item,idx,removedCnt,addedCnt){for(var parent=get(this,"parent"),relationshipKey=get(this,"relationshipKey"),isDirty=get(this,"isDirty"),content=item,i=idx;idx+addedCnt>i;i++){var currentItem=content[i];if(currentItem&¤tItem.record){var isDirtyRecord=currentItem.record.get("isDirty"),isNewRecord=currentItem.record.get("isNew");(isDirtyRecord||isNewRecord)&&this._modifiedRecords.pushObject(currentItem),Ember.addObserver(currentItem,"record.isDirty",this,"recordStateChanged"),currentItem.record.registerParentHasManyArray(this)}}isDirty?parent._relationshipBecameDirty(relationshipKey):parent._relationshipBecameClean(relationshipKey)},load:function(content){Ember.setProperties(this,{content:content,originalContent:content.slice()}),set(this,"_modifiedRecords",[])},revert:function(){this._setupOriginalContent()},_setupOriginalContent:function(content){content=content||get(this,"content"),content&&set(this,"originalContent",content.slice()),set(this,"_modifiedRecords",[])},init:function(){this._super(),this._setupOriginalContent(),this._contentDidChange()},recordStateChanged:function(obj){var parent=get(this,"parent"),relationshipKey=get(this,"relationshipKey");obj.record.get("isDirty")?(-1===this._modifiedRecords.indexOf(obj)&&this._modifiedRecords.pushObject(obj),parent._relationshipBecameDirty(relationshipKey)):(this._modifiedRecords.indexOf(obj)>-1&&this._modifiedRecords.removeObject(obj),this.get("isDirty")||parent._relationshipBecameClean(relationshipKey))}}),Ember.HasManyArray=Ember.ManyArray.extend({materializeRecord:function(idx,container){var klass=get(this,"modelClass"),content=get(this,"content"),reference=content.objectAt(idx),record=reference.record;return record?(record.container||(record.container=container),record):klass._findFetchById(reference.id,!1,container)},toJSON:function(){var ids=[],content=this.get("content");return content.forEach(function(reference){reference.id&&ids.push(reference.id)}),ids}}),Ember.EmbeddedHasManyArray=Ember.ManyArray.extend({create:function(attrs){var klass=get(this,"modelClass"),record=klass.create(attrs);return this.pushObject(record),record},materializeRecord:function(idx,container){var record,klass=get(this,"modelClass"),primaryKey=get(klass,"primaryKey"),content=get(this,"content"),reference=content.objectAt(idx),attrs=reference.data;return reference.record?record=reference.record:(record=klass.create({_reference:reference,container:container}),reference.record=record,attrs&&record.load(attrs[primaryKey],attrs)),record.container=container,record},toJSON:function(){return this.map(function(record){return record.toJSON()})}})}(),function(){function contains(array,element){for(var i=0,l=array.length;l>i;i++)if(array[i]===element)return!0;return!1}function concatUnique(toArray,fromArray){for(var e,i=0,l=fromArray.length;l>i;i++)e=fromArray[i],contains(toArray,e)||toArray.push(e);return toArray}var get=Ember.get,set=Ember.set,underscore=(Ember.setProperties,Ember.meta,Ember.String.underscore);Ember.run.queues.push("data"),Ember.Model=Ember.Object.extend(Ember.Evented,{isLoaded:!0,isLoading:Ember.computed.not("isLoaded"),isNew:!0,isDeleted:!1,_dirtyAttributes:null,getAttr:function(key,value){return value},isDirty:function(){var dirtyAttributes=get(this,"_dirtyAttributes");return dirtyAttributes&&0!==dirtyAttributes.length||!1}.property("_dirtyAttributes.length"),_relationshipBecameDirty:function(name){var dirtyAttributes=get(this,"_dirtyAttributes");dirtyAttributes.contains(name)||dirtyAttributes.pushObject(name)},_relationshipBecameClean:function(name){var dirtyAttributes=get(this,"_dirtyAttributes");dirtyAttributes.removeObject(name)},dataKey:function(key){var camelizeKeys=get(this.constructor,"camelizeKeys"),meta=this.constructor.metaForProperty(key);return meta.options&&meta.options.key?camelizeKeys?underscore(meta.options.key):meta.options.key:camelizeKeys?underscore(key):key},init:function(){this._createReference(),this._dirtyAttributes||set(this,"_dirtyAttributes",[]),this._super()},_createReference:function(){var reference=this._reference,id=this.getPrimaryKey();return reference?reference.id!==id&&(reference.id=id,this.constructor._cacheReference(reference)):(reference=this.constructor._getOrCreateReferenceForId(id),reference.record=this,this._reference=reference),reference.id||(reference.id=id),reference},getPrimaryKey:function(){return get(this,get(this.constructor,"primaryKey"))},load:function(id,hash){var data={};data[get(this.constructor,"primaryKey")]=id,set(this,"_data",Ember.merge(data,hash)),this.getWithDefault("_dirtyAttributes",[]).clear(),this._reloadHasManys();for(var relationshipKey,relationship,relationshipMeta,relationshipData,relationshipType,relationships=this.constructor._relationships||[],meta=Ember.meta(this),i=0,l=relationships.length;l>i;i++)relationshipKey=relationships[i],relationship=meta.descs[relationshipKey],relationshipMeta=relationship.meta(),relationshipMeta.options.embedded&&(relationshipType=relationshipMeta.type,"string"==typeof relationshipType&&(relationshipType=Ember.get(Ember.lookup,relationshipType)||this.container.lookupFactory("model:"+relationshipType)),relationshipData=data[relationshipKey],relationshipData&&relationshipType.load(relationshipData));set(this,"isNew",!1),set(this,"isLoaded",!0),this._createReference(),this.trigger("didLoad")},didDefineProperty:function(proto,key,value){if(value instanceof Ember.Descriptor){var meta=value.meta(),klass=proto.constructor;meta.isAttribute?(klass._attributes||(klass._attributes=[]),klass._attributes.push(key)):meta.isRelationship&&(klass._relationships||(klass._relationships=[]),klass._relationships.push(key),meta.relationshipKey=key)}},serializeHasMany:function(key){return this.get(key).toJSON()},serializeBelongsTo:function(key,meta){if(meta.options.embedded){var record=this.get(key);return record?record.toJSON():null}var primaryKey=get(meta.getType(this),"primaryKey");return this.get(key+"."+primaryKey)},toJSON:function(){var key,meta,json={},attributes=this.constructor.getAttributes(),relationships=this.constructor.getRelationships(),properties=attributes?this.getProperties(attributes):{},rootKey=get(this.constructor,"rootKey");for(key in properties)meta=this.constructor.metaForProperty(key),json[this.dataKey(key)]=meta.type&&meta.type.serialize?meta.type.serialize(properties[key]):meta.type&&Ember.Model.dataTypes[meta.type]?Ember.Model.dataTypes[meta.type].serialize(properties[key]):properties[key];if(relationships)for(var data,relationshipKey,i=0;i<relationships.length;i++)key=relationships[i],meta=this.constructor.metaForProperty(key),relationshipKey=meta.options.key||key,data="belongsTo"===meta.kind?this.serializeBelongsTo(key,meta):this.serializeHasMany(key,meta),json[relationshipKey]=data;if(rootKey){var jsonRoot={};return jsonRoot[rootKey]=json,jsonRoot}return json},save:function(){var adapter=this.constructor.adapter;if(set(this,"isSaving",!0),get(this,"isNew"))return adapter.createRecord(this);if(get(this,"isDirty"))return adapter.saveRecord(this);var self=this,promise=new Ember.RSVP.Promise(function(resolve){resolve(self)});return set(this,"isSaving",!1),promise},reload:function(){return this.getWithDefault("_dirtyAttributes",[]).clear(),this.constructor.reload(this.get(get(this.constructor,"primaryKey")),this.container)},revert:function(){this.getWithDefault("_dirtyAttributes",[]).clear(),this.notifyPropertyChange("_data"),this._reloadHasManys(!0)},didCreateRecord:function(){{var primaryKey=get(this.constructor,"primaryKey");get(this,primaryKey)}set(this,"isNew",!1),set(this,"_dirtyAttributes",[]),this.constructor.addToRecordArrays(this),this.trigger("didCreateRecord"),this.didSaveRecord()},didSaveRecord:function(){set(this,"isSaving",!1),this.trigger("didSaveRecord"),this.get("isDirty")&&this._copyDirtyAttributesToData()},deleteRecord:function(){return this.constructor.adapter.deleteRecord(this)},didDeleteRecord:function(){this.constructor.removeFromRecordArrays(this),set(this,"isDeleted",!0),this.trigger("didDeleteRecord")},_copyDirtyAttributesToData:function(){if(this._dirtyAttributes){var key,dirtyAttributes=this._dirtyAttributes,data=get(this,"_data");data||(data={},set(this,"_data",data));for(var i=0,l=dirtyAttributes.length;l>i;i++)key=dirtyAttributes[i],data[this.dataKey(key)]=this.cacheFor(key);set(this,"_dirtyAttributes",[]),this._resetDirtyStateInNestedObjects(this)}},_resetDirtyStateInNestedObjects:function(object){var i,obj;if(object._hasManyArrays)for(i=0;i<object._hasManyArrays.length;i++){var array=object._hasManyArrays[i];if(array.revert(),array.embedded)for(var j=0;j<array.get("length");j++)obj=array.objectAt(j),obj._copyDirtyAttributesToData()}if(object._belongsTo)for(i=0;i<object._belongsTo.length;i++){var belongsTo=object._belongsTo[i];belongsTo.options.embedded&&(obj=this.get(belongsTo.relationshipKey),obj&&obj._copyDirtyAttributesToData())}},_registerHasManyArray:function(array){this._hasManyArrays||(this._hasManyArrays=Ember.A([])),this._hasManyArrays.pushObject(array)},registerParentHasManyArray:function(array){this._parentHasManyArrays||(this._parentHasManyArrays=Ember.A([])),this._parentHasManyArrays.pushObject(array)},unregisterParentHasManyArray:function(array){this._parentHasManyArrays&&this._parentHasManyArrays.removeObject(array)},_reloadHasManys:function(reverting){if(this._hasManyArrays){var i,j;for(i=0;i<this._hasManyArrays.length;i++){var array=this._hasManyArrays[i],hasManyContent=this._getHasManyContent(get(array,"key"),get(array,"modelClass"),get(array,"embedded"));if(!reverting)for(j=0;j<array.get("length");j++)array.objectAt(j).get("isNew")&&!array.objectAt(j).get("isDeleted")&&hasManyContent.addObject(array.objectAt(j)._reference);array.load(hasManyContent)}}},_getHasManyContent:function(key,type,embedded){var content=get(this,"_data."+key);if(content){var mapFunction,primaryKey,reference;embedded?(primaryKey=get(type,"primaryKey"),mapFunction=function(attrs){return reference=type._getOrCreateReferenceForId(attrs[primaryKey]),reference.data=attrs,reference}):mapFunction=function(id){return type._getOrCreateReferenceForId(id)},content=Ember.EnumerableUtils.map(content,mapFunction)}return Ember.A(content||[])},_registerBelongsTo:function(key){this._belongsTo||(this._belongsTo=Ember.A([])),this._belongsTo.pushObject(key)}}),Ember.Model.reopenClass({primaryKey:"id",adapter:Ember.Adapter.create(),_clientIdCounter:1,getAttributes:function(){this.proto();var attributes=this._attributes||[];return"function"==typeof this.superclass.getAttributes&&(attributes=this.superclass.getAttributes().concat(attributes)),attributes},getRelationships:function(){this.proto();var relationships=this._relationships||[];return"function"==typeof this.superclass.getRelationships&&(relationships=this.superclass.getRelationships().concat(relationships)),relationships},fetch:function(id){return arguments.length?Ember.isArray(id)?this._findFetchMany(id,!0):"object"==typeof id?this._findFetchQuery(id,!0):this._findFetchById(id,!0):this._findFetchAll(!0)},find:function(id){return arguments.length?Ember.isArray(id)?this._findFetchMany(id,!1):"object"==typeof id?this._findFetchQuery(id,!1):this._findFetchById(id,!1):this._findFetchAll(!1)},findQuery:function(params){return this._findFetchQuery(params,!1)},fetchQuery:function(params){return this._findFetchQuery(params,!0)},_findFetchQuery:function(params,isFetch,container){var records=Ember.RecordArray.create({modelClass:this,_query:params,container:container}),promise=this.adapter.findQuery(this,records,params);return isFetch?promise:records},findMany:function(ids){return this._findFetchMany(ids,!1)},fetchMany:function(ids){return this._findFetchMany(ids,!0)},_findFetchMany:function(ids,isFetch,container){Ember.assert("findFetchMany requires an array",Ember.isArray(ids));var deferred,records=Ember.RecordArray.create({_ids:ids,modelClass:this,container:container});return this.recordArrays||(this.recordArrays=[]),this.recordArrays.push(records),this._currentBatchIds?(concatUnique(this._currentBatchIds,ids),this._currentBatchRecordArrays.push(records)):(this._currentBatchIds=concatUnique([],ids),this._currentBatchRecordArrays=[records]),isFetch&&(deferred=Ember.RSVP.defer(),Ember.set(deferred,"resolveWith",records),this._currentBatchDeferreds||(this._currentBatchDeferreds=[]),this._currentBatchDeferreds.push(deferred)),Ember.run.scheduleOnce("data",this,this._executeBatch,container),isFetch?deferred.promise:records},findAll:function(){return this._findFetchAll(!1)},fetchAll:function(){return this._findFetchAll(!0)},_findFetchAll:function(isFetch,container){var self=this,currentFetchPromise=this._currentFindFetchAllPromise;if(isFetch&¤tFetchPromise)return currentFetchPromise;if(this._findAllRecordArray)return isFetch?new Ember.RSVP.Promise(function(resolve){resolve(self._findAllRecordArray)}):this._findAllRecordArray;var records=this._findAllRecordArray=Ember.RecordArray.create({modelClass:this,container:container}),promise=this._currentFindFetchAllPromise=this.adapter.findAll(this,records);return promise["finally"](function(){self._currentFindFetchAllPromise=null}),promise.then&&promise.then(null,function(){return self._findAllRecordArray=null,Ember.RSVP.reject.apply(null,arguments)}),isFetch?promise:records},findById:function(id){return this._findFetchById(id,!1)},fetchById:function(id){return this._findFetchById(id,!0)},_findFetchById:function(id,isFetch,container){{var deferredOrPromise,record=this.cachedRecordForId(id,container),isLoaded=get(record,"isLoaded");get(this,"adapter")}return isLoaded?isFetch?new Ember.RSVP.Promise(function(resolve){resolve(record)}):record:(deferredOrPromise=this._fetchById(record,id),isFetch?deferredOrPromise:record)},_currentBatchIds:null,_currentBatchRecordArrays:null,_currentBatchDeferreds:null,reload:function(id,container){var record=this.cachedRecordForId(id,container);return record.set("isLoaded",!1),this._fetchById(record,id)},_fetchById:function(record,id){var deferred,adapter=get(this,"adapter");return adapter.findMany&&!adapter.findMany.isUnimplemented?(this._currentBatchIds?contains(this._currentBatchIds,id)||this._currentBatchIds.push(id):(this._currentBatchIds=[id],this._currentBatchRecordArrays=[]),deferred=Ember.RSVP.defer(),Ember.set(deferred,"resolveWith",record),this._currentBatchDeferreds||(this._currentBatchDeferreds=[]),this._currentBatchDeferreds.push(deferred),Ember.run.scheduleOnce("data",this,this._executeBatch,record.container),deferred.promise):adapter.find(record,id)},_executeBatch:function(container){var promise,i,batchIds=this._currentBatchIds,batchRecordArrays=this._currentBatchRecordArrays,batchDeferreds=this._currentBatchDeferreds,self=this,requestIds=[];for(this._currentBatchIds=null,this._currentBatchRecordArrays=null,this._currentBatchDeferreds=null,i=0;i<batchIds.length;i++)this.cachedRecordForId(batchIds[i]).get("isLoaded")||requestIds.push(batchIds[i]);if(1===requestIds.length)promise=get(this,"adapter").find(this.cachedRecordForId(requestIds[0],container),requestIds[0]);else{var recordArray=Ember.RecordArray.create({_ids:batchIds,container:container});0===requestIds.length?(promise=new Ember.RSVP.Promise(function(resolve){resolve(recordArray)}),recordArray.notifyLoaded()):promise=get(this,"adapter").findMany(this,recordArray,requestIds)}promise.then(function(){for(var i=0,l=batchRecordArrays.length;l>i;i++)batchRecordArrays[i].loadForFindMany(self);if(batchDeferreds)for(i=0,l=batchDeferreds.length;l>i;i++){var resolveWith=Ember.get(batchDeferreds[i],"resolveWith");batchDeferreds[i].resolve(resolveWith)}}).then(null,function(errorXHR){if(batchDeferreds)for(var i=0,l=batchDeferreds.length;l>i;i++)batchDeferreds[i].reject(errorXHR)})},getCachedReferenceRecord:function(id,container){var ref=this._getReferenceById(id);return ref&&ref.record?(ref.record.container||(ref.record.container=container),ref.record):void 0},cachedRecordForId:function(id,container){var record;if(this["transient"]||(record=this.getCachedReferenceRecord(id,container)),!record){var primaryKey=get(this,"primaryKey"),attrs={isLoaded:!1};if(attrs[primaryKey]=id,attrs.container=container,record=this.create(attrs),!this["transient"]){var sideloadedData=this.sideloadedData&&this.sideloadedData[id];sideloadedData&&record.load(id,sideloadedData)}}return record},addToRecordArrays:function(record){this._findAllRecordArray&&this._findAllRecordArray.addObject(record),this.recordArrays&&this.recordArrays.forEach(function(recordArray){recordArray instanceof Ember.FilteredRecordArray?(recordArray.registerObserversOnRecord(record),recordArray.updateFilter()):recordArray.addObject(record)})},unload:function(record){this.removeFromHasManyArrays(record),this.removeFromRecordArrays(record);var primaryKey=record.get(get(this,"primaryKey"));this.removeFromCache(primaryKey)},clearCache:function(){this.sideloadedData=void 0,this._referenceCache=void 0,this._findAllRecordArray=void 0},removeFromCache:function(key){this.sideloadedData&&this.sideloadedData[key]&&delete this.sideloadedData[key],this._referenceCache&&this._referenceCache[key]&&delete this._referenceCache[key]},removeFromHasManyArrays:function(record){record._parentHasManyArrays&&(record._parentHasManyArrays.forEach(function(hasManyArray){hasManyArray.unloadObject(record)}),record._parentHasManyArrays=null)},removeFromRecordArrays:function(record){this._findAllRecordArray&&this._findAllRecordArray.removeObject(record),this.recordArrays&&this.recordArrays.forEach(function(recordArray){recordArray.removeObject(record)})},findFromCacheOrLoad:function(data,container){var record;return record=data[get(this,"primaryKey")]?this.cachedRecordForId(data[get(this,"primaryKey")],container):this.create({isLoaded:!1,container:container}),record.load(data[get(this,"primaryKey")],data),record},registerRecordArray:function(recordArray){this.recordArrays||(this.recordArrays=[]),this.recordArrays.push(recordArray)},unregisterRecordArray:function(recordArray){this.recordArrays&&Ember.A(this.recordArrays).removeObject(recordArray)},forEachCachedRecord:function(callback){if(this._referenceCache){var ids=Object.keys(this._referenceCache);ids.map(function(id){return this._getReferenceById(id).record},this).forEach(callback)}},load:function(hashes,container){"array"!==Ember.typeOf(hashes)&&(hashes=[hashes]),this.sideloadedData||(this.sideloadedData={});for(var i=0,l=hashes.length;l>i;i++){var hash=hashes[i],primaryKey=hash[get(this,"primaryKey")],record=this.getCachedReferenceRecord(primaryKey,container);record?record.load(primaryKey,hash):this.sideloadedData[primaryKey]=hash}},_getReferenceById:function(id){return this._referenceCache||(this._referenceCache={}),this._referenceCache[id]},_getOrCreateReferenceForId:function(id){var reference=this._getReferenceById(id);return reference||(reference=this._createReference(id)),reference},_createReference:function(id){this._referenceCache||(this._referenceCache={}),Ember.assert("The id "+id+" has already been used with another record of type "+this.toString()+".",!id||!this._referenceCache[id]);var reference={id:id,clientId:this._clientIdCounter++};return this._cacheReference(reference),reference},_cacheReference:function(reference){this._referenceCache||(this._referenceCache={}),Ember.isEmpty(reference.id)||(this._referenceCache[reference.id]=reference)}})}(),function(){function getType(record){var type=this.type;if("string"==typeof this.type&&this.type&&(this.type=get(Ember.lookup,this.type),!this.type)){var store=record.container.lookup("store:main");this.type=store.modelFor(type),this.type.reopenClass({adapter:store.adapterFor(type)})}return this.type}var get=Ember.get;Ember.hasMany=function(type,options){options=options||{};var meta={type:type,isRelationship:!0,options:options,kind:"hasMany",getType:getType};return Ember.computed(function(propertyKey,newContentArray,existingArray){type=meta.getType(this),Ember.assert("Type cannot be empty",!Ember.isEmpty(type));var key=options.key||propertyKey;return arguments.length>1?existingArray.setObjects(newContentArray):this.getHasMany(key,type,meta,this.container)}).property().meta(meta)},Ember.Model.reopen({getHasMany:function(key,type,meta,container){var embedded=meta.options.embedded,collectionClass=embedded?Ember.EmbeddedHasManyArray:Ember.HasManyArray,collection=collectionClass.create({parent:this,modelClass:type,content:this._getHasManyContent(key,type,embedded),embedded:embedded,key:key,relationshipKey:meta.relationshipKey,container:container});return this._registerHasManyArray(collection),collection}})}(),function(){function storeFor(record){return record.container?record.container.lookup("store:main"):null}function getType(record){var type=this.type;if("string"==typeof this.type&&this.type&&(type=Ember.get(Ember.lookup,this.type),!type)){var store=storeFor(record);type=store.modelFor(this.type),type.reopenClass({adapter:store.adapterFor(this.type)})}return type}var get=Ember.get,set=Ember.set;Ember.belongsTo=function(type,options){options=options||{};var meta={type:type,isRelationship:!0,options:options,kind:"belongsTo",getType:getType};return Ember.computed(function(propertyKey,value,oldValue){type=meta.getType(this),Ember.assert("Type cannot be empty.",!Ember.isEmpty(type));var key=options.key||propertyKey,dirtyAttributes=get(this,"_dirtyAttributes"),createdDirtyAttributes=!1,self=this,dirtyChanged=function(sender){sender.get("isDirty")?self._relationshipBecameDirty(propertyKey):self._relationshipBecameClean(propertyKey)};if(dirtyAttributes||(dirtyAttributes=[],createdDirtyAttributes=!0),arguments.length>1)return value&&Ember.assert(Ember.String.fmt("Attempted to set property of type: %@ with a value of type: %@",[value.constructor,type]),value instanceof type),oldValue!==value?dirtyAttributes.pushObject(propertyKey):dirtyAttributes.removeObject(propertyKey),createdDirtyAttributes&&set(this,"_dirtyAttributes",dirtyAttributes),meta.options.embedded&&(oldValue&&oldValue.removeObserver("isDirty",dirtyChanged),value&&value.addObserver("isDirty",dirtyChanged)),void 0===value?null:value;var store=storeFor(this);return value=this.getBelongsTo(key,type,meta,store),this._registerBelongsTo(meta),null!==value&&meta.options.embedded&&(value.get("isDirty"),value.addObserver("isDirty",dirtyChanged)),value}).property("_data").meta(meta)},Ember.Model.reopen({getBelongsTo:function(key,type,meta,store){var record,idOrAttrs=get(this,"_data."+key);if(Ember.isNone(idOrAttrs))return null;if(meta.options.embedded){var primaryKey=get(type,"primaryKey"),id=idOrAttrs[primaryKey];record=type.create({isLoaded:!1,id:id,container:this.container}),record.load(id,idOrAttrs)}else record=store?store._findSync(meta.type,idOrAttrs):type.find(idOrAttrs);return record}})}(),function(){function deserialize(value,type){return type&&type.deserialize?type.deserialize(value):type&&Ember.Model.dataTypes[type]?Ember.Model.dataTypes[type].deserialize(value):value}function serialize(value,type){return type&&type.serialize?type.serialize(value):type&&Ember.Model.dataTypes[type]?Ember.Model.dataTypes[type].serialize(value):value}var get=Ember.get,set=Ember.set,meta=Ember.meta;Ember.Model.dataTypes={},Ember.Model.dataTypes[Date]={deserialize:function(string){return string?new Date(string):null},serialize:function(date){return date?date.toISOString():null},isEqual:function(obj1,obj2){return obj1 instanceof Date&&(obj1=this.serialize(obj1)),obj2 instanceof Date&&(obj2=this.serialize(obj2)),obj1===obj2}},Ember.Model.dataTypes[Number]={deserialize:function(string){return string||0===string?Number(string):null},serialize:function(number){return number||0===number?Number(number):null}},Ember.attr=function(type,options){return Ember.computed(function(key,value){var data=get(this,"_data"),dataKey=this.dataKey(key),dataValue=data&&get(data,dataKey),beingCreated=meta(this).proto===this,dirtyAttributes=get(this,"_dirtyAttributes"),createdDirtyAttributes=!1;return dirtyAttributes||(dirtyAttributes=[],createdDirtyAttributes=!0),2===arguments.length?(beingCreated&&(data||(data={},set(this,"_data",data)),dataValue=data[dataKey]=value),dataValue!==serialize(value,type)?dirtyAttributes.pushObject(key):dirtyAttributes.removeObject(key),createdDirtyAttributes&&set(this,"_dirtyAttributes",dirtyAttributes),value):null==dataValue&&options&&null!=options.defaultValue?Ember.copy(options.defaultValue):this.getAttr(key,deserialize(dataValue,type))
|
2 |
+
}).property("_data").meta({isAttribute:!0,type:type,options:options})}}(),function(){var get=Ember.get;Ember.RESTAdapter=Ember.Adapter.extend({find:function(record,id){var url=this.buildURL(record.constructor,id),self=this;return this.ajax(url).then(function(data){return self.didFind(record,id,data),record})},didFind:function(record,id,data){var rootKey=get(record.constructor,"rootKey"),dataToLoad=rootKey?get(data,rootKey):data;record.load(id,dataToLoad)},findAll:function(klass,records){var url=this.buildURL(klass),self=this;return this.ajax(url).then(function(data){return self.didFindAll(klass,records,data),records})},didFindAll:function(klass,records,data){var collectionKey=get(klass,"collectionKey"),dataToLoad=collectionKey?get(data,collectionKey):data;records.load(klass,dataToLoad)},findQuery:function(klass,records,params){var url=this.buildURL(klass),self=this;return this.ajax(url,params).then(function(data){return self.didFindQuery(klass,records,params,data),records})},didFindQuery:function(klass,records,params,data){var collectionKey=get(klass,"collectionKey"),dataToLoad=collectionKey?get(data,collectionKey):data;records.load(klass,dataToLoad)},createRecord:function(record){var url=this.buildURL(record.constructor),self=this;return this.ajax(url,record.toJSON(),"POST").then(function(data){return self.didCreateRecord(record,data),record})},didCreateRecord:function(record,data){this._loadRecordFromData(record,data),record.didCreateRecord()},saveRecord:function(record){var primaryKey=get(record.constructor,"primaryKey"),url=this.buildURL(record.constructor,get(record,primaryKey)),self=this;return this.ajax(url,record.toJSON(),"PUT").then(function(data){return self.didSaveRecord(record,data),record})},didSaveRecord:function(record,data){this._loadRecordFromData(record,data),record.didSaveRecord()},deleteRecord:function(record){var primaryKey=get(record.constructor,"primaryKey"),url=this.buildURL(record.constructor,get(record,primaryKey)),self=this;return this.ajax(url,record.toJSON(),"DELETE").then(function(data){self.didDeleteRecord(record,data)})},didDeleteRecord:function(record){record.didDeleteRecord()},ajax:function(url,params,method,settings){return this._ajax(url,params,method||"GET",settings)},buildURL:function(klass,id){var urlRoot=get(klass,"url"),urlSuffix=get(klass,"urlSuffix")||"";if(!urlRoot)throw new Error("Ember.RESTAdapter requires a `url` property to be specified");return Ember.isEmpty(id)?urlRoot+urlSuffix:urlRoot+"/"+id+urlSuffix},ajaxSettings:function(url,method){return{url:url,type:method,dataType:"json"}},_ajax:function(url,params,method,settings){return settings||(settings=this.ajaxSettings(url,method)),new Ember.RSVP.Promise(function(resolve,reject){params&&("GET"===method?settings.data=params:(settings.contentType="application/json; charset=utf-8",settings.data=JSON.stringify(params))),settings.success=function(json){Ember.run(null,resolve,json)},settings.error=function(jqXHR){jqXHR&&"object"==typeof jqXHR&&(jqXHR.then=null),Ember.run(null,reject,jqXHR)},Ember.$.ajax(settings)})},_loadRecordFromData:function(record,data){var rootKey=get(record.constructor,"rootKey"),primaryKey=get(record.constructor,"primaryKey");data&&(data=rootKey?get(data,rootKey):data,Ember.isEmpty(data)||record.load(data[primaryKey],data))}})}(),function(){var get=Ember.get;Ember.loadPromise=function(target){if(Ember.isNone(target))return null;if(target.then)return target;var deferred=Ember.RSVP.defer();return get(target,"isLoaded")&&!get(target,"isNew")?deferred.resolve(target):target.one("didLoad",this,function(){deferred.resolve(target)}),deferred.promise}}(),function(){if(Ember.DataAdapter){var get=Ember.get,capitalize=Ember.String.capitalize,underscore=Ember.String.underscore,DebugAdapter=Ember.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(klass){return klass!==Ember.Model&&Ember.Model.detect(klass)},columnsForType:function(type){var columns=[],count=0,self=this;return type.getAttributes().forEach(function(name){if(count++>self.attributeLimit)return!1;var desc=capitalize(underscore(name).replace("_"," "));columns.push({name:name,desc:desc})}),columns},getRecords:function(type){var records=[];return type.forEachCachedRecord(function(record){records.push(record)}),records},getRecordColumnValues:function(record){var self=this,count=0,columnValues={id:get(record,"id")};return record.constructor.getAttributes().forEach(function(key){if(count++>self.attributeLimit)return!1;var value=get(record,key);columnValues[key]=value}),columnValues},getRecordKeywords:function(record){var keywords=[],keys=Ember.A(["id"]);return record.constructor.getAttributes().forEach(function(key){keys.push(key)}),keys.forEach(function(key){keywords.push(get(record,key))}),keywords},getRecordFilterValues:function(record){return{isNew:record.get("isNew"),isModified:record.get("isDirty")&&!record.get("isNew"),isClean:!record.get("isDirty")}},getRecordColor:function(record){var color="black";return record.get("isNew")?color="green":record.get("isDirty")&&(color="blue"),color},observeRecord:function(record,recordUpdated){var releaseMethods=Ember.A(),self=this,keysToObserve=Ember.A(["id","isNew","isDirty"]);record.constructor.getAttributes().forEach(function(key){keysToObserve.push(key)}),keysToObserve.forEach(function(key){var handler=function(){recordUpdated(self.wrapRecord(record))};Ember.addObserver(record,key,handler),releaseMethods.push(function(){Ember.removeObserver(record,key,handler)})});var release=function(){releaseMethods.forEach(function(fn){fn()})};return release}});Ember.onLoad("Ember.Application",function(Application){Application.initializer({name:"data-adapter",initialize:function(container,application){application.register("data-adapter:main",DebugAdapter)}})})}}(),function(){function NIL(){}Ember.Model.Store=Ember.Object.extend({container:null,modelFor:function(type){return this.container.lookupFactory("model:"+type)},adapterFor:function(type){var adapter=this.modelFor(type).adapter,container=this.container;return adapter&&adapter!==Ember.Model.adapter?adapter:(adapter=container.lookupFactory("adapter:"+type)||container.lookupFactory("adapter:application")||container.lookupFactory("adapter:REST"),adapter?adapter.create():adapter)},createRecord:function(type,props){var klass=this.modelFor(type);return klass.reopenClass({adapter:this.adapterFor(type)}),klass.create(Ember.merge({container:this.container},props))},find:function(type,id){return 1===arguments.length&&(id=NIL),this._find(type,id,!0)},_find:function(type,id,async){var klass=this.modelFor(type);return klass.reopenClass({adapter:this.adapterFor(type)}),id===NIL?klass._findFetchAll(async,this.container):Ember.isArray(id)?klass._findFetchMany(id,async,this.container):"object"==typeof id?klass._findFetchQuery(id,async,this.container):klass._findFetchById(id,async,this.container)},_findSync:function(type,id){return this._find(type,id,!1)}}),Ember.onLoad("Ember.Application",function(Application){Application.initializer({name:"store",initialize:function(container,application){application.register("store:main",container.lookupFactory("store:application")||Ember.Model.Store),application.inject("route","store","store:main"),application.inject("controller","store","store:main")}})})}();
|
3 |
+
//# sourceMappingURL=ember-model.min.js.map
|
|
|
|
admin/views/slider-panel/js/ember-model.min.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"file":"ember-model.min.js","sources":["ember-model.js"],"names":["VERSION","Ember","libraries","register","mustImplement","message","fn","className","this","constructor","toString","Error","replace","isUnimplemented","Adapter","Object","extend","find","findQuery","findMany","findAll","createRecord","saveRecord","deleteRecord","load","record","id","data","get","set","FixtureAdapter","_counter","_findData","klass","fixtures","FIXTURES","idAsString","primaryKey","A","el","_setPrimaryKey","_generatePrimaryKey","counter","RSVP","Promise","resolve","run","later","records","ids","requestedData","i","l","length","push","self","json","rootKey","toJSON","findFromCacheOrLoad","didCreateRecord","didSaveRecord","didDeleteRecord","RecordArray","ArrayProxy","Evented","isLoaded","isLoading","computed","not","materializeData","notifyLoaded","loadForFindMany","content","map","cachedRecordForId","container","trigger","reload","promises","modelClass","_findAllRecordArray","adapter","_query","all","then","FilteredRecordArray","init","registerRecordArray","registerObservers","updateFilter","_super","results","forEachCachedRecord","filterFunction","updateFilterForRecord","contains","pushObject","registerObserversOnRecord","filterProperties","addObserver","ManyArray","_records","originalContent","_modifiedRecords","unloadObject","obj","findBy","_reference","clientId","removeObject","originalObj","isDirty","originalContentLength","contentLength","property","objectAtContent","idx","observerNeeded","materializeRecord","isDirtyRecord","isNewRecord","registerParentHasManyArray","save","replaceContent","index","removed","added","EnumerableUtils","_contentWillChange","arrayWillChange","removeArrayObserver","_setupOriginalContent","observesBefore","_contentDidChange","addArrayObserver","arrayDidChange","observes","item","removedCnt","currentItem","unregisterParentHasManyArray","removeObserver","addedCnt","parent","relationshipKey","_relationshipBecameDirty","_relationshipBecameClean","setProperties","slice","revert","recordStateChanged","indexOf","HasManyArray","reference","objectAt","_findFetchById","forEach","EmbeddedHasManyArray","create","attrs","array","element","concatUnique","toArray","fromArray","e","underscore","meta","String","queues","Model","isNew","isDeleted","_dirtyAttributes","getAttr","key","value","dirtyAttributes","name","dataKey","camelizeKeys","metaForProperty","options","_createReference","getPrimaryKey","_cacheReference","_getOrCreateReferenceForId","hash","merge","getWithDefault","clear","_reloadHasManys","relationship","relationshipMeta","relationshipData","relationshipType","relationships","_relationships","descs","embedded","type","lookup","lookupFactory","didDefineProperty","proto","Descriptor","isAttribute","_attributes","isRelationship","serializeHasMany","serializeBelongsTo","getType","attributes","getAttributes","getRelationships","properties","getProperties","serialize","dataTypes","kind","jsonRoot","promise","notifyPropertyChange","addToRecordArrays","_copyDirtyAttributesToData","removeFromRecordArrays","cacheFor","_resetDirtyStateInNestedObjects","object","_hasManyArrays","j","_belongsTo","belongsTo","_registerHasManyArray","_parentHasManyArrays","reverting","hasManyContent","_getHasManyContent","addObject","mapFunction","_registerBelongsTo","reopenClass","_clientIdCounter","superclass","concat","fetch","arguments","isArray","_findFetchMany","_findFetchQuery","_findFetchAll","params","fetchQuery","isFetch","fetchMany","assert","deferred","_ids","recordArrays","_currentBatchIds","_currentBatchRecordArrays","defer","_currentBatchDeferreds","scheduleOnce","_executeBatch","fetchAll","currentFetchPromise","_currentFindFetchAllPromise","reject","apply","findById","fetchById","deferredOrPromise","_fetchById","batchIds","batchRecordArrays","batchDeferreds","requestIds","recordArray","resolveWith","errorXHR","getCachedReferenceRecord","ref","_getReferenceById","undefined","sideloadedData","unload","removeFromHasManyArrays","removeFromCache","clearCache","_referenceCache","hasManyArray","unregisterRecordArray","callback","keys","hashes","typeOf","isEmpty","store","modelFor","adapterFor","hasMany","propertyKey","newContentArray","existingArray","setObjects","getHasMany","reopen","collectionClass","collection","storeFor","oldValue","createdDirtyAttributes","dirtyChanged","sender","fmt","getBelongsTo","idOrAttrs","isNone","_findSync","deserialize","Date","string","date","toISOString","isEqual","obj1","obj2","Number","number","attr","dataValue","beingCreated","defaultValue","copy","RESTAdapter","url","buildURL","ajax","didFind","dataToLoad","didFindAll","collectionKey","didFindQuery","_loadRecordFromData","method","settings","_ajax","urlRoot","urlSuffix","ajaxSettings","dataType","contentType","JSON","stringify","success","error","jqXHR","$","loadPromise","target","one","DataAdapter","capitalize","DebugAdapter","getFilters","desc","detect","columnsForType","columns","count","attributeLimit","getRecords","getRecordColumnValues","columnValues","getRecordKeywords","keywords","getRecordFilterValues","isModified","isClean","getRecordColor","color","observeRecord","recordUpdated","releaseMethods","keysToObserve","handler","wrapRecord","release","onLoad","Application","initializer","initialize","application","NIL","Store","props","_find","async","inject"],"mappings":"CAAA,WAEA,GAAIA,SAAU,QAEVC,OAAMC,WACRD,MAAMC,UAAUC,SAAS,cAAeH,YAM1C,WAEA,QAASI,eAAcC,SACrB,GAAIC,IAAK,WACP,GAAIC,WAAYC,KAAKC,YAAYC,UAEjC,MAAM,IAAIC,OAAMN,QAAQO,QAAQ,gBAAiBL,YAGnD,OADAD,IAAGO,iBAAkB,EACdP,GAGTL,MAAMa,QAAUb,MAAMc,OAAOC,QAC3BC,KAAMb,cAAc,qCACpBc,UAAWd,cAAc,0CACzBe,SAAUf,cAAc,yCACxBgB,QAAShB,cAAc,wCACvBiB,aAAcjB,cAAc,6CAC5BkB,WAAYlB,cAAc,2CAC1BmB,aAAcnB,cAAc,6CAE5BoB,KAAM,SAASC,OAAQC,GAAIC,MACzBF,OAAOD,KAAKE,GAAIC,YAOpB,WAEA,GAAIC,KAAM3B,MAAM2B,IACZC,IAAM5B,MAAM4B,GAEhB5B,OAAM6B,eAAiB7B,MAAMa,QAAQE,QACnCe,SAAU,EACVC,UAAW,SAASC,MAAOP,IACzB,GAAIQ,UAAWD,MAAME,SACjBC,WAAaV,GAAGhB,WAChB2B,WAAaT,IAAIK,MAAO,cACxBN,KAAO1B,MAAMqC,EAAEJ,UAAUjB,KAAK,SAASsB,IAAM,MAAQA,IAAGF,YAAa3B,aAAe0B,YAExF,OAAOT,OAGTa,eAAgB,SAASf,QACvB,GAAIQ,OAAQR,OAAOhB,YAEf4B,YADWJ,MAAME,SACJP,IAAIK,MAAO,cAGzBR,QAAOG,IAAIS,aAIdR,IAAIJ,OAAQY,WAAY7B,KAAKiC,wBAG/BA,oBAAqB,WACnB,GAAIC,SAAUlC,KAAKoB,IAAI,WAIvB,OAFApB,MAAKqB,IAAI,WAAYa,QAAU,GAExB,WAAaA,SAGtBzB,KAAM,SAASQ,OAAQC,IACrB,GAAIC,MAAOnB,KAAKwB,UAAUP,OAAOhB,YAAaiB,GAE9C,OAAO,IAAIzB,OAAM0C,KAAKC,QAAQ,SAASC,SACrC5C,MAAM6C,IAAIC,MAAMvC,KAAM,WACpBP,MAAM6C,IAAIrB,OAAQA,OAAOD,KAAME,GAAIC,MACnCkB,QAAQpB,SACP,MAIPN,SAAU,SAASc,MAAOe,QAASC,KAIjC,IAAK,GAFDC,gBADWjB,MAAME,aAGZgB,EAAI,EAAGC,EAAIH,IAAII,OAAYD,EAAJD,EAAOA,IACrCD,cAAcI,KAAK9C,KAAKwB,UAAUC,MAAOgB,IAAIE,IAG/C,OAAO,IAAIlD,OAAM0C,KAAKC,QAAQ,SAASC,SACrC5C,MAAM6C,IAAIC,MAAMvC,KAAM,WACpBP,MAAM6C,IAAIE,QAASA,QAAQxB,KAAMS,MAAOiB,eACxCL,QAAQG,UACP,MAIP5B,QAAS,SAASa,MAAOe,SACvB,GAAId,UAAWD,MAAME,QAErB,OAAO,IAAIlC,OAAM0C,KAAKC,QAAQ,SAASC,SACrC5C,MAAM6C,IAAIC,MAAMvC,KAAM,WACpBP,MAAM6C,IAAIE,QAASA,QAAQxB,KAAMS,MAAOC,UACxCW,QAAQG,UACP,MAIP3B,aAAc,SAASI,QACrB,GAAIQ,OAAQR,OAAOhB,YACfyB,SAAWD,MAAME,SACjBoB,KAAO/C,IAEX,OAAO,IAAIP,OAAM0C,KAAKC,QAAQ,SAASC,SACrC5C,MAAM6C,IAAIC,MAAMvC,KAAM,WACpB,GACIgD,MADAC,QAAUhC,OAAOhB,YAAYgD,OAGjCF,MAAKf,eAAef,QACpB+B,KAAOC,QAAUhC,OAAOiC,SAASD,SAAWhC,OAAOiC,SACnDxB,SAASoB,KAAKrB,MAAM0B,oBAAoBH,OACxC/B,OAAOmC,kBACPf,QAAQpB,SACP,MAIPH,WAAY,SAASG,QACnB,MAAO,IAAIxB,OAAM0C,KAAKC,QAAQ,SAASC,SACrC5C,MAAM6C,IAAIC,MAAMvC,KAAM,WACpBiB,OAAOoC,gBACPhB,QAAQpB,SACP,MAIPF,aAAc,SAASE,QACrB,MAAO,IAAIxB,OAAM0C,KAAKC,QAAQ,SAASC,SACrC5C,MAAM6C,IAAIC,MAAMvC,KAAM,WACpBiB,OAAOqC,kBACPjB,QAAQpB,SACP,WAQT,WAEA,GAAIG,KAAM3B,MAAM2B,IACZC,IAAM5B,MAAM4B,GAEhB5B,OAAM8D,YAAc9D,MAAM+D,WAAWhD,OAAOf,MAAMgE,SAChDC,UAAU,EACVC,UAAWlE,MAAMmE,SAASC,IAAI,YAE9B7C,KAAM,SAASS,MAAON,MACpBE,IAAIrB,KAAM,UAAWA,KAAK8D,gBAAgBrC,MAAON,OACjDnB,KAAK+D,gBAGPC,gBAAiB,SAASvC,OACxB,GAAIsB,MAAO/C,KACPiE,QAAU7C,IAAIpB,KAAM,QAAQkE,IAAI,SAAShD,IAAM,MAAOO,OAAM0C,kBAAkBjD,GAAI6B,KAAKqB,YAC3F/C,KAAIrB,KAAM,UAAWP,MAAMqC,EAAEmC,UAC7BjE,KAAK+D,gBAGPA,aAAc,WACZ1C,IAAIrB,KAAM,YAAY,GACtBA,KAAKqE,QAAQ,YAGfP,gBAAiB,SAASrC,MAAON,MAC/B,GAAI4B,MAAO/C,IACX,OAAOP,OAAMqC,EAAEX,KAAK+C,IAAI,SAASnC,IAC/B,MAAON,OAAM0B,oBAAoBpB,GAAIgB,KAAKqB,eAI9CE,OAAQ,WACN,GAEIC,UAFAC,WAAaxE,KAAKoB,IAAI,cACtB2B,KAAO/C,IAIX,OADAqB,KAAIrB,KAAM,YAAY,GAClBwE,WAAWC,sBAAwBzE,KAC9BwE,WAAWE,QAAQ9D,QAAQ4D,WAAYxE,MACrCA,KAAK2E,OACPH,WAAWE,QAAQhE,UAAU8D,WAAYxE,KAAMA,KAAK2E,SAE3DJ,SAAWvE,KAAKkE,IAAI,SAASjD,QAC3B,MAAOA,QAAOqD,WAET7E,MAAM0C,KAAKyC,IAAIL,UAAUM,KAAK,WACnC9B,KAAKgB,wBASb,WAEA,GAAI3C,KAAM3B,MAAM2B,GAEhB3B,OAAMqF,oBAAsBrF,MAAM8D,YAAY/C,QAC5CuE,KAAM,WACJ,IAAK3D,IAAIpB,KAAM,cACb,KAAM,IAAIG,OAAM,yDAElB,KAAKiB,IAAIpB,KAAM,kBACb,KAAM,IAAIG,OAAM,6DAElB,KAAKiB,IAAIpB,KAAM,oBACb,KAAM,IAAIG,OAAM,6DAGlB,IAAIqE,YAAapD,IAAIpB,KAAM,aAC3BwE,YAAWQ,oBAAoBhF,MAE/BA,KAAKiF,oBACLjF,KAAKkF,eAELlF,KAAKmF,UAGPD,aAAc,WACZ,GAAInC,MAAO/C,KACPoF,UACJhE,KAAIpB,KAAM,cAAcqF,oBAAoB,SAASpE,QAC/C8B,KAAKuC,eAAerE,SACtBmE,QAAQtC,KAAK7B,UAGjBjB,KAAKqB,IAAI,UAAW5B,MAAMqC,EAAEsD,WAG9BG,sBAAuB,SAAStE,QAC9B,GAAImE,SAAUhE,IAAIpB,KAAM,UACpBA,MAAKsF,eAAerE,UAAYmE,QAAQI,SAASvE,SACnDmE,QAAQK,WAAWxE,SAIvBgE,kBAAmB,WACjB,GAAIlC,MAAO/C,IACXoB,KAAIpB,KAAM,cAAcqF,oBAAoB,SAASpE,QACnD8B,KAAK2C,0BAA0BzE,WAInCyE,0BAA2B,SAASzE,QAIlC,IAAK,GAHD8B,MAAO/C,KACP2F,iBAAmBvE,IAAIpB,KAAM,oBAExB2C,EAAI,EAAGC,EAAIxB,IAAIuE,iBAAkB,UAAe/C,EAAJD,EAAOA,IAC1D1B,OAAO2E,YAAYD,iBAAiBhD,GAAII,KAAM,+BAOpD,WAEA,GAAI3B,KAAM3B,MAAM2B,IAAKC,IAAM5B,MAAM4B,GAEjC5B,OAAMoG,UAAYpG,MAAM8D,YAAY/C,QAClCsF,SAAU,KACVC,gBAAiB,KACjBC,iBAAkB,KAElBC,aAAc,SAAShF,QACrB,GAAIiF,KAAM9E,IAAIpB,KAAM,WAAWmG,OAAO,WAAYlF,OAAOmF,WAAWC,SACpEjF,KAAIpB,KAAM,WAAWsG,aAAaJ,IAElC,IAAIK,aAAcnF,IAAIpB,KAAM,mBAAmBmG,OAAO,WAAYlF,OAAOmF,WAAWC,SACpFjF,KAAIpB,KAAM,mBAAmBsG,aAAaC,cAG5CC,QAAS,WACP,GAAIT,iBAAkB3E,IAAIpB,KAAM,mBAC5ByG,sBAAwBrF,IAAI2E,gBAAiB,UAC7C9B,QAAU7C,IAAIpB,KAAM,WACpB0G,cAAgBtF,IAAI6C,QAAS,SAEjC,IAAIwC,wBAA0BC,cAAiB,OAAO,CAEtD,IAAI1G,KAAKgG,kBAAoBhG,KAAKgG,iBAAiBnD,OAAU,OAAO,CAIpE,KAAK,GAFD2D,UAAU,EAEL7D,EAAI,EAAGC,EAAI8D,cAAmB9D,EAAJD,EAAOA,IACxC,IAAKoD,gBAAgBP,SAASvB,QAAQtB,IAAK,CACzC6D,SAAU,CACV,OAIJ,MAAOA,UACPG,SAAS,aAAc,qBAAsB,uBAE/CC,gBAAiB,SAASC,KACxB,GAAI5C,SAAU7C,IAAIpB,KAAM,UAExB,IAAKiE,QAAQpB,OAAb,CAGA,GAAIiE,gBAAkB7C,QAAQ4C,KAAW,QAAI,GAAQ,EAEjD5F,OAASjB,KAAK+G,kBAAkBF,IAAK7G,KAAKoE,UAE9C,IAAI0C,eAAgB,CAClB,GAAIE,eAAgB/F,OAAOG,IAAI,WAAY6F,YAAchG,OAAOG,IAAI,UAChE4F,eAAiBC,cAAejH,KAAKgG,iBAAiBP,WAAWxB,QAAQ4C,MAC7EpH,MAAMmG,YAAY3B,QAAQ4C,KAAM,iBAAkB7G,KAAM,sBACxDiB,OAAOiG,2BAA2BlH,MAGpC,MAAOiB,UAGTkG,KAAM,WAEJ,MAAO1H,OAAM0C,KAAKyC,IAAI5E,KAAKkE,IAAI,SAASjD,QACtC,MAAOA,QAAOkG,WAIlBC,eAAgB,SAASC,MAAOC,QAASC,OACvCA,MAAQ9H,MAAM+H,gBAAgBtD,IAAIqD,MAAO,SAAStG,QAChD,MAAOA,QAAOmF,YACbpG,MAEHA,KAAKmF,OAAOkC,MAAOC,QAASC,QAG9BE,mBAAoB,WAClB,GAAIxD,SAAU7C,IAAIpB,KAAM,UAEpBiE,WACFjE,KAAK0H,gBAAgBzD,QAAS,EAAG7C,IAAI6C,QAAS,UAAW,GACzDA,QAAQ0D,oBAAoB3H,MAC5BA,KAAK4H,sBAAsB3D,WAE7B4D,eAAe,WAEjBC,kBAAmB,WACjB,GAAI7D,SAAU7C,IAAIpB,KAAM,UACpBiE,WACFA,QAAQ8D,iBAAiB/H,MACzBA,KAAKgI,eAAe/D,QAAS,EAAG,EAAG7C,IAAI6C,QAAS,aAElDgE,SAAS,WAEXP,gBAAiB,SAASQ,KAAMrB,IAAKsB,YAEnC,IAAK,GADDlE,SAAUiE,KACLvF,EAAIkE,IAASA,IAAIsB,WAARxF,EAAoBA,IAAK,CACzC,GAAIyF,aAAcnE,QAAQtB,EACtByF,cAAeA,YAAYnH,SAC7BjB,KAAKgG,iBAAiBM,aAAa8B,aACnCA,YAAYnH,OAAOoH,6BAA6BrI,MAChDP,MAAM6I,eAAeF,YAAa,iBAAkBpI,KAAM,yBAKhEgI,eAAgB,SAASE,KAAMrB,IAAKsB,WAAYI,UAK9C,IAAK,GAJDC,QAASpH,IAAIpB,KAAM,UAAWyI,gBAAkBrH,IAAIpB,KAAM,mBAC1DwG,QAAUpF,IAAIpB,KAAM,WAEpBiE,QAAUiE,KACLvF,EAAIkE,IAASA,IAAI0B,SAAR5F,EAAkBA,IAAK,CACvC,GAAIyF,aAAcnE,QAAQtB,EAC1B,IAAIyF,aAAeA,YAAYnH,OAAQ,CACrC,GAAI+F,eAAgBoB,YAAYnH,OAAOG,IAAI,WAAY6F,YAAcmB,YAAYnH,OAAOG,IAAI,UACxF4F,eAAiBC,cAAejH,KAAKgG,iBAAiBP,WAAW2C,aACrE3I,MAAMmG,YAAYwC,YAAa,iBAAkBpI,KAAM,sBACvDoI,YAAYnH,OAAOiG,2BAA2BlH,OAI9CwG,QACFgC,OAAOE,yBAAyBD,iBAEhCD,OAAOG,yBAAyBF,kBAIpCzH,KAAM,SAASiD,SACbxE,MAAMmJ,cAAc5I,MAClBiE,QAASA,QACT8B,gBAAiB9B,QAAQ4E,UAE3BxH,IAAIrB,KAAM,wBAGZ8I,OAAQ,WACN9I,KAAK4H,yBAGPA,sBAAuB,SAAS3D,SAC9BA,QAAUA,SAAW7C,IAAIpB,KAAM,WAC3BiE,SACF5C,IAAIrB,KAAM,kBAAmBiE,QAAQ4E,SAEvCxH,IAAIrB,KAAM,wBAGZ+E,KAAM,WACJ/E,KAAKmF,SACLnF,KAAK4H,wBACL5H,KAAK8H,qBAGPiB,mBAAoB,SAAS7C,KAC3B,GAAIsC,QAASpH,IAAIpB,KAAM,UAAWyI,gBAAkBrH,IAAIpB,KAAM,kBAE1DkG,KAAIjF,OAAOG,IAAI,YAC0B,KAAvCpB,KAAKgG,iBAAiBgD,QAAQ9C,MAAelG,KAAKgG,iBAAiBP,WAAWS,KAClFsC,OAAOE,yBAAyBD,mBAE5BzI,KAAKgG,iBAAiBgD,QAAQ9C,KAAO,IAAMlG,KAAKgG,iBAAiBM,aAAaJ,KAC7ElG,KAAKoB,IAAI,YACZoH,OAAOG,yBAAyBF,qBAMxChJ,MAAMwJ,aAAexJ,MAAMoG,UAAUrF,QACnCuG,kBAAmB,SAASF,IAAKzC,WAC/B,GAAI3C,OAAQL,IAAIpB,KAAM,cAClBiE,QAAU7C,IAAIpB,KAAM,WACpBkJ,UAAYjF,QAAQkF,SAAStC,KAC7B5F,OAASiI,UAAUjI,MAEvB,OAAIA,SACIA,OAAOmD,YACXnD,OAAOmD,UAAYA,WAEdnD,QAEFQ,MAAM2H,eAAeF,UAAUhI,IAAI,EAAOkD,YAGnDlB,OAAQ,WACN,GAAIT,QAAUwB,QAAUjE,KAAKoB,IAAI,UAQjC,OANA6C,SAAQoF,QAAQ,SAASH,WACnBA,UAAUhI,IACZuB,IAAIK,KAAKoG,UAAUhI,MAIhBuB,OAIXhD,MAAM6J,qBAAuB7J,MAAMoG,UAAUrF,QAC3C+I,OAAQ,SAASC,OACf,GAAI/H,OAAQL,IAAIpB,KAAM,cAClBiB,OAASQ,MAAM8H,OAAOC,MAI1B,OAFAxJ,MAAKyF,WAAWxE,QAETA,QAGT8F,kBAAmB,SAASF,IAAKzC,WAC/B,GAMInD,QANAQ,MAAQL,IAAIpB,KAAM,cAClB6B,WAAaT,IAAIK,MAAO,cACxBwC,QAAU7C,IAAIpB,KAAM,WACpBkJ,UAAYjF,QAAQkF,SAAStC,KAC7B2C,MAAQN,UAAU/H,IActB,OAXI+H,WAAUjI,OACZA,OAASiI,UAAUjI,QAEnBA,OAASQ,MAAM8H,QAASnD,WAAY8C,UAAW9E,UAAWA,YAC1D8E,UAAUjI,OAASA,OACfuI,OACFvI,OAAOD,KAAKwI,MAAM3H,YAAa2H,QAInCvI,OAAOmD,UAAYA,UACZnD,QAGTiC,OAAQ,WACN,MAAOlD,MAAKkE,IAAI,SAASjD,QACvB,MAAOA,QAAOiC,iBAQpB,WAQA,QAASsC,UAASiE,MAAOC,SACvB,IAAK,GAAI/G,GAAI,EAAGC,EAAI6G,MAAM5G,OAAYD,EAAJD,EAAOA,IACvC,GAAI8G,MAAM9G,KAAO+G,QAAW,OAAO,CAErC,QAAO,EAGT,QAASC,cAAaC,QAASC,WAE7B,IAAK,GADDC,GACKnH,EAAI,EAAGC,EAAIiH,UAAUhH,OAAYD,EAAJD,EAAOA,IAC3CmH,EAAID,UAAUlH,GACT6C,SAASoE,QAASE,IAAMF,QAAQ9G,KAAKgH,EAE5C,OAAOF,SAnBT,GAAIxI,KAAM3B,MAAM2B,IACZC,IAAM5B,MAAM4B,IAGZ0I,YAFgBtK,MAAMmJ,cACfnJ,MAAMuK,KACAvK,MAAMwK,OAAOF,WAyB9BtK,OAAM6C,IAAI4H,OAAOpH,KAAK,QAEtBrD,MAAM0K,MAAQ1K,MAAMc,OAAOC,OAAOf,MAAMgE,SACtCC,UAAU,EACVC,UAAWlE,MAAMmE,SAASC,IAAI,YAC9BuG,OAAO,EACPC,WAAW,EACXC,iBAAkB,KASlBC,QAAS,SAASC,IAAKC,OACrB,MAAOA,QAGTjE,QAAS,WACP,GAAIkE,iBAAkBtJ,IAAIpB,KAAM,mBAChC,OAAO0K,kBAA8C,IAA3BA,gBAAgB7H,SAAgB,GAC1D8D,SAAS,2BAEX+B,yBAA0B,SAASiC,MACjC,GAAID,iBAAkBtJ,IAAIpB,KAAM,mBAC3B0K,iBAAgBlF,SAASmF,OAASD,gBAAgBjF,WAAWkF,OAGpEhC,yBAA0B,SAASgC,MACjC,GAAID,iBAAkBtJ,IAAIpB,KAAM,mBAChC0K,iBAAgBpE,aAAaqE,OAG/BC,QAAS,SAASJ,KAChB,GAAIK,cAAezJ,IAAIpB,KAAKC,YAAa,gBACrC+J,KAAOhK,KAAKC,YAAY6K,gBAAgBN,IAC5C,OAAIR,MAAKe,SAAWf,KAAKe,QAAQP,IACxBK,aAAed,WAAWC,KAAKe,QAAQP,KAAOR,KAAKe,QAAQP,IAE7DK,aAAed,WAAWS,KAAOA,KAG1CzF,KAAM,WACJ/E,KAAKgL,mBACAhL,KAAKsK,kBACRjJ,IAAIrB,KAAM,uBAEZA,KAAKmF,UAGP6F,iBAAkB,WAChB,GAAI9B,WAAYlJ,KAAKoG,WACjBlF,GAAKlB,KAAKiL,eAed,OAbK/B,WAIMA,UAAUhI,KAAOA,KAC1BgI,UAAUhI,GAAKA,GACflB,KAAKC,YAAYiL,gBAAgBhC,aALjCA,UAAYlJ,KAAKC,YAAYkL,2BAA2BjK,IACxDgI,UAAUjI,OAASjB,KACnBA,KAAKoG,WAAa8C,WAMfA,UAAUhI,KACbgI,UAAUhI,GAAKA,IAGVgI,WAGT+B,cAAe,WACb,MAAO7J,KAAIpB,KAAMoB,IAAIpB,KAAKC,YAAa,gBAGzCe,KAAM,SAASE,GAAIkK,MACjB,GAAIjK,QACJA,MAAKC,IAAIpB,KAAKC,YAAa,eAAiBiB,GAC5CG,IAAIrB,KAAM,QAASP,MAAM4L,MAAMlK,KAAMiK,OACrCpL,KAAKsL,eAAe,uBAAwBC,QAE5CvL,KAAKwL,iBAIL,KAAK,GAD+E/C,iBAAiBgD,aAAcC,iBAAkBC,iBAAkBC,iBAAnJC,cAAgB7L,KAAKC,YAAY6L,mBAAsB9B,KAAOvK,MAAMuK,KAAKhK,MACpE2C,EAAI,EAAGC,EAAIiJ,cAAchJ,OAAYD,EAAJD,EAAOA,IAC/C8F,gBAAkBoD,cAAclJ,GAChC8I,aAAezB,KAAK+B,MAAMtD,iBAC1BiD,iBAAmBD,aAAazB,OAE5B0B,iBAAiBX,QAAQiB,WAC3BJ,iBAAmBF,iBAAiBO,KACJ,gBAArBL,oBACTA,iBAAmBnM,MAAM2B,IAAI3B,MAAMyM,OAAQN,mBAAqB5L,KAAKoE,UAAU+H,cAAc,SAAUP,mBAGzGD,iBAAmBxK,KAAKsH,iBACpBkD,kBACFC,iBAAiB5K,KAAK2K,kBAK5BtK,KAAIrB,KAAM,SAAS,GACnBqB,IAAIrB,KAAM,YAAY,GACtBA,KAAKgL,mBACLhL,KAAKqE,QAAQ,YAGf+H,kBAAmB,SAASC,MAAO7B,IAAKC,OACtC,GAAIA,gBAAiBhL,OAAM6M,WAAY,CACrC,GAAItC,MAAOS,MAAMT,OACbvI,MAAQ4K,MAAMpM,WAEd+J,MAAKuC,aACF9K,MAAM+K,cAAe/K,MAAM+K,gBAChC/K,MAAM+K,YAAY1J,KAAK0H,MACdR,KAAKyC,iBACThL,MAAMqK,iBAAkBrK,MAAMqK,mBACnCrK,MAAMqK,eAAehJ,KAAK0H,KAC1BR,KAAKvB,gBAAkB+B,OAK7BkC,iBAAkB,SAASlC,KACzB,MAAOxK,MAAKoB,IAAIoJ,KAAKtH,UAGvByJ,mBAAoB,SAASnC,IAAKR,MAChC,GAAIA,KAAKe,QAAQiB,SAAU,CACzB,GAAI/K,QAASjB,KAAKoB,IAAIoJ,IACtB,OAAOvJ,QAASA,OAAOiC,SAAW,KAElC,GAAIrB,YAAaT,IAAI4I,KAAK4C,QAAQ5M,MAAO,aACzC,OAAOA,MAAKoB,IAAIoJ,IAAM,IAAM3I,aAIhCqB,OAAQ,WACN,GAAIsH,KAAKR,KACLhH,QACA6J,WAAa7M,KAAKC,YAAY6M,gBAC9BjB,cAAgB7L,KAAKC,YAAY8M,mBACjCC,WAAaH,WAAa7M,KAAKiN,cAAcJ,eAC7C5J,QAAU7B,IAAIpB,KAAKC,YAAa,UAEpC,KAAKuK,MAAOwC,YACVhD,KAAOhK,KAAKC,YAAY6K,gBAAgBN,KAEtCxH,KAAKhD,KAAK4K,QAAQJ,MADhBR,KAAKiC,MAAQjC,KAAKiC,KAAKiB,UACClD,KAAKiC,KAAKiB,UAAUF,WAAWxC,MAChDR,KAAKiC,MAAQxM,MAAM0K,MAAMgD,UAAUnD,KAAKiC,MACvBxM,MAAM0K,MAAMgD,UAAUnD,KAAKiC,MAAMiB,UAAUF,WAAWxC,MAEtDwC,WAAWxC,IAIzC,IAAIqB,cAGF,IAAI,GAFA1K,MAAMsH,gBAEF9F,EAAI,EAAGA,EAAIkJ,cAAchJ,OAAQF,IACvC6H,IAAMqB,cAAclJ,GACpBqH,KAAOhK,KAAKC,YAAY6K,gBAAgBN,KACxC/B,gBAAkBuB,KAAKe,QAAQP,KAAOA,IAGpCrJ,KADgB,cAAd6I,KAAKoD,KACApN,KAAK2M,mBAAmBnC,IAAKR,MAE7BhK,KAAK0M,iBAAiBlC,IAAKR,MAGpChH,KAAKyF,iBAAmBtH,IAK5B,IAAI8B,QAAS,CACX,GAAIoK,YAEJ,OADAA,UAASpK,SAAWD,KACbqK,SAEP,MAAOrK,OAIXmE,KAAM,WACJ,GAAIzC,SAAU1E,KAAKC,YAAYyE,OAE/B,IADArD,IAAIrB,KAAM,YAAY,GAClBoB,IAAIpB,KAAM,SACZ,MAAO0E,SAAQ7D,aAAab,KACvB,IAAIoB,IAAIpB,KAAM,WACnB,MAAO0E,SAAQ5D,WAAWd,KAE1B,IAAI+C,MAAO/C,KACPsN,QAAU,GAAI7N,OAAM0C,KAAKC,QAAQ,SAASC,SACxCA,QAAQU,OAGd,OADA1B,KAAIrB,KAAM,YAAY,GACfsN,SAIXhJ,OAAQ,WAEN,MADAtE,MAAKsL,eAAe,uBAAwBC,QACrCvL,KAAKC,YAAYqE,OAAOtE,KAAKoB,IAAIA,IAAIpB,KAAKC,YAAa,eAAgBD,KAAKoE,YAGrF0E,OAAQ,WACN9I,KAAKsL,eAAe,uBAAwBC,QAC5CvL,KAAKuN,qBAAqB,SAC1BvN,KAAKwL,iBAAgB,IAGvBpI,gBAAiB,WACf,CAAA,GAAIvB,YAAaT,IAAIpB,KAAKC,YAAa,aAC9BmB,KAAIpB,KAAM6B,YAEnBR,IAAIrB,KAAM,SAAS,GAEnBqB,IAAIrB,KAAM,uBACVA,KAAKC,YAAYuN,kBAAkBxN,MACnCA,KAAKqE,QAAQ,mBACbrE,KAAKqD,iBAGPA,cAAe,WACbhC,IAAIrB,KAAM,YAAY,GACtBA,KAAKqE,QAAQ,iBACTrE,KAAKoB,IAAI,YAAcpB,KAAKyN,8BAGlC1M,aAAc,WACZ,MAAOf,MAAKC,YAAYyE,QAAQ3D,aAAaf,OAG/CsD,gBAAiB,WACftD,KAAKC,YAAYyN,uBAAuB1N,MACxCqB,IAAIrB,KAAM,aAAa,GACvBA,KAAKqE,QAAQ,oBAGfoJ,2BAA4B,WAC1B,GAAKzN,KAAKsK,iBAAV,CACA,GAEIE,KAFAE,gBAAkB1K,KAAKsK,iBACvBnJ,KAAOC,IAAIpB,KAAM,QAGhBmB,QACHA,QACAE,IAAIrB,KAAM,QAASmB,MAErB,KAAK,GAAIwB,GAAI,EAAGC,EAAI8H,gBAAgB7H,OAAYD,EAAJD,EAAOA,IAEjD6H,IAAME,gBAAgB/H,GACtBxB,KAAKnB,KAAK4K,QAAQJ,MAAQxK,KAAK2N,SAASnD,IAE1CnJ,KAAIrB,KAAM,uBACVA,KAAK4N,gCAAgC5N,QAGvC4N,gCAAiC,SAASC,QACxC,GAAIlL,GAAGuD,GACP,IAAI2H,OAAOC,eACT,IAAKnL,EAAI,EAAGA,EAAIkL,OAAOC,eAAejL,OAAQF,IAAK,CACjD,GAAI8G,OAAQoE,OAAOC,eAAenL,EAElC,IADA8G,MAAMX,SACFW,MAAMuC,SACR,IAAK,GAAI+B,GAAI,EAAGA,EAAItE,MAAMrI,IAAI,UAAW2M,IACvC7H,IAAMuD,MAAMN,SAAS4E,GACrB7H,IAAIuH,6BAMZ,GAAII,OAAOG,WACT,IAAKrL,EAAI,EAAGA,EAAIkL,OAAOG,WAAWnL,OAAQF,IAAK,CAC7C,GAAIsL,WAAYJ,OAAOG,WAAWrL,EAC9BsL,WAAUlD,QAAQiB,WACpB9F,IAAMlG,KAAKoB,IAAI6M,UAAUxF,iBACrBvC,KACFA,IAAIuH,gCAOdS,sBAAuB,SAASzE,OACzBzJ,KAAK8N,iBAAkB9N,KAAK8N,eAAiBrO,MAAMqC,OAExD9B,KAAK8N,eAAerI,WAAWgE,QAGjCvC,2BAA4B,SAASuC,OAC9BzJ,KAAKmO,uBAAwBnO,KAAKmO,qBAAuB1O,MAAMqC,OAEpE9B,KAAKmO,qBAAqB1I,WAAWgE,QAGvCpB,6BAA8B,SAASoB,OAChCzJ,KAAKmO,sBAEVnO,KAAKmO,qBAAqB7H,aAAamD,QAGzC+B,gBAAiB,SAAS4C,WACxB,GAAKpO,KAAK8N,eAAV,CACA,GAAInL,GAAGoL,CACP,KAAKpL,EAAI,EAAGA,EAAI3C,KAAK8N,eAAejL,OAAQF,IAAK,CAC/C,GAAI8G,OAAQzJ,KAAK8N,eAAenL,GAC5B0L,eAAiBrO,KAAKsO,mBAAmBlN,IAAIqI,MAAO,OAAQrI,IAAIqI,MAAO,cAAerI,IAAIqI,MAAO,YACrG,KAAK2E,UACH,IAAKL,EAAI,EAAGA,EAAItE,MAAMrI,IAAI,UAAW2M,IAC/BtE,MAAMN,SAAS4E,GAAG3M,IAAI,WAAaqI,MAAMN,SAAS4E,GAAG3M,IAAI,cAC3DiN,eAAeE,UAAU9E,MAAMN,SAAS4E,GAAG3H,WAIjDqD,OAAMzI,KAAKqN,mBAIfC,mBAAoB,SAAS9D,IAAKyB,KAAMD,UACtC,GAAI/H,SAAU7C,IAAIpB,KAAM,SAAWwK,IAEnC,IAAIvG,QAAS,CACX,GAAIuK,aAAa3M,WAAYqH,SACzB8C,WACFnK,WAAaT,IAAI6K,KAAM,cACvBuC,YAAc,SAAShF,OAGrB,MAFAN,WAAY+C,KAAKd,2BAA2B3B,MAAM3H,aAClDqH,UAAU/H,KAAOqI,MACVN,YAGTsF,YAAc,SAAStN,IAAM,MAAO+K,MAAKd,2BAA2BjK,KAEtE+C,QAAUxE,MAAM+H,gBAAgBtD,IAAID,QAASuK,aAG/C,MAAO/O,OAAMqC,EAAEmC,cAGjBwK,mBAAoB,SAASjE,KACtBxK,KAAKgO,aAAchO,KAAKgO,WAAavO,MAAMqC,OAEhD9B,KAAKgO,WAAWvI,WAAW+E,QAI/B/K,MAAM0K,MAAMuE,aACV7M,WAAY,KAEZ6C,QAASjF,MAAMa,QAAQiJ,SAEvBoF,iBAAkB,EAElB7B,cAAe,WACb9M,KAAKqM,OACL,IAAIQ,YAAa7M,KAAKwM,eAItB,OAH6C,kBAAlCxM,MAAK4O,WAAW9B,gBACzBD,WAAa7M,KAAK4O,WAAW9B,gBAAgB+B,OAAOhC,aAE/CA,YAGTE,iBAAkB,WAChB/M,KAAKqM,OACL,IAAIR,eAAgB7L,KAAK8L,kBAIzB,OAHgD,kBAArC9L,MAAK4O,WAAW7B,mBACzBlB,cAAgB7L,KAAK4O,WAAW7B,mBAAmB8B,OAAOhD,gBAErDA,eAGTiD,MAAO,SAAS5N,IACd,MAAK6N,WAAUlM,OAEJpD,MAAMuP,QAAQ9N,IAChBlB,KAAKiP,eAAe/N,IAAI,GACR,gBAAPA,IACTlB,KAAKkP,gBAAgBhO,IAAI,GAEzBlB,KAAKoJ,eAAelI,IAAI,GANxBlB,KAAKmP,eAAc,IAU9B1O,KAAM,SAASS,IACb,MAAK6N,WAAUlM,OAEJpD,MAAMuP,QAAQ9N,IAChBlB,KAAKiP,eAAe/N,IAAI,GACR,gBAAPA,IACTlB,KAAKkP,gBAAgBhO,IAAI,GAEzBlB,KAAKoJ,eAAelI,IAAI,GANxBlB,KAAKmP,eAAc,IAU9BzO,UAAW,SAAS0O,QAClB,MAAOpP,MAAKkP,gBAAgBE,QAAQ,IAGtCC,WAAY,SAASD,QACnB,MAAOpP,MAAKkP,gBAAgBE,QAAQ,IAGtCF,gBAAiB,SAASE,OAAQE,QAASlL,WACzC,GAAI5B,SAAU/C,MAAM8D,YAAYgG,QAAQ/E,WAAYxE,KAAM2E,OAAQyK,OAAQhL,UAAWA,YAEjFkJ,QAAUtN,KAAK0E,QAAQhE,UAAUV,KAAMwC,QAAS4M,OAEpD,OAAOE,SAAUhC,QAAU9K,SAG7B7B,SAAU,SAAS8B,KACjB,MAAOzC,MAAKiP,eAAexM,KAAK,IAGlC8M,UAAW,SAAS9M,KAClB,MAAOzC,MAAKiP,eAAexM,KAAK,IAGlCwM,eAAgB,SAASxM,IAAK6M,QAASlL,WACrC3E,MAAM+P,OAAO,kCAAmC/P,MAAMuP,QAAQvM,KAE9D,IACIgN,UADAjN,QAAU/C,MAAM8D,YAAYgG,QAAQmG,KAAMjN,IAAK+B,WAAYxE,KAAMoE,UAAWA,WAwBhF,OArBKpE,MAAK2P,eAAgB3P,KAAK2P,iBAC/B3P,KAAK2P,aAAa7M,KAAKN,SAEnBxC,KAAK4P,kBACPjG,aAAa3J,KAAK4P,iBAAkBnN,KACpCzC,KAAK6P,0BAA0B/M,KAAKN,WAEpCxC,KAAK4P,iBAAmBjG,gBAAiBlH,KACzCzC,KAAK6P,2BAA6BrN,UAGhC8M,UACFG,SAAWhQ,MAAM0C,KAAK2N,QACtBrQ,MAAM4B,IAAIoO,SAAU,cAAejN,SAE9BxC,KAAK+P,yBAA0B/P,KAAK+P,2BACzC/P,KAAK+P,uBAAuBjN,KAAK2M,WAGnChQ,MAAM6C,IAAI0N,aAAa,OAAQhQ,KAAMA,KAAKiQ,cAAe7L,WAElDkL,QAAUG,SAASnC,QAAU9K,SAGtC5B,QAAS,WACP,MAAOZ,MAAKmP,eAAc,IAG5Be,SAAU,WACR,MAAOlQ,MAAKmP,eAAc,IAG5BA,cAAe,SAASG,QAASlL,WAC/B,GAAIrB,MAAO/C,KAEPmQ,oBAAsBnQ,KAAKoQ,2BAC/B,IAAId,SAAWa,oBACb,MAAOA,oBACF,IAAInQ,KAAKyE,oBACd,MAAI6K,SACK,GAAI7P,OAAM0C,KAAKC,QAAQ,SAASC,SACrCA,QAAQU,KAAK0B,uBAGRzE,KAAKyE,mBAIhB,IAAIjC,SAAUxC,KAAKyE,oBAAsBhF,MAAM8D,YAAYgG,QAAQ/E,WAAYxE,KAAMoE,UAAWA,YAE5FkJ,QAAUtN,KAAKoQ,4BAA8BpQ,KAAK0E,QAAQ9D,QAAQZ,KAAMwC,QAc5E,OAZA8K,SAAQ,WAAW,WACjBvK,KAAKqN,4BAA8B,OAIjC9C,QAAQzI,MACVyI,QAAQzI,KAAK,KAAM,WAEjB,MADA9B,MAAK0B,oBAAsB,KACpBhF,MAAM0C,KAAKkO,OAAOC,MAAM,KAAMvB,aAIlCO,QAAUhC,QAAU9K,SAG7B+N,SAAU,SAASrP,IACjB,MAAOlB,MAAKoJ,eAAelI,IAAI,IAGjCsP,UAAW,SAAStP,IAClB,MAAOlB,MAAKoJ,eAAelI,IAAI,IAGjCkI,eAAgB,SAASlI,GAAIoO,QAASlL,WACpC,CAAA,GAGIqM,mBAHAxP,OAASjB,KAAKmE,kBAAkBjD,GAAIkD,WACpCV,SAAWtC,IAAIH,OAAQ,WACbG,KAAIpB,KAAM,WAGxB,MAAI0D,UACE4L,QACK,GAAI7P,OAAM0C,KAAKC,QAAQ,SAASC,SACrCA,QAAQpB,UAGHA,QAIXwP,kBAAoBzQ,KAAK0Q,WAAWzP,OAAQC,IAErCoO,QAAUmB,kBAAoBxP,SAGvC2O,iBAAkB,KAClBC,0BAA2B,KAC3BE,uBAAwB,KAExBzL,OAAQ,SAASpD,GAAIkD,WACnB,GAAInD,QAASjB,KAAKmE,kBAAkBjD,GAAIkD,UAExC,OADAnD,QAAOI,IAAI,YAAY,GAChBrB,KAAK0Q,WAAWzP,OAAQC,KAGjCwP,WAAY,SAASzP,OAAQC,IAC3B,GACIuO,UADA/K,QAAUtD,IAAIpB,KAAM,UAGxB,OAAI0E,SAAQ/D,WAAa+D,QAAQ/D,SAASN,iBACpCL,KAAK4P,iBACFpK,SAASxF,KAAK4P,iBAAkB1O,KAAOlB,KAAK4P,iBAAiB9M,KAAK5B,KAEvElB,KAAK4P,kBAAoB1O,IACzBlB,KAAK6P,8BAGPJ,SAAWhQ,MAAM0C,KAAK2N,QAGtBrQ,MAAM4B,IAAIoO,SAAU,cAAexO,QAE9BjB,KAAK+P,yBAA0B/P,KAAK+P,2BACzC/P,KAAK+P,uBAAuBjN,KAAK2M,UAEjChQ,MAAM6C,IAAI0N,aAAa,OAAQhQ,KAAMA,KAAKiQ,cAAehP,OAAOmD,WAEzDqL,SAASnC,SAET5I,QAAQjE,KAAKQ,OAAQC,KAIhC+O,cAAe,SAAS7L,WACtB,GAKIkJ,SACA3K,EANAgO,SAAW3Q,KAAK4P,iBAChBgB,kBAAoB5Q,KAAK6P,0BACzBgB,eAAiB7Q,KAAK+P,uBACtBhN,KAAO/C,KACP8Q,aAQJ,KAJA9Q,KAAK4P,iBAAmB,KACxB5P,KAAK6P,0BAA4B,KACjC7P,KAAK+P,uBAAyB,KAEzBpN,EAAI,EAAGA,EAAIgO,SAAS9N,OAAQF,IAC1B3C,KAAKmE,kBAAkBwM,SAAShO,IAAIvB,IAAI,aAC3C0P,WAAWhO,KAAK6N,SAAShO,GAI7B,IAA0B,IAAtBmO,WAAWjO,OACbyK,QAAUlM,IAAIpB,KAAM,WAAWS,KAAKT,KAAKmE,kBAAkB2M,WAAW,GAAI1M,WAAY0M,WAAW,QAC5F,CACL,GAAIC,aAActR,MAAM8D,YAAYgG,QAAQmG,KAAMiB,SAAUvM,UAAWA,WAC7C,KAAtB0M,WAAWjO,QACbyK,QAAU,GAAI7N,OAAM0C,KAAKC,QAAQ,SAASC,SAAmBA,QAAQ0O,eACrEA,YAAYhN,gBAEZuJ,QAAUlM,IAAIpB,KAAM,WAAWW,SAASX,KAAM+Q,YAAaD,YAI/DxD,QAAQzI,KAAK,WACX,IAAK,GAAIlC,GAAI,EAAGC,EAAIgO,kBAAkB/N,OAAYD,EAAJD,EAAOA,IACnDiO,kBAAkBjO,GAAGqB,gBAAgBjB,KAGvC,IAAI8N,eACF,IAAKlO,EAAI,EAAGC,EAAIiO,eAAehO,OAAYD,EAAJD,EAAOA,IAAK,CACjD,GAAIqO,aAAcvR,MAAM2B,IAAIyP,eAAelO,GAAI,cAC/CkO,gBAAelO,GAAGN,QAAQ2O,gBAG7BnM,KAAK,KAAM,SAASoM,UACrB,GAAIJ,eACF,IAAK,GAAIlO,GAAI,EAAGC,EAAIiO,eAAehO,OAAYD,EAAJD,EAAOA,IAChDkO,eAAelO,GAAG0N,OAAOY,aAMjCC,yBAA0B,SAAShQ,GAAIkD,WACrC,GAAI+M,KAAMnR,KAAKoR,kBAAkBlQ,GACjC,OAAGiQ,MAAOA,IAAIlQ,QACNkQ,IAAIlQ,OAAOmD,YACf+M,IAAIlQ,OAAOmD,UAAYA,WAElB+M,IAAIlQ,QAENoQ,QAGTlN,kBAAmB,SAASjD,GAAIkD,WAC9B,GAAInD,OAKJ,IAJKjB,KAAAA,eACHiB,OAASjB,KAAKkR,yBAAyBhQ,GAAIkD,aAGxCnD,OAAQ,CACX,GAAIY,YAAaT,IAAIpB,KAAM,cACvBwJ,OAAS9F,UAAU,EAKvB,IAHA8F,MAAM3H,YAAcX,GACpBsI,MAAMpF,UAAYA,UAClBnD,OAASjB,KAAKuJ,OAAOC,QAChBxJ,KAAAA,aAAgB,CACnB,GAAIsR,gBAAiBtR,KAAKsR,gBAAkBtR,KAAKsR,eAAepQ,GAC5DoQ,iBACFrQ,OAAOD,KAAKE,GAAIoQ,iBAKtB,MAAOrQ,SAITuM,kBAAmB,SAASvM,QACtBjB,KAAKyE,qBACPzE,KAAKyE,oBAAoB8J,UAAUtN,QAEjCjB,KAAK2P,cACP3P,KAAK2P,aAAatG,QAAQ,SAAS0H,aAC7BA,sBAAuBtR,OAAMqF,qBAC/BiM,YAAYrL,0BAA0BzE,QACtC8P,YAAY7L,gBAEZ6L,YAAYxC,UAAUtN,WAM9BsQ,OAAQ,SAAUtQ,QAChBjB,KAAKwR,wBAAwBvQ,QAC7BjB,KAAK0N,uBAAuBzM,OAC5B,IAAIY,YAAaZ,OAAOG,IAAIA,IAAIpB,KAAM,cACtCA,MAAKyR,gBAAgB5P,aAGvB6P,WAAY,WACV1R,KAAKsR,eAAiBD,OACtBrR,KAAK2R,gBAAkBN,OACvBrR,KAAKyE,oBAAsB4M,QAG7BI,gBAAiB,SAAUjH,KACrBxK,KAAKsR,gBAAkBtR,KAAKsR,eAAe9G,YACtCxK,MAAKsR,eAAe9G,KAE1BxK,KAAK2R,iBAAmB3R,KAAK2R,gBAAgBnH,YACvCxK,MAAK2R,gBAAgBnH,MAIhCgH,wBAAyB,SAASvQ,QAC5BA,OAAOkN,uBACTlN,OAAOkN,qBAAqB9E,QAAQ,SAASuI,cAC3CA,aAAa3L,aAAahF,UAE5BA,OAAOkN,qBAAuB,OAIlCT,uBAAwB,SAASzM,QAC3BjB,KAAKyE,qBACPzE,KAAKyE,oBAAoB6B,aAAarF,QAEpCjB,KAAK2P,cACP3P,KAAK2P,aAAatG,QAAQ,SAAS0H,aACjCA,YAAYzK,aAAarF,WAM/BkC,oBAAqB,SAAShC,KAAMiD,WAClC,GAAInD,OAQJ,OAJEA,QAHGE,KAAKC,IAAIpB,KAAM,eAGTA,KAAKmE,kBAAkBhD,KAAKC,IAAIpB,KAAM,eAAgBoE,WAFtDpE,KAAKuJ,QAAQ7F,UAAU,EAAOU,UAAWA,YAKpDnD,OAAOD,KAAKG,KAAKC,IAAIpB,KAAM,eAAgBmB,MACpCF,QAGT+D,oBAAqB,SAAS+L,aACvB/Q,KAAK2P,eAAgB3P,KAAK2P,iBAC/B3P,KAAK2P,aAAa7M,KAAKiO,cAGzBc,sBAAuB,SAASd,aACzB/Q,KAAK2P,cACVlQ,MAAMqC,EAAE9B,KAAK2P,cAAcrJ,aAAayK,cAG1C1L,oBAAqB,SAASyM,UAC5B,GAAK9R,KAAK2R,gBAAV,CACA,GAAIlP,KAAMlC,OAAOwR,KAAK/R,KAAK2R,gBAC3BlP,KAAIyB,IAAI,SAAShD,IACf,MAAOlB,MAAKoR,kBAAkBlQ,IAAID,QACjCjB,MAAMqJ,QAAQyI,YAGnB9Q,KAAM,SAASgR,OAAQ5N,WACQ,UAAzB3E,MAAMwS,OAAOD,UAAuBA,QAAUA,SAE7ChS,KAAKsR,iBAAkBtR,KAAKsR,kBAEjC,KAAK,GAAI3O,GAAI,EAAGC,EAAIoP,OAAOnP,OAAYD,EAAJD,EAAOA,IAAK,CAC7C,GAAIyI,MAAO4G,OAAOrP,GACdd,WAAauJ,KAAKhK,IAAIpB,KAAM,eAC5BiB,OAASjB,KAAKkR,yBAAyBrP,WAAYuC,UAEnDnD,QACFA,OAAOD,KAAKa,WAAYuJ,MAExBpL,KAAKsR,eAAezP,YAAcuJ,OAKxCgG,kBAAmB,SAASlQ,IAE1B,MADKlB,MAAK2R,kBAAmB3R,KAAK2R,oBAC3B3R,KAAK2R,gBAAgBzQ,KAG9BiK,2BAA4B,SAASjK,IACnC,GAAIgI,WAAYlJ,KAAKoR,kBAAkBlQ,GAMvC,OAJKgI,aACHA,UAAYlJ,KAAKgL,iBAAiB9J,KAG7BgI,WAGT8B,iBAAkB,SAAS9J,IACpBlB,KAAK2R,kBAAmB3R,KAAK2R,oBAElClS,MAAM+P,OAAO,UAAYtO,GAAK,sDAAwDlB,KAAKE,WAAa,KAAMgB,KAAOlB,KAAK2R,gBAAgBzQ,IAE1I,IAAIgI,YACFhI,GAAIA,GACJmF,SAAUrG,KAAK2O,mBAKjB,OAFA3O,MAAKkL,gBAAgBhC,WAEdA,WAGTgC,gBAAiB,SAAShC,WACnBlJ,KAAK2R,kBAAmB3R,KAAK2R,oBAI7BlS,MAAMyS,QAAQhJ,UAAUhI,MAC3BlB,KAAK2R,gBAAgBzI,UAAUhI,IAAMgI,iBAQ3C,WAIA,QAAS0D,SAAQ3L,QACf,GAAIgL,MAAOjM,KAAKiM,IAEhB,IAAyB,gBAAdjM,MAAKiM,MAAqBjM,KAAKiM,OACxCjM,KAAKiM,KAAO7K,IAAI3B,MAAMyM,OAAQlM,KAAKiM,OAE9BjM,KAAKiM,MAAM,CACd,GAAIkG,OAAQlR,OAAOmD,UAAU8H,OAAO,aACpClM,MAAKiM,KAAOkG,MAAMC,SAASnG,MAC3BjM,KAAKiM,KAAKyC,aAAchK,QAASyN,MAAME,WAAWpG,QAItD,MAAOjM,MAAKiM,KAfd,GAAI7K,KAAM3B,MAAM2B,GAkBhB3B,OAAM6S,QAAU,SAASrG,KAAMlB,SAC7BA,QAAUA,WAEV,IAAIf,OAASiC,KAAMA,KAAMQ,gBAAgB,EAAM1B,QAASA,QAASqC,KAAM,UAAWR,QAASA,QAE3F,OAAOnN,OAAMmE,SAAS,SAAS2O,YAAaC,gBAAiBC,eAC3DxG,KAAOjC,KAAK4C,QAAQ5M,MACpBP,MAAM+P,OAAO,wBAAyB/P,MAAMyS,QAAQjG,MAEpD,IAAIzB,KAAMO,QAAQP,KAAO+H,WAEzB,OAAIxD,WAAUlM,OAAS,EACd4P,cAAcC,WAAWF,iBAEzBxS,KAAK2S,WAAWnI,IAAKyB,KAAMjC,KAAMhK,KAAKoE,aAE9CuC,WAAWqD,KAAKA,OAGrBvK,MAAM0K,MAAMyI,QACVD,WAAY,SAASnI,IAAKyB,KAAMjC,KAAM5F,WACpC,GAAI4H,UAAWhC,KAAKe,QAAQiB,SACxB6G,gBAAkB7G,SAAWvM,MAAM6J,qBAAuB7J,MAAMwJ,aAEhE6J,WAAaD,gBAAgBtJ,QAC/Bf,OAAQxI,KACRwE,WAAYyH,KACZhI,QAASjE,KAAKsO,mBAAmB9D,IAAKyB,KAAMD,UAC5CA,SAAUA,SACVxB,IAAKA,IACL/B,gBAAiBuB,KAAKvB,gBACtBrE,UAAWA,WAKb,OAFApE,MAAKkO,sBAAsB4E,YAEpBA,iBAOX,WAKA,QAASC,UAAS9R,QAChB,MAAIA,QAAOmD,UACFnD,OAAOmD,UAAU8H,OAAO,cAG1B,KAGT,QAASU,SAAQ3L,QACf,GAAIgL,MAAOjM,KAAKiM,IAEhB,IAAyB,gBAAdjM,MAAKiM,MAAqBjM,KAAKiM,OACxCA,KAAOxM,MAAM2B,IAAI3B,MAAMyM,OAAQlM,KAAKiM,OAE/BA,MAAM,CACT,GAAIkG,OAAQY,SAAS9R,OACrBgL,MAAOkG,MAAMC,SAASpS,KAAKiM,MAC3BA,KAAKyC,aAAchK,QAASyN,MAAME,WAAWrS,KAAKiM,QAItD,MAAOA,MAxBT,GAAI7K,KAAM3B,MAAM2B,IACZC,IAAM5B,MAAM4B,GA0BhB5B,OAAMwO,UAAY,SAAShC,KAAMlB,SAC/BA,QAAUA,WAEV,IAAIf,OAASiC,KAAMA,KAAMQ,gBAAgB,EAAM1B,QAASA,QAASqC,KAAM,YAAaR,QAASA,QAE7F,OAAOnN,OAAMmE,SAAS,SAAS2O,YAAa9H,MAAOuI,UACjD/G,KAAOjC,KAAK4C,QAAQ5M,MACpBP,MAAM+P,OAAO,yBAA0B/P,MAAMyS,QAAQjG,MAErD,IAAIzB,KAAMO,QAAQP,KAAO+H,YAErB7H,gBAAkBtJ,IAAIpB,KAAM,oBAC5BiT,wBAAyB,EACzBlQ,KAAO/C,KAEPkT,aAAe,SAASC,QACtBA,OAAO/R,IAAI,WACb2B,KAAK2F,yBAAyB6J,aAE9BxP,KAAK4F,yBAAyB4J,aASlC,IALK7H,kBACHA,mBACAuI,wBAAyB,GAGvBlE,UAAUlM,OAAS,EA2BrB,MAzBI4H,QACFhL,MAAM+P,OAAO/P,MAAMwK,OAAOmJ,IAAI,kEACjB3I,MAAMxK,YAAagM,OACpBxB,gBAAiBwB,OAG3B+G,WAAavI,MACfC,gBAAgBjF,WAAW8M,aAE3B7H,gBAAgBpE,aAAaiM,aAG3BU,wBACF5R,IAAIrB,KAAM,mBAAoB0K,iBAG5BV,KAAKe,QAAQiB,WACXgH,UACFA,SAAS1K,eAAe,UAAW4K,cAEjCzI,OACFA,MAAM7E,YAAY,UAAWsN,eAIhB7B,SAAV5G,MAAsB,KAAOA,KAEpC,IAAI0H,OAAQY,SAAS/S,KAOrB,OANAyK,OAAQzK,KAAKqT,aAAa7I,IAAKyB,KAAMjC,KAAMmI,OAC3CnS,KAAKyO,mBAAmBzE,MACV,OAAVS,OAAkBT,KAAKe,QAAQiB,WACjCvB,MAAMrJ,IAAI,WACVqJ,MAAM7E,YAAY,UAAWsN,eAExBzI,QAER9D,SAAS,SAASqD,KAAKA,OAG5BvK,MAAM0K,MAAMyI,QACVS,aAAc,SAAS7I,IAAKyB,KAAMjC,KAAMmI,OACtC,GACIlR,QADAqS,UAAYlS,IAAIpB,KAAM,SAAWwK,IAGrC,IAAI/K,MAAM8T,OAAOD,WACf,MAAO,KAGT,IAAItJ,KAAKe,QAAQiB,SAAU,CACzB,GAAInK,YAAaT,IAAI6K,KAAM,cACzB/K,GAAKoS,UAAUzR,WACjBZ,QAASgL,KAAK1C,QAAS7F,UAAU,EAAOxC,GAAIA,GAAIkD,UAAWpE,KAAKoE,YAChEnD,OAAOD,KAAKE,GAAIoS,eAGdrS,QADEkR,MACOA,MAAMqB,UAAUxJ,KAAKiC,KAAMqH,WAE3BrH,KAAKxL,KAAK6S,UAIvB,OAAOrS,cAOX,WAmCA,QAASwS,aAAYhJ,MAAOwB,MAC1B,MAAIA,OAAQA,KAAKwH,YACRxH,KAAKwH,YAAYhJ,OACfwB,MAAQxM,MAAM0K,MAAMgD,UAAUlB,MAChCxM,MAAM0K,MAAMgD,UAAUlB,MAAMwH,YAAYhJ,OAExCA,MAIX,QAASyC,WAAUzC,MAAOwB,MACxB,MAAIA,OAAQA,KAAKiB,UACRjB,KAAKiB,UAAUzC,OACbwB,MAAQxM,MAAM0K,MAAMgD,UAAUlB,MAChCxM,MAAM0K,MAAMgD,UAAUlB,MAAMiB,UAAUzC,OAEtCA,MAjDX,GAAIrJ,KAAM3B,MAAM2B,IACZC,IAAM5B,MAAM4B,IACZ2I,KAAOvK,MAAMuK,IAEjBvK,OAAM0K,MAAMgD,aAEZ1N,MAAM0K,MAAMgD,UAAUuG,OACpBD,YAAa,SAASE,QACpB,MAAKA,QACE,GAAID,MAAKC,QADM,MAGxBzG,UAAW,SAAU0G,MACnB,MAAKA,MACEA,KAAKC,cADQ,MAGtBC,QAAS,SAASC,KAAMC,MAGtB,MAFID,gBAAgBL,QAAQK,KAAO/T,KAAKkN,UAAU6G,OAC9CC,eAAgBN,QAAQM,KAAOhU,KAAKkN,UAAU8G,OAC3CD,OAASC,OAIpBvU,MAAM0K,MAAMgD,UAAU8G,SACpBR,YAAa,SAASE,QACpB,MAAKA,SAAqB,IAAXA,OACRM,OAAON,QADwB,MAGxCzG,UAAW,SAAUgH,QACnB,MAAKA,SAAqB,IAAXA,OACRD,OAAOC,QADwB,OAyB1CzU,MAAM0U,KAAO,SAASlI,KAAMlB,SAC1B,MAAOtL,OAAMmE,SAAS,SAAS4G,IAAKC,OAClC,GAAItJ,MAAOC,IAAIpB,KAAM,SACjB4K,QAAU5K,KAAK4K,QAAQJ,KACvB4J,UAAYjT,MAAQC,IAAID,KAAMyJ,SAC9ByJ,aAAerK,KAAKhK,MAAMqM,QAAUrM,KACpC0K,gBAAkBtJ,IAAIpB,KAAM,oBAC5BiT,wBAAyB,CAO7B,OALKvI,mBACHA,mBACAuI,wBAAyB,GAGF,IAArBlE,UAAUlM,QACRwR,eACGlT,OACHA,QACAE,IAAIrB,KAAM,QAASmB,OAErBiT,UAAYjT,KAAKyJ,SAAWH,OAG1B2J,YAAclH,UAAUzC,MAAOwB,MACjCvB,gBAAgBjF,WAAW+E,KAE3BE,gBAAgBpE,aAAakE,KAG3ByI,wBACF5R,IAAIrB,KAAM,mBAAoB0K,iBAGzBD,OAGM,MAAX2J,WAAmBrJ,SAAiC,MAAtBA,QAAQuJ,aACjC7U,MAAM8U,KAAKxJ,QAAQuJ,cAGrBtU,KAAKuK,QAAQC,IAAKiJ,YAAYW,UAAWnI;GAC/CtF,SAAS,SAASqD,MAAMuC,aAAa,EAAMN,KAAMA,KAAMlB,QAASA,cAMrE,WAEA,GAAI3J,KAAM3B,MAAM2B,GAEhB3B,OAAM+U,YAAc/U,MAAMa,QAAQE,QAChCC,KAAM,SAASQ,OAAQC,IACrB,GAAIuT,KAAMzU,KAAK0U,SAASzT,OAAOhB,YAAaiB,IACxC6B,KAAO/C,IAEX,OAAOA,MAAK2U,KAAKF,KAAK5P,KAAK,SAAS1D,MAElC,MADA4B,MAAK6R,QAAQ3T,OAAQC,GAAIC,MAClBF,UAIX2T,QAAS,SAAS3T,OAAQC,GAAIC,MAC5B,GAAI8B,SAAU7B,IAAIH,OAAOhB,YAAa,WAClC4U,WAAa5R,QAAU7B,IAAID,KAAM8B,SAAW9B,IAEhDF,QAAOD,KAAKE,GAAI2T,aAGlBjU,QAAS,SAASa,MAAOe,SACvB,GAAIiS,KAAMzU,KAAK0U,SAASjT,OACpBsB,KAAO/C,IAEX,OAAOA,MAAK2U,KAAKF,KAAK5P,KAAK,SAAS1D,MAElC,MADA4B,MAAK+R,WAAWrT,MAAOe,QAASrB,MACzBqB,WAIXsS,WAAY,SAASrT,MAAOe,QAASrB,MACnC,GAAI4T,eAAgB3T,IAAIK,MAAO,iBAC3BoT,WAAaE,cAAgB3T,IAAID,KAAM4T,eAAiB5T,IAE5DqB,SAAQxB,KAAKS,MAAOoT,aAGtBnU,UAAW,SAASe,MAAOe,QAAS4M,QAClC,GAAIqF,KAAMzU,KAAK0U,SAASjT,OACpBsB,KAAO/C,IAEX,OAAOA,MAAK2U,KAAKF,IAAKrF,QAAQvK,KAAK,SAAS1D,MAE1C,MADA4B,MAAKiS,aAAavT,MAAOe,QAAS4M,OAAQjO,MACnCqB,WAIXwS,aAAc,SAASvT,MAAOe,QAAS4M,OAAQjO,MAC3C,GAAI4T,eAAgB3T,IAAIK,MAAO,iBAC3BoT,WAAaE,cAAgB3T,IAAID,KAAM4T,eAAiB5T,IAE5DqB,SAAQxB,KAAKS,MAAOoT,aAGxBhU,aAAc,SAASI,QACrB,GAAIwT,KAAMzU,KAAK0U,SAASzT,OAAOhB,aAC3B8C,KAAO/C,IAEX,OAAOA,MAAK2U,KAAKF,IAAKxT,OAAOiC,SAAU,QAAQ2B,KAAK,SAAS1D,MAE3D,MADA4B,MAAKK,gBAAgBnC,OAAQE,MACtBF,UAIXmC,gBAAiB,SAASnC,OAAQE,MAChCnB,KAAKiV,oBAAoBhU,OAAQE,MACjCF,OAAOmC,mBAGTtC,WAAY,SAASG,QACnB,GAAIY,YAAaT,IAAIH,OAAOhB,YAAa,cACrCwU,IAAMzU,KAAK0U,SAASzT,OAAOhB,YAAamB,IAAIH,OAAQY,aACpDkB,KAAO/C,IAEX,OAAOA,MAAK2U,KAAKF,IAAKxT,OAAOiC,SAAU,OAAO2B,KAAK,SAAS1D,MAE1D,MADA4B,MAAKM,cAAcpC,OAAQE,MACpBF,UAIXoC,cAAe,SAASpC,OAAQE,MAC9BnB,KAAKiV,oBAAoBhU,OAAQE,MACjCF,OAAOoC,iBAGTtC,aAAc,SAASE,QACrB,GAAIY,YAAaT,IAAIH,OAAOhB,YAAa,cACrCwU,IAAMzU,KAAK0U,SAASzT,OAAOhB,YAAamB,IAAIH,OAAQY,aACpDkB,KAAO/C,IAEX,OAAOA,MAAK2U,KAAKF,IAAKxT,OAAOiC,SAAU,UAAU2B,KAAK,SAAS1D,MAC7D4B,KAAKO,gBAAgBrC,OAAQE,SAIjCmC,gBAAiB,SAASrC,QACxBA,OAAOqC,mBAGTqR,KAAM,SAASF,IAAKrF,OAAQ8F,OAAQC,UAClC,MAAOnV,MAAKoV,MAAMX,IAAKrF,OAAS8F,QAAU,MAAQC,WAGpDT,SAAU,SAASjT,MAAOP,IACxB,GAAImU,SAAUjU,IAAIK,MAAO,OACrB6T,UAAYlU,IAAIK,MAAO,cAAgB,EAC3C,KAAK4T,QAAW,KAAM,IAAIlV,OAAM,8DAEhC,OAAKV,OAAMyS,QAAQhR,IAGVmU,QAAUC,UAFVD,QAAU,IAAMnU,GAAKoU,WAMhCC,aAAc,SAASd,IAAKS,QAC1B,OACET,IAAKA,IACLxI,KAAMiJ,OACNM,SAAU,SAIdJ,MAAO,SAASX,IAAKrF,OAAQ8F,OAAQC,UAKnC,MAJKA,YACHA,SAAWnV,KAAKuV,aAAad,IAAKS,SAG7B,GAAIzV,OAAM0C,KAAKC,QAAQ,SAASC,QAASgO,QAC1CjB,SACa,QAAX8F,OACFC,SAAShU,KAAOiO,QAEhB+F,SAASM,YAAc,kCACvBN,SAAShU,KAAOuU,KAAKC,UAAUvG,UAInC+F,SAASS,QAAU,SAAS5S,MAC1BvD,MAAM6C,IAAI,KAAMD,QAASW,OAG3BmS,SAASU,MAAQ,SAASC,OAEpBA,OAA0B,gBAAVA,SAClBA,MAAMjR,KAAO,MAGfpF,MAAM6C,IAAI,KAAM+N,OAAQyF,QAI1BrW,MAAMsW,EAAEpB,KAAKQ,aAIjBF,oBAAqB,SAAShU,OAAQE,MACpC,GAAI8B,SAAU7B,IAAIH,OAAOhB,YAAa,WAClC4B,WAAaT,IAAIH,OAAOhB,YAAa,aAErCkB,QACFA,KAAO8B,QAAU7B,IAAID,KAAM8B,SAAW9B,KACjC1B,MAAMyS,QAAQ/Q,OACjBF,OAAOD,KAAKG,KAAKU,YAAaV,aAStC,WAEA,GAAIC,KAAM3B,MAAM2B,GAEhB3B,OAAMuW,YAAc,SAASC,QAC3B,GAAIxW,MAAM8T,OAAO0C,QACf,MAAO,KACF,IAAIA,OAAOpR,KAChB,MAAOoR,OAEP,IAAIxG,UAAWhQ,MAAM0C,KAAK2N,OAU1B,OARI1O,KAAI6U,OAAQ,cAAgB7U,IAAI6U,OAAQ,SAC1CxG,SAASpN,QAAQ4T,QAEjBA,OAAOC,IAAI,UAAWlW,KAAM,WAC1ByP,SAASpN,QAAQ4T,UAIdxG,SAASnC,YAOpB,WAKA,GAAK7N,MAAM0W,YAAX,CAEA,GAAI/U,KAAM3B,MAAM2B,IAAKgV,WAAa3W,MAAMwK,OAAOmM,WAAYrM,WAAatK,MAAMwK,OAAOF,WAEjFsM,aAAe5W,MAAM0W,YAAY3V,QACnC8V,WAAY,WACV,QACI3L,KAAM,QAAS4L,KAAM,QACrB5L,KAAM,aAAc4L,KAAM,aAC1B5L,KAAM,UAAW4L,KAAM,WAI7BC,OAAQ,SAAS/U,OACf,MAAOA,SAAUhC,MAAM0K,OAAS1K,MAAM0K,MAAMqM,OAAO/U,QAGrDgV,eAAgB,SAASxK,MACvB,GAAIyK,YAAcC,MAAQ,EAAG5T,KAAO/C,IAMpC,OALAiM,MAAKa,gBAAgBzD,QAAQ,SAASsB,MAClC,GAAIgM,QAAU5T,KAAK6T,eAAkB,OAAO,CAC5C,IAAIL,MAAOH,WAAWrM,WAAWY,MAAMvK,QAAQ,IAAK,KACpDsW,SAAQ5T,MAAO6H,KAAMA,KAAM4L,KAAMA,SAE9BG,SAGTG,WAAY,SAAS5K,MACnB,GAAIzJ,WAEJ,OADAyJ,MAAK5G,oBAAoB,SAASpE,QAAUuB,QAAQM,KAAK7B,UAClDuB,SAGTsU,sBAAuB,SAAS7V,QAC9B,GAAI8B,MAAO/C,KAAM2W,MAAQ,EACrBI,cAAiB7V,GAAIE,IAAIH,OAAQ,MASrC,OAPAA,QAAOhB,YAAY6M,gBAAgBzD,QAAQ,SAASmB,KAClD,GAAImM,QAAU5T,KAAK6T,eACjB,OAAO,CAET,IAAInM,OAAQrJ,IAAIH,OAAQuJ,IACxBuM,cAAavM,KAAOC,QAEfsM,cAGTC,kBAAmB,SAAS/V,QAC1B,GAAIgW,aAAelF,KAAOtS,MAAMqC,GAAG,MAOnC,OANAb,QAAOhB,YAAY6M,gBAAgBzD,QAAQ,SAASmB,KAClDuH,KAAKjP,KAAK0H,OAEZuH,KAAK1I,QAAQ,SAASmB,KACpByM,SAASnU,KAAK1B,IAAIH,OAAQuJ,QAErByM,UAGTC,sBAAuB,SAASjW,QAC9B,OACEmJ,MAAOnJ,OAAOG,IAAI,SAClB+V,WAAYlW,OAAOG,IAAI,aAAeH,OAAOG,IAAI,SACjDgW,SAAUnW,OAAOG,IAAI,aAIzBiW,eAAgB,SAASpW,QACvB,GAAIqW,OAAQ,OAMZ,OALIrW,QAAOG,IAAI,SACbkW,MAAQ,QACCrW,OAAOG,IAAI,aACpBkW,MAAQ,QAEHA,OAGTC,cAAe,SAAStW,OAAQuW,eAC9B,GAAIC,gBAAiBhY,MAAMqC,IAAKiB,KAAO/C,KACnC0X,cAAgBjY,MAAMqC,GAAG,KAAM,QAAS,WAE5Cb,QAAOhB,YAAY6M,gBAAgBzD,QAAQ,SAASmB,KAClDkN,cAAc5U,KAAK0H,OAGrBkN,cAAcrO,QAAQ,SAASmB,KAC7B,GAAImN,SAAU,WACZH,cAAczU,KAAK6U,WAAW3W,SAEhCxB,OAAMmG,YAAY3E,OAAQuJ,IAAKmN,SAC/BF,eAAe3U,KAAK,WAClBrD,MAAM6I,eAAerH,OAAQuJ,IAAKmN,YAItC,IAAIE,SAAU,WACZJ,eAAepO,QAAQ,SAASvJ,IAAMA,OAGxC,OAAO+X,WAIXpY,OAAMqY,OAAO,oBAAqB,SAASC,aACzCA,YAAYC,aACVrN,KAAM,eAENsN,WAAY,SAAS7T,UAAW8T,aAC9BA,YAAYvY,SAAS,oBAAqB0W,uBAQhD,WAEA,QAAS8B,QAET1Y,MAAM0K,MAAMiO,MAAQ3Y,MAAMc,OAAOC,QAC/B4D,UAAW,KAEXgO,SAAU,SAASnG,MACjB,MAAOjM,MAAKoE,UAAU+H,cAAc,SAASF,OAG/CoG,WAAY,SAASpG,MACnB,GAAIvH,SAAU1E,KAAKoS,SAASnG,MAAMvH,QAC9BN,UAAYpE,KAAKoE,SAErB,OAAIM,UAAWA,UAAYjF,MAAM0K,MAAMzF,QAC9BA,SAEPA,QAAUN,UAAU+H,cAAc,WAAYF,OAC5C7H,UAAU+H,cAAc,wBACxB/H,UAAU+H,cAAc,gBAEnBzH,QAAUA,QAAQ6E,SAAW7E,UAIxC7D,aAAc,SAASoL,KAAMoM,OAC3B,GAAI5W,OAAQzB,KAAKoS,SAASnG,KAE1B,OADAxK,OAAMiN,aAAahK,QAAS1E,KAAKqS,WAAWpG,QACrCxK,MAAM8H,OAAO9J,MAAM4L,OAAOjH,UAAWpE,KAAKoE,WAAYiU,SAG/D5X,KAAM,SAASwL,KAAM/K,IAEnB,MADyB,KAArB6N,UAAUlM,SAAgB3B,GAAKiX,KAC5BnY,KAAKsY,MAAMrM,KAAM/K,IAAI,IAG9BoX,MAAO,SAASrM,KAAM/K,GAAIqX,OACxB,GAAI9W,OAAQzB,KAAKoS,SAASnG,KAM1B,OAHExK,OAAMiN,aAAahK,QAAS1E,KAAKqS,WAAWpG,QAG1C/K,KAAOiX,IACF1W,MAAM0N,cAAcoJ,MAAOvY,KAAKoE,WAC9B3E,MAAMuP,QAAQ9N,IAChBO,MAAMwN,eAAe/N,GAAIqX,MAAOvY,KAAKoE,WACrB,gBAAPlD,IACTO,MAAMyN,gBAAgBhO,GAAIqX,MAAOvY,KAAKoE,WAEtC3C,MAAM2H,eAAelI,GAAIqX,MAAOvY,KAAKoE,YAIhDoP,UAAW,SAASvH,KAAM/K,IACxB,MAAOlB,MAAKsY,MAAMrM,KAAM/K,IAAI,MAIhCzB,MAAMqY,OAAO,oBAAqB,SAASC,aACzCA,YAAYC,aACVrN,KAAM,QAENsN,WAAY,SAAS7T,UAAW8T,aAC9BA,YAAYvY,SAAS,aAAcyE,UAAU+H,cAAc,sBAAwB1M,MAAM0K,MAAMiO,OAE/FF,YAAYM,OAAO,QAAS,QAAS,cACrCN,YAAYM,OAAO,aAAc,QAAS"}
|
admin/views/slider-panel/js/ember.min.js
CHANGED
@@ -8,12 +8,12 @@
|
|
8 |
* @version 1.5.1
|
9 |
*/
|
10 |
!function(){var e,t,r,n;!function(){var i={},o={};e=function(e,t,r){i[e]={deps:t,callback:r}},n=r=t=function(e){function r(t){if("."!==t.charAt(0))return t;for(var r=t.split("/"),n=e.split("/").slice(0,-1),i=0,o=r.length;o>i;i++){var a=r[i];if(".."===a)n.pop();else{if("."===a)continue;n.push(a)}}return n.join("/")}if(n._eak_seen=i,o[e])return o[e];if(o[e]={},!i[e])throw new Error("Could not find module "+e);for(var a,s=i[e],u=s.deps,l=s.callback,c=[],h=0,m=u.length;m>h;h++)"exports"===u[h]?c.push(a={}):c.push(t(r(u[h])));var p=l.apply(this,c);return o[e]=a||p}}(),function(){"undefined"==typeof Ember&&(Ember={});{var e=(Ember.imports=Ember.imports||this,Ember.exports=Ember.exports||this);Ember.lookup=Ember.lookup||this}e.Em=e.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.5.1",Ember.ENV||(Ember.ENV="undefined"!=typeof EmberENV?EmberENV:"undefined"!=typeof ENV?ENV:{}),Ember.config=Ember.config||{},"undefined"==typeof Ember.ENV.DISABLE_RANGE_API&&(Ember.ENV.DISABLE_RANGE_API=!0),"undefined"==typeof MetamorphENV&&(e.MetamorphENV={}),MetamorphENV.DISABLE_RANGE_API=Ember.ENV.DISABLE_RANGE_API,Ember.FEATURES=Ember.ENV.FEATURES||{},Ember.FEATURES.isEnabled=function(e){var t=Ember.FEATURES[e];return Ember.ENV.ENABLE_ALL_FEATURES?!0:t===!0||t===!1||void 0===t?t:Ember.ENV.ENABLE_OPTIONAL_FEATURES?!0:!1},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,"undefined"==typeof Ember.EXTEND_PROTOTYPES&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.runInDebug&&(Ember.runInDebug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.merge=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},Ember.isNone=function(e){return null===e||void 0===e},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return Ember.isNone(e)||0===e.length&&"function"!=typeof e||"object"==typeof e&&0===Ember.get(e,"length")},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty),Ember.isBlank=function(e){return Ember.isEmpty(e)||"string"==typeof e&&null===e.match(/\S/)}}(),function(){var e=Ember.platform={};if(Ember.create=Object.create,Ember.create&&2!==Ember.create({a:1},{a:{value:2}}).a&&(Ember.create=null),!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,r){if(t.prototype=e,e=new t,r){t.prototype=e;for(var n in r)t.prototype[n]=r[n].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var r,n,i=Object.defineProperty;if(i)try{i({},"a",{get:function(){}})}catch(o){i=null}i&&(r=function(){var e={};return i(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),i(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),n=function(){try{return i(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?n||(i=function(e,t,r){var n;return n="object"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n?e[t]=r.value:Object.defineProperty(e,t,r)}):i=null),e.defineProperty=i,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,r){r.get||(e[t]=r.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=new Array(r),i=arguments[1],o=0;r>o;o++)o in t&&(n[o]=e.call(i,t[o],o,t));return n},r=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=arguments[1],i=0;r>i;i++)i in t&&e.call(n,t[i],i,t)},n=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){null===t||void 0===t?t=0:0>t&&(t=Math.max(0,this.length+t));for(var r=t,n=this.length;n>r;r++)if(this[r]===e)return r;return-1},i=e(Array.prototype.filter)?Array.prototype.filter:function(e,t){var r,n,i=[],o=this.length;for(r=0;o>r;r++)this.hasOwnProperty(r)&&(n=this[r],e.call(t,n,r,this)&&i.push(n));return i};Ember.ArrayPolyfills={map:t,forEach:r,filter:i,indexOf:n},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=r),Array.prototype.filter||(Array.prototype.filter=i),Array.prototype.indexOf||(Array.prototype.indexOf=n))}(),function(){var e=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var t=Error.apply(this,arguments);Error.captureStackTrace&&Error.captureStackTrace(this,Ember.Error);for(var r=0;r<e.length;r++)this[e[r]]=t[e[r]]},Ember.Error.prototype=Ember.create(Error.prototype),Ember.onerror=null}(),function(){function e(e){this.descs={},this.watching={},this.cache={},this.cacheMeta={},this.source=e}function t(e,t){return!(!e||"function"!=typeof e[t])}Ember.GUID_PREFIX="ember";var r=Ember.platform.defineProperty,n=Ember.create,i="__ember"+ +new Date,o=[],a={},s=0,u=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=i;var l={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,t){t||(t=Ember.GUID_PREFIX);var n=t+s++;return e&&(null===e[i]?e[i]=n:(l.value=n,r(e,i,l))),n},Ember.guidFor=function(e){if(void 0===e)return"(undefined)";if(null===e)return"(null)";var t,n=typeof e;switch(n){case"number":return t=o[e],t||(t=o[e]="nu"+e),t;case"string":return t=a[e],t||(t=a[e]="st"+s++),t;case"boolean":return e?"(true)":"(false)";default:return e[i]?e[i]:e===Object?"(Object)":e===Array?"(Array)":(t="ember"+s++,null===e[i]?e[i]=t:(l.value=t,r(e,i,l)),t)}};var c=Ember.META_DESC={writable:!0,configurable:!1,enumerable:!1,value:null},h=Ember.GUID_KEY+"_meta";Ember.META_KEY=h;var m=Ember.platform.defineProperty.isSimulated;e.prototype={descs:null,deps:null,watching:null,listeners:null,cache:null,cacheMeta:null,source:null,mixins:null,bindings:null,chains:null,chainWatchers:null,values:null,proto:null},m&&(e.prototype.__preventPlainObject__=!0,e.prototype.toJSON=function(){});var p=new e(null);u&&(p.values={}),Ember.EMPTY_META=p,Ember.meta=function(t,i){var o=t[h];return i===!1?o||p:(o?o.source!==t&&(m||r(t,h,c),o=n(o),o.descs=n(o.descs),o.watching=n(o.watching),o.cache={},o.cacheMeta={},o.source=t,u&&(o.values=n(o.values)),t[h]=o):(m||r(t,h,c),o=new e(t),u&&(o.values={}),t[h]=o,o.descs.constructor=null),o)},Ember.getMeta=function(e,t){var r=Ember.meta(e,!1);return r[t]},Ember.setMeta=function(e,t,r){var n=Ember.meta(e,!0);return n[t]=r,r},Ember.metaPath=function(e,t,r){for(var i,o,a=Ember.meta(e,r),s=0,u=t.length;u>s;s++){if(i=t[s],o=a[i]){if(o.__ember_source__!==e){if(!r)return void 0;o=a[i]=n(o),o.__ember_source__=e}}else{if(!r)return void 0;o=a[i]={__ember_source__:e}}a=o}return o},Ember.wrap=function(e,t){function r(){var r,n=this.__nextSuper;return this.__nextSuper=t,r=e.apply(this,arguments),this.__nextSuper=n,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r.__ember_listens__=e.__ember_listens__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:void 0!==e.length&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return null===e||void 0===e?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=t,Ember.tryInvoke=function(e,r,n){return t(e,r)?e[r].apply(e,n||[]):void 0};var f=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return 1!==e}();Ember.tryFinally=f?function(e,t,r){var n,i,o;r=r||this;try{n=e.call(r)}finally{try{i=t.call(r)}catch(a){o=a}}if(o)throw o;return void 0===i?n:i}:function(e,t,r){var n,i;r=r||this;try{n=e.call(r)}finally{i=t.call(r)}return void 0===i?n:i},Ember.tryCatchFinally=f?function(e,t,r,n){var i,o,a;n=n||this;try{i=e.call(n)}catch(s){i=t.call(n,s)}finally{try{o=r.call(n)}catch(u){a=u}}if(a)throw a;return void 0===o?i:o}:function(e,t,r,n){var i,o;n=n||this;try{i=e.call(n)}catch(a){i=t.call(n,a)}finally{o=r.call(n)}return void 0===o?i:o};var d={},b="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(b,function(e){d["[object "+e+"]"]=e.toLowerCase()});var v=Object.prototype.toString;Ember.typeOf=function(e){var t;return t=null===e||void 0===e?String(e):d[v.call(e)]||"object","function"===t?Ember.Object&&Ember.Object.detect(e)&&(t="class"):"object"===t&&(e instanceof Error?t="error":Ember.Object&&e instanceof Ember.Object?t="instance":e instanceof Date&&(t="date")),t},Ember.inspect=function(e){var t=Ember.typeOf(e);if("array"===t)return"["+e+"]";if("object"!==t)return e+"";var r,n=[];for(var i in e)if(e.hasOwnProperty(i)){if(r=e[i],"toString"===r)continue;"function"===Ember.typeOf(r)&&(r="function() { ... }"),n.push(i+": "+r)}return"{"+n.join(", ")+"}"}}(),function(){Ember.Instrumentation={};var e=[],t={},r=function(r){for(var n,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.regex.test(r)&&i.push(n.object);return t[r]=i,i},n=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+new Date}}();Ember.Instrumentation.instrument=function(e,i,o,a){function s(){for(f=0,d=m.length;d>f;f++)p=m[f],b[f]=p.before(e,n(),i);return o.call(a)}function u(e){i=i||{},i.exception=e}function l(){for(f=0,d=m.length;d>f;f++)p=m[f],p.after(e,n(),i,b[f]);Ember.STRUCTURED_PROFILE&&console.timeEnd(c)}var c,h,m=t[e];if(Ember.STRUCTURED_PROFILE&&(c=e+": "+i.object,console.time(c)),m||(m=r(e)),0===m.length)return h=o.call(a),Ember.STRUCTURED_PROFILE&&console.timeEnd(c),h;var p,f,d,b=[];return Ember.tryCatchFinally(s,u,l)},Ember.Instrumentation.subscribe=function(r,n){for(var i,o=r.split("."),a=[],s=0,u=o.length;u>s;s++)i=o[s],"*"===i?a.push("[^\\.]*"):a.push(i);a=a.join("\\."),a+="(\\..*)?";var l={pattern:r,regex:new RegExp("^"+a+"$"),object:n};return e.push(l),t={},l},Ember.Instrumentation.unsubscribe=function(r){for(var n,i=0,o=e.length;o>i;i++)e[i]===r&&(n=i);e.splice(n,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e,t,r,n,i;e=Array.prototype.map||Ember.ArrayPolyfills.map,t=Array.prototype.forEach||Ember.ArrayPolyfills.forEach,r=Array.prototype.indexOf||Ember.ArrayPolyfills.indexOf,i=Array.prototype.filter||Ember.ArrayPolyfills.filter,n=Array.prototype.splice;var o=Ember.EnumerableUtils={map:function(t,r,n){return t.map?t.map.call(t,r,n):e.call(t,r,n)},forEach:function(e,r,n){return e.forEach?e.forEach.call(e,r,n):t.call(e,r,n)},filter:function(e,t,r){return e.filter?e.filter.call(e,t,r):i.call(e,t,r)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):r.call(e,t,n)},indexesOf:function(e,t){return void 0===t?[]:o.map(t,function(t){return o.indexOf(e,t)})},addObject:function(e,t){var r=o.indexOf(e,t);-1===r&&e.push(t)},removeObject:function(e,t){var r=o.indexOf(e,t);-1!==r&&e.splice(r,1)},_replace:function(e,t,r,i){for(var o,a,s=[].concat(i),u=[],l=6e4,c=t,h=r;s.length;)a=h>l?l:h,0>=a&&(a=0),o=s.splice(0,l),o=[c,a].concat(o),c+=l,h-=a,u=u.concat(n.apply(e,o));return u},replace:function(e,t,r,n){return e.replace?e.replace(t,r,n):o._replace(e,t,r,n)},intersection:function(e,t){var r=[];return o.forEach(e,function(e){o.indexOf(t,e)>=0&&r.push(e)}),r}}}(),function(){var e,t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,i=/^this[\.\*]/,o=/^([^\.\*]+)/;e=function(e,n){if(""===n)return e;if(n||"string"!=typeof e||(n=e,e=null),null===e||-1!==n.indexOf("."))return s(e,n);var i,o=e[t],a=o&&o.descs[n];return a?a.get(e,n):(i=r&&o&&o.watching[n]>0?o.values[n]:e[n],void 0!==i||"object"!=typeof e||n in e||"function"!=typeof e.unknownProperty?i:e.unknownProperty(n))},Ember.config.overrideAccessors&&(Ember.get=e,Ember.config.overrideAccessors(),e=Ember.get);var a=Ember.normalizeTuple=function(t,r){var a,s=i.test(r),u=!s&&n.test(r);if((!t||u)&&(t=Ember.lookup),s&&(r=r.slice(5)),t===Ember.lookup&&(a=r.match(o)[0],t=e(t,a),r=r.slice(a.length+1)),!r||0===r.length)throw new Ember.Error("Path cannot be empty");return[t,r]},s=Ember._getPath=function(t,r){var n,o,s,u,l;if(null===t&&-1===r.indexOf("."))return e(Ember.lookup,r);for(n=i.test(r),(!t||n)&&(s=a(t,r),t=s[0],r=s[1],s.length=0),o=r.split("."),l=o.length,u=0;null!=t&&l>u;u++)if(t=e(t,o[u],!0),t&&t.isDestroyed)return void 0;return t};Ember.getWithDefault=function(t,r,n){var i=e(t,r);return void 0===i?n:i},Ember.get=e}(),function(){function e(e,t,r){for(var n=-1,i=e.length-3;i>=0;i-=3)if(t===e[i]&&r===e[i+1]){n=i;break}return n}function t(e,t){var r,n=p(e,!0);return n.listeners||(n.listeners={}),n.hasOwnProperty("listeners")||(n.listeners=m(n.listeners)),r=n.listeners[t],r&&!n.listeners.hasOwnProperty(t)?r=n.listeners[t]=n.listeners[t].slice():r||(r=n.listeners[t]=[]),r}function r(t,r,n){var i=t[f],o=i&&i.listeners&&i.listeners[r];if(o)for(var a=o.length-3;a>=0;a-=3){var s=o[a],u=o[a+1],l=o[a+2],c=e(n,s,u);-1===c&&n.push(s,u,l)}}function n(t,r,n){var i=t[f],o=i&&i.listeners&&i.listeners[r],a=[];if(o){for(var s=o.length-3;s>=0;s-=3){var u=o[s],l=o[s+1],c=o[s+2],h=e(n,u,l);-1===h&&(n.push(u,l,c),a.push(u,l,c))}return a}}function i(r,n,i,o,a){o||"function"!=typeof i||(o=i,i=null);var s=t(r,n),u=e(s,i,o),l=0;a&&(l|=b),-1===u&&(s.push(i,o,l),"function"==typeof r.didAddListener&&r.didAddListener(n,i,o))}function o(r,n,i,o){function a(i,o){var a=t(r,n),s=e(a,i,o);-1!==s&&(a.splice(s,3),"function"==typeof r.didRemoveListener&&r.didRemoveListener(n,i,o))}if(o||"function"!=typeof i||(o=i,i=null),o)a(i,o);else{var s=r[f],u=s&&s.listeners&&s.listeners[n];if(!u)return;for(var l=u.length-3;l>=0;l-=3)a(u[l],u[l+1])}}function a(r,n,i,o,a){function s(){return a.call(i)}function u(){-1!==c&&(l[c+2]&=~v)}o||"function"!=typeof i||(o=i,i=null);var l=t(r,n),c=e(l,i,o);return-1!==c&&(l[c+2]|=v),Ember.tryFinally(s,u)}function s(r,n,i,o,a){function s(){return a.call(i)}function u(){for(var e=0,t=p.length;t>e;e++){var r=p[e];f[e][r+2]&=~v}}o||"function"!=typeof i||(o=i,i=null);var l,c,h,m,p=[],f=[];for(h=0,m=n.length;m>h;h++){l=n[h],c=t(r,l);var d=e(c,i,o);-1!==d&&(c[d+2]|=v,p.push(d),f.push(c))}return Ember.tryFinally(s,u)}function u(e){var t=e[f].listeners,r=[];if(t)for(var n in t)t[n]&&r.push(n);return r}function l(e,t,r,n){if(e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r),!n){var i=e[f];n=i&&i.listeners&&i.listeners[t]}if(n){for(var a=n.length-3;a>=0;a-=3){var s=n[a],u=n[a+1],l=n[a+2];u&&(l&v||(l&b&&o(e,t,s,u),s||(s=e),"string"==typeof u&&(u=s[u]),r?u.apply(s,r):u.call(s)))}return!0}}function c(e,t){var r=e[f],n=r&&r.listeners&&r.listeners[t];return!(!n||!n.length)}function h(e,t){var r=[],n=e[f],i=n&&n.listeners&&n.listeners[t];if(!i)return r;for(var o=0,a=i.length;a>o;o+=3){var s=i[o],u=i[o+1];r.push([s,u])}return r}var m=Ember.create,p=Ember.meta,f=Ember.META_KEY,d=[].slice,b=1,v=2;Ember.on=function(){var e=d.call(arguments,-1)[0],t=d.call(arguments,0,-1);return e.__ember_listens__=t,e},Ember.addListener=i,Ember.removeListener=o,Ember._suspendListener=a,Ember._suspendListeners=s,Ember.sendEvent=l,Ember.hasListeners=c,Ember.watchedEvents=u,Ember.listenersFor=h,Ember.listenersDiff=n,Ember.listenersUnion=r}(),function(){var e=Ember.guidFor,t=Ember.sendEvent,r=Ember._ObserverSet=function(){this.clear()};r.prototype.add=function(t,r,n){var i,o=this.observerSet,a=this.observers,s=e(t),u=o[s];return u||(o[s]=u={}),i=u[r],void 0===i&&(i=a.push({sender:t,keyName:r,eventName:n,listeners:[]})-1,u[r]=i),a[i].listeners},r.prototype.flush=function(){var e,r,n,i,o=this.observers;for(this.clear(),e=0,r=o.length;r>e;++e)n=o[e],i=n.sender,i.isDestroying||i.isDestroyed||t(i,n.eventName,[i,n.keyName],n.listeners)},r.prototype.clear=function(){this.observerSet={},this.observers=[]}}(),function(){function e(e,t){var n=e[h],i=n&&n.watching[t]>0||"length"===t,a=n&&n.proto,s=n&&n.descs[t];i&&a!==e&&(s&&s.willChange&&s.willChange(e,t),r(e,t,n),o(e,t,n),l(e,t))}function t(e,t){var r=e[h],i=r&&r.watching[t]>0||"length"===t,o=r&&r.proto,s=r&&r.descs[t];o!==e&&(s&&s.didChange&&s.didChange(e,t),(i||"length"===t)&&(n(e,t,r),a(e,t,r,!1),c(e,t)))}function r(t,r,n){if(!t.isDestroying){var o=_,a=!o;a&&(o=_={}),i(e,t,r,o,n),a&&(_=null)}}function n(e,r,n){if(!e.isDestroying){var o=w,a=!o;a&&(o=w={}),i(t,e,r,o,n),a&&(w=null)}}function i(e,t,r,n,i){var o=m(t);if(n[o]||(n[o]={}),!n[o][r]){n[o][r]=!0;var a=i.deps;if(a=a&&a[r])for(var s in a){var u=i.descs[s];u&&u._suspended===t||e(t,s)}}}function o(t,r,n){if(n.hasOwnProperty("chainWatchers")&&n.chainWatchers[r]){var i,o,a=n.chainWatchers[r],s=[];for(i=0,o=a.length;o>i;i++)a[i].willChange(s);for(i=0,o=s.length;o>i;i+=2)e(s[i],s[i+1])}}function a(e,r,n,i){if(n&&n.hasOwnProperty("chainWatchers")&&n.chainWatchers[r]){var o,a,s=n.chainWatchers[r],u=i?null:[];for(o=0,a=s.length;a>o;o++)s[o].didChange(u);if(!i)for(o=0,a=u.length;a>o;o+=2)t(u[o],u[o+1])}}function s(){y++}function u(){y--,0>=y&&(E.clear(),g.flush())}function l(e,t){if(!e.isDestroying){var r,n,i=t+":before";y?(r=E.add(e,t,i),n=b(e,i,r),f(e,i,[e,t],n)):f(e,i,[e,t])}}function c(e,t){if(!e.isDestroying){var r,n=t+":change";y?(r=g.add(e,t,n),d(e,n,r)):f(e,n,[e,t])}}var h=Ember.META_KEY,m=Ember.guidFor,p=Ember.tryFinally,f=Ember.sendEvent,d=Ember.listenersUnion,b=Ember.listenersDiff,v=Ember._ObserverSet,E=new v,g=new v,y=0;Ember.propertyWillChange=e,Ember.propertyDidChange=t;var _,w;Ember.overrideChains=function(e,t,r){a(e,t,r,!0)},Ember.beginPropertyChanges=s,Ember.endPropertyChanges=u,Ember.changeProperties=function(e,t){s(),p(e,u,t)}}(),function(){function e(e,t,r,o){var a;if(a=t.slice(t.lastIndexOf(".")+1),t=t===a?a:t.slice(0,t.length-(a.length+1)),"this"!==t&&(e=n(e,t)),!a||0===a.length)throw new Ember.Error("Property set failed: You passed an empty path");if(!e){if(o)return;throw new Ember.Error('Property set failed: object in path "'+t+'" could not be found or was destroyed.')}return i(e,a,r)}var t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=Ember._getPath,i=function(n,i,o,a){if("string"==typeof n&&(o=i,i=n,n=null),!n||-1!==i.indexOf("."))return e(n,i,o,a);var s,u,l=n[t],c=l&&l.descs[i];return c?c.set(n,i,o):(s="object"==typeof n&&!(i in n),s&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,o):l&&l.watching[i]>0?(u=r?l.values[i]:n[i],o!==u&&(Ember.propertyWillChange(n,i),r?(void 0!==u||i in n)&&n.propertyIsEnumerable(i)?l.values[i]=o:Ember.defineProperty(n,i,null,o):n[i]=o,Ember.propertyDidChange(n,i))):n[i]=o),o};Ember.config.overrideAccessors&&(Ember.set=i,Ember.config.overrideAccessors(),i=Ember.set),Ember.set=i,Ember.trySet=function(e,t,r){return i(e,t,r,!0)}}(),function(){var e=Ember.set,t=Ember.guidFor,r=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},i=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,t.values=i,t.length=e.length,t},o=Ember.OrderedSet=function(){this.clear()};o.create=function(){return new o},o.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(e){var r=t(e),n=this.presenceSet,i=this.list;r in n||(n[r]=!0,i.push(e))},remove:function(e){var n=t(e),i=this.presenceSet,o=this.list;delete i[n];var a=r.call(o,e);a>-1&&o.splice(a,1)},isEmpty:function(){return 0===this.list.length},has:function(e){var r=t(e),n=this.presenceSet;return r in n},forEach:function(e,t){for(var r=this.toArray(),n=0,i=r.length;i>n;n++)e.call(t,r[n])},toArray:function(){return this.list.slice()},copy:function(){var e=new o;return e.presenceSet=n(this.presenceSet),e.list=this.toArray(),e}};var a=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};a.create=function(){return new a},a.prototype={length:0,get:function(e){var r=this.values,n=t(e);return r[n]},set:function(r,n){var i=this.keys,o=this.values,a=t(r);i.add(r),o[a]=n,e(this,"length",i.list.length)},remove:function(r){var n=this.keys,i=this.values,o=t(r);return i.hasOwnProperty(o)?(n.remove(r),delete i[o],e(this,"length",n.list.length),!0):!1},has:function(e){var r=this.values,n=t(e);return r.hasOwnProperty(n)},forEach:function(e,r){var n=this.keys,i=this.values;n.forEach(function(n){var o=t(n);e.call(r,n,i[o])})},copy:function(){return i(this,new a)}};var s=Ember.MapWithDefault=function(e){a.call(this),this.defaultValue=e.defaultValue};s.create=function(e){return e?new s(e):new a},s.prototype=Ember.create(a.prototype),s.prototype.get=function(e){var t=this.has(e);if(t)return a.prototype.get.call(this,e);var r=this.defaultValue(e);return this.set(e,r),r},s.prototype.copy=function(){return i(this,new s({defaultValue:this.defaultValue}))}}(),function(){function e(e){var t,r;Ember.imports.console?t=Ember.imports.console:"undefined"!=typeof console&&(t=console);var n="object"==typeof t?t[e]:null;return n?"function"==typeof n.apply?(r=function(){n.apply(t,arguments)},r.displayName="console."+e,r):function(){var e=Array.prototype.join.call(arguments,", ");n(e)}:void 0}function t(e,t){if(!e)try{throw new Ember.Error("assertion failed: "+t)}catch(r){setTimeout(function(){throw r},0)}}Ember.Logger={log:e("log")||Ember.K,warn:e("warn")||Ember.K,error:e("error")||Ember.K,info:e("info")||Ember.K,debug:e("debug")||e("info")||Ember.K,assert:e("assert")||t}}(),function(){var e=Ember.META_KEY,t=Ember.meta,r=Ember.platform.defineProperty,n=Ember.ENV.MANDATORY_SETTER;Ember.Descriptor=function(){};var i=Ember.MANDATORY_SETTER_FUNCTION=function(){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var r=this[e];return r&&r.values[t]}};if(Ember.defineProperty=function(e,s,u,l,c){var h,m,p,f;return c||(c=t(e)),h=c.descs,m=c.descs[s],p=c.watching[s]>0,m instanceof Ember.Descriptor&&m.teardown(e,s),u instanceof Ember.Descriptor?(f=u,h[s]=u,n&&p?r(e,s,{configurable:!0,enumerable:!0,writable:!0,value:void 0}):e[s]=void 0,Ember.FEATURES.isEnabled("composable-computed-properties")&&u.func&&u._dependentCPs&&a(e,u._dependentCPs,c)):(h[s]=void 0,null==u?(f=l,n&&p?(c.values[s]=l,r(e,s,{configurable:!0,enumerable:!0,set:i,get:o(s)})):e[s]=l):(f=u,r(e,s,u))),p&&Ember.overrideChains(e,s,c),e.didDefineProperty&&e.didDefineProperty(e,s,f),this},Ember.FEATURES.isEnabled("composable-computed-properties"))var a=function(e,t,r){for(var n,i,o=t.length,s=0;o>s;++s)n=t[s],i=n.implicitCPKey,Ember.defineProperty(e,i,n,void 0,r),n._dependentCPs&&a(e,n._dependentCPs,r)}}(),function(){var e=Ember.get;Ember.getProperties=function(t){var r={},n=arguments,i=1;2===arguments.length&&"array"===Ember.typeOf(arguments[1])&&(i=0,n=arguments[1]);for(var o=n.length;o>i;i++)r[n[i]]=e(t,n[i]);return r}}(),function(){var e=Ember.changeProperties,t=Ember.set;Ember.setProperties=function(r,n){return e(function(){for(var e in n)n.hasOwnProperty(e)&&t(r,e,n[e])}),r}}(),function(){var e=Ember.meta,t=Ember.typeOf,r=Ember.ENV.MANDATORY_SETTER,n=Ember.platform.defineProperty;Ember.watchKey=function(i,o,a){if("length"!==o||"array"!==t(i)){var s=a||e(i),u=s.watching;u[o]?u[o]=(u[o]||0)+1:(u[o]=1,"function"==typeof i.willWatchProperty&&i.willWatchProperty(o),r&&o in i&&(s.values[o]=i[o],n(i,o,{configurable:!0,enumerable:i.propertyIsEnumerable(o),set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(o)})))}},Ember.unwatchKey=function(t,i,o){var a=o||e(t),s=a.watching;1===s[i]?(s[i]=0,"function"==typeof t.didUnwatchProperty&&t.didUnwatchProperty(i),r&&i in t&&n(t,i,{configurable:!0,enumerable:t.propertyIsEnumerable(i),set:function(e){n(t,i,{configurable:!0,writable:!0,enumerable:!0,value:e}),delete a.values[i]},get:Ember.DEFAULT_GETTER_FUNCTION(i)})):s[i]>1&&s[i]--}}(),function(){function e(e){return e.match(c)[0]}function t(e,t,r){if(e&&"object"==typeof e){var i=n(e),o=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(o=i.chainWatchers={}),o[t]||(o[t]=[]),o[t].push(r),u(e,t,i)}}function r(e,t){if(!e)return void 0;var r=e[h];if(r&&r.proto===e)return void 0;if("@each"===t)return i(e,t);var n=r&&r.descs[t];return n&&n._cacheable?t in r.cache?r.cache[t]:void 0:i(e,t)}var n=Ember.meta,i=Ember.get,o=Ember.normalizeTuple,a=Ember.ArrayPolyfills.forEach,s=Ember.warn,u=Ember.watchKey,l=Ember.unwatchKey,c=/^([^\.\*]+)/,h=Ember.META_KEY,m=[];Ember.flushPendingChains=function(){if(0!==m.length){var e=m;m=[],a.call(e,function(e){e[0].add(e[1])}),s("Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos",0===m.length)}};var p=Ember.removeChainWatcher=function(e,t,r){if(e&&"object"==typeof e){var n=e[h];if(!n||n.hasOwnProperty("chainWatchers")){var i=n&&n.chainWatchers;if(i&&i[t]){i=i[t];for(var o=0,a=i.length;a>o;o++)i[o]===r&&i.splice(o,1)}l(e,t,n)}}},f=Ember._ChainNode=function(e,r,n){this._parent=e,this._key=r,this._watching=void 0===n,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&t(this._object,this._key,this)),this._parent&&"@each"===this._parent._key&&this.value()},d=f.prototype;d.value=function(){if(void 0===this._value&&this._watching){var e=this._parent.value();this._value=r(e,this._key)}return this._value},d.destroy=function(){if(this._watching){var e=this._object;e&&p(e,this._key,this),this._watching=!1}},d.copy=function(e){var t,r=new f(null,null,e),n=this._paths;for(t in n)n[t]<=0||r.add(t);return r},d.add=function(t){var r,n,i,a,s;if(s=this._paths,s[t]=(s[t]||0)+1,r=this.value(),n=o(r,t),n[0]&&n[0]===r)t=n[1],i=e(t),t=t.slice(i.length+1);else{if(!n[0])return m.push([this,t]),n.length=0,void 0;a=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]}n.length=0,this.chain(i,t,a)},d.remove=function(t){var r,n,i,a,s;s=this._paths,s[t]>0&&s[t]--,r=this.value(),n=o(r,t),n[0]===r?(t=n[1],i=e(t),t=t.slice(i.length+1)):(a=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]),n.length=0,this.unchain(i,t)},d.count=0,d.chain=function(t,r,n){var i,o=this._chains;o||(o=this._chains={}),i=o[t],i||(i=o[t]=new f(this,t,n)),i.count++,r&&r.length>0&&(t=e(r),r=r.slice(t.length+1),i.chain(t,r))},d.unchain=function(t,r){var n=this._chains,i=n[t];r&&r.length>1&&(t=e(r),r=r.slice(t.length+1),i.unchain(t,r)),i.count--,i.count<=0&&(delete n[i._key],i.destroy())},d.willChange=function(e){var t=this._chains;if(t)for(var r in t)t.hasOwnProperty(r)&&t[r].willChange(e);this._parent&&this._parent.chainWillChange(this,this._key,1,e)},d.chainWillChange=function(e,t,r,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,r+1,n):(r>1&&n.push(this.value(),t),t="this."+t,this._paths[t]>0&&n.push(this.value(),t))},d.chainDidChange=function(e,t,r,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,r+1,n):(r>1&&n.push(this.value(),t),t="this."+t,this._paths[t]>0&&n.push(this.value(),t))},d.didChange=function(e){if(this._watching){var r=this._parent.value();r!==this._object&&(p(this._object,this._key,this),this._object=r,t(r,this._key,this)),this._value=void 0,this._parent&&"@each"===this._parent._key&&this.value()}var n=this._chains;if(n)for(var i in n)n.hasOwnProperty(i)&&n[i].didChange(e);null!==e&&this._parent&&this._parent.chainDidChange(this,this._key,1,e)},Ember.finishChains=function(e){var t=e[h],r=t&&t.chains;r&&(r.value()!==e?n(e).chains=r=r.copy(e):r.didChange(null))}}(),function(){var e=Ember.EnumerableUtils.forEach,t=/^((?:[^\.]*\.)*)\{(.*)\}$/;Ember.expandProperties=function(r,n){var i,o,a;(i=t.exec(r))?(o=i[1],a=i[2],e(a.split(","),function(e){n(o+e)})):n(r)}}(),function(){function e(e,r){var i=r||t(e),o=i.chains;return o?o.value()!==e&&(o=i.chains=o.copy(e)):o=i.chains=new n(null,null,e),o}var t=Ember.meta,r=Ember.typeOf,n=Ember._ChainNode;Ember.watchPath=function(n,i,o){if("length"!==i||"array"!==r(n)){var a=o||t(n),s=a.watching;s[i]?s[i]=(s[i]||0)+1:(s[i]=1,e(n,a).add(i))}},Ember.unwatchPath=function(r,n,i){var o=i||t(r),a=o.watching;1===a[n]?(a[n]=0,e(r,o).remove(n)):a[n]>1&&a[n]--}}(),function(){function e(e){return"*"===e||!c.test(e)}var t=(Ember.meta,Ember.GUID_KEY),r=Ember.META_KEY,n=Ember.removeChainWatcher,i=Ember.watchKey,o=Ember.unwatchKey,a=Ember.watchPath,s=Ember.unwatchPath,u=Ember.typeOf,l=Ember.generateGuid,c=/[\.\*]/;Ember.watch=function(t,r,n){("length"!==r||"array"!==u(t))&&(e(r)?i(t,r,n):a(t,r,n))},Ember.isWatching=function(e,t){var n=e[r];return(n&&n.watching[t])>0},Ember.watch.flushPending=Ember.flushPendingChains,Ember.unwatch=function(t,r,n){("length"!==r||"array"!==u(t))&&(e(r)?o(t,r,n):s(t,r,n))},Ember.rewatch=function(e){var n=e[r],i=n&&n.chains;t in e&&!e.hasOwnProperty(t)&&l(e),i&&i.value()!==e&&(n.chains=i.copy(e))};var h=[];Ember.destroy=function(e){var t,i,o,a,s=e[r];if(s&&(e[r]=null,t=s.chains))for(h.push(t);h.length>0;){if(t=h.pop(),i=t._chains)for(o in i)i.hasOwnProperty(o)&&h.push(i[o]);t._watching&&(a=t._object,a&&n(a,t._key,t))}}}(),function(){function e(e,t){var r=e[t];return r?e.hasOwnProperty(t)||(r=e[t]=h(r)):r=e[t]={},r}function t(t){return e(t,"deps")}function r(r,n,i,o){var a,s,u,l,c,h=r._dependentKeys;if(h)for(a=t(o),s=0,u=h.length;u>s;s++)l=h[s],c=e(a,l),c[i]=(c[i]||0)+1,p(n,l,o)}function n(r,n,i,o){var a,s,u,l,c,h=r._dependentKeys;if(h)for(a=t(o),s=0,u=h.length;u>s;s++)l=h[s],c=e(a,l),c[i]=(c[i]||0)-1,f(n,l,o)}function i(e,t){this.func=e,Ember.FEATURES.isEnabled("composable-computed-properties")?P(this,t&&t.dependentKeys):this._dependentKeys=t&&t.dependentKeys,this._cacheable=t&&void 0!==t.cacheable?t.cacheable:!0,this._readOnly=t&&(void 0!==t.readOnly||!!t.readOnly)}function o(e){for(var t=0,r=e.length;r>t;t++)e[t].didChange(null)}function a(e,t){for(var r={},n=0;n<t.length;n++)r[t[n]]=s(e,t[n]);return r}var s=Ember.get,u=Ember.set,l=Ember.meta,c=[].slice,h=Ember.create,m=Ember.META_KEY,p=Ember.watch,f=Ember.unwatch,d=Ember.expandProperties;Ember.ComputedProperty=i,i.prototype=new Ember.Descriptor;var b=i.prototype;b._dependentKeys=void 0,b._suspended=void 0,b._meta=void 0,Ember.FEATURES.isEnabled("composable-computed-properties")&&(b._dependentCPs=void 0,b.implicitCPKey=void 0,b.toString=function(){return this.implicitCPKey?this.implicitCPKey:Ember.Descriptor.prototype.toString.apply(this,arguments)}),b.cacheable=function(e){return this._cacheable=e!==!1,this},b.volatile=function(){return this.cacheable(!1)},b.readOnly=function(e){return this._readOnly=void 0===e||!!e,this},b.property=function(){var e,t=function(t){e.push(t)};e=[];for(var r=0,n=arguments.length;n>r;r++)d(arguments[r],t);return Ember.FEATURES.isEnabled("composable-computed-properties")?P(this,e):this._dependentKeys=e,this},b.meta=function(e){return 0===arguments.length?this._meta||{}:(this._meta=e,this)},b.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=l(e);t in r.cache&&(delete r.cache[t],n(this,e,t,r))}},b.get=function(e,t){var n,i,a,s;if(this._cacheable){if(a=l(e),i=a.cache,t in i)return i[t];n=i[t]=this.func.call(e,t),s=a.chainWatchers&&a.chainWatchers[t],s&&o(s),r(this,e,t,a)}else n=this.func.call(e,t);return n},b.set=function(e,t,n){var i,o,a,s=this._cacheable,u=this.func,c=l(e,s),h=c.watching[t],m=this._suspended,p=!1,f=c.cache;if(this._readOnly)throw new Ember.Error('Cannot set read-only property "'+t+'" on object: '+Ember.inspect(e));this._suspended=e;try{if(s&&f.hasOwnProperty(t)&&(o=f[t],p=!0),i=u.wrappedFunction?u.wrappedFunction.length:u.length,3===i)a=u.call(e,t,n,o);else{if(2!==i)return Ember.defineProperty(e,t,null,o),Ember.set(e,t,n),void 0;a=u.call(e,t,n)}if(p&&o===a)return;h&&Ember.propertyWillChange(e,t),p&&delete f[t],s&&(p||r(this,e,t,c),f[t]=a),h&&Ember.propertyDidChange(e,t)}finally{this._suspended=m}return a},b.teardown=function(e,t){var r=l(e);return t in r.cache&&n(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;if(arguments.length>1&&(t=c.call(arguments,0,-1),e=c.call(arguments,-1)[0]),"function"!=typeof e)throw new Ember.Error("Computed Property declared without a property function");var r=new i(e);return t&&r.property.apply(r,t),r},Ember.cacheFor=function(e,t){var r=e[m],n=r&&r.cache;return n&&t in n?n[t]:void 0};var v,E;if(Ember.FEATURES.isEnabled("composable-computed-properties")){var g=Ember.guidFor,y=Ember.EnumerableUtils.map,_=Ember.EnumerableUtils.filter,w=(Ember.typeOf,function(e){return[g(e)].concat(e._dependentKeys).join("_").replace(/\./g,"_DOT_")
|
11 |
-
}),C=function(e){return e instanceof Ember.ComputedProperty?w(e):e},O=function(e){return y(e,function(e){return C(e)})},A=function(e){return _(e,function(e){return e instanceof Ember.ComputedProperty})},P=function(e,t){t?(e._dependentKeys=O(t),e._dependentCPs=A(t)):e._dependentKeys=e._dependentCPs=[],e.implicitCPKey=w(e)};Ember.computed.normalizeDependentKey=C,Ember.computed.normalizeDependentKeys=O,v=function(e,t){Ember.computed[e]=function(e){var r=O(c.call(arguments));return Ember.computed(e,function(){return t.apply(this,r)})}}}Ember.FEATURES.isEnabled("composable-computed-properties")?E=function(e,t){Ember.computed[e]=function(){var e=c.call(arguments),r=O(e),n=Ember.computed(function(){return t.apply(this,[a(this,r)])});return n.property.apply(n,e)}}:(v=function(e,t){Ember.computed[e]=function(e){var r=c.call(arguments);return Ember.computed(e,function(){return t.apply(this,r)})}},E=function(e,t){Ember.computed[e]=function(){var e=c.call(arguments),r=Ember.computed(function(){return t.apply(this,[a(this,e)])});return r.property.apply(r,e)}}),Ember.FEATURES.isEnabled("composable-computed-properties")&&(Ember.computed.literal=function(e){return Ember.computed(function(){return e})}),v("empty",function(e){return Ember.isEmpty(s(this,e))}),v("notEmpty",function(e){return!Ember.isEmpty(s(this,e))}),v("none",function(e){return Ember.isNone(s(this,e))}),v("not",function(e){return!s(this,e)}),v("bool",function(e){return!!s(this,e)}),v("match",function(e,t){var r=s(this,e);return"string"==typeof r?t.test(r):!1}),v("equal",function(e,t){return s(this,e)===t}),v("gt",function(e,t){return s(this,e)>t}),v("gte",function(e,t){return s(this,e)>=t}),v("lt",function(e,t){return s(this,e)<t}),v("lte",function(e,t){return s(this,e)<=t}),E("and",function(e){for(var t in e)if(e.hasOwnProperty(t)&&!e[t])return!1;return!0}),E("or",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!0;return!1}),E("any",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return e[t];return null}),E("collect",function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&(Ember.isNone(e[r])?t.push(null):t.push(e[r]));return t}),Ember.computed.alias=function(e){return Ember.computed(e,function(t,r){return arguments.length>1?(u(this,e,r),r):s(this,e)})},Ember.computed.oneWay=function(e){return Ember.computed(e,function(){return s(this,e)})},Ember.computed.readOnly=function(e){return Ember.computed(e,function(){return s(this,e)}).readOnly()},Ember.computed.defaultTo=function(e){return Ember.computed(function(t,r,n){return 1===arguments.length?null!=n?n:s(this,e):null!=r?r:s(this,e)})}}(),function(){function e(e){return e+r}function t(e){return e+n}var r=":change",n=":before";Ember.addObserver=function(t,r,n,i){return Ember.addListener(t,e(r),n,i),Ember.watch(t,r),this},Ember.observersFor=function(t,r){return Ember.listenersFor(t,e(r))},Ember.removeObserver=function(t,r,n,i){return Ember.unwatch(t,r),Ember.removeListener(t,e(r),n,i),this},Ember.addBeforeObserver=function(e,r,n,i){return Ember.addListener(e,t(r),n,i),Ember.watch(e,r),this},Ember._suspendBeforeObserver=function(e,r,n,i,o){return Ember._suspendListener(e,t(r),n,i,o)},Ember._suspendObserver=function(t,r,n,i,o){return Ember._suspendListener(t,e(r),n,i,o)};var i=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,r,n,o,a){var s=i.call(r,t);return Ember._suspendListeners(e,s,n,o,a)},Ember._suspendObservers=function(t,r,n,o,a){var s=i.call(r,e);return Ember._suspendListeners(t,s,n,o,a)},Ember.beforeObserversFor=function(e,r){return Ember.listenersFor(e,t(r))},Ember.removeBeforeObserver=function(e,r,n,i){return Ember.unwatch(e,r),Ember.removeListener(e,t(r),n,i),this}}(),function(){e("backburner/queue",["exports"],function(e){"use strict";function t(e,t,r){this.daq=e,this.name=t,this.options=r,this._queue=[]}t.prototype={daq:null,name:null,options:null,_queue:null,push:function(e,t,r,n){var i=this._queue;return i.push(e,t,r,n),{queue:this,target:e,method:t}},pushUnique:function(e,t,r,n){var i,o,a,s,u=this._queue;for(a=0,s=u.length;s>a;a+=4)if(i=u[a],o=u[a+1],i===e&&o===t)return u[a+2]=r,u[a+3]=n,{queue:this,target:e,method:t};return this._queue.push(e,t,r,n),{queue:this,target:e,method:t}},flush:function(){var e,t,r,n,i,o=this._queue,a=this.options,s=a&&a.before,u=a&&a.after,l=o.length;for(l&&s&&s(),i=0;l>i;i+=4)e=o[i],t=o[i+1],r=o[i+2],n=o[i+3],r&&r.length>0?t.apply(e,r):t.call(e);l&&u&&u(),o.length>l?(this._queue=o.slice(l),this.flush()):this._queue.length=0},cancel:function(e){var t,r,n,i,o=this._queue;for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o.splice(n,4),!0;if(o=this._queueBeingFlushed)for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o[n+1]=null,!0}},e.Queue=t}),e("backburner/deferred_action_queues",["backburner/queue","exports"],function(e,t){"use strict";function r(e,t){var r=this.queues={};this.queueNames=e=e||[];for(var n,o=0,a=e.length;a>o;o++)n=e[o],r[n]=new i(this,n,t[n])}function n(e,t){for(var r,n,i=0,o=t;o>=i;i++)if(r=e.queueNames[i],n=e.queues[r],n._queue.length)return i;return-1}var i=e.Queue;r.prototype={queueNames:null,queues:null,schedule:function(e,t,r,n,i,o){var a=this.queues,s=a[e];if(!s)throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist");return i?s.pushUnique(t,r,n,o):s.push(t,r,n,o)},flush:function(){for(var e,t,r,i,o=this.queues,a=this.queueNames,s=0,u=a.length;u>s;){e=a[s],t=o[e],r=t._queueBeingFlushed=t._queue.slice(),t._queue=[];var l,c,h,m,p=t.options,f=p&&p.before,d=p&&p.after,b=0,v=r.length;for(v&&f&&f();v>b;)l=r[b],c=r[b+1],h=r[b+2],m=r[b+3],"string"==typeof c&&(c=l[c]),c&&(h&&h.length>0?c.apply(l,h):c.call(l)),b+=4;t._queueBeingFlushed=null,v&&d&&d(),-1===(i=n(this,s))?s++:s=i}}},t.DeferredActionQueues=r}),e("backburner",["backburner/deferred_action_queues","exports"],function(e,t){"use strict";function r(e){return"number"==typeof e||g.test(e)}function n(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[]}function i(e){e.begin(),l=E.setTimeout(function(){l=null,e.end()})}function o(e,t,r){(!c||h>t)&&(c&&clearTimeout(c),c=E.setTimeout(function(){c=null,h=null,a(e)},r),h=t)}function a(e){var t,r,n,i,a=+new Date;e.run(function(){for(n=0,i=v.length;i>n&&(t=v[n],!(t>a));n+=2);for(r=v.splice(0,n),n=1,i=r.length;i>n;n+=2)e.schedule(e.options.defaultQueue,null,r[n])}),v.length&&o(e,v[0],v[0]-a)}function s(e,t){for(var r,n=-1,i=0,o=b.length;o>i;i++)if(r=b[i],r[0]===e&&r[1]===t){n=i;break}return n}function u(e,t){for(var r,n=-1,i=0,o=d.length;o>i;i++)if(r=d[i],r[0]===e&&r[1]===t){n=i;break}return n}var l,c,h,m=e.DeferredActionQueues,p=[].slice,f=[].pop,d=[],b=[],v=[],E=this,g=/\d+/;n.prototype={queueNames:null,options:null,currentInstance:null,instanceStack:null,begin:function(){var e=this.options&&this.options.onBegin,t=this.currentInstance;t&&this.instanceStack.push(t),this.currentInstance=new m(this.queueNames,this.options),e&&e(this.currentInstance,t)},end:function(){var e=this.options&&this.options.onEnd,t=this.currentInstance,r=null;try{t.flush()}finally{this.currentInstance=null,this.instanceStack.length&&(r=this.instanceStack.pop(),this.currentInstance=r),e&&e(t,r)}},run:function(e,t){var r;this.begin(),t||(t=e,e=null),"string"==typeof t&&(t=e[t]);var n=!1;try{r=arguments.length>2?t.apply(e,p.call(arguments,2)):t.call(e)}finally{n||(n=!0,this.end())}return r},defer:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var n=this.DEBUG?new Error:void 0,o=arguments.length>3?p.call(arguments,3):void 0;return this.currentInstance||i(this),this.currentInstance.schedule(e,t,r,o,!1,n)},deferOnce:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var n=this.DEBUG?new Error:void 0,o=arguments.length>3?p.call(arguments,3):void 0;return this.currentInstance||i(this),this.currentInstance.schedule(e,t,r,o,!0,n)},setTimeout:function(){function e(){t.apply(i,l)}var t,n,i,a,s,u,l=p.call(arguments),c=l.length,h=this;if(0!==c){if(1===c)t=l.shift(),n=0;else if(2===c)a=l[0],s=l[1],"function"==typeof s||"function"==typeof a[s]?(i=l.shift(),t=l.shift(),n=0):r(s)?(t=l.shift(),n=l.shift()):(t=l.shift(),n=0);else{var m=l[l.length-1];r(m)&&(n=l.pop()),a=l[0],u=l[1],"function"==typeof u||"string"==typeof u&&null!==a&&u in a?(i=l.shift(),t=l.shift()):t=l.shift()}var f=+new Date+parseInt(n,10);"string"==typeof t&&(t=i[t]);var d,b;for(d=0,b=v.length;b>d&&!(f<v[d]);d+=2);return v.splice(d,0,f,e),o(h,f,n),e}},throttle:function(e,t){var r,n,i,o,a=this,s=arguments,l=f.call(s);return"number"==typeof l||"string"==typeof l?(r=l,l=!0):r=f.call(s),r=parseInt(r,10),i=u(e,t),i>-1?d[i]:(o=E.setTimeout(function(){l||a.run.apply(a,s);var r=u(e,t);r>-1&&d.splice(r,1)},r),l&&a.run.apply(a,s),n=[e,t,o],d.push(n),n)},debounce:function(e,t){var r,n,i,o,a=this,u=arguments,l=f.call(u);return"number"==typeof l||"string"==typeof l?(r=l,l=!1):r=f.call(u),r=parseInt(r,10),n=s(e,t),n>-1&&(i=b[n],b.splice(n,1),clearTimeout(i[2])),o=E.setTimeout(function(){l||a.run.apply(a,u);var r=s(e,t);r>-1&&b.splice(r,1)},r),l&&-1===n&&a.run.apply(a,u),i=[e,t,o],b.push(i),i},cancelTimers:function(){var e,t;for(e=0,t=d.length;t>e;e++)clearTimeout(d[e][2]);for(d=[],e=0,t=b.length;t>e;e++)clearTimeout(b[e][2]);b=[],c&&(clearTimeout(c),c=null),v=[],l&&(clearTimeout(l),l=null)},hasTimers:function(){return!!v.length||l},cancel:function(e){var t=typeof e;if(e&&"object"===t&&e.queue&&e.method)return e.queue.cancel(e);if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(u,d,e)||this._cancelItem(s,b,e):void 0;for(var r=0,n=v.length;n>r;r+=2)if(v[r+1]===e)return v.splice(r,2),!0},_cancelItem:function(e,t,r){var n,i;return r.length<3?!1:(i=e(r[0],r[1]),i>-1&&(n=t[i],n[2]===r[2])?(t.splice(i,1),clearTimeout(r[2]),!0):!1)}},n.prototype.schedule=n.prototype.defer,n.prototype.scheduleOnce=n.prototype.deferOnce,n.prototype.later=n.prototype.setTimeout,t.Backburner=n})}(),function(){function e(e){try{return a.run.apply(a,e)}catch(t){Ember.onerror(t)}}function r(){!Ember.run.currentRunLoop}{var n=function(e){Ember.run.currentRunLoop=e},i=function(e,t){Ember.run.currentRunLoop=t},o=t("backburner").Backburner,a=new o(["sync","actions","destroy"],{sync:{before:Ember.beginPropertyChanges,after:Ember.endPropertyChanges},defaultQueue:"actions",onBegin:n,onEnd:i}),s=[].slice;[].concat}Ember.run=function(){return Ember.onerror?e(arguments):a.run.apply(a,arguments)},Ember.run.join=function(){if(!Ember.run.currentRunLoop)return Ember.run.apply(Ember.run,arguments);var e=s.call(arguments);e.unshift("actions"),Ember.run.schedule.apply(Ember.run,e)},Ember.run.bind=function(){var e=s.call(arguments);return function(){return Ember.run.join.apply(Ember.run,e.concat(s.call(arguments)))}},Ember.run.backburner=a;Ember.run;Ember.run.currentRunLoop=null,Ember.run.queues=a.queueNames,Ember.run.begin=function(){a.begin()},Ember.run.end=function(){a.end()},Ember.run.schedule=function(){r(),a.schedule.apply(a,arguments)},Ember.run.hasScheduledTimers=function(){return a.hasTimers()},Ember.run.cancelTimers=function(){a.cancelTimers()},Ember.run.sync=function(){a.currentInstance&&a.currentInstance.queues.sync.flush()},Ember.run.later=function(){return a.later.apply(a,arguments)},Ember.run.once=function(){r();var e=s.call(arguments);return e.unshift("actions"),a.scheduleOnce.apply(a,e)},Ember.run.scheduleOnce=function(){return r(),a.scheduleOnce.apply(a,arguments)},Ember.run.next=function(){var e=s.call(arguments);return e.push(1),a.later.apply(a,e)},Ember.run.cancel=function(e){return a.cancel(e)},Ember.run.debounce=function(){return a.debounce.apply(a,arguments)},Ember.run.throttle=function(){return a.throttle.apply(a,arguments)}}(),function(){function e(e,t){return r(o(t)?Ember.lookup:e,t)}function t(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}Ember.LOG_BINDINGS=!1||!!Ember.ENV.LOG_BINDINGS;var r=Ember.get,n=(Ember.set,Ember.guidFor),i=/^([A-Z$]|([0-9][A-Z$]))/,o=Ember.isGlobalPath=function(e){return i.test(e)},a=function(e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};a.prototype={copy:function(){var e=new a(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(t){var r=this._from,n=this._to;return Ember.trySet(t,n,e(t,r)),Ember.addObserver(t,r,this,this.fromDidChange),this._oneWay||Ember.addObserver(t,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var r=this._directionMap,n=r.get(e);n||(Ember.run.schedule("sync",this,this._sync,e),r.set(e,t)),"back"===n&&"fwd"===t&&r.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(!t.isDestroyed&&this._readyToSync){var i=this._directionMap,o=i.get(t),a=this._from,s=this._to;if(i.remove(t),"fwd"===o){var u=e(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",u,t),this._oneWay?Ember.trySet(t,s,u):Ember._suspendObserver(t,s,this,this.toDidChange,function(){Ember.trySet(t,s,u)})}else if("back"===o){var l=r(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",l,t),Ember._suspendObserver(t,a,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(a)?Ember.lookup:t,a,l)})}}}},t(a,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var r=this,n=new r(null,e);return n.oneWay(t)}}),Ember.Binding=a,Ember.bind=function(e,t,r){return new Ember.Binding(t,r).connect(e)},Ember.oneWay=function(e,t,r){return new Ember.Binding(t,r).oneWay().connect(e)}}(),function(){function e(){var e,t=this.__nextSuper;return t&&(this.__nextSuper=null,e=t.apply(this,arguments),this.__nextSuper=t),e}function t(e){var t=N(e,!0),r=t.mixins;return r?t.hasOwnProperty("mixins")||(r=t.mixins=x(r)):r=t.mixins={},r}function r(e,t){return t&&t.length>0&&(e.mixins=O.call(t,function(e){if(e instanceof _)return e;var t=new _;return t.properties=e,t})),e}function n(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function i(e,t){var r;return t instanceof _?(r=V(t),e[r]?D:(e[r]=t,t.properties)):t}function o(e,t,r,n){var i;return i=r[e]||n[e],t[e]&&(i=i?i.concat(t[e]):t[e]),i}function a(e,t,r,n,i){var o;return void 0===n[t]&&(o=i[t]),o=o||e.descs[t],o&&o instanceof Ember.ComputedProperty?(r=x(r),r.func=Ember.wrap(r.func,o.func),r):r}function s(e,t,r,n,i){var o;return void 0===i[t]&&(o=n[t]),o=o||e[t],"function"!=typeof o?r:Ember.wrap(r,o)}function u(e,t,r,n){var i=n[t]||e[t];return i?"function"==typeof i.concat?i.concat(r):Ember.makeArray(i).concat(r):Ember.makeArray(r)}function l(t,r,i,o){var a=o[r]||t[r];if(!a)return i;var u=Ember.merge({},a),l=!1;for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];n(h)?(l=!0,u[c]=s(t,c,h,a,{})):u[c]=h}return l&&(u._super=e),u}function c(e,t,r,i,o,c,h,m){if(r instanceof Ember.Descriptor){if(r===w&&o[t])return D;r.func&&(r=a(i,t,r,c,o)),o[t]=r,c[t]=void 0}else h&&A.call(h,t)>=0||"concatenatedProperties"===t||"mergedProperties"===t?r=u(e,t,r,c):m&&A.call(m,t)>=0?r=l(e,t,r,c):n(r)&&(r=s(e,t,r,c,o)),o[t]=void 0,c[t]=r}function h(e,t,r,n,a,s){function u(e){delete r[e],delete n[e]}for(var l,m,p,f,d,b,v=0,E=e.length;E>v;v++)if(l=e[v],m=i(t,l),m!==D)if(m){b=N(a),a.willMergeMixin&&a.willMergeMixin(m),f=o("concatenatedProperties",m,n,a),d=o("mergedProperties",m,n,a);for(p in m)m.hasOwnProperty(p)&&(s.push(p),c(a,p,m[p],b,r,n,f,d));m.hasOwnProperty("toString")&&(a.toString=m.toString)}else l.mixins&&(h(l.mixins,t,r,n,a,s),l._without&&P.call(l._without,u))}function m(e,t,r,n){if(M.test(t)){var i=n.bindings;i?n.hasOwnProperty("bindings")||(i=n.bindings=x(n.bindings)):i=n.bindings={},i[t]=r}}function p(e,t){var r,n,i,o=t.bindings;if(o){for(r in o)n=o[r],n&&(i=r.slice(0,-7),n instanceof Ember.Binding?(n=n.copy(),n.to(i)):n=new Ember.Binding(i,n),n.connect(e),e[r]=n);t.bindings={}}}function f(e,t){return p(e,t||N(e)),e}function d(e,t,r,n,i){var o,a=t.methodName;return n[a]||i[a]?(o=i[a],t=n[a]):r.descs[a]?(t=r.descs[a],o=void 0):(t=void 0,o=e[a]),{desc:t,value:o}}function b(e,t,r,n,i){var o=r[n];if(o)for(var a=0,s=o.length;s>a;a++)Ember[i](e,o[a],null,t)}function v(e,t,r){var n=e[t];"function"==typeof n&&(b(e,t,n,"__ember_observesBefore__","removeBeforeObserver"),b(e,t,n,"__ember_observes__","removeObserver"),b(e,t,n,"__ember_listens__","removeListener")),"function"==typeof r&&(b(e,t,r,"__ember_observesBefore__","addBeforeObserver"),b(e,t,r,"__ember_observes__","addObserver"),b(e,t,r,"__ember_listens__","addListener"))}function E(r,n,i){var o,a,s,u={},l={},c=N(r),p=[];r._super=e,h(n,t(r),u,l,r,p);for(var b=0,E=p.length;E>b;b++)if(o=p[b],"constructor"!==o&&l.hasOwnProperty(o)&&(s=u[o],a=l[o],s!==w)){for(;s&&s instanceof C;){var g=d(r,s,c,u,l);s=g.desc,a=g.value}(void 0!==s||void 0!==a)&&(v(r,o,a),m(r,o,a,c),S(r,o,s,a,c))}return i||f(r,c),r}function g(e,t,r){var n=V(e);if(r[n])return!1;if(r[n]=!0,e===t)return!0;for(var i=e.mixins,o=i?i.length:0;--o>=0;)if(g(i[o],t,r))return!0;return!1}function y(e,t,r){if(!r[V(t)])if(r[V(t)]=!0,t.properties){var n=t.properties;for(var i in n)n.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&P.call(t.mixins,function(t){y(e,t,r)})}var _,w,C,O=Ember.ArrayPolyfills.map,A=Ember.ArrayPolyfills.indexOf,P=Ember.ArrayPolyfills.forEach,T=[].slice,x=Ember.create,S=Ember.defineProperty,V=Ember.guidFor,N=Ember.meta,I=Ember.META_KEY,R=Ember.expandProperties,D={},M=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=T.call(arguments,1);return E(e,t,!1),e},Ember.Mixin=function(){return r(this,arguments)},_=Ember.Mixin,_.prototype={properties:null,mixins:null,ownerConstructor:null},_._apply=E,_.applyPartial=function(e){var t=T.call(arguments,1);return E(e,t,!0)},_.finishPartial=f,Ember.anyUnprocessedMixins=!1,_.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return r(new e,arguments)};var k=_.prototype;k.reopen=function(){var e,t;this.properties?(e=_.create(),e.properties=this.properties,delete this.properties,this.mixins=[e]):this.mixins||(this.mixins=[]);var r,n=arguments.length,i=this.mixins;for(r=0;n>r;r++)e=arguments[r],e instanceof _?i.push(e):(t=_.create(),t.properties=e,i.push(t));return this},k.apply=function(e){return E(e,[this],!1)},k.applyPartial=function(e){return E(e,[this],!0)},k.detect=function(e){if(!e)return!1;if(e instanceof _)return g(e,this,{});var t=e[I],r=t&&t.mixins;return r?!!r[V(this)]:!1},k.without=function(){var e=new _(this);return e._without=T.call(arguments),e},k.keys=function(){var e={},t={},r=[];y(e,this,t);for(var n in e)e.hasOwnProperty(n)&&r.push(n);return r},_.mixins=function(e){var t=e[I],r=t&&t.mixins,n=[];if(!r)return n;for(var i in r){var o=r[i];o.properties||n.push(o)}return n},w=new Ember.Descriptor,w.toString=function(){return"(Required Property)"},Ember.required=function(){return w},C=function(e){this.methodName=e},C.prototype=new Ember.Descriptor,Ember.aliasMethod=function(e){return new C(e)},Ember.observer=function(){var e,t=T.call(arguments,-1)[0],r=function(t){e.push(t)},n=T.call(arguments,0,-1);"function"!=typeof t&&(t=arguments[0],n=T.call(arguments,1)),e=[];for(var i=0;i<n.length;++i)R(n[i],r);if("function"!=typeof t)throw new Ember.Error("Ember.observer called without a function");return t.__ember_observes__=e,t},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;t>e;e++){arguments[e]}return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(){var e,t=T.call(arguments,-1)[0],r=function(t){e.push(t)},n=T.call(arguments,0,-1);"function"!=typeof t&&(t=arguments[0],n=T.call(arguments,1)),e=[];for(var i=0;i<n.length;++i)R(n[i],r);if("function"!=typeof t)throw new Ember.Error("Ember.beforeObserver called without a function");return t.__ember_observesBefore__=e,t}}(),function(){var e=Ember.EnumerableUtils.forEach,t=Ember.EnumerableUtils.indexOf;Ember.libraries=function(){var r=[],n=0,i=function(e){for(var t=0;t<r.length;t++)if(r[t].name===e)return r[t]};return r.register=function(e,t){i(e)||r.push({name:e,version:t})},r.registerCoreLibrary=function(e,t){i(e)||r.splice(n++,0,{name:e,version:t})},r.deRegister=function(e){var n=i(e);n&&r.splice(t(r,n),1)},r.each=function(t){e(r,function(e){t(e.name,e.version)})},r}(),Ember.libraries.registerCoreLibrary("Ember",Ember.VERSION)}(),function(){e("rsvp/all",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.all(e,t)}}),e("rsvp/all_settled",["./promise","./utils","exports"],function(e,t,r){"use strict";function n(e){return{state:"fulfilled",value:e}}function i(e){return{state:"rejected",reason:e}}var o=e["default"],a=t.isArray,s=t.isNonThenable;r["default"]=function(e,t){return new o(function(t){function r(e){return function(t){l(e,n(t))}}function u(e){return function(t){l(e,i(t))}}function l(e,r){m[e]=r,0===--h&&t(m)}if(!a(e))throw new TypeError("You must pass an array to allSettled.");var c,h=e.length;if(0===h)return t([]),void 0;for(var m=new Array(h),p=0;p<e.length;p++)c=e[p],s(c)?l(p,n(c)):o.cast(c).then(r(p),u(p))},t)}}),e("rsvp/config",["./events","exports"],function(e,t){"use strict";function r(e,t){return"onerror"===e?(i.on("error",t),void 0):2!==arguments.length?i[e]:(i[e]=t,void 0)}var n=e["default"],i={instrument:!1};n.mixin(i),t.config=i,t.configure=r}),e("rsvp/defer",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e){var t={};return t.promise=new r(function(e,r){t.resolve=e,t.reject=r},e),t}}),e("rsvp/events",["exports"],function(e){"use strict";var t=function(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1},r=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t};e["default"]={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e._promiseCallbacks=void 0,e},on:function(e,n){var i,o=r(this);i=o[e],i||(i=o[e]=[]),-1===t(i,n)&&i.push(n)},off:function(e,n){var i,o,a=r(this);return n?(i=a[e],o=t(i,n),-1!==o&&i.splice(o,1),void 0):(a[e]=[],void 0)},trigger:function(e,t){var n,i,o=r(this);if(n=o[e])for(var a=0;a<n.length;a++)(i=n[a])(t)}}}),e("rsvp/filter",["./all","./map","./utils","exports"],function(e,t,r,n){"use strict";function i(e,t,r){return o(e,r).then(function(n){if(!u(e))throw new TypeError("You must pass an array to filter.");if(!s(t))throw new TypeError("You must pass a function to filter's second argument.");return a(e,t,r).then(function(e){var t,r=n.length,i=[];for(t=0;r>t;t++)e[t]&&i.push(n[t]);return i})})}var o=e["default"],a=t["default"],s=r.isFunction,u=r.isArray;n["default"]=i}),e("rsvp/hash",["./promise","./utils","exports"],function(e,t,r){"use strict";var n=e["default"],i=t.isNonThenable,o=t.keysOf;r["default"]=function(e){return new n(function(t,r){function a(e){return function(r){c[e]=r,0===--m&&t(c)}}function s(e){m=0,r(e)}var u,l,c={},h=o(e),m=h.length;if(0===m)return t(c),void 0;for(var p=0;p<h.length;p++)l=h[p],u=e[l],i(u)?(c[l]=u,0===--m&&t(c)):n.cast(u).then(a(l),s)})}}),e("rsvp/instrument",["./config","./utils","exports"],function(e,t,r){"use strict";var n=e.config,i=t.now;r["default"]=function(e,t,r){try{n.trigger(e,{guid:t._guidKey+t._id,eventName:e,detail:t._detail,childGuid:r&&t._guidKey+r._id,label:t._label,timeStamp:i(),stack:new Error(t._label).stack})}catch(o){setTimeout(function(){throw o},0)}}}),e("rsvp/map",["./promise","./all","./utils","exports"],function(e,t,r,n){"use strict";var i=(e["default"],t["default"]),o=r.isArray,a=r.isFunction;n["default"]=function(e,t,r){return i(e,r).then(function(n){if(!o(e))throw new TypeError("You must pass an array to map.");if(!a(t))throw new TypeError("You must pass a function to map's second argument.");var s,u=n.length,l=[];for(s=0;u>s;s++)l.push(t(n[s]));return i(l,r)})}}),e("rsvp/node",["./promise","exports"],function(e,t){"use strict";function r(e,t){return function(r,n){r?t(r):arguments.length>2?e(i.call(arguments,1)):e(n)}}var n=e["default"],i=Array.prototype.slice;t["default"]=function(e,t){return function(){var o=i.call(arguments),a=this||t;return new n(function(t,i){n.all(o).then(function(n){try{n.push(r(t,i)),e.apply(a,n)}catch(o){i(o)}})})}}}),e("rsvp/promise",["./config","./events","./instrument","./utils","./promise/cast","./promise/all","./promise/race","./promise/resolve","./promise/reject","exports"],function(e,t,r,n,i,o,a,s,u,l){"use strict";function c(){}function h(e,t){if(!A(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof h))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._id=R++,this._label=t,this._subscribers=[],w.instrument&&C("created",this),c!==e&&m(e,this)}function m(e,t){function r(e){v(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(i){n(i)}}function p(e,t,r,n){var i=e._subscribers,o=i.length;i[o]=t,i[o+k]=r,i[o+j]=n}function f(e,t){var r,n,i=e._subscribers,o=e._detail;w.instrument&&C(t===k?"fulfilled":"rejected",e);for(var a=0;a<i.length;a+=3)r=i[a],n=i[a+t],d(t,r,n,o);e._subscribers=null}function d(e,t,r,n){var i,o,a,s,u=A(r);if(u)try{i=r(n),a=!0}catch(l){s=!0,o=l}else i=n,a=!0;b(t,i)||(u&&a?v(t,i):s?g(t,o):e===k?v(t,i):e===j&&g(t,i))}function b(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(O(t)&&(n=t.then,A(n)))return n.call(t,function(n){return r?!0:(r=!0,t!==n?v(e,n):E(e,n),void 0)},function(t){return r?!0:(r=!0,g(e,t),void 0)},"derived from: "+(e._label||" unknown promise")),!0}catch(i){return r?!0:(g(e,i),!0)}return!1}function v(e,t){e===t?E(e,t):b(e,t)||E(e,t)}function E(e,t){e._state===D&&(e._state=M,e._detail=t,w.async(y,e))}function g(e,t){e._state===D&&(e._state=M,e._detail=t,w.async(_,e))}function y(e){f(e,e._state=k)}function _(e){e._onerror&&e._onerror(e._detail),f(e,e._state=j)}var w=e.config,C=(t["default"],r["default"]),O=n.objectOrFunction,A=n.isFunction,P=n.now,T=i["default"],x=o["default"],S=a["default"],V=s["default"],N=u["default"],I="rsvp_"+P()+"-",R=0;l["default"]=h,h.cast=T,h.all=x,h.race=S,h.resolve=V,h.reject=N;var D=void 0,M=0,k=1,j=2;h.prototype={constructor:h,_id:void 0,_guidKey:I,_label:void 0,_state:void 0,_detail:void 0,_subscribers:void 0,_onerror:function(e){w.trigger("error",e)},then:function(e,t,r){var n=this;this._onerror=null;var i=new this.constructor(c,r);if(this._state){var o=arguments;w.async(function(){d(n._state,i,o[n._state-1],n._detail)})}else p(this,i,e,t);return w.instrument&&C("chained",n,i),i},"catch":function(e,t){return this.then(null,e,t)},"finally":function(e,t){var r=this.constructor;return this.then(function(t){return r.cast(e()).then(function(){return t})},function(t){return r.cast(e()).then(function(){throw t})},t)}}}),e("rsvp/promise/all",["../utils","exports"],function(e,t){"use strict";var r=e.isArray,n=e.isNonThenable;t["default"]=function(e,t){var i=this;return new i(function(t,o){function a(e){return function(r){c[e]=r,0===--l&&t(c)}}function s(e){l=0,o(e)}if(!r(e))throw new TypeError("You must pass an array to all.");var u,l=e.length,c=new Array(l);if(0===l)return t(c),void 0;for(var h=0;h<e.length;h++)u=e[h],n(u)?(c[h]=u,0===--l&&t(c)):i.cast(u).then(a(h),s)},t)}}),e("rsvp/promise/cast",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)},t)}}),e("rsvp/promise/race",["../utils","exports"],function(e,t){"use strict";var r=e.isArray,n=(e.isFunction,e.isNonThenable);t["default"]=function(e,t){var i,o=this;return new o(function(t,a){function s(e){l&&(l=!1,t(e))}function u(e){l&&(l=!1,a(e))}if(!r(e))throw new TypeError("You must pass an array to race.");for(var l=!0,c=0;c<e.length;c++){if(i=e[c],n(i))return l=!1,t(i),void 0;o.cast(i).then(s,u)}},t)}}),e("rsvp/promise/reject",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return new r(function(t,r){r(e)},t)}}),e("rsvp/promise/resolve",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return new r(function(t){t(e)},t)}}),e("rsvp/race",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.race(e,t)}}),e("rsvp/reject",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.reject(e,t)}}),e("rsvp/resolve",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.resolve(e,t)}}),e("rsvp/rethrow",["exports"],function(e){"use strict";e["default"]=function(e){throw setTimeout(function(){throw e}),e}}),e("rsvp/utils",["exports"],function(e){"use strict";function t(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function n(e){return!t(e)}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}e.objectOrFunction=t,e.isFunction=r,e.isNonThenable=n,e.isArray=i;var o=Date.now||function(){return(new Date).getTime()};e.now=o;var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.keysOf=a}),e("rsvp",["./rsvp/promise","./rsvp/events","./rsvp/node","./rsvp/all","./rsvp/all_settled","./rsvp/race","./rsvp/hash","./rsvp/rethrow","./rsvp/defer","./rsvp/config","./rsvp/map","./rsvp/resolve","./rsvp/reject","./rsvp/filter","exports"],function(e,t,r,n,i,o,a,s,u,l,c,h,m,p,f){"use strict";function d(e,t){T.async(e,t)}function b(){T.on.apply(T,arguments)}function v(){T.off.apply(T,arguments)}var E=e["default"],g=t["default"],y=r["default"],_=n["default"],w=i["default"],C=o["default"],O=a["default"],A=s["default"],P=u["default"],T=l.config,x=l.configure,S=c["default"],V=h["default"],N=m["default"],I=p["default"];if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var R=window.__PROMISE_INSTRUMENTATION__;x("instrument",!0);for(var D in R)R.hasOwnProperty(D)&&b(D,R[D])}f.Promise=E,f.EventTarget=g,f.all=_,f.allSettled=w,f.race=C,f.hash=O,f.rethrow=A,f.defer=P,f.denodeify=y,f.configure=x,f.on=b,f.off=v,f.resolve=V,f.reject=N,f.async=d,f.map=S,f.filter=I})}(),function(){e("container/container",["container/inheriting_dict","exports"],function(e,t){"use strict";function r(e){this.parent=e,this.children=[],this.resolver=e&&e.resolver||function(){},this.registry=new E(e&&e.registry),this.cache=new E(e&&e.cache),this.factoryCache=new E(e&&e.factoryCache),this.resolveCache=new E(e&&e.resolveCache),this.typeInjections=new E(e&&e.typeInjections),this.injections={},this.factoryTypeInjections=new E(e&&e.factoryTypeInjections),this.factoryInjections={},this._options=new E(e&&e._options),this._typeOptions=new E(e&&e._typeOptions)}function n(e,t){return e.cache.has(t)?!0:!!e.resolve(t)}function i(e,t,r){if(r=r||{},e.cache.has(t)&&r.singleton!==!1)return e.cache.get(t);var n=m(e,t);return void 0!==n?(a(e,t)&&r.singleton!==!1&&e.cache.set(t,n),n):void 0}function o(e){throw new Error(e+" is not currently supported on child containers")}function a(e,t){var r=u(e,t,"singleton");return r!==!1}function s(e,t){var r={};if(!t)return r;for(var n,o,a=0,s=t.length;s>a;a++){if(n=t[a],o=i(e,n.fullName),void 0===o)throw new Error("Attempting to inject an unknown injection: `"+n.fullName+"`");r[n.property]=o}return r}function u(e,t,r){var n=e._options.get(t);if(n&&void 0!==n[r])return n[r];var i=t.split(":")[0];return n=e._typeOptions.get(i),n?n[r]:void 0}function l(e,t){var r,n=t,i=e.resolve(n),o=e.factoryCache,a=t.split(":")[0];if(void 0!==i){if(o.has(t))return o.get(t);if(!i||"function"!=typeof i.extend||!Ember.MODEL_FACTORY_INJECTIONS&&"model"===a)return i;var s=c(e,t),u=h(e,t);return u._toString=e.makeToString(i,t),r=i.extend(s),r.reopenClass(u),o.set(t,r),r}}function c(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.typeInjections.get(n)||[]),i=i.concat(e.injections[t]||[]),i=s(e,i),i._debugContainerKey=t,i.container=e,i}function h(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.factoryTypeInjections.get(n)||[]),i=i.concat(e.factoryInjections[t]||[]),i=s(e,i),i._debugContainerKey=t,i}function m(e,t){var r=l(e,t);return u(e,t,"instantiate")===!1?r:r?"function"==typeof r.extend?r.create():r.create(c(e,t)):void 0}function p(e,t){e.cache.eachLocal(function(r,n){u(e,r,"instantiate")!==!1&&t(n)
|
12 |
})}function f(e){e.cache.eachLocal(function(t,r){u(e,t,"instantiate")!==!1&&r.destroy()}),e.cache.dict={}}function d(e,t,r,n){var i=e.get(t);i||(i=[],e.set(t,i)),i.push({property:r,fullName:n})}function b(e){if(!g.test(e))throw new TypeError("Invalid Fullname, expected: `type:name` got: "+e)}function v(e,t,r,n){var i=e[t]=e[t]||[];i.push({property:r,fullName:n})}var E=e["default"];r.prototype={parent:null,children:null,resolver:null,registry:null,cache:null,typeInjections:null,injections:null,_options:null,_typeOptions:null,child:function(){var e=new r(this);return this.children.push(e),e},set:function(e,t,r){e[t]=r},register:function(e,t,r){if(b(e),void 0===t)throw new TypeError("Attempting to register an unknown factory: `"+e+"`");var n=this.normalize(e);if(this.cache.has(n))throw new Error("Cannot re-register: `"+e+"`, as it has already been looked up.");this.registry.set(n,t),this._options.set(n,r||{})},unregister:function(e){b(e);var t=this.normalize(e);this.registry.remove(t),this.cache.remove(t),this.factoryCache.remove(t),this.resolveCache.remove(t),this._options.remove(t)},resolve:function(e){b(e);var t=this.normalize(e),r=this.resolveCache.get(t);if(r)return r;var n=this.resolver(t)||this.registry.get(t);return this.resolveCache.set(t,n),n},describe:function(e){return e},normalize:function(e){return e},makeToString:function(e){return e.toString()},lookup:function(e,t){return b(e),i(this,this.normalize(e),t)},lookupFactory:function(e){return b(e),l(this,this.normalize(e))},has:function(e){return b(e),n(this,this.normalize(e))},optionsForType:function(e,t){this.parent&&o("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){b(r),this.parent&&o("typeInjection"),d(this.typeInjections,e,t,r)},injection:function(e,t,r){this.parent&&o("injection"),b(r);var n=this.normalize(r);if(-1===e.indexOf(":"))return this.typeInjection(e,t,n);b(e);var i=this.normalize(e);v(this.injections,i,t,n)},factoryTypeInjection:function(e,t,r){this.parent&&o("factoryTypeInjection"),d(this.factoryTypeInjections,e,t,this.normalize(r))},factoryInjection:function(e,t,r){this.parent&&o("injection");var n=this.normalize(e),i=this.normalize(r);return b(r),-1===e.indexOf(":")?this.factoryTypeInjection(n,t,i):(b(e),v(this.factoryInjections,n,t,i),void 0)},destroy:function(){for(var e=0,t=this.children.length;t>e;e++)this.children[e].destroy();this.children=[],p(this,function(e){e.destroy()}),this.parent=void 0,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;t>e;e++)f(this.children[e]);f(this)}};var g=/^[^:]+.+:[^:]+$/;t["default"]=r}),e("container/inheriting_dict",["exports"],function(e){"use strict";function t(e){this.parent=e,this.dict={}}t.prototype={parent:null,dict:null,get:function(e){var t=this.dict;return t.hasOwnProperty(e)?t[e]:this.parent?this.parent.get(e):void 0},set:function(e,t){this.dict[e]=t},remove:function(e){delete this.dict[e]},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var r=this.dict;for(var n in r)r.hasOwnProperty(n)&&e.call(t,n,r[n])}},e["default"]=t}),e("container",["container/container","exports"],function(e,t){"use strict";Ember.MODEL_FACTORY_INJECTIONS=!1||!!Ember.ENV.MODEL_FACTORY_INJECTIONS;var r=e["default"];t["default"]=r})}(),function(){function e(r,n,i,o){var a,s,u;if("object"!=typeof r||null===r)return r;if(n&&(s=t(i,r))>=0)return o[s];if("array"===Ember.typeOf(r)){if(a=r.slice(),n)for(s=a.length;--s>=0;)a[s]=e(a[s],n,i,o)}else if(Ember.Copyable&&Ember.Copyable.detect(r))a=r.copy(n,i,o);else if(r instanceof Date)a=new Date(r.getTime());else{a={};for(u in r)r.hasOwnProperty(u)&&"__"!==u.substring(0,2)&&(a[u]=n?e(r[u],n,i,o):r[u])}return n&&(i.push(r),o.push(a)),a}var t=Ember.EnumerableUtils.indexOf;if(Ember.compare=function i(e,t){if(e===t)return 0;var r=Ember.typeOf(e),n=Ember.typeOf(t),o=Ember.Comparable;if(o){if("instance"===r&&o.detect(e.constructor))return e.constructor.compare(e,t);if("instance"===n&&o.detect(t.constructor))return 1-t.constructor.compare(t,e)}var a=Ember.ORDER_DEFINITION_MAPPING;if(!a){var s=Ember.ORDER_DEFINITION;a=Ember.ORDER_DEFINITION_MAPPING={};var u,l;for(u=0,l=s.length;l>u;++u)a[s[u]]=u;delete Ember.ORDER_DEFINITION}var c=a[r],h=a[n];if(h>c)return-1;if(c>h)return 1;switch(r){case"boolean":case"number":return t>e?-1:e>t?1:0;case"string":var m=e.localeCompare(t);return 0>m?-1:m>0?1:0;case"array":for(var p=e.length,f=t.length,d=Math.min(p,f),b=0,v=0;0===b&&d>v;)b=i(e[v],t[v]),v++;return 0!==b?b:f>p?-1:p>f?1:0;case"instance":return Ember.Comparable&&Ember.Comparable.detect(e)?e.compare(e,t):0;case"date":var E=e.getTime(),g=t.getTime();return g>E?-1:E>g?1:0;default:return 0}},Ember.copy=function(t,r){return"object"!=typeof t||null===t?t:Ember.Copyable&&Ember.Copyable.detect(t)?t.copy(r):e(t,r,r?[]:null,r?[]:null)},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,!Ember.keys||Ember.create.isSimulated){var r=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","toString"],n=function(e,r,n){"__"!==n.substring(0,2)&&"_super"!==n&&(t(r,n)>=0||e.hasOwnProperty(n)&&r.push(n))};Ember.keys=function(e){var t,i=[];for(t in e)n(e,i,t);for(var o=0,a=r.length;a>o;o++)t=r[o],n(e,i,t);return i}}}(),function(){var e=/[ _]/g,t={},r=/([a-z\d])([A-Z])/g,n=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,o=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var r=0;return e.replace(/%@([0-9]+)?/g,function(e,n){return n=n?parseInt(n,10)-1:r++,e=t[n],null===e?"(null)":void 0===e?"":Ember.inspect(e)})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(r,"$1_$2").toLowerCase()},dasherize:function(r){var n,i=t,o=i.hasOwnProperty(r);return o?i[r]:(n=Ember.String.decamelize(r).replace(e,"-"),i[r]=n,n)},camelize:function(e){return e.replace(n,function(e,t,r){return r?r.toUpperCase():""}).replace(/^([A-Z])/,function(e){return e.toLowerCase()})},classify:function(e){for(var t=e.split("."),r=[],n=0,i=t.length;i>n;n++){var o=Ember.String.camelize(t[n]);r.push(o.charAt(0).toUpperCase()+o.substr(1))}return r.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(o,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,r=Ember.String.loc,n=Ember.String.camelize,i=Ember.String.decamelize,o=Ember.String.dasherize,a=Ember.String.underscore,s=Ember.String.capitalize,u=Ember.String.classify;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return r(this,arguments)},String.prototype.camelize=function(){return n(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return o(this)},String.prototype.underscore=function(){return a(this)},String.prototype.classify=function(){return u(this)},String.prototype.capitalize=function(){return s(this)})}(),function(){var e=Ember.get,t=Ember.set,r=Array.prototype.slice,n=Ember.getProperties;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){return n.apply(null,[this].concat(r.call(arguments)))},set:function(e,r){return t(this,e,r),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,r){Ember.addBeforeObserver(this,e,t,r)},addObserver:function(e,t,r){Ember.addObserver(this,e,t,r)},removeObserver:function(e,t,r){Ember.removeObserver(this,e,t,r)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)+n),e(this,r)},decrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)-n),e(this,r)},toggleProperty:function(r){return t(this,r,!e(this,r)),e(this,r)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){function e(){var e,t,o=!1,a=function(){o||a.proto(),n(this,i,_),n(this,"__nextSuper",y);var u=s(this),l=u.proto;if(u.proto=this,e){var m=e;e=null,this.reopen.apply(this,m)}if(t){var p=t;t=null;for(var f=this.concatenatedProperties,d=0,v=p.length;v>d;d++){var w=p[d];if("object"!=typeof w&&void 0!==w)throw new Ember.Error("Ember.Object.create only accepts objects.");if(w)for(var C=Ember.keys(w),O=0,A=C.length;A>O;O++){var P=C[O];if(w.hasOwnProperty(P)){var T=w[P],x=Ember.IS_BINDING;if(x.test(P)){var S=u.bindings;S?u.hasOwnProperty("bindings")||(S=u.bindings=r(u.bindings)):S=u.bindings={},S[P]=T}var V=u.descs[P];if(f&&g(f,P)>=0){var N=this[P];T=N?"function"==typeof N.concat?N.concat(T):Ember.makeArray(N).concat(T):Ember.makeArray(T)}V?V.set(this,P,T):"function"!=typeof this.setUnknownProperty||P in this?E?Ember.defineProperty(this,P,null,T):this[P]=T:this.setUnknownProperty(P,T)}}}}b(this,u),this.init.apply(this,arguments),u.proto=l,c(this),h(this,"init")};return a.toString=f.prototype.toString,a.willReopen=function(){o&&(a.PrototypeMixin=f.create(a.PrototypeMixin)),o=!1},a._initMixins=function(t){e=t},a._initProperties=function(e){t=e},a.proto=function(){var e=a.superclass;return e&&e.proto(),o||(o=!0,a.PrototypeMixin.applyPartial(a.prototype),l(a.prototype)),this.prototype},a}function t(e){return function(){return e}}var r=(Ember.set,Ember.get,Ember.create),n=Ember.platform.defineProperty,i=Ember.GUID_KEY,o=Ember.guidFor,a=Ember.generateGuid,s=Ember.meta,u=Ember.META_KEY,l=Ember.rewatch,c=Ember.finishChains,h=Ember.sendEvent,m=Ember.destroy,p=Ember.run.schedule,f=Ember.Mixin,d=f._apply,b=f.finishPartial,v=f.prototype.reopen,E=Ember.ENV.MANDATORY_SETTER,g=Ember.EnumerableUtils.indexOf,y={configurable:!0,writable:!0,enumerable:!1,value:void 0},_={configurable:!0,writable:!0,enumerable:!1,value:null},w=e();w.toString=function(){return"Ember.CoreObject"},w.PrototypeMixin=f.create({reopen:function(){return d(this,arguments,!0),this},init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){return this.isDestroying?void 0:(this.isDestroying=!0,p("actions",this,this.willDestroy),p("destroy",this,this._scheduledDestroy),this)},willDestroy:Ember.K,_scheduledDestroy:function(){this.isDestroyed||(m(this),this.isDestroyed=!0)},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function(){var e="function"==typeof this.toStringExtension,r=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+r+">";return this.toString=t(n),n}}),w.PrototypeMixin.ownerConstructor=w,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(w.PrototypeMixin),w.__super__=null;var C=f.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var t,n=e();return n.ClassMixin=f.create(this.ClassMixin),n.PrototypeMixin=f.create(this.PrototypeMixin),n.ClassMixin.ownerConstructor=n,n.PrototypeMixin.ownerConstructor=n,v.apply(n.PrototypeMixin,arguments),n.superclass=this,n.__super__=this.prototype,t=n.prototype=r(this.prototype),t.constructor=n,a(t),s(t).proto=t,n.ClassMixin.apply(n),n},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),v.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return v.apply(this.ClassMixin,arguments),d(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;for(;e;){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=this.proto()[u],r=t&&t.descs[e];return r._meta||{}},eachComputedProperty:function(e,t){var r,n=this.proto(),i=s(n).descs,o={};for(var a in i)r=i[a],r instanceof Ember.ComputedProperty&&e.call(t||this,a,r._meta||o)}});C.ownerConstructor=w,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(C),w.ClassMixin=C,C.apply(w),Ember.CoreObject=w}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function e(t,r,i){var a=t.length;l[t.join(".")]=r;for(var s in r)if(c.call(r,s)){var u=r[s];if(t[a]=s,u&&u.toString===n)u.toString=o(t.join(".")),u[m]=t.join(".");else if(u&&u.isNamespace){if(i[h(u)])continue;i[h(u)]=!0,e(t,u,i)}}t.length=a}function t(){var e,t,r=Ember.Namespace,n=Ember.lookup;if(!r.PROCESSED)for(var i in n)if("parent"!==i&&"top"!==i&&"frameElement"!==i&&"webkitStorageInfo"!==i&&!("globalStorage"===i&&n.StorageList&&n.globalStorage instanceof n.StorageList||n.hasOwnProperty&&!n.hasOwnProperty(i))){try{e=Ember.lookup[i],t=e&&e.isNamespace}catch(o){continue}t&&(e[m]=i)}}function r(e){var t=e.superclass;return t?t[m]?t[m]:r(t):void 0}function n(){Ember.BOOTED||this[m]||i();var e;if(this[m])e=this[m];else if(this._toString)e=this._toString;else{var t=r(this);e=t?"(subclass of "+t+")":"(unknown mixin)",this.toString=o(e)}return e}function i(){var r=!u.PROCESSED,n=Ember.anyUnprocessedMixins;if(r&&(t(),u.PROCESSED=!0),r||n){for(var i,o=u.NAMESPACES,a=0,s=o.length;s>a;a++)i=o[a],e([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function o(e){return function(){return e}}var a=Ember.get,s=Ember.ArrayPolyfills.indexOf,u=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var e=a(this,"name");return e?e:(t(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){e([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=void 0,delete Ember.Namespace.NAMESPACES_BY_ID[this.toString()],e.splice(s.call(e,this),1),this._super()}});u.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:i,byName:function(e){return Ember.BOOTED||i(),l[e]}});var l=u.NAMESPACES_BY_ID,c={}.hasOwnProperty,h=Ember.guidFor,m=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=n}(),function(){function e(e,t){var r=t.slice(8);r in this||u(this,r)}function t(e,t){var r=t.slice(8);r in this||l(this,r)}var r=Ember.get,n=Ember.set,i=(Ember.String.fmt,Ember.addBeforeObserver),o=Ember.addObserver,a=Ember.removeBeforeObserver,s=Ember.removeObserver,u=Ember.propertyWillChange,l=Ember.propertyDidChange,c=Ember.meta,h=Ember.defineProperty;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer("content",function(){}),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(r){var n="content."+r;i(this,n,null,e),o(this,n,null,t)},didUnwatchProperty:function(r){var n="content."+r;a(this,n,null,e),s(this,n,null,t)},unknownProperty:function(e){var t=r(this,"content");return t?r(t,e):void 0},setUnknownProperty:function(e,t){var i=c(this);if(i.proto===this)return h(this,e,null,t),t;var o=r(this,"content");return n(o,e,t)}})}(),function(){function e(){return 0===s.length?{}:s.pop()}function t(e){return s.push(e),null}function r(e,t){function r(r){var o=n(r,e);return i?t===o:!!o}var i=2===arguments.length;return r}var n=Ember.get,i=Ember.set,o=Array.prototype.slice,a=Ember.EnumerableUtils.indexOf,s=[];Ember.Enumerable=Ember.Mixin.create({nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(0===n(this,"length"))return void 0;var r,i=e();return r=this.nextObject(0,null,i),t(i),r}).property("[]"),lastObject:Ember.computed(function(){var r=n(this,"length");if(0===r)return void 0;var i,o=e(),a=0,s=null;do s=i,i=this.nextObject(a++,s,o);while(void 0!==i);return t(o),s}).property("[]"),contains:function(e){return void 0!==this.find(function(t){return t===e})},forEach:function(r,i){if("function"!=typeof r)throw new TypeError;var o=n(this,"length"),a=null,s=e();void 0===i&&(i=null);for(var u=0;o>u;u++){var l=this.nextObject(u,a,s);r.call(i,l,u,this),a=l}return a=null,s=t(s),this},getEach:function(e){return this.mapBy(e)},setEach:function(e,t){return this.forEach(function(r){i(r,e,t)})},map:function(e,t){var r=Ember.A();return this.forEach(function(n,i,o){r[i]=e.call(t,n,i,o)}),r},mapBy:function(e){return this.map(function(t){return n(t,e)})},mapProperty:Ember.aliasMethod("mapBy"),filter:function(e,t){var r=Ember.A();return this.forEach(function(n,i,o){e.call(t,n,i,o)&&r.push(n)}),r},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterBy:function(){return this.filter(r.apply(this,arguments))},filterProperty:Ember.aliasMethod("filterBy"),rejectBy:function(e,t){var r=function(r){return n(r,e)===t},i=function(t){return!!n(t,e)},o=2===arguments.length?r:i;return this.reject(o)},rejectProperty:Ember.aliasMethod("rejectBy"),find:function(r,i){var o=n(this,"length");void 0===i&&(i=null);for(var a,s,u=null,l=!1,c=e(),h=0;o>h&&!l;h++)a=this.nextObject(h,u,c),(l=r.call(i,a,h,this))&&(s=a),u=a;return a=u=null,c=t(c),s},findBy:function(){return this.find(r.apply(this,arguments))},findProperty:Ember.aliasMethod("findBy"),every:function(e,t){return!this.find(function(r,n,i){return!e.call(t,r,n,i)})},everyBy:Ember.aliasMethod("isEvery"),everyProperty:Ember.aliasMethod("isEvery"),isEvery:function(){return this.every(r.apply(this,arguments))},any:function(r,i){var o,a,s=n(this,"length"),u=e(),l=!1,c=null;for(void 0===i&&(i=null),a=0;s>a&&!l;a++)o=this.nextObject(a,c,u),l=r.call(i,o,a,this),c=o;return o=c=null,u=t(u),l},some:Ember.aliasMethod("any"),isAny:function(){return this.any(r.apply(this,arguments))},anyBy:Ember.aliasMethod("isAny"),someProperty:Ember.aliasMethod("isAny"),reduce:function(e,t,r){if("function"!=typeof e)throw new TypeError;var n=t;return this.forEach(function(t,i){n=e(n,t,i,this,r)},this),n},invoke:function(e){var t,r=Ember.A();return arguments.length>1&&(t=o.call(arguments,1)),this.forEach(function(n,i){var o=n&&n[e];"function"==typeof o&&(r[i]=t?o.apply(n,t):n[e]())},this),r},toArray:function(){var e=Ember.A();return this.forEach(function(t,r){e[r]=t}),e},compact:function(){return this.filter(function(e){return null!=e})},without:function(e){if(!this.contains(e))return this;var t=Ember.A();return this.forEach(function(r){r!==e&&(t[t.length]=r)}),t},uniq:function(){var e=Ember.A();return this.forEach(function(t){a(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(){return this}),addEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",e,r),Ember.addListener(this,"@enumerable:change",e,i),o||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",e,r),Ember.removeListener(this,"@enumerable:change",e,i),o&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||i-r!==0,-1===e&&(e=null),-1===t&&(t=null),Ember.propertyWillChange(this,"[]"),o&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,e,t]),this},enumerableContentDidChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||i-r!==0,-1===e&&(e=null),-1===t&&(t=null),Ember.sendEvent(this,"@enumerable:change",[this,e,t]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this},sortBy:function(){var e=arguments;return this.toArray().sort(function(t,r){for(var i=0;i<e.length;i++){var o=e[i],a=n(t,o),s=n(r,o),u=Ember.compare(a,s);if(u)return u}return 0})}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.isNone),r=Ember.EnumerableUtils.map,n=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{length:Ember.required(),objectAt:function(t){return 0>t||t>=e(this,"length")?void 0:e(this,t)},objectsAt:function(e){var t=this;return r(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,r){return void 0!==r&&this.replace(0,e(this,"length"),r),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(e(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(r,n){var i=Ember.A(),o=e(this,"length");for(t(r)&&(r=0),(t(n)||n>o)&&(n=o),0>r&&(r=o+r),0>n&&(n=o+n);n>r;)i[i.length]=this.objectAt(r++);return i},indexOf:function(t,r){var n,i=e(this,"length");for(void 0===r&&(r=0),0>r&&(r+=i),n=r;i>n;n++)if(this.objectAt(n)===t)return n;return-1},lastIndexOf:function(t,r){var n,i=e(this,"length");for((void 0===r||r>=i)&&(r=i-1),0>r&&(r+=i),n=r;n>=0;n--)if(this.objectAt(n)===t)return n;return-1},addArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,n),Ember.addListener(this,"@array:change",t,i),o||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,n),Ember.removeListener(this,"@array:change",t,i),o&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,r,n){void 0===t?(t=0,r=n=-1):(void 0===r&&(r=-1),void 0===n&&(n=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,r,n]);var i,o;if(t>=0&&r>=0&&e(this,"hasEnumerableObservers")){i=[],o=t+r;for(var a=t;o>a;a++)i.push(this.objectAt(a))}else i=r;return this.enumerableContentWillChange(i,n),this},arrayContentDidChange:function(t,r,i){void 0===t?(t=0,r=i=-1):(void 0===r&&(r=-1),void 0===i&&(i=-1));var o,a;if(t>=0&&i>=0&&e(this,"hasEnumerableObservers")){o=[],a=t+i;for(var s=t;a>s;s++)o.push(this.objectAt(s))}else o=i;this.enumerableContentDidChange(r,o),Ember.sendEvent(this,"@array:change",[this,t,r,i]);var u=e(this,"length"),l=n(this,"firstObject"),c=n(this,"lastObject");return this.objectAt(0)!==l&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(u-1)!==c&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){function e(e,t){return"@this"===t?e:m(e,t)}function t(e,t,r){this.callbacks=e,this.cp=t,this.instanceMeta=r,this.dependentKeysByGuid={},this.trackedArraysByGuid={},this.suspended=!1,this.changedItems={}}function r(e,t,r){this.dependentArray=e,this.index=t,this.item=e.objectAt(t),this.trackedArray=r,this.beforeObserver=null,this.observer=null,this.destroyed=!1}function n(e,t,r){return 0>e?Math.max(0,t+e):t>e?e:Math.min(t-r,e)}function i(e,t,r){return Math.min(r,t-e)}function o(e,t,r,n,i,o){var a={arrayChanged:e,index:r,item:t,propertyName:n,property:i};return o&&(a.previousValues=o),a}function a(e,t,r,n,i){O(e,function(a,s){i.setValue(t.addedItem.call(this,i.getValue(),a,o(e,a,s,n,r),i.sugarMeta))},this)}function s(e,t){{var r;e._callbacks()}e._hasInstanceMeta(this,t)?(r=e._instanceMeta(this,t),r.setValue(e.resetValue(r.getValue()))):r=e._instanceMeta(this,t),e.options.initialize&&e.options.initialize.call(this,r.getValue(),{property:e,propertyName:t},r.sugarMeta)}function u(t,r){if(T.test(r))return!1;var n=e(t,r);return Ember.Array.detect(n)}function l(e,t,r){this.context=e,this.propertyName=t,this.cache=f(e).cache,this.dependentArrays={},this.sugarMeta={},this.initialValue=r}function c(t){var r=this;this.options=t,this._dependentKeys=null,this._itemPropertyKeys={},this._previousItemPropertyKeys={},this.readOnly(),this.cacheable(),this.recomputeOnce=function(e){Ember.run.once(this,n,e)};var n=function(t){var n=(r._dependentKeys,r._instanceMeta(this,t)),i=r._callbacks();s.call(this,r,t),n.dependentArraysObserver.suspendArrayObservers(function(){O(r._dependentKeys,function(t){if(u(this,t)){var i=e(this,t),o=n.dependentArrays[t];i===o?r._previousItemPropertyKeys[t]&&(delete r._previousItemPropertyKeys[t],n.dependentArraysObserver.setupPropertyObservers(t,r._itemPropertyKeys[t])):(n.dependentArrays[t]=i,o&&n.dependentArraysObserver.teardownObservers(o,t),i&&n.dependentArraysObserver.setupObservers(i,t))}},this)},this),O(r._dependentKeys,function(o){if(u(this,o)){var s=e(this,o);s&&a.call(this,s,i,r,t,n)}},this)};this.func=function(e){return n.call(this,e),r._instanceMeta(this,e).getValue()}}function h(e){return e}var m=Ember.get,p=(Ember.set,Ember.guidFor),f=Ember.meta,d=Ember.propertyWillChange,b=Ember.propertyDidChange,v=Ember.addBeforeObserver,E=Ember.removeBeforeObserver,g=Ember.addObserver,y=Ember.removeObserver,_=Ember.ComputedProperty,w=[].slice,C=Ember.create,O=Ember.EnumerableUtils.forEach,A=(Ember.cacheFor.set,Ember.cacheFor.get,Ember.cacheFor.remove,/^(.*)\.@each\.(.*)/),P=/(.*\.@each){2,}/,T=/\.\[\]$/,x=Ember.expandProperties;t.prototype={setValue:function(e){this.instanceMeta.setValue(e,!0)},getValue:function(){return this.instanceMeta.getValue()},setupObservers:function(e,t){this.dependentKeysByGuid[p(e)]=t,e.addArrayObserver(this,{willChange:"dependentArrayWillChange",didChange:"dependentArrayDidChange"}),this.cp._itemPropertyKeys[t]&&this.setupPropertyObservers(t,this.cp._itemPropertyKeys[t])},teardownObservers:function(e,t){var r=this.cp._itemPropertyKeys[t]||[];delete this.dependentKeysByGuid[p(e)],this.teardownPropertyObservers(t,r),e.removeArrayObserver(this,{willChange:"dependentArrayWillChange",didChange:"dependentArrayDidChange"})},suspendArrayObservers:function(e,t){var r=this.suspended;this.suspended=!0,e.call(t),this.suspended=r},setupPropertyObservers:function(t,r){var n=e(this.instanceMeta.context,t),i=e(n,"length"),o=new Array(i);this.resetTransformations(t,o),O(n,function(e,i){var a=this.createPropertyObserverContext(n,i,this.trackedArraysByGuid[t]);o[i]=a,O(r,function(t){v(e,t,this,a.beforeObserver),g(e,t,this,a.observer)},this)},this)},teardownPropertyObservers:function(e,t){var r,n,i,o=this,a=this.trackedArraysByGuid[e];a&&a.apply(function(e,a,s){s!==Ember.TrackedArray.DELETE&&O(e,function(e){e.destroyed=!0,r=e.beforeObserver,n=e.observer,i=e.item,O(t,function(e){E(i,e,o,r),y(i,e,o,n)})})})},createPropertyObserverContext:function(e,t,n){var i=new r(e,t,n);return this.createPropertyObserver(i),i},createPropertyObserver:function(e){var t=this;e.beforeObserver=function(r,n){return t.itemPropertyWillChange(r,n,e.dependentArray,e)},e.observer=function(r,n){return t.itemPropertyDidChange(r,n,e.dependentArray,e)}},resetTransformations:function(e,t){this.trackedArraysByGuid[e]=new Ember.TrackedArray(t)},trackAdd:function(e,t,r){var n=this.trackedArraysByGuid[e];n&&n.addItems(t,r)},trackRemove:function(e,t,r){var n=this.trackedArraysByGuid[e];return n?n.removeItems(t,r):[]},updateIndexes:function(t,r){var n=e(r,"length");t.apply(function(e,t,r){r!==Ember.TrackedArray.DELETE&&(r!==Ember.TrackedArray.RETAIN||e.length!==n||0!==t)&&O(e,function(e,r){e.index=r+t})})},dependentArrayWillChange:function(t,r,a){function s(e){m[h].destroyed=!0,E(l,e,this,m[h].beforeObserver),y(l,e,this,m[h].observer)}if(!this.suspended){var u,l,c,h,m,f=this.callbacks.removedItem,d=p(t),b=this.dependentKeysByGuid[d],v=this.cp._itemPropertyKeys[b]||[],g=e(t,"length"),_=n(r,g,0),w=i(_,g,a);for(m=this.trackRemove(b,_,w),h=w-1;h>=0&&(c=_+h,!(c>=g));--h)l=t.objectAt(c),O(v,s,this),u=o(t,l,c,this.instanceMeta.propertyName,this.cp),this.setValue(f.call(this.instanceMeta.context,this.getValue(),l,u,this.instanceMeta.sugarMeta))}},dependentArrayDidChange:function(t,r,i,a){if(!this.suspended){var s,u,l=this.callbacks.addedItem,c=p(t),h=this.dependentKeysByGuid[c],m=new Array(a),f=this.cp._itemPropertyKeys[h],d=e(t,"length"),b=n(r,d,a);O(t.slice(b,b+a),function(e,r){f&&(u=m[r]=this.createPropertyObserverContext(t,b+r,this.trackedArraysByGuid[h]),O(f,function(t){v(e,t,this,u.beforeObserver),g(e,t,this,u.observer)},this)),s=o(t,e,b+r,this.instanceMeta.propertyName,this.cp),this.setValue(l.call(this.instanceMeta.context,this.getValue(),e,s,this.instanceMeta.sugarMeta))},this),this.trackAdd(h,b,m)}},itemPropertyWillChange:function(t,r,n,i){var o=p(t);this.changedItems[o]||(this.changedItems[o]={array:n,observerContext:i,obj:t,previousValues:{}}),this.changedItems[o].previousValues[r]=e(t,r)},itemPropertyDidChange:function(){this.flushChanges()},flushChanges:function(){var e,t,r,n=this.changedItems;for(e in n)t=n[e],t.observerContext.destroyed||(this.updateIndexes(t.observerContext.trackedArray,t.observerContext.dependentArray),r=o(t.array,t.obj,t.observerContext.index,this.instanceMeta.propertyName,this.cp,t.previousValues),this.setValue(this.callbacks.removedItem.call(this.instanceMeta.context,this.getValue(),t.obj,r,this.instanceMeta.sugarMeta)),this.setValue(this.callbacks.addedItem.call(this.instanceMeta.context,this.getValue(),t.obj,r,this.instanceMeta.sugarMeta)));this.changedItems={}}},l.prototype={getValue:function(){return this.propertyName in this.cache?this.cache[this.propertyName]:this.initialValue},setValue:function(e,t){e!==this.cache[this.propertyName]&&(t&&d(this.context,this.propertyName),void 0===e?delete this.cache[this.propertyName]:this.cache[this.propertyName]=e,t&&b(this.context,this.propertyName))}},Ember.ReduceComputedProperty=c,c.prototype=C(_.prototype),c.prototype._callbacks=function(){if(!this.callbacks){var e=this.options;this.callbacks={removedItem:e.removedItem||h,addedItem:e.addedItem||h}}return this.callbacks},c.prototype._hasInstanceMeta=function(e,t){return!!f(e).cacheMeta[t]},c.prototype._instanceMeta=function(e,r){var n=f(e).cacheMeta,i=n[r];return i||(i=n[r]=new l(e,r,this.initialValue()),i.dependentArraysObserver=new t(this._callbacks(),this,i,e,r,i.sugarMeta)),i},c.prototype.initialValue=function(){return"function"==typeof this.options.initialValue?this.options.initialValue():this.options.initialValue},c.prototype.resetValue=function(){return this.initialValue()},c.prototype.itemPropertyKey=function(e,t){this._itemPropertyKeys[e]=this._itemPropertyKeys[e]||[],this._itemPropertyKeys[e].push(t)},c.prototype.clearItemPropertyKeys=function(e){this._itemPropertyKeys[e]&&(this._previousItemPropertyKeys[e]=this._itemPropertyKeys[e],this._itemPropertyKeys[e]=[])},c.prototype.property=function(){var e,t,r=this,n=w.call(arguments),i=new Ember.Set;return O(n,function(n){if(P.test(n))throw new Ember.Error("Nested @each properties not supported: "+n);if(e=A.exec(n)){t=e[1];var o=e[2],a=function(e){r.itemPropertyKey(t,e)};x(o,a),i.add(t)}else i.add(n)}),_.prototype.property.apply(this,i.toArray())},Ember.reduceComputed=function(e){var t;if(arguments.length>1&&(t=w.call(arguments,0,-1),e=w.call(arguments,-1)[0]),"object"!=typeof e)throw new Ember.Error("Reduce Computed Property declared without an options hash");if(!("initialValue"in e))throw new Ember.Error("Reduce Computed Property declared without an initial value");var r=new c(e);return t&&r.property.apply(r,t),r}}(),function(){function e(){var e=this;
|
13 |
return t.apply(this,arguments),this.func=function(t){return function(r){return e._hasInstanceMeta(this,r)||i(e._dependentKeys,function(t){Ember.addObserver(this,t,function(){e.recomputeOnce.call(this,r)})},this),t.apply(this,arguments)}}(this.func),this}var t=Ember.ReduceComputedProperty,r=[].slice,n=Ember.create,i=Ember.EnumerableUtils.forEach;Ember.ArrayComputedProperty=e,e.prototype=n(t.prototype),e.prototype.initialValue=function(){return Ember.A()},e.prototype.resetValue=function(e){return e.clear(),e},e.prototype.didChange=function(){},Ember.arrayComputed=function(t){var n;if(arguments.length>1&&(n=r.call(arguments,0,-1),t=r.call(arguments,-1)[0]),"object"!=typeof t)throw new Ember.Error("Array Computed Property declared without an options hash");var i=new e(t);return n&&i.property.apply(i,n),i}}(),function(){function e(e,i,o,a){function s(e){return t.detectInstance(e)?n(r(e,"content")):n(e)}var u,l,c,h,m;return arguments.length<4&&(a=r(e,"length")),arguments.length<3&&(o=0),o===a?o:(u=o+Math.floor((a-o)/2),l=e.objectAt(u),h=s(l),m=s(i),h===m?u:(c=this.order(l,i),0===c&&(c=m>h?-1:1),0>c?this.binarySearch(e,i,u+1,a):c>0?this.binarySearch(e,i,o,u):u))}var t,r=Ember.get,n=(Ember.set,Ember.guidFor),i=Ember.merge,o=[].slice,a=Ember.EnumerableUtils.forEach,s=Ember.EnumerableUtils.map;Ember.computed.sum=function(e){return Ember.reduceComputed(e,{initialValue:0,addedItem:function(e,t){return e+t},removedItem:function(e,t){return e-t}})},Ember.computed.max=function(e){return Ember.reduceComputed(e,{initialValue:-1/0,addedItem:function(e,t){return Math.max(e,t)},removedItem:function(e,t){return e>t?e:void 0}})},Ember.computed.min=function(e){return Ember.reduceComputed(e,{initialValue:1/0,addedItem:function(e,t){return Math.min(e,t)},removedItem:function(e,t){return t>e?e:void 0}})},Ember.computed.map=function(e,t){var r={addedItem:function(e,r,n){var i=t.call(this,r);return e.insertAt(n.index,i),e},removedItem:function(e,t,r){return e.removeAt(r.index,1),e}};return Ember.arrayComputed(e,r)},Ember.computed.mapBy=function(e,t){var n=function(e){return r(e,t)};return Ember.computed.map(e+".@each."+t,n)},Ember.computed.mapProperty=Ember.computed.mapBy,Ember.computed.filter=function(e,t){var r={initialize:function(e,t,r){r.filteredArrayIndexes=new Ember.SubArray},addedItem:function(e,r,n,i){var o=!!t.call(this,r),a=i.filteredArrayIndexes.addItem(n.index,o);return o&&e.insertAt(a,r),e},removedItem:function(e,t,r,n){var i=n.filteredArrayIndexes.removeItem(r.index);return i>-1&&e.removeAt(i),e}};return Ember.arrayComputed(e,r)},Ember.computed.filterBy=function(e,t,n){var i;return i=2===arguments.length?function(e){return r(e,t)}:function(e){return r(e,t)===n},Ember.computed.filter(e+".@each."+t,i)},Ember.computed.filterProperty=Ember.computed.filterBy,Ember.computed.uniq=function(){var e=o.call(arguments);return e.push({initialize:function(e,t,r){r.itemCounts={}},addedItem:function(e,t,r,i){var o=n(t);return i.itemCounts[o]?++i.itemCounts[o]:i.itemCounts[o]=1,e.addObject(t),e},removedItem:function(e,t,r,i){var o=n(t),a=i.itemCounts;return 0===--a[o]&&e.removeObject(t),e}}),Ember.arrayComputed.apply(null,e)},Ember.computed.union=Ember.computed.uniq,Ember.computed.intersect=function(){var e=function(e){return s(e.property._dependentKeys,function(e){return n(e)})},t=o.call(arguments);return t.push({initialize:function(e,t,r){r.itemCounts={}},addedItem:function(t,r,i,o){var a=n(r),s=(e(i),n(i.arrayChanged)),u=i.property._dependentKeys.length,l=o.itemCounts;return l[a]||(l[a]={}),void 0===l[a][s]&&(l[a][s]=0),1===++l[a][s]&&u===Ember.keys(l[a]).length&&t.addObject(r),t},removedItem:function(t,r,i,o){var a,s=n(r),u=(e(i),n(i.arrayChanged)),l=(i.property._dependentKeys.length,o.itemCounts);return void 0===l[s][u]&&(l[s][u]=0),0===--l[s][u]&&(delete l[s][u],a=Ember.keys(l[s]).length,0===a&&delete l[s],t.removeObject(r)),t}}),Ember.arrayComputed.apply(null,t)},Ember.computed.setDiff=function(e,t){if(2!==arguments.length)throw new Ember.Error("setDiff requires exactly two dependent arrays.");return Ember.arrayComputed(e,t,{addedItem:function(n,i,o){var a=r(this,e),s=r(this,t);return o.arrayChanged===a?s.contains(i)||n.addObject(i):n.removeObject(i),n},removedItem:function(n,i,o){var a=r(this,e),s=r(this,t);return o.arrayChanged===s?a.contains(i)&&n.addObject(i):n.removeObject(i),n}})},t=Ember.ObjectProxy.extend(),Ember.computed.sort=function(n,o){var s,u;return"function"==typeof o?s=function(t,r,n){n.order=o,n.binarySearch=e}:(u=o,s=function(i,o,s){function l(){var e,t,i,l=r(this,u),h=s.sortProperties=[],m=s.sortPropertyAscending={};o.property.clearItemPropertyKeys(n),a(l,function(r){-1!==(t=r.indexOf(":"))?(e=r.substring(0,t),i="desc"!==r.substring(t+1).toLowerCase()):(e=r,i=!0),h.push(e),m[e]=i,o.property.itemPropertyKey(n,e)}),l.addObserver("@each",this,c)}function c(){Ember.run.once(this,h,o.propertyName)}function h(e){l.call(this),o.property.recomputeOnce.call(this,e)}Ember.addObserver(this,u,c),l.call(this),s.order=function(e,n){for(var i,o,a,s=n instanceof t,u=0;u<this.sortProperties.length;++u)if(i=this.sortProperties[u],o=Ember.compare(r(e,i),s?n[i]:r(n,i)),0!==o)return a=this.sortPropertyAscending[i],a?o:-1*o;return 0},s.binarySearch=e}),Ember.arrayComputed(n,{initialize:s,addedItem:function(e,t,r,n){var i=n.binarySearch(e,t);return e.insertAt(i,t),e},removedItem:function(e,r,n,o){var a,s,u;return n.previousValues?(a=i({content:r},n.previousValues),u=t.create(a)):u=r,s=o.binarySearch(e,u),e.removeAt(s),e}})}}(),function(){Ember.RSVP=t("rsvp"),Ember.RSVP.onerrorDefault=function(e){if(e instanceof Error)if(Ember.testing){if(!Ember.Test||!Ember.Test.adapter)throw e;Ember.Test.adapter.exception(e)}else Ember.Logger.error(e.stack)},Ember.RSVP.on("error",Ember.RSVP.onerrorDefault)}(),function(){var e=Array.prototype.slice,t=Ember.expandProperties;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)&&(Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){for(var e=function(e){r.push(e)},r=[],n=0;n<arguments.length;++n)t(arguments[n],e);return this.__ember_observes__=r,this},Function.prototype.observesImmediately=function(){for(var e=0,t=arguments.length;t>e;e++){arguments[e]}return this.observes.apply(this,arguments)},Function.prototype.observesBefore=function(){for(var e=function(e){r.push(e)},r=[],n=0;n<arguments.length;++n)t(arguments[n],e);return this.__ember_observesBefore__=r,this},Function.prototype.on=function(){var t=e.call(arguments);return this.__ember_listens__=t,this})}(),function(){Ember.Comparable=Ember.Mixin.create({compare:Ember.required(Function)})}(),function(){{var e=Ember.get;Ember.set}Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Ember.Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){{var e="Index out of range",t=[],r=Ember.get;Ember.set}Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=r(this,"length");return 0===e?this:(this.replace(0,e,t),this)},insertAt:function(t,n){if(t>r(this,"length"))throw new Ember.Error(e);return this.replace(t,0,[n]),this},removeAt:function(n,i){if("number"==typeof n){if(0>n||n>=r(this,"length"))throw new Ember.Error(e);void 0===i&&(i=1),this.replace(n,i,t)}return this},pushObject:function(e){return this.insertAt(r(this,"length"),e),e},pushObjects:function(e){if(!Ember.Enumerable.detect(e)&&!Ember.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this.replace(r(this,"length"),0,e),this},popObject:function(){var e=r(this,"length");if(0===e)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(0===r(this,"length"))return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=r(this,"length");if(0===e)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this.replace(0,t,e),this},removeObject:function(e){for(var t=r(this,"length")||0;--t>=0;){var n=this.objectAt(t);n===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){{var e=Ember.get;Ember.set}Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,actionContext:null,targetObject:Ember.computed(function(){var t=e(this,"target");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("target"),actionContextObject:Ember.computed(function(){var t=e(this,"actionContext");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("actionContext"),triggerAction:function(t){function r(e,t){var r=[];return t&&r.push(t),r.concat(e)}t=t||{};var n=t.action||e(this,"action"),i=t.target||e(this,"targetObject"),o=t.actionContext;if("undefined"==typeof o&&(o=e(this,"actionContextObject")||this),i&&n){var a;return a=i.send?i.send.apply(i,r(o,n)):i[n].apply(i,r(o)),a!==!1&&(a=!0),a}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,r){return Ember.addListener(this,e,t,r),this},one:function(e,t,r){return r||(r=t,t=null),Ember.addListener(this,e,t,r,!0),this},trigger:function(e){var t,r,n=[];for(t=1,r=arguments.length;r>t;t++)n.push(arguments[t]);Ember.sendEvent(this,e,n)},off:function(e,t,r){return Ember.removeListener(this,e,t,r),this},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");if(Ember.FEATURES["ember-runtime-test-friendly-promises"]){var r=function(){Ember.Test&&Ember.Test.adapter&&Ember.Test.adapter.asyncStart()},n=function(){Ember.Test&&Ember.Test.adapter&&Ember.Test.adapter.asyncEnd()};e.configure("async",function(e,t){var i=!Ember.run.currentRunLoop;Ember.testing&&i&&r(),Ember.run.backburner.schedule("actions",function(){Ember.testing&&i&&n(),e(t)})})}else e.configure("async",function(e,t){Ember.run.backburner.schedule("actions",function(){e(t)})});e.Promise.prototype.fail=function(e,t){return this["catch"](e,t)};var i=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t,r){function n(t){return t===a?e(s):e(t)}var o,a,s;return s=this,o=i(this,"_deferred"),a=o.promise,a.then(e&&n,t,r)},resolve:function(e){var t,r;t=i(this,"_deferred"),r=t.promise,e===this?t.resolve(r):t.resolve(e)},reject:function(e){i(this,"_deferred").reject(e)},_deferred:Ember.computed(function(){return e.defer("Ember: DeferredMixin - "+this)})})}(),function(){var e=Ember.get,t=Ember.typeOf;Ember.ActionHandler=Ember.Mixin.create({mergedProperties:["_actions"],willMergeMixin:function(e){var r;e._actions||("object"===t(e.actions)?r="actions":"object"===t(e.events)&&(r="events"),r&&(e._actions=Ember.merge(e._actions||{},e[r])),delete e[r])},send:function(t){var r,n=[].slice.call(arguments,1);if(this._actions&&this._actions[t]){if(this._actions[t].apply(this,n)!==!0)return}else if(!Ember.FEATURES.isEnabled("ember-routing-drop-deprecated-action-style")&&this.deprecatedSend&&this.deprecatedSendHandles&&this.deprecatedSendHandles(t)&&this.deprecatedSend.apply(this,[].slice.call(arguments))!==!0)return;(r=e(this,"target"))&&r.send.apply(r,arguments)}})}(),function(){function e(e,t){return r(e,"isFulfilled",!1),r(e,"isRejected",!1),t.then(function(t){return r(e,"isFulfilled",!0),r(e,"content",t),t},function(t){throw r(e,"isRejected",!0),r(e,"reason",t),t},"Ember: PromiseProxy")}function t(e){return function(){var t=n(this,"promise");return t[e].apply(t,arguments)}}var r=Ember.set,n=Ember.get,i=Ember.computed.not,o=Ember.computed.or;Ember.PromiseProxyMixin=Ember.Mixin.create({reason:null,isPending:i("isSettled").readOnly(),isSettled:o("isRejected","isFulfilled").readOnly(),isRejected:!1,isFulfilled:!1,promise:Ember.computed(function(t,r){if(2===arguments.length)return e(this,r);throw new Ember.Error("PromiseProxy's promise must be set")}),then:t("then"),"catch":t("catch"),"finally":t("finally")})}(),function(){function e(e,t,r){this.type=e,this.count=t,this.items=r}function t(e,t,r,n){this.operation=e,this.index=t,this.split=r,this.rangeStart=n}var r=Ember.get,n=Ember.EnumerableUtils.forEach,i="r",o="i",a="d";Ember.TrackedArray=function(t){arguments.length<1&&(t=[]);var n=r(t,"length");this._operations=n?[new e(i,n,t)]:[]},Ember.TrackedArray.RETAIN=i,Ember.TrackedArray.INSERT=o,Ember.TrackedArray.DELETE=a,Ember.TrackedArray.prototype={addItems:function(t,n){var i=r(n,"length");if(!(1>i)){var a,s,u=this._findArrayOperation(t),l=u.operation,c=u.index,h=u.rangeStart;s=new e(o,i,n),l?u.split?(this._split(c,t-h,s),a=c+1):(this._operations.splice(c,0,s),a=c):(this._operations.push(s),a=c),this._composeInsert(a)}},removeItems:function(t,r){if(!(1>r)){var n,i,o=this._findArrayOperation(t),s=(o.operation,o.index),u=o.rangeStart;return n=new e(a,r),o.split?(this._split(s,t-u,n),i=s+1):(this._operations.splice(s,0,n),i=s),this._composeDelete(i)}},apply:function(t){var r=[],o=0;n(this._operations,function(e){t(e.items,o,e.type),e.type!==a&&(o+=e.count,r=r.concat(e.items))}),this._operations=[new e(i,r.length,r)]},_findArrayOperation:function(e){var r,n,i,o,s,u=!1;for(r=o=0,n=this._operations.length;n>r;++r)if(i=this._operations[r],i.type!==a){if(s=o+i.count-1,e===o)break;if(e>o&&s>=e){u=!0;break}o=s+1}return new t(i,r,u,o)},_split:function(t,r,n){var i=this._operations[t],o=i.items.slice(r),a=new e(i.type,o.length,o);i.count=r,i.items=i.items.slice(0,r),this._operations.splice(t+1,0,n,a)},_composeInsert:function(e){var t=this._operations[e],r=this._operations[e-1],n=this._operations[e+1],i=r&&r.type,a=n&&n.type;i===o?(r.count+=t.count,r.items=r.items.concat(t.items),a===o?(r.count+=n.count,r.items=r.items.concat(n.items),this._operations.splice(e,2)):this._operations.splice(e,1)):a===o&&(t.count+=n.count,t.items=t.items.concat(n.items),this._operations.splice(e+1,1))},_composeDelete:function(e){var t,r,n,i=this._operations[e],s=i.count,u=this._operations[e-1],l=u&&u.type,c=!1,h=[];l===a&&(i=u,e-=1);for(var m=e+1;s>0;++m)t=this._operations[m],r=t.type,n=t.count,r!==a?(n>s?(h=h.concat(t.items.splice(0,s)),t.count-=s,m-=1,n=s,s=0):(n===s&&(c=!0),h=h.concat(t.items),s-=n),r===o&&(i.count-=n)):i.count+=n;return i.count>0?this._operations.splice(e+1,m-1-e):this._operations.splice(e,c?2:1),h},toString:function(){var e="";return n(this._operations,function(t){e+=" "+t.type+":"+t.count}),e.substring(1)}}}(),function(){function e(e,t){this.type=e,this.count=t}var t=(Ember.get,Ember.EnumerableUtils.forEach),r="r",n="f";Ember.SubArray=function(t){arguments.length<1&&(t=0),this._operations=t>0?[new e(r,t)]:[]},Ember.SubArray.prototype={addItem:function(t,i){var o=-1,a=i?r:n,s=this;return this._findOperation(t,function(n,u,l,c,h){var m,p;a===n.type?++n.count:t===l?s._operations.splice(u,0,new e(a,1)):(m=new e(a,1),p=new e(n.type,c-t+1),n.count=t-l,s._operations.splice(u+1,0,m,p)),i&&(o=n.type===r?h+(t-l):h),s._composeAt(u)},function(t){s._operations.push(new e(a,1)),i&&(o=t),s._composeAt(s._operations.length-1)}),o},removeItem:function(e){var t=-1,n=this;return this._findOperation(e,function(i,o,a,s,u){i.type===r&&(t=u+(e-a)),i.count>1?--i.count:(n._operations.splice(o,1),n._composeAt(o))},function(){throw new Ember.Error("Can't remove an item that has never been added.")}),t},_findOperation:function(e,t,n){var i,o,a,s,u,l=0;for(i=s=0,o=this._operations.length;o>i;s=u+1,++i){if(a=this._operations[i],u=s+a.count-1,e>=s&&u>=e)return t(a,i,s,u,l),void 0;a.type===r&&(l+=a.count)}n(l)},_composeAt:function(e){var t,r=this._operations[e];r&&(e>0&&(t=this._operations[e-1],t.type===r.type&&(r.count+=t.count,this._operations.splice(e-1,1),--e)),e<this._operations.length-1&&(t=this._operations[e+1],t.type===r.type&&(r.count+=t.count,this._operations.splice(e+1,1))))},toString:function(){var e="";return t(this._operations,function(t){e+=" "+t.type+":"+t.count}),e.substring(1)}}}(),function(){Ember.Container=t("container")["default"],Ember.Container.set=Ember.set}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){{var e="Index out of range",t=[],r=Ember.get;Ember.set}Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return r(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,n){r(this,"content").replace(e,t,n)},_contentWillChange:Ember.beforeObserver("content",function(){this._teardownContent()}),_teardownContent:function(){var e=r(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer("content",function(){r(this,"content");this._setupContent()}),_setupContent:function(){var e=r(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver("arrangedContent",function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,void 0),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)}),_arrangedContentDidChange:Ember.observer("arrangedContent",function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,void 0,t)}),_setupArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return r(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=r(this,"arrangedContent");return e?r(e,"length"):0}),_replace:function(e,t,n){var i=r(this,"content");return i&&this.replaceContent(e,t,n),this},replace:function(){if(r(this,"arrangedContent")!==r(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,n){if(t>r(this,"content.length"))throw new Ember.Error(e);return this._replace(t,0,[n]),this},insertAt:function(e,t){if(r(this,"arrangedContent")===r(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(n,i){if("number"==typeof n){var o,a=r(this,"content"),s=r(this,"arrangedContent"),u=[];if(0>n||n>=r(this,"length"))throw new Ember.Error(e);for(void 0===i&&(i=1),o=n;n+i>o;o++)u.push(a.indexOf(s.objectAt(o)));for(u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges(),o=0;o<u.length;o++)this._replace(u[o],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(r(this,"content.length"),e),e},pushObjects:function(e){if(!Ember.Enumerable.detect(e)&&!Ember.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this._replace(r(this,"length"),0,e),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this._replace(0,t,e),this},unshiftObject:function(e){return this._insertAt(0,e),e},unshiftObjects:function(e){return this._replace(0,0,e),this},slice:function(){var e=this.toArray();return e.slice.apply(e,arguments)},arrangedContentArrayWillChange:function(e,t,r,n){this.arrayContentWillChange(t,r,n)},arrangedContentArrayDidChange:function(e,t,r,n){this.arrayContentDidChange(t,r,n)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function e(e,t,r,i,o){var a,s=r._objects;for(s||(s=r._objects={});--o>=i;){var u=e.objectAt(o);u&&(Ember.addBeforeObserver(u,t,r,"contentKeyWillChange"),Ember.addObserver(u,t,r,"contentKeyDidChange"),a=n(u),s[a]||(s[a]=[]),s[a].push(o))}}function t(e,t,r,i,a){var s=r._objects;s||(s=r._objects={});for(var u,l;--a>=i;){var c=e.objectAt(a);c&&(Ember.removeBeforeObserver(c,t,r,"contentKeyWillChange"),Ember.removeObserver(c,t,r,"contentKeyDidChange"),l=n(c),u=s[l],u[o.call(u,a)]=null)}}var r=(Ember.set,Ember.get),n=Ember.guidFor,i=Ember.EnumerableUtils.forEach,o=Ember.ArrayPolyfills.indexOf,a=Ember.Object.extend(Ember.Array,{init:function(e,t,r){this._super(),this._keyName=t,this._owner=r,this._content=e},objectAt:function(e){var t=this._content.objectAt(e);return t&&r(t,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?r(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),i(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e){var t;return t=new a(this._content,e,this),Ember.defineProperty(this,e,null,t),this.beginObservingContentKey(e),t},arrayWillChange:function(e,r,n){var i,o,a=this._keys;o=n>0?r+n:-1,Ember.beginPropertyChanges(this);for(i in a)a.hasOwnProperty(i)&&(o>0&&t(e,i,this,r,o),Ember.propertyWillChange(this,i));Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(t,r,n,i){var o,a=this._keys;o=i>0?r+i:-1,Ember.changeProperties(function(){for(var n in a)a.hasOwnProperty(n)&&(o>0&&e(t,n,this,r,o),Ember.propertyDidChange(this,n));Ember.propertyDidChange(this._content,"@each")},this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(t){var n=this._keys;if(n||(n=this._keys={}),n[t])n[t]++;else{n[t]=1;var i=this._content,o=r(i,"length");e(i,t,this,0,o)}},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var i=this._content,o=r(i,"length");t(i,e,this,0,o)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils._replace),r=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return"length"===e?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(r,n,i){if(this.isFrozen)throw Ember.FROZEN_ERROR;var o=i?e(i,"length"):0;return this.arrayContentWillChange(r,n,o),0===o?this.splice(r,n):t(this,r,n,i),this.arrayContentDidChange(r,n,o),this},unknownProperty:function(e,t){var r;return void 0!==t&&void 0===r&&(r=this[e]=t),r},indexOf:function(e,t){var r,n=this.length;for(t=void 0===t?0:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var r,n=this.length;for(t=void 0===t?n-1:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;r>=0;r--)if(this[r]===e)return r;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),n=["length"];Ember.EnumerableUtils.forEach(r.keys(),function(e){Array.prototype[e]&&n.push(e)}),n.length>0&&(r=r.without.apply(r,n)),Ember.NativeArray=r,Ember.A=function(e){return void 0===e&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){r.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.get,t=Ember.set,r=Ember.guidFor,n=Ember.isNone,i=Ember.String.fmt;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Ember.Error(Ember.FROZEN_ERROR);var n=e(this,"length");if(0===n)return this;var i;this.enumerableContentWillChange(n,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var o=0;n>o;o++)i=r(this[o]),delete this[i],delete this[o];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(n,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var r=e(this,"length");if(e(t,"length")!==r)return!1;for(;--r>=0;)if(!t.contains(this[r]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:void 0}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:void 0}),addObject:function(i){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,a=r(i),s=this[a],u=e(this,"length");return s>=0&&u>s&&this[s]===i?this:(o=[i],this.enumerableContentWillChange(null,o),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[a]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,o),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,a,s=r(i),u=this[s],l=e(this,"length"),c=0===u,h=u===l-1;return u>=0&&l>u&&this[u]===i&&(a=[i],this.enumerableContentWillChange(a,null),c&&Ember.propertyWillChange(this,"firstObject"),h&&Ember.propertyWillChange(this,"lastObject"),l-1>u&&(o=this[l-1],this[u]=o,this[r(o)]=u),delete this[s],delete this[l-1],t(this,"length",l-1),c&&Ember.propertyDidChange(this,"firstObject"),h&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(a,null)),this},contains:function(e){return this[r(e)]>=0},copy:function(){var n=this.constructor,i=new n,o=e(this,"length");for(t(i,"length",o);--o>=0;)i[o]=this[o],i[r(this[o])]=o;return i},toString:function(){var e,t=this.length,r=[];for(e=0;t>e;e++)r[e]=this[e];return i("Ember.Set<%@>",[r.join(",")])}})}(),function(){var e=Ember.DeferredMixin,t=(Ember.get,Ember.Object.extend(e));t.reopenClass({promise:function(e,r){var n=t.create();return e.call(r,n),n}}),Ember.Deferred=t}(),function(){var e=Ember.ArrayPolyfills.forEach,t=Ember.ENV.EMBER_LOAD_HOOKS||{},r={};Ember.onLoad=function(e,n){var i;t[e]=t[e]||Ember.A(),t[e].pushObject(n),(i=r[e])&&n(i)},Ember.runLoadHooks=function(n,i){if(r[n]=i,"object"==typeof window&&"function"==typeof window.dispatchEvent&&"function"==typeof CustomEvent){var o=new CustomEvent(n,{detail:i,name:n});window.dispatchEvent(o)}t[n]&&e.call(t[n],function(e){e(i)})}}(),function(){Ember.get;Ember.ControllerMixin=Ember.Mixin.create(Ember.ActionHandler,{isController:!0,target:null,container:null,parentController:null,store:null,model:Ember.computed.alias("content"),deprecatedSendHandles:function(e){return!!this[e]},deprecatedSend:function(e){var t=[].slice.call(arguments,1);this[e].apply(this,t)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach);Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,sortFunction:Ember.compare,orderBy:function(r,n){var i=0,o=e(this,"sortProperties"),a=e(this,"sortAscending"),s=e(this,"sortFunction");return t(o,function(t){0===i&&(i=s(e(r,t),e(n,t)),0===i||a||(i=-1*i))}),i},destroy:function(){var r=e(this,"content"),n=e(this,"sortProperties");return r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(){var r=e(this,"content"),n=e(this,"isSorted"),i=e(this,"sortProperties"),o=this;return r&&n?(r=r.slice(),r.sort(function(e,t){return o.orderBy(e,t)}),t(r,function(e){t(i,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(r)):r}),_contentWillChange:Ember.beforeObserver("content",function(){var r=e(this,"content"),n=e(this,"sortProperties");r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()}),sortAscendingWillChange:Ember.beforeObserver("sortAscending",function(){this._lastSortAscending=e(this,"sortAscending")}),sortAscendingDidChange:Ember.observer("sortAscending",function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}}),contentArrayWillChange:function(r,n,i,o){var a=e(this,"isSorted");if(a){var s=e(this,"arrangedContent"),u=r.slice(n,n+i),l=e(this,"sortProperties");t(u,function(e){s.removeObject(e),t(l,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},contentArrayDidChange:function(r,n,i,o){var a=e(this,"isSorted"),s=e(this,"sortProperties");if(a){var u=r.slice(n,n+o);t(u,function(e){this.insertItemSorted(e),t(s,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},insertItemSorted:function(t){var r=e(this,"arrangedContent"),n=e(r,"length"),i=this._binarySearch(t,0,n);r.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var r=e(this,"arrangedContent"),n=r.indexOf(t),i=r.objectAt(n-1),o=r.objectAt(n+1),a=i&&this.orderBy(t,i),s=o&&this.orderBy(t,o);(0>a||s>0)&&(r.removeObject(t),this.insertItemSorted(t))},_binarySearch:function(t,r,n){var i,o,a,s;return r===n?r:(s=e(this,"arrangedContent"),i=r+Math.floor((n-r)/2),o=s.objectAt(i),a=this.orderBy(o,t),0>a?this._binarySearch(t,i+1,n):a>0?this._binarySearch(t,r,i):i)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach),r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(){return e(this,"itemController")},objectAtContent:function(t){var r=e(this,"length"),n=e(this,"arrangedContent"),i=n&&n.objectAt(t);if(t>=0&&r>t){var o=this.lookupItemController(i);if(o)return this.controllerAt(t,i,o)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(n,i,o){var a=e(this,"_subControllers"),s=a.slice(n,n+i);t(s,function(e){e&&e.destroy()}),r(a,n,i,new Array(o)),this._super(n,i,o)},init:function(){this._super(),this.set("_subControllers",Ember.A())},content:Ember.computed(function(){return Ember.A()}),_isVirtual:!1,controllerAt:function(t,r,n){var i,o=e(this,"container"),a=e(this,"_subControllers"),s=a[t];if(s)return s;if(i="controller:"+n,!o.has(i))throw new Ember.Error('Could not resolve itemController: "'+n+'"');var u;return this._isVirtual&&(u=e(this,"parentController")),u=u||this,s=o.lookupFactory(i).create({target:this,parentController:u,content:r}),a[t]=s,s},_subControllers:null,_resetSubControllers:function(){var r=e(this,"_subControllers");r&&t(r,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){var e=Ember.imports&&Ember.imports.jQuery||this&&this.jQuery;e||"function"!=typeof r||(e=r("jquery")),Ember.$=e}(),function(){if(Ember.$){var e=Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");
|
14 |
Ember.EnumerableUtils.forEach(e,function(e){Ember.$.event.fixHooks[e]={props:["dataTransfer"]}})}}(),function(){function e(e){var t=e.shiftKey||e.metaKey||e.altKey||e.ctrlKey,r=e.which>1;return!t&&!r}var t="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="<div></div>",e.firstChild.innerHTML="<script></script>",""===e.firstChild.innerHTML}(),r="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="Test: <script type='text/x-placeholder'></script>Value","Test:"===e.childNodes[0].nodeValue&&" Value"===e.childNodes[2].nodeValue}(),n=function(e,t){if(e.getAttribute("id")===t)return e;var r,i,o,a=e.childNodes.length;for(r=0;a>r;r++)if(i=e.childNodes[r],o=1===i.nodeType&&n(i,t))return o},i=function(e,i){t&&(i="­"+i);var o=[];if(r&&(i=i.replace(/(\s+)(<script id='([^']+)')/g,function(e,t,r,n){return o.push([n,t]),r})),e.innerHTML=i,o.length>0){var a,s=o.length;for(a=0;s>a;a++){var u=n(e,o[a][0]),l=document.createTextNode(o[a][1]);u.parentNode.insertBefore(l,u)}}if(t){for(var c=e.firstChild;1===c.nodeType&&!c.nodeName;)c=c.firstChild;3===c.nodeType&&""===c.nodeValue.charAt(0)&&(c.nodeValue=c.nodeValue.slice(1))}},o={},a=function(e){if(void 0!==o[e])return o[e];var t=!0;if("select"===e.toLowerCase()){var r=document.createElement("select");i(r,'<option value="test">Test</option>'),t=1===r.options.length}return o[e]=t,t},s=function(e,t){var r=e.tagName;if(a(r))i(e,t);else{var n=e.outerHTML||(new XMLSerializer).serializeToString(e),o=n.match(new RegExp("<"+r+"([^>]*)>","i"))[0],s="</"+r+">",u=document.createElement("div");for(i(u,o+t+s),e=u.firstChild;e.tagName!==r;)e=e.nextSibling}return e};Ember.ViewUtils={setInnerHTML:s,isSimpleClick:e}}(),function(){function e(e){return e?n.test(e)?e.replace(i,""):e:e}function t(e){var t={"<":"<",">":">",'"':""","'":"'","`":"`"},r=function(e){return t[e]||"&"},n=e.toString();return a.test(n)?n.replace(o,r):n}var r=(Ember.get,Ember.set,function(){this.seen={},this.list=[]});r.prototype={add:function(e){e in this.seen||(this.seen[e]=!0,this.list.push(e))},toDOM:function(){return this.list.join(" ")}};var n=/[^a-zA-Z0-9\-]/,i=/[^a-zA-Z0-9\-]/g,o=/&(?!\w+;)|[<>"'`]/g,a=/[&<>"'`]/,s=function(){var e=document.createElement("div"),t=document.createElement("input");return t.setAttribute("name","foo"),e.appendChild(t),!!e.innerHTML.match("foo")}();Ember.RenderBuffer=function(e){return new Ember._RenderBuffer(e)},Ember._RenderBuffer=function(e){this.tagNames=[e||null],this.buffer=""},Ember._RenderBuffer.prototype={_element:null,_hasElement:!0,elementClasses:null,classes:null,elementId:null,elementAttributes:null,elementProperties:null,elementTag:null,elementStyle:null,parentBuffer:null,push:function(e){return this.buffer+=e,this},addClass:function(e){return this.elementClasses=this.elementClasses||new r,this.elementClasses.add(e),this.classes=this.elementClasses.list,this},setClasses:function(e){this.elementClasses=null;var t,r=e.length;for(t=0;r>t;t++)this.addClass(e[t])},id:function(e){return this.elementId=e,this},attr:function(e,t){var r=this.elementAttributes=this.elementAttributes||{};return 1===arguments.length?r[e]:(r[e]=t,this)},removeAttr:function(e){var t=this.elementAttributes;return t&&delete t[e],this},prop:function(e,t){var r=this.elementProperties=this.elementProperties||{};return 1===arguments.length?r[e]:(r[e]=t,this)},removeProp:function(e){var t=this.elementProperties;return t&&delete t[e],this},style:function(e,t){return this.elementStyle=this.elementStyle||{},this.elementStyle[e]=t,this},begin:function(e){return this.tagNames.push(e||null),this},pushOpeningTag:function(){var r=this.currentTagName();if(r){if(this._hasElement&&!this._element&&0===this.buffer.length)return this._element=this.generateElement(),void 0;var n,i,o=this.buffer,a=this.elementId,s=this.classes,u=this.elementAttributes,l=this.elementProperties,c=this.elementStyle;if(o+="<"+e(r),a&&(o+=' id="'+t(a)+'"',this.elementId=null),s&&(o+=' class="'+t(s.join(" "))+'"',this.classes=null,this.elementClasses=null),c){o+=' style="';for(i in c)c.hasOwnProperty(i)&&(o+=i+":"+t(c[i])+";");o+='"',this.elementStyle=null}if(u){for(n in u)u.hasOwnProperty(n)&&(o+=" "+n+'="'+t(u[n])+'"');this.elementAttributes=null}if(l){for(i in l)if(l.hasOwnProperty(i)){var h=l[i];(h||"number"==typeof h)&&(o+=h===!0?" "+i+'="'+i+'"':" "+i+'="'+t(l[i])+'"')}this.elementProperties=null}o+=">",this.buffer=o}},pushClosingTag:function(){var t=this.tagNames.pop();t&&(this.buffer+="</"+e(t)+">")},currentTagName:function(){return this.tagNames[this.tagNames.length-1]},generateElement:function(){var r,n,i,o=this.tagNames.pop(),a=this.elementId,u=this.classes,l=this.elementAttributes,c=this.elementProperties,h=this.elementStyle,m="";i=l&&l.name&&!s?"<"+e(o)+' name="'+t(l.name)+'">':o;var p=document.createElement(i),f=Ember.$(p);if(a&&(f.attr("id",a),this.elementId=null),u&&(f.attr("class",u.join(" ")),this.classes=null,this.elementClasses=null),h){for(n in h)h.hasOwnProperty(n)&&(m+=n+":"+h[n]+";");f.attr("style",m),this.elementStyle=null}if(l){for(r in l)l.hasOwnProperty(r)&&f.attr(r,l[r]);this.elementAttributes=null}if(c){for(n in c)c.hasOwnProperty(n)&&f.prop(n,c[n]);this.elementProperties=null}return p},element:function(){var e=this.innerString();return e&&(this._element=Ember.ViewUtils.setInnerHTML(this._element,e)),this._element},string:function(){if(this._hasElement&&this._element){var e=this.element(),t=e.outerHTML;return"undefined"==typeof t?Ember.$("<div/>").append(e).html():t}return this.innerString()},innerString:function(){return this.buffer}}}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.EventDispatcher=Ember.Object.extend({events:{touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",mousemove:"mouseMove",focusin:"focusIn",focusout:"focusOut",mouseenter:"mouseEnter",mouseleave:"mouseLeave",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"},rootElement:"body",setup:function(r,n){var i,o=e(this,"events");Ember.$.extend(o,r||{}),Ember.isNone(n)||t(this,"rootElement",n),n=Ember.$(e(this,"rootElement")),n.addClass("ember-application");for(i in o)o.hasOwnProperty(i)&&this.setupHandler(n,i,o[i])},setupHandler:function(e,t,r){var n=this;e.on(t+".ember",".ember-view",function(e,t){var i=Ember.View.views[this.id],o=!0,a=null;return a=n._findNearestEventManager(i,r),a&&a!==t?o=n._dispatchEvent(a,e,r,i):i?o=n._bubbleEvent(i,e,r):e.stopPropagation(),o}),e.on(t+".ember","[data-ember-action]",function(e){var t=Ember.$(e.currentTarget).attr("data-ember-action"),n=Ember.Handlebars.ActionHelper.registeredActions[t];return n&&n.eventName===r?n.handler(e):void 0})},_findNearestEventManager:function(t,r){for(var n=null;t&&(n=e(t,"eventManager"),!n||!n[r]);)t=e(t,"parentView");return n},_dispatchEvent:function(e,t,r,n){var i=!0,o=e[r];return"function"===Ember.typeOf(o)?(i=Ember.run(e,o,t,n),t.stopPropagation()):i=this._bubbleEvent(n,t,r),i},_bubbleEvent:function(e,t,r){return Ember.run(e,e.handleEvent,r,t)},destroy:function(){var t=e(this,"rootElement");return Ember.$(t).off(".ember","**").removeClass("ember-application"),this._super()}})}(),function(){var e=Ember.run.queues,t=Ember.ArrayPolyfills.indexOf;e.splice(t.call(e,"actions")+1,0,"render","afterRender")}(),function(){function e(e){e.buffer=null}function t(){Ember.run.once(Ember.View,"notifyMutationListeners")}var r={},n=Ember.get,i=Ember.set,o=Ember.guidFor,a=Ember.EnumerableUtils.forEach,s=Ember.EnumerableUtils.addObject,u=Ember.meta,l=Ember.defineProperty,c=Ember.computed(function(){var e=this._childViews,t=Ember.A(),r=this;return a(e,function(e){var r;e.isVirtual?(r=n(e,"childViews"))&&t.pushObjects(r):t.push(e)}),t.replace=function(e,t,n){if(r instanceof Ember.ContainerView)return r.replace(e,t,n);throw new Ember.Error("childViews is immutable")},t});Ember.TEMPLATES={},Ember.CoreView=Ember.Object.extend(Ember.Evented,Ember.ActionHandler,{isView:!0,states:r,init:function(){this._super(),this.transitionTo("preRender"),this._isVisible=n(this,"isVisible")},parentView:Ember.computed("_parentView",function(){var e=this._parentView;return e&&e.isVirtual?n(e,"parentView"):e}),state:null,_parentView:null,concreteView:Ember.computed("parentView",function(){return this.isVirtual?n(this,"parentView"):this}),instrumentName:"core_view",instrumentDetails:function(e){e.object=this.toString()},renderToBuffer:function(e,t){var r="render."+this.instrumentName,n={};return this.instrumentDetails(n),Ember.instrument(r,n,function(){return this._renderToBuffer(e,t)},this)},_renderToBuffer:function(e){var t=this.tagName;(null===t||void 0===t)&&(t="div");var r=this.buffer=e&&e.begin(t)||Ember.RenderBuffer(t);return this.transitionTo("inBuffer",!1),this.beforeRender(r),this.render(r),this.afterRender(r),r},trigger:function(e){this._super.apply(this,arguments);var t=this[e];if(t){var r,n,i=[];for(r=1,n=arguments.length;n>r;r++)i.push(arguments[r]);return t.apply(this,i)}},deprecatedSendHandles:function(e){return!!this[e]},deprecatedSend:function(e){var t=[].slice.call(arguments,1);this[e].apply(this,t)},has:function(e){return"function"===Ember.typeOf(this[e])||this._super(e)},destroy:function(){var e=this._parentView;if(this._super())return this.removedFromDOM||this.destroyElement(),e&&e.removeChild(this),this.transitionTo("destroying",!1),this},clearRenderedChildren:Ember.K,triggerRecursively:Ember.K,invokeRecursively:Ember.K,transitionTo:Ember.K,destroyElement:Ember.K});var h=Ember._ViewCollection=function(e){var t=this.views=e||[];this.length=t.length};h.prototype={length:0,trigger:function(e){for(var t,r=this.views,n=0,i=r.length;i>n;n++)t=r[n],t.trigger&&t.trigger(e)},triggerRecursively:function(e){for(var t=this.views,r=0,n=t.length;n>r;r++)t[r].triggerRecursively(e)},invokeRecursively:function(e){for(var t,r=this.views,n=0,i=r.length;i>n;n++)t=r[n],e(t)},transitionTo:function(e,t){for(var r=this.views,n=0,i=r.length;i>n;n++)r[n].transitionTo(e,t)},push:function(){this.length+=arguments.length;var e=this.views;return e.push.apply(e,arguments)},objectAt:function(e){return this.views[e]},forEach:function(e){var t=this.views;return a(t,e)},clear:function(){this.length=0,this.views.length=0}};var m=[];Ember.View=Ember.CoreView.extend({concatenatedProperties:["classNames","classNameBindings","attributeBindings"],isView:!0,templateName:null,layoutName:null,template:Ember.computed("templateName",function(e,t){if(void 0!==t)return t;var r=n(this,"templateName"),i=this.templateForName(r,"template");return i||n(this,"defaultTemplate")}),controller:Ember.computed("_parentView",function(){var e=n(this,"_parentView");return e?n(e,"controller"):null}),layout:Ember.computed(function(){var e=n(this,"layoutName"),t=this.templateForName(e,"layout");return t||n(this,"defaultLayout")}).property("layoutName"),_yield:function(e,t){var r=n(this,"template");r&&r(e,t)},templateForName:function(e){if(e){var t=this.container||Ember.Container&&Ember.Container.defaultContainer;return t&&t.lookup("template:"+e)}},context:Ember.computed(function(e,t){return 2===arguments.length?(i(this,"_context",t),t):n(this,"_context")}).volatile(),_context:Ember.computed(function(){var e,t;return(t=n(this,"controller"))?t:(e=this._parentView,e?n(e,"_context"):null)}),_contextDidChange:Ember.observer("context",function(){this.rerender()}),isVisible:!0,childViews:c,_childViews:m,_childViewsWillChange:Ember.beforeObserver("childViews",function(){if(this.isVirtual){var e=n(this,"parentView");e&&Ember.propertyWillChange(e,"childViews")}}),_childViewsDidChange:Ember.observer("childViews",function(){if(this.isVirtual){var e=n(this,"parentView");e&&Ember.propertyDidChange(e,"childViews")}}),nearestInstanceOf:function(e){for(var t=n(this,"parentView");t;){if(t instanceof e)return t;t=n(t,"parentView")}},nearestOfType:function(e){for(var t=n(this,"parentView"),r=e instanceof Ember.Mixin?function(t){return e.detect(t)}:function(t){return e.detect(t.constructor)};t;){if(r(t))return t;t=n(t,"parentView")}},nearestWithProperty:function(e){for(var t=n(this,"parentView");t;){if(e in t)return t;t=n(t,"parentView")}},nearestChildOf:function(e){for(var t=n(this,"parentView");t;){if(n(t,"parentView")instanceof e)return t;t=n(t,"parentView")}},_parentViewDidChange:Ember.observer("_parentView",function(){this.isDestroying||(this.trigger("parentViewDidChange"),n(this,"parentView.controller")&&!n(this,"controller")&&this.notifyPropertyChange("controller"))}),_controllerDidChange:Ember.observer("controller",function(){this.isDestroying||(this.rerender(),this.forEachChildView(function(e){e.propertyDidChange("controller")}))}),cloneKeywords:function(){var e=n(this,"templateData"),t=e?Ember.copy(e.keywords):{};return i(t,"view",n(this,"concreteView")),i(t,"_view",this),i(t,"controller",n(this,"controller")),t},render:function(e){var t=n(this,"layout")||n(this,"template");if(t){var r,i=n(this,"context"),o=this.cloneKeywords(),a={view:this,buffer:e,isRenderData:!0,keywords:o,insideGroup:n(this,"templateData.insideGroup")};r=t(i,{data:a}),void 0!==r&&e.push(r)}},rerender:function(){return this.currentState.rerender(this)},clearRenderedChildren:function(){for(var e=this.lengthBeforeRender,t=this.lengthAfterRender,r=this._childViews,n=t-1;n>=e;n--)r[n]&&r[n].destroy()},_applyClassNameBindings:function(e){var t,r,n,i=this.classNames;a(e,function(e){var o,a=Ember.View._parsePropertyPath(e),u=function(){r=this._classStringForProperty(e),t=this.$(),o&&(t.removeClass(o),i.removeObject(o)),r?(t.addClass(r),o=r):o=null};n=this._classStringForProperty(e),n&&(s(i,n),o=n),this.registerObserver(this,a.path,u),this.one("willClearRender",function(){o&&(i.removeObject(o),o=null)})},this)},_unspecifiedAttributeBindings:null,_applyAttributeBindings:function(e,t){var r,i=this._unspecifiedAttributeBindings=this._unspecifiedAttributeBindings||{};a(t,function(t){var o=t.split(":"),a=o[0],s=o[1]||a;a in this?(this._setupAttributeBindingObservation(a,s),r=n(this,a),Ember.View.applyAttributeBindings(e,s,r)):i[a]=s},this),this.setUnknownProperty=this._setUnknownProperty},_setupAttributeBindingObservation:function(e,t){var r,i,o=function(){i=this.$(),r=n(this,e),Ember.View.applyAttributeBindings(i,t,r)};this.registerObserver(this,e,o)},setUnknownProperty:null,_setUnknownProperty:function(e,t){var r=this._unspecifiedAttributeBindings&&this._unspecifiedAttributeBindings[e];return r&&this._setupAttributeBindingObservation(e,r),l(this,e),i(this,e,t)},_classStringForProperty:function(e){var t=Ember.View._parsePropertyPath(e),r=t.path,i=n(this,r);return void 0===i&&Ember.isGlobalPath(r)&&(i=n(Ember.lookup,r)),Ember.View._classStringForValue(r,i,t.className,t.falsyClassName)},element:Ember.computed("_parentView",function(e,t){return void 0!==t?this.currentState.setElement(this,t):this.currentState.getElement(this)}),$:function(e){return this.currentState.$(this,e)},mutateChildViews:function(e){for(var t,r=this._childViews,n=r.length;--n>=0;)t=r[n],e(this,t,n);return this},forEachChildView:function(e){var t=this._childViews;if(!t)return this;var r,n,i=t.length;for(n=0;i>n;n++)r=t[n],e(r);return this},appendTo:function(e){return this._insertElementLater(function(){this.$().appendTo(e)}),this},replaceIn:function(e){return this._insertElementLater(function(){Ember.$(e).empty(),this.$().appendTo(e)}),this},_insertElementLater:function(e){this._scheduledInsert=Ember.run.scheduleOnce("render",this,"_insertElement",e)},_insertElement:function(e){this._scheduledInsert=null,this.currentState.insertElement(this,e)},append:function(){return this.appendTo(document.body)},remove:function(){this.removedFromDOM||this.destroyElement(),this.invokeRecursively(function(e){e.clearRenderedChildren&&e.clearRenderedChildren()})},elementId:null,findElementInParentElement:function(e){var t="#"+this.elementId;return Ember.$(t)[0]||Ember.$(t,e)[0]},createElement:function(){if(n(this,"element"))return this;var e=this.renderToBuffer();return i(this,"element",e.element()),this},willInsertElement:Ember.K,didInsertElement:Ember.K,willClearRender:Ember.K,invokeRecursively:function(e,t){for(var r,n,i,o=t===!1?this._childViews:[this];o.length;){r=o.slice(),o=[];for(var a=0,s=r.length;s>a;a++)n=r[a],i=n._childViews?n._childViews.slice(0):null,e(n),i&&o.push.apply(o,i)}},triggerRecursively:function(e){for(var t,r,n,i=[this];i.length;){t=i.slice(),i=[];for(var o=0,a=t.length;a>o;o++)r=t[o],n=r._childViews?r._childViews.slice(0):null,r.trigger&&r.trigger(e),n&&i.push.apply(i,n)}},viewHierarchyCollection:function(){for(var e,t=new h([this]),r=0;r<t.length;r++)e=t.objectAt(r),e._childViews&&t.push.apply(t,e._childViews);return t},destroyElement:function(){return this.currentState.destroyElement(this)},willDestroyElement:Ember.K,_notifyWillDestroyElement:function(){var e=this.viewHierarchyCollection();return e.trigger("willClearRender"),e.trigger("willDestroyElement"),e},_elementDidChange:Ember.observer("element",function(){this.forEachChildView(function(e){delete u(e).cache.element})}),parentViewDidChange:Ember.K,instrumentName:"view",instrumentDetails:function(e){e.template=n(this,"templateName"),this._super(e)},_renderToBuffer:function(e,t){this.lengthBeforeRender=this._childViews.length;var r=this._super(e,t);return this.lengthAfterRender=this._childViews.length,r},renderToBufferIfNeeded:function(e){return this.currentState.renderToBufferIfNeeded(this,e)},beforeRender:function(e){this.applyAttributesToBuffer(e),e.pushOpeningTag()},afterRender:function(e){e.pushClosingTag()},applyAttributesToBuffer:function(e){var t=n(this,"classNameBindings");t.length&&this._applyClassNameBindings(t);var r=n(this,"attributeBindings");r.length&&this._applyAttributeBindings(e,r),e.setClasses(this.classNames),e.id(this.elementId);var i=n(this,"ariaRole");i&&e.attr("role",i),n(this,"isVisible")===!1&&e.style("display","none")},tagName:null,ariaRole:null,classNames:["ember-view"],classNameBindings:m,attributeBindings:m,init:function(){this.elementId=this.elementId||o(this),this._super(),this._childViews=this._childViews.slice(),this.classNameBindings=Ember.A(this.classNameBindings.slice()),this.classNames=Ember.A(this.classNames.slice())},appendChild:function(e,t){return this.currentState.appendChild(this,e,t)},removeChild:function(e){if(!this.isDestroying){i(e,"_parentView",null);var t=this._childViews;return Ember.EnumerableUtils.removeObject(t,e),this.propertyDidChange("childViews"),this}},removeAllChildren:function(){return this.mutateChildViews(function(e,t){e.removeChild(t)})},destroyAllChildren:function(){return this.mutateChildViews(function(e,t){t.destroy()})},removeFromParent:function(){var e=this._parentView;return this.remove(),e&&e.removeChild(this),this},destroy:function(){var e,t,r=this._childViews,i=n(this,"parentView"),o=this.viewName;if(this._super()){for(e=r.length,t=e-1;t>=0;t--)r[t].removedFromDOM=!0;for(o&&i&&i.set(o,null),e=r.length,t=e-1;t>=0;t--)r[t].destroy();return this}},createChildView:function(e,t){if(!e)throw new TypeError("createChildViews first argument must exist");if(e.isView&&e._parentView===this&&e.container===this.container)return e;if(t=t||{},t._parentView=this,Ember.CoreView.detect(e))t.templateData=t.templateData||n(this,"templateData"),t.container=this.container,e=e.create(t),e.viewName&&i(n(this,"concreteView"),e.viewName,e);else if("string"==typeof e){var r="view:"+e,o=this.container.lookupFactory(r);t.templateData=n(this,"templateData"),e=o.create(t)}else t.container=this.container,n(e,"templateData")||(t.templateData=n(this,"templateData")),Ember.setProperties(e,t);return e},becameVisible:Ember.K,becameHidden:Ember.K,_isVisibleDidChange:Ember.observer("isVisible",function(){this._isVisible!==n(this,"isVisible")&&Ember.run.scheduleOnce("render",this,this._toggleVisibility)}),_toggleVisibility:function(){var e=this.$();if(e){var t=n(this,"isVisible");this._isVisible!==t&&(e.toggle(t),this._isVisible=t,this._isAncestorHidden()||(t?this._notifyBecameVisible():this._notifyBecameHidden()))}},_notifyBecameVisible:function(){this.trigger("becameVisible"),this.forEachChildView(function(e){var t=n(e,"isVisible");(t||null===t)&&e._notifyBecameVisible()})},_notifyBecameHidden:function(){this.trigger("becameHidden"),this.forEachChildView(function(e){var t=n(e,"isVisible");(t||null===t)&&e._notifyBecameHidden()})},_isAncestorHidden:function(){for(var e=n(this,"parentView");e;){if(n(e,"isVisible")===!1)return!0;e=n(e,"parentView")}return!1},clearBuffer:function(){this.invokeRecursively(e)},transitionTo:function(e,t){var r=this.currentState,n=this.currentState=this.states[e];this.state=e,r&&r.exit&&r.exit(this),n.enter&&n.enter(this),"inDOM"===e&&delete Ember.meta(this).cache.element,t!==!1&&this.forEachChildView(function(t){t.transitionTo(e)})},handleEvent:function(e,t){return this.currentState.handleEvent(this,e,t)},registerObserver:function(e,t,r,n){if(n||"function"!=typeof r||(n=r,r=null),e&&"object"==typeof e){var i=this,o=function(){i.currentState.invokeObserver(this,n)},a=function(){Ember.run.scheduleOnce("render",this,o)};Ember.addObserver(e,t,r,a),this.one("willClearRender",function(){Ember.removeObserver(e,t,r,a)})}}});var p={prepend:function(e,r){e.$().prepend(r),t()},after:function(e,r){e.$().after(r),t()},html:function(e,r){e.$().html(r),t()},replace:function(e){var r=n(e,"element");i(e,"element",null),e._insertElementLater(function(){Ember.$(r).replaceWith(n(e,"element")),t()})},remove:function(e){e.$().remove(),t()},empty:function(e){e.$().empty(),t()}};Ember.View.reopen({domManager:p}),Ember.View.reopenClass({_parsePropertyPath:function(e){var t,r,n=e.split(":"),i=n[0],o="";return n.length>1&&(t=n[1],3===n.length&&(r=n[2]),o=":"+t,r&&(o+=":"+r)),{path:i,classNames:o,className:""===t?void 0:t,falsyClassName:r}},_classStringForValue:function(e,t,r,n){if(r||n)return r&&t?r:n&&!t?n:null;if(t===!0){var i=e.split(".");return Ember.String.dasherize(i[i.length-1])}return t!==!1&&null!=t?t:null}});var f=Ember.Object.extend(Ember.Evented).create();Ember.View.addMutationListener=function(e){f.on("change",e)},Ember.View.removeMutationListener=function(e){f.off("change",e)},Ember.View.notifyMutationListeners=function(){f.trigger("change")},Ember.View.views={},Ember.View.childViewsProperty=c,Ember.View.applyAttributeBindings=function(e,t,r){var n=Ember.typeOf(r);"value"===t||"string"!==n&&("number"!==n||isNaN(r))?"value"===t||"boolean"===n?Ember.isNone(r)||r===!1?(e.removeAttr(t),e.prop(t,"")):r!==e.prop(t)&&e.prop(t,r):r||e.removeAttr(t):r!==e.attr(t)&&e.attr(t,r)},Ember.View.states=r}(),function(){var e=(Ember.get,Ember.set);Ember.View.states._default={appendChild:function(){throw"You can't use appendChild outside of the rendering process"},$:function(){return void 0},getElement:function(){return null},handleEvent:function(){return!0},destroyElement:function(t){return e(t,"element",null),t._scheduledInsert&&(Ember.run.cancel(t._scheduledInsert),t._scheduledInsert=null),t},renderToBufferIfNeeded:function(){return!1},rerender:Ember.K,invokeObserver:Ember.K}}(),function(){var e=Ember.View.states.preRender=Ember.create(Ember.View.states._default);Ember.merge(e,{insertElement:function(e,t){e.createElement();var r=e.viewHierarchyCollection();r.trigger("willInsertElement"),t.call(e);var n=e.get("element");document.body.contains(n)&&(r.transitionTo("inDOM",!1),r.trigger("didInsertElement"))},renderToBufferIfNeeded:function(e,t){return e.renderToBuffer(t),!0},empty:Ember.K,setElement:function(e,t){return null!==t&&e.transitionTo("hasElement"),t}})}(),function(){var e=(Ember.get,Ember.set,Ember.View.states.inBuffer=Ember.create(Ember.View.states._default));Ember.merge(e,{$:function(e){return e.rerender(),Ember.$()},rerender:function(){throw new Ember.Error("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.")},appendChild:function(e,t,r){var n=e.buffer,i=e._childViews;return t=e.createChildView(t,r),i.length||(i=e._childViews=i.slice()),i.push(t),t.renderToBuffer(n),e.propertyDidChange("childViews"),t},destroyElement:function(e){e.clearBuffer();var t=e._notifyWillDestroyElement();return t.transitionTo("preRender",!1),e},empty:function(){},renderToBufferIfNeeded:function(){return!1},insertElement:function(){throw"You can't insert an element that has already been rendered"},setElement:function(e,t){return null===t?e.transitionTo("preRender"):(e.clearBuffer(),e.transitionTo("hasElement")),t},invokeObserver:function(e,t){t.call(e)}})}(),function(){var e=Ember.get,t=Ember.set,r=Ember.View.states.hasElement=Ember.create(Ember.View.states._default);Ember.merge(r,{$:function(t,r){var n=e(t,"element");return r?Ember.$(r,n):Ember.$(n)},getElement:function(t){var r=e(t,"parentView");return r&&(r=e(r,"element")),r?t.findElementInParentElement(r):Ember.$("#"+e(t,"elementId"))[0]},setElement:function(e,t){if(null!==t)throw"You cannot set an element to a non-null value when the element is already in the DOM.";return e.transitionTo("preRender"),t},rerender:function(e){return e.triggerRecursively("willClearRender"),e.clearRenderedChildren(),e.domManager.replace(e),e},destroyElement:function(e){return e._notifyWillDestroyElement(),e.domManager.remove(e),t(e,"element",null),e._scheduledInsert&&(Ember.run.cancel(e._scheduledInsert),e._scheduledInsert=null),e},empty:function(e){var t,r,n=e._childViews;if(n)for(t=n.length,r=0;t>r;r++)n[r]._notifyWillDestroyElement();e.domManager.empty(e)},handleEvent:function(e,t,r){return e.has(t)?e.trigger(t,r):!0},invokeObserver:function(e,t){t.call(e)}})}(),function(){var e=Ember.View.states.hasElement,t=Ember.View.states.inDOM=Ember.create(e);Ember.merge(t,{enter:function(e){e.isVirtual||(Ember.View.views[e.elementId]=e),e.addBeforeObserver("elementId",function(){throw new Ember.Error("Changing a view's elementId after creation is not allowed")})},exit:function(e){this.isVirtual||delete Ember.View.views[e.elementId]},insertElement:function(){throw"You can't insert an element into the DOM that has already been inserted"}})}(),function(){var e="You can't call %@ on a view being destroyed",t=Ember.String.fmt,r=Ember.View.states.destroying=Ember.create(Ember.View.states._default);Ember.merge(r,{appendChild:function(){throw t(e,["appendChild"])},rerender:function(){throw t(e,["rerender"])},destroyElement:function(){throw t(e,["destroyElement"])},empty:function(){throw t(e,["empty"])},setElement:function(){throw t(e,["set('element', ...)"])},renderToBufferIfNeeded:function(){return!1},insertElement:Ember.K})}(),function(){Ember.View.cloneStates=function(e){var t={};t._default={},t.preRender=Ember.create(t._default),t.destroying=Ember.create(t._default),t.inBuffer=Ember.create(t._default),t.hasElement=Ember.create(t._default),t.inDOM=Ember.create(t.hasElement);for(var r in e)e.hasOwnProperty(r)&&Ember.merge(t[r],e[r]);return t}}(),function(){function e(e,t,r,n){t.triggerRecursively("willInsertElement"),r?r.domManager.after(r,n.string()):e.domManager.prepend(e,n.string()),t.forEach(function(e){e.transitionTo("inDOM"),e.propertyDidChange("element"),e.triggerRecursively("didInsertElement")})}var t=Ember.View.cloneStates(Ember.View.states),r=Ember.get,n=Ember.set,i=Ember.EnumerableUtils.forEach,o=Ember._ViewCollection;Ember.ContainerView=Ember.View.extend(Ember.MutableArray,{states:t,init:function(){this._super();var e=r(this,"childViews");Ember.defineProperty(this,"childViews",Ember.View.childViewsProperty);var t=this._childViews;i(e,function(e,i){var o;"string"==typeof e?(o=r(this,e),o=this.createChildView(o),n(this,e,o)):o=this.createChildView(e),t[i]=o},this);var o=r(this,"currentView");o&&(t.length||(t=this._childViews=this._childViews.slice()),t.push(this.createChildView(o)))},replace:function(e,t,n){var i=n?r(n,"length"):0;if(this.arrayContentWillChange(e,t,i),this.childViewsWillChange(this._childViews,e,t),0===i)this._childViews.splice(e,t);else{var o=[e,t].concat(n);n.length&&!this._childViews.length&&(this._childViews=this._childViews.slice()),this._childViews.splice.apply(this._childViews,o)}return this.arrayContentDidChange(e,t,i),this.childViewsDidChange(this._childViews,e,t,i),this},objectAt:function(e){return this._childViews[e]},length:Ember.computed(function(){return this._childViews.length}).volatile(),render:function(e){this.forEachChildView(function(t){t.renderToBuffer(e)})},instrumentName:"container",childViewsWillChange:function(e,t,r){if(this.propertyWillChange("childViews"),r>0){var n=e.slice(t,t+r);this.currentState.childViewsWillChange(this,e,t,r),this.initializeViews(n,null,null)}},removeChild:function(e){return this.removeObject(e),this},childViewsDidChange:function(e,t,n,i){if(i>0){var o=e.slice(t,t+i);this.initializeViews(o,this,r(this,"templateData")),this.currentState.childViewsDidChange(this,e,t,i)}this.propertyDidChange("childViews")},initializeViews:function(e,t,o){i(e,function(e){n(e,"_parentView",t),!e.container&&t&&n(e,"container",t.container),r(e,"templateData")||n(e,"templateData",o)})},currentView:null,_currentViewWillChange:Ember.beforeObserver("currentView",function(){var e=r(this,"currentView");e&&e.destroy()}),_currentViewDidChange:Ember.observer("currentView",function(){var e=r(this,"currentView");e&&this.pushObject(e)}),_ensureChildrenAreInDOM:function(){this.currentState.ensureChildrenAreInDOM(this)}}),Ember.merge(t._default,{childViewsWillChange:Ember.K,childViewsDidChange:Ember.K,ensureChildrenAreInDOM:Ember.K}),Ember.merge(t.inBuffer,{childViewsDidChange:function(){throw new Ember.Error("You cannot modify child views while in the inBuffer state")}}),Ember.merge(t.hasElement,{childViewsWillChange:function(e,t,r,n){for(var i=r;r+n>i;i++)t[i].remove()},childViewsDidChange:function(e){Ember.run.scheduleOnce("render",e,"_ensureChildrenAreInDOM")},ensureChildrenAreInDOM:function(t){var r,n,i,a,s,u=t._childViews,l=new o;for(r=0,n=u.length;n>r;r++)i=u[r],s||(s=Ember.RenderBuffer(),s._hasElement=!1),i.renderToBufferIfNeeded(s)?l.push(i):l.length?(e(t,l,a,s),s=null,a=i,l.clear()):a=i;l.length&&e(t,l,a,s)}})}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.CollectionView=Ember.ContainerView.extend({content:null,emptyViewClass:Ember.View,emptyView:null,itemViewClass:Ember.View,init:function(){var e=this._super();return this._contentDidChange(),e},_contentWillChange:Ember.beforeObserver("content",function(){var t=this.get("content");t&&t.removeArrayObserver(this);var r=t?e(t,"length"):0;this.arrayWillChange(t,0,r)}),_contentDidChange:Ember.observer("content",function(){var t=e(this,"content");t&&(this._assertArrayLike(t),t.addArrayObserver(this));var r=t?e(t,"length"):0;this.arrayDidChange(t,0,null,r)}),_assertArrayLike:function(){},destroy:function(){if(this._super()){var t=e(this,"content");return t&&t.removeArrayObserver(this),this._createdEmptyView&&this._createdEmptyView.destroy(),this}},arrayWillChange:function(t,r,n){var i=e(this,"emptyView");i&&i instanceof Ember.View&&i.removeFromParent();var o,a,s,u=this._childViews;s=this._childViews.length;var l=n===s;for(l&&(this.currentState.empty(this),this.invokeRecursively(function(e){e.removedFromDOM=!0},!1)),a=r+n-1;a>=r;a--)o=u[a],o.destroy()},arrayDidChange:function(r,n,i,o){var a,s,u,l,c,h,m=[];if(l=r?e(r,"length"):0)for(c=e(this,"itemViewClass"),"string"==typeof c&&(c=e(c)||c),u=n;n+o>u;u++)s=r.objectAt(u),a=this.createChildView(c,{content:s,contentIndex:u}),m.push(a);else{if(h=e(this,"emptyView"),!h)return;"string"==typeof h&&(h=e(h)||h),h=this.createChildView(h),m.push(h),t(this,"emptyView",h),Ember.CoreView.detect(h)&&(this._createdEmptyView=h)}this.replace(n,0,m)},createChildView:function(r,n){r=this._super(r,n);var i=e(r,"tagName");return(null===i||void 0===i)&&(i=Ember.CollectionView.CONTAINER_MAP[e(this,"tagName")],t(r,"tagName",i)),r}}),Ember.CollectionView.CONTAINER_MAP={ul:"li",ol:"li",table:"tr",thead:"tr",tbody:"tr",tfoot:"tr",tr:"td",select:"option"}}(),function(){var e=Ember.get;Ember.ComponentTemplateDeprecation=Ember.Mixin.create({willMergeMixin:function(t){this._super.apply(this,arguments);var r,n,i=t.layoutName||t.layout||e(this,"layoutName");t.templateName&&!i&&(r="templateName",n="layoutName",t.layoutName=t.templateName,delete t.templateName),t.template&&!i&&(r="template",n="layout",t.layout=t.template,delete t.template)}})}(),function(){var e=Ember.get,t=Ember.set,r=(Ember.isNone,Array.prototype.slice);Ember.Component=Ember.View.extend(Ember.TargetActionSupport,Ember.ComponentTemplateDeprecation,{init:function(){this._super(),t(this,"context",this),t(this,"controller",this)
|
15 |
},defaultLayout:function(e,t){Ember.Handlebars.helpers.yield.call(e,t)},template:Ember.computed(function(t,r){if(void 0!==r)return r;var n=e(this,"templateName"),i=this.templateForName(n,"template");return i||e(this,"defaultTemplate")}).property("templateName"),templateName:null,cloneKeywords:function(){return{view:this,controller:this}},_yield:function(t,r){var n=r.data.view,i=this._parentView,o=e(this,"template");o&&n.appendChild(Ember.View,{isVirtual:!0,tagName:"",_contextView:i,template:o,context:e(i,"context"),controller:e(i,"controller"),templateData:{keywords:i.cloneKeywords()}})},targetObject:Ember.computed(function(){var t=e(this,"_parentView");return t?e(t,"controller"):null}).property("_parentView"),sendAction:function(t){var n,i=r.call(arguments,1);n=void 0===t?e(this,"action"):e(this,t),void 0!==n&&this.triggerAction({action:n,actionContext:i})}})}(),function(){Ember.ViewTargetActionSupport=Ember.Mixin.create(Ember.TargetActionSupport,{target:Ember.computed.alias("controller"),actionContext:Ember.computed.alias("context")})}(),function(){e("metamorph",[],function(){"use strict";// Copyright: ©2014 Tilde, Inc. All rights reserved.
|
16 |
var e=function(){},t=0,r=function(){return"undefined"!=typeof MetamorphENV?MetamorphENV.DISABLE_RANGE_API:"undefined"!==ENV?ENV.DISABLE_RANGE_API:!1}(),n=!r&&"undefined"!=typeof document&&"createRange"in document&&"undefined"!=typeof Range&&Range.prototype.createContextualFragment,i="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="<div></div>",e.firstChild.innerHTML="<script></script>",""===e.firstChild.innerHTML}(),o=document&&function(){var e=document.createElement("div");return e.innerHTML="Test: <script type='text/x-placeholder'></script>Value","Test:"===e.childNodes[0].nodeValue&&" Value"===e.childNodes[2].nodeValue}(),a=function(r){var n;n=this instanceof a?this:new e,n.innerHTML=r;var i="metamorph-"+t++;return n.start=i+"-start",n.end=i+"-end",n};e.prototype=a.prototype;var s,u,l,c,h,m,p,f,d;if(c=function(){return this.startTag()+this.innerHTML+this.endTag()},f=function(){return"<script id='"+this.start+"' type='text/x-placeholder'></script>"},d=function(){return"<script id='"+this.end+"' type='text/x-placeholder'></script>"},n)s=function(e,t){var r=document.createRange(),n=document.getElementById(e.start),i=document.getElementById(e.end);return t?(r.setStartBefore(n),r.setEndAfter(i)):(r.setStartAfter(n),r.setEndBefore(i)),r},u=function(e,t){var r=s(this,t);r.deleteContents();var n=r.createContextualFragment(e);r.insertNode(n)},l=function(){var e=s(this,!0);e.deleteContents()},h=function(e){var t=document.createRange();t.setStart(e),t.collapse(!1);var r=t.createContextualFragment(this.outerHTML());e.appendChild(r)},m=function(e){var t=document.createRange(),r=document.getElementById(this.end);t.setStartAfter(r),t.setEndAfter(r);var n=t.createContextualFragment(e);t.insertNode(n)},p=function(e){var t=document.createRange(),r=document.getElementById(this.start);t.setStartAfter(r),t.setEndAfter(r);var n=t.createContextualFragment(e);t.insertNode(n)};else{var b={select:[1,"<select multiple='multiple'>","</select>"],fieldset:[1,"<fieldset>","</fieldset>"],table:[1,"<table>","</table>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"],colgroup:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],map:[1,"<map>","</map>"],_default:[0,"",""]},v=function(e,t){if(e.getAttribute("id")===t)return e;var r,n,i,o=e.childNodes.length;for(r=0;o>r;r++)if(n=e.childNodes[r],i=1===n.nodeType&&v(n,t))return i},E=function(e,t){var r=[];if(o&&(t=t.replace(/(\s+)(<script id='([^']+)')/g,function(e,t,n,i){return r.push([i,t]),n})),e.innerHTML=t,r.length>0){var n,i=r.length;for(n=0;i>n;n++){var a=v(e,r[n][0]),s=document.createTextNode(r[n][1]);a.parentNode.insertBefore(s,a)}}},g=function(e,t){var r=b[e.tagName.toLowerCase()]||b._default,n=r[0],o=r[1],a=r[2];i&&(t="­"+t);var s=document.createElement("div");E(s,o+t+a);for(var u=0;n>=u;u++)s=s.firstChild;if(i){for(var l=s;1===l.nodeType&&!l.nodeName;)l=l.firstChild;3===l.nodeType&&""===l.nodeValue.charAt(0)&&(l.nodeValue=l.nodeValue.slice(1))}return s},y=function(e){for(;""===e.parentNode.tagName;)e=e.parentNode;return e},_=function(e,t){e.parentNode!==t.parentNode&&t.parentNode.insertBefore(e,t.parentNode.firstChild)};u=function(e,t){var r,n,i,o=y(document.getElementById(this.start)),a=document.getElementById(this.end),s=a.parentNode;for(_(o,a),r=o.nextSibling;r;){if(n=r.nextSibling,i=r===a){if(!t)break;a=r.nextSibling}if(r.parentNode.removeChild(r),i)break;r=n}for(r=g(o.parentNode,e),t&&o.parentNode.removeChild(o);r;)n=r.nextSibling,s.insertBefore(r,a),r=n},l=function(){var e=y(document.getElementById(this.start)),t=document.getElementById(this.end);this.html(""),e.parentNode.removeChild(e),t.parentNode.removeChild(t)},h=function(e){for(var t,r=g(e,this.outerHTML());r;)t=r.nextSibling,e.appendChild(r),r=t},m=function(e){var t,r,n=document.getElementById(this.end),i=n.nextSibling,o=n.parentNode;for(r=g(o,e);r;)t=r.nextSibling,o.insertBefore(r,i),r=t},p=function(e){var t,r,n=document.getElementById(this.start),i=n.parentNode;r=g(i,e);for(var o=n.nextSibling;r;)t=r.nextSibling,i.insertBefore(r,o),r=t}}return a.prototype.html=function(e){return this.checkRemoved(),void 0===e?this.innerHTML:(u.call(this,e),this.innerHTML=e,void 0)},a.prototype.replaceWith=function(e){this.checkRemoved(),u.call(this,e,!0)},a.prototype.remove=l,a.prototype.outerHTML=c,a.prototype.appendTo=h,a.prototype.after=m,a.prototype.prepend=p,a.prototype.startTag=f,a.prototype.endTag=d,a.prototype.isRemoved=function(){var e=document.getElementById(this.start),t=document.getElementById(this.end);return!e||!t},a.prototype.checkRemoved=function(){if(this.isRemoved())throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")},a})}(),function(){var e=Object.create||function(e){function t(){}return t.prototype=e,new t},t=Ember.imports&&Ember.imports.Handlebars||this&&this.Handlebars;t||"function"!=typeof r||(t=r("handlebars")),Ember.Handlebars=e(t),Ember.Handlebars.helper=function(e,t){Ember.View.detect(t)?Ember.Handlebars.registerHelper(e,Ember.Handlebars.makeViewHelper(t)):Ember.Handlebars.registerBoundHelper.apply(null,arguments)},Ember.Handlebars.makeViewHelper=function(e){return function(t){return Ember.Handlebars.helpers.view.call(this,e,t)}},Ember.Handlebars.helpers=e(t.helpers),Ember.Handlebars.Compiler=function(){},t.Compiler&&(Ember.Handlebars.Compiler.prototype=e(t.Compiler.prototype)),Ember.Handlebars.Compiler.prototype.compiler=Ember.Handlebars.Compiler,Ember.Handlebars.JavaScriptCompiler=function(){},t.JavaScriptCompiler&&(Ember.Handlebars.JavaScriptCompiler.prototype=e(t.JavaScriptCompiler.prototype),Ember.Handlebars.JavaScriptCompiler.prototype.compiler=Ember.Handlebars.JavaScriptCompiler),Ember.Handlebars.JavaScriptCompiler.prototype.namespace="Ember.Handlebars",Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer=function(){return"''"},Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer=function(e){return"data.buffer.push("+e+");"};var n=/helpers\.(.*?)\)/,i=/helpers\['(.*?)'/,o=/(.*blockHelperMissing\.call\(.*)(stack[0-9]+)(,.*)/;Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation=function(e){var t=e[e.length-1],r=(n.exec(t)||i.exec(t))[1],a=o.exec(t);e[e.length-1]=a[1]+"'"+r+"'"+a[3]};var a=Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation,s=Ember.Handlebars.JavaScriptCompiler.prototype.blockValue;Ember.Handlebars.JavaScriptCompiler.prototype.blockValue=function(){s.apply(this,arguments),a(this.source)};var u=Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue=function(){u.apply(this,arguments),a(this.source)},Ember.Handlebars.Compiler.prototype.mustache=function(e){if(!e.params.length&&!e.hash){var r=new t.AST.IdNode([{part:"_triageMustache"}]);e.escaped||(e.hash=e.hash||new t.AST.HashNode([]),e.hash.pairs.push(["unescaped",new t.AST.StringNode("true")])),e=new t.AST.MustacheNode([r].concat([e.id]),e.hash,!e.escaped)}return t.Compiler.prototype.mustache.call(this,e)},Ember.Handlebars.precompile=function(e){var r=t.parse(e),n={knownHelpers:{action:!0,unbound:!0,"bind-attr":!0,template:!0,view:!0,_triageMustache:!0},data:!0,stringParams:!0},i=(new Ember.Handlebars.Compiler).compile(r,n);return(new Ember.Handlebars.JavaScriptCompiler).compile(i,n,void 0,!0)},t.compile&&(Ember.Handlebars.compile=function(e){var r=t.parse(e),n={data:!0,stringParams:!0},i=(new Ember.Handlebars.Compiler).compile(r,n),o=(new Ember.Handlebars.JavaScriptCompiler).compile(i,n,void 0,!0),a=Ember.Handlebars.template(o);return a.isMethod=!1,a})}(),function(){function e(e,r,n,i){var o,a,s,u,l,c=[],h=i.hash,m=h.boundOptions,p=t.call(i.types,1);for(l in m)m.hasOwnProperty(l)&&(h[l]=Ember.Handlebars.get(e,m[l],i));for(o=0,a=n.length;a>o;++o)s=n[o],u=p[o],"ID"===u?c.push(Ember.Handlebars.get(s.root,s.path,i)):c.push(s.path);return c.push(i),r.apply(e,c)}var t=Array.prototype.slice,r=Ember.Handlebars.template,n=Ember.Handlebars.normalizePath=function(e,t,r){var n,i,o=r&&r.keywords||{};return n=t.split(".",1)[0],o.hasOwnProperty(n)&&(e=o[n],i=!0,t=t===n?"":t.substr(n.length+1)),{root:e,path:t,isKeyword:i}},i=Ember.Handlebars.get=function(e,t,r){var i,o=r&&r.data,a=n(e,t,o);return e=a.root,t=a.path,i=Ember.get(e,t),void 0===i&&e!==Ember.lookup&&Ember.isGlobalPath(t)&&(i=Ember.get(Ember.lookup,t)),i};Ember.Handlebars.getEscaped=function(e,t,r){var n=i(e,t,r);return null===n||void 0===n?n="":n instanceof Handlebars.SafeString||(n=String(n)),r.hash.unescaped||(n=Handlebars.Utils.escapeExpression(n)),n},Ember.Handlebars.resolveParams=function(e,t,r){for(var n,o,a=[],s=r.types,u=0,l=t.length;l>u;u++)n=t[u],o=s[u],"ID"===o?a.push(i(e,n,r)):a.push(n);return a},Ember.Handlebars.resolveHash=function(e,t,r){var n,o={},a=r.hashTypes;for(var s in t)t.hasOwnProperty(s)&&(n=a[s],o[s]="ID"===n?i(e,t[s],r):t[s]);return o},Ember.Handlebars.registerHelper("helperMissing",function(e){var r,n="",i=arguments[arguments.length-1],o=Ember.Handlebars.resolveHelper(i.data.view.container,e);if(o)return o.apply(this,t.call(arguments,1));throw r="%@ Handlebars error: Could not find property '%@' on object %@.",i.data&&(n=i.data.view),new Ember.Error(Ember.String.fmt(r,[n,e,this]))}),Ember.Handlebars.registerHelper("blockHelperMissing",function(e){var r=arguments[arguments.length-1],n=Ember.Handlebars.resolveHelper(r.data.view.container,e);return n?n.apply(this,t.call(arguments,1)):Handlebars.helpers.helperMissing.call(this,e)}),Ember.Handlebars.registerBoundHelper=function(e){var r=t.call(arguments,1),n=Ember.Handlebars.makeBoundHelper.apply(this,r);Ember.Handlebars.registerHelper(e,n)},Ember.Handlebars.makeBoundHelper=function(r){function i(){var i,a,s,u,l,c=t.call(arguments,0,-1),h=c.length,m=arguments[arguments.length-1],p=[],f=m.data,d=f.isUnbound?t.call(m.types,1):m.types,b=m.hash,v=f.view,E=m.contexts,g=E&&E.length?E[0]:this,y="",_=Ember._SimpleHandlebarsView.prototype.normalizedValue,w=b.boundOptions={};for(s in b)Ember.IS_BINDING.test(s)&&(w[s.slice(0,-7)]=b[s]);var C=[];for(f.properties=[],i=0;h>i;++i)if(f.properties.push(c[i]),"ID"===d[i]){var O=n(g,c[i],f);p.push(O),C.push(O)}else f.isUnbound?p.push({path:c[i]}):p.push(null);if(f.isUnbound)return e(this,r,p,m);var A=new Ember._SimpleHandlebarsView(null,null,!m.hash.unescaped,m.data);A.normalizedValue=function(){var e,t=[];for(e in w)w.hasOwnProperty(e)&&(l=n(g,w[e],f),A.path=l.path,A.pathRoot=l.root,b[e]=_.call(A));for(i=0;h>i;++i)l=p[i],l?(A.path=l.path,A.pathRoot=l.root,t.push(_.call(A))):t.push(c[i]);return t.push(m),r.apply(g,t)},v.appendChild(A);for(u in w)w.hasOwnProperty(u)&&C.push(n(g,w[u],f));for(i=0,a=C.length;a>i;++i)l=C[i],v.registerObserver(l.root,l.path,A,A.rerender);if("ID"===d[0]&&0!==p.length){var P=p[0],T=P.root,x=P.path;Ember.isEmpty(x)||(y=x+".");for(var S=0,V=o.length;V>S;S++)v.registerObserver(T,y+o[S],A,A.rerender)}}var o=t.call(arguments,1);return i._rawFunction=r,i},Ember.Handlebars.template=function(e){var t=r(e);return t.isTop=!0,t}}(),function(){Ember.String.htmlSafe=function(e){return new Handlebars.SafeString(e)};var e=Ember.String.htmlSafe;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.htmlSafe=function(){return e(this)})}(),function(){Ember.Handlebars.resolvePaths=function(e){for(var t=[],r=e.contexts,n=e.roots,i=e.data,o=0,a=r.length;a>o;o++)t.push(Ember.Handlebars.get(n[o],r[o],{data:i}));return t}}(),function(){function e(){Ember.run.once(Ember.View,"notifyMutationListeners")}var r=(Ember.set,Ember.get,t("metamorph")),n={remove:function(t){t.morph.remove(),e()},prepend:function(t,r){t.morph.prepend(r),e()},after:function(t,r){t.morph.after(r),e()},html:function(t,r){t.morph.html(r),e()},replace:function(t){var r=t.morph;t.transitionTo("preRender"),Ember.run.schedule("render",this,function(){if(!t.isDestroying){t.clearRenderedChildren();var n=t.renderToBuffer();t.invokeRecursively(function(e){e.propertyWillChange("element")}),t.triggerRecursively("willInsertElement"),r.replaceWith(n.string()),t.transitionTo("inDOM"),t.invokeRecursively(function(e){e.propertyDidChange("element")}),t.triggerRecursively("didInsertElement"),e()}})},empty:function(t){t.morph.html(""),e()}};Ember._Metamorph=Ember.Mixin.create({isVirtual:!0,tagName:"",instrumentName:"metamorph",init:function(){this._super(),this.morph=r()},beforeRender:function(e){e.push(this.morph.startTag()),e.pushOpeningTag()},afterRender:function(e){e.pushClosingTag(),e.push(this.morph.endTag())},createElement:function(){var e=this.renderToBuffer();this.outerHTML=e.string(),this.clearBuffer()},domManager:n}),Ember._MetamorphView=Ember.View.extend(Ember._Metamorph),Ember._SimpleMetamorphView=Ember.CoreView.extend(Ember._Metamorph)}(),function(){function e(e,t,r,n){this.path=e,this.pathRoot=t,this.isEscaped=r,this.templateData=n,this.morph=o(),this.state="preRender",this.updateId=null,this._parentView=null,this.buffer=null}var r=Ember.get,n=Ember.set,i=Ember.Handlebars.get,o=t("metamorph");Ember._SimpleHandlebarsView=e,e.prototype={isVirtual:!0,isView:!0,destroy:function(){this.updateId&&(Ember.run.cancel(this.updateId),this.updateId=null),this._parentView&&this._parentView.removeChild(this),this.morph=null,this.state="destroyed"},propertyWillChange:Ember.K,propertyDidChange:Ember.K,normalizedValue:function(){var e,t,r=this.path,n=this.pathRoot;return""===r?e=n:(t=this.templateData,e=i(n,r,{data:t})),e},renderToBuffer:function(e){var t="";t+=this.morph.startTag(),t+=this.render(),t+=this.morph.endTag(),e.push(t)},render:function(){var e=this.isEscaped,t=this.normalizedValue();return null===t||void 0===t?t="":t instanceof Handlebars.SafeString||(t=String(t)),e&&(t=Handlebars.Utils.escapeExpression(t)),t},rerender:function(){switch(this.state){case"preRender":case"destroyed":break;case"inBuffer":throw new Ember.Error("Something you did tried to replace an {{expression}} before it was inserted into the DOM.");case"hasElement":case"inDOM":this.updateId=Ember.run.scheduleOnce("render",this,"update")}return this},update:function(){this.updateId=null,this.morph.html(this.render())},transitionTo:function(e){this.state=e}};var a=Ember.View.cloneStates(Ember.View.states),s=Ember.merge;s(a._default,{rerenderIfNeeded:Ember.K}),s(a.inDOM,{rerenderIfNeeded:function(e){e.normalizedValue()!==e._lastNormalizedValue&&e.rerender()}}),Ember._HandlebarsBoundView=Ember._MetamorphView.extend({instrumentName:"boundHandlebars",states:a,shouldDisplayFunc:null,preserveContext:!1,previousContext:null,displayTemplate:null,inverseTemplate:null,path:null,pathRoot:null,normalizedValue:function(){var e,t,n=r(this,"path"),o=r(this,"pathRoot"),a=r(this,"valueNormalizerFunc");return""===n?e=o:(t=r(this,"templateData"),e=i(o,n,{data:t})),a?a(e):e},rerenderIfNeeded:function(){this.currentState.rerenderIfNeeded(this)},render:function(e){var t=r(this,"isEscaped"),i=r(this,"shouldDisplayFunc"),o=r(this,"preserveContext"),a=r(this,"previousContext"),s=r(this,"_contextController"),u=r(this,"inverseTemplate"),l=r(this,"displayTemplate"),c=this.normalizedValue();if(this._lastNormalizedValue=c,i(c))if(n(this,"template",l),o)n(this,"_context",a);else{if(!l)return null===c||void 0===c?c="":c instanceof Handlebars.SafeString||(c=String(c)),t&&(c=Handlebars.Utils.escapeExpression(c)),e.push(c),void 0;s&&(n(s,"content",c),c=s),n(this,"_context",c)}else u?(n(this,"template",u),o?n(this,"_context",a):n(this,"_context",c)):n(this,"template",function(){return""});return this._super(e)}})}(),function(){function e(e){return!Ember.isNone(e)}function t(e,t,r,n,i,u){var l,c,h,m=t.data,p=t.fn,f=t.inverse,d=m.view,b=this;if(l=a(b,e,m),"object"==typeof this){if(m.insideGroup){c=function(){Ember.run.once(d,"rerender")};var v,E,g=o(b,e,t);g=i?i(g):g,E=r?b:g,n(g)?v=p:f&&(v=f),v(E,{data:t.data})}else{var y=d.createChildView(Ember._HandlebarsBoundView,{preserveContext:r,shouldDisplayFunc:n,valueNormalizerFunc:i,displayTemplate:p,inverseTemplate:f,path:e,pathRoot:b,previousContext:b,isEscaped:!t.hash.unescaped,templateData:t.data});t.hash.controller&&y.set("_contextController",this.container.lookupFactory("controller:"+t.hash.controller).create({container:b.container,parentController:b,target:b})),d.appendChild(y),c=function(){Ember.run.scheduleOnce("render",y,"rerenderIfNeeded")}}if(""!==l.path&&(d.registerObserver(l.root,l.path,c),u))for(h=0;h<u.length;h++)d.registerObserver(l.root,l.path+"."+u[h],c)}else m.buffer.push(s(b,e,t))}function r(e,t,r){var n,i,o,u,l=r.data,c=l.view;if(n=a(e,t,l),o=n.root,o&&"object"==typeof o){if(l.insideGroup)i=function(){Ember.run.once(c,"rerender")},u=s(e,t,r),l.buffer.push(u);else{var h=new Ember._SimpleHandlebarsView(t,e,!r.hash.unescaped,r.data);h._parentView=c,c.appendChild(h),i=function(){Ember.run.scheduleOnce("render",h,"rerender")}}""!==n.path&&c.registerObserver(n.root,n.path,i)}else u=s(e,t,r),l.buffer.push(u)}function n(e){var t=e&&i(e,"isTruthy");return"boolean"==typeof t?t:Ember.isArray(e)?0!==i(e,"length"):!!e}var i=Ember.get,o=(Ember.set,Ember.String.fmt,Ember.Handlebars.get),a=Ember.Handlebars.normalizePath,s=Ember.Handlebars.getEscaped,u=Ember.ArrayPolyfills.forEach,l=Ember.create,c=Ember.Handlebars,h=c.helpers;c.bind=t,c.registerHelper("_triageMustache",function(e,t){if(h[e])return h[e].call(this,t);var r=Ember.Handlebars.resolveHelper(t.data.view.container,e);return r?r.call(this,t):h.bind.call(this,e,t)}),Ember.Handlebars.resolveHelper=function(e,t){if(e&&-1!==t.indexOf("-")){var r=e.lookup("helper:"+t);if(!r){var n=e.lookup("component-lookup:main"),i=n.lookupFactory(t,e);i&&(r=c.makeViewHelper(i),e.register("helper:"+t,r))}return r}},c.registerHelper("bind",function(n,i){var o=i.contexts&&i.contexts.length?i.contexts[0]:this;return i.fn?t.call(o,n,i,!1,e):r(o,n,i)}),c.registerHelper("boundIf",function(e,r){var i=r.contexts&&r.contexts.length?r.contexts[0]:this;return t.call(i,e,r,!0,n,n,["isTruthy","length"])}),c.registerHelper("unboundIf",function(e,t){var r,i,s=t.contexts&&t.contexts.length?t.contexts[0]:this,u=t.data,l=t.fn,c=t.inverse;r=a(s,e,u),i=o(s,e,t),n(i)||(l=c),l(s,{data:u})}),c.registerHelper("with",function(r,n){if(4===arguments.length){var i,o,s,u,c;n=arguments[3],i=arguments[2],o=arguments[0];var m=l(n);if(m.data=l(n.data),m.data.keywords=l(n.data.keywords||{}),Ember.isGlobalPath(o))c=o;else{u=a(this,o,n.data),o=u.path,s=u.root;var p=Ember.$.expando+Ember.guidFor(s);m.data.keywords[p]=s,c=o?p+"."+o:p}return Ember.bind(m.data.keywords,i,c),t.call(this,o,m,!0,e)}return h.bind.call(n.contexts[0],r,n)}),c.registerHelper("if",function(e,t){return t.data.isUnbound?h.unboundIf.call(t.contexts[0],e,t):h.boundIf.call(t.contexts[0],e,t)}),c.registerHelper("unless",function(e,t){var r=t.fn,n=t.inverse;return t.fn=n,t.inverse=r,t.data.isUnbound?h.unboundIf.call(t.contexts[0],e,t):h.boundIf.call(t.contexts[0],e,t)}),c.registerHelper("bind-attr",function(e){var t=e.hash,r=e.data.view,n=[],i=this,s=++Ember.uuid,l=t["class"];if(null!=l){var h=c.bindClasses(this,l,r,s,e);n.push('class="'+Handlebars.Utils.escapeExpression(h.join(" "))+'"'),delete t["class"]}var m=Ember.keys(t);return u.call(m,function(u){var l,c=t[u];l=a(i,c,e.data);var h,m,p="this"===c?l.root:o(i,c,e),f=Ember.typeOf(p);h=function(){var t=o(i,c,e),n=r.$("[data-bindattr-"+s+"='"+s+"']");return n&&0!==n.length?(Ember.View.applyAttributeBindings(n,u,t),void 0):(Ember.removeObserver(l.root,l.path,m),void 0)},"this"===c||l.isKeyword&&""===l.path||r.registerObserver(l.root,l.path,h),"string"===f||"number"===f&&!isNaN(p)?n.push(u+'="'+Handlebars.Utils.escapeExpression(p)+'"'):p&&"boolean"===f&&n.push(u+'="'+u+'"')},this),n.push("data-bindattr-"+s+'="'+s+'"'),new c.SafeString(n.join(" "))}),c.registerHelper("bindAttr",function(){return c.helpers["bind-attr"].apply(this,arguments)}),c.bindClasses=function(e,t,r,n,i){var s,l,c,h=[],m=function(e,t,r){var n,i=t.path;return n="this"===i?e:""===i?!0:o(e,i,r),Ember.View._classStringForValue(i,n,t.className,t.falsyClassName)};return u.call(t.split(" "),function(t){var o,u,p,f,d=Ember.View._parsePropertyPath(t),b=d.path,v=e;""!==b&&"this"!==b&&(f=a(e,b,i.data),v=f.root,b=f.path),u=function(){s=m(e,d,i),c=n?r.$("[data-bindattr-"+n+"='"+n+"']"):r.$(),c&&0!==c.length?(o&&c.removeClass(o),s?(c.addClass(s),o=s):o=null):Ember.removeObserver(v,b,p)},""!==b&&"this"!==b&&r.registerObserver(v,b,u),l=m(e,d,i),l&&(h.push(l),o=l)}),h}}(),function(){function e(e,r){var n=r.hash,i=r.hashTypes;for(var o in n)if("ID"===i[o]){var a=n[o];Ember.IS_BINDING.test(o)||(n[o+"Binding"]=a,i[o+"Binding"]="STRING",delete n[o],delete i[o])}n.hasOwnProperty("idBinding")&&(n.id=t.get(e,n.idBinding,r),i.id="STRING",delete n.idBinding,delete i.idBinding)}var t=(Ember.get,Ember.set,Ember.Handlebars),r=/^[a-z]/,n=/^view\./;t.ViewHelper=Ember.Object.create({propertiesFromHTMLOptions:function(e){var t=e.hash,r=e.data,n={},i=t["class"],o=!1;t.id&&(n.elementId=t.id,o=!0),t.tag&&(n.tagName=t.tag,o=!0),i&&(i=i.split(" "),n.classNames=i,o=!0),t.classBinding&&(n.classNameBindings=t.classBinding.split(" "),o=!0),t.classNameBindings&&(void 0===n.classNameBindings&&(n.classNameBindings=[]),n.classNameBindings=n.classNameBindings.concat(t.classNameBindings.split(" ")),o=!0),t.attributeBindings&&(n.attributeBindings=null,o=!0),o&&(t=Ember.$.extend({},t),delete t.id,delete t.tag,delete t["class"],delete t.classBinding);var a;for(var s in t)t.hasOwnProperty(s)&&Ember.IS_BINDING.test(s)&&"string"==typeof t[s]&&(a=this.contextualizeBindingPath(t[s],r),a&&(t[s]=a));if(n.classNameBindings)for(var u in n.classNameBindings){var l=n.classNameBindings[u];if("string"==typeof l){var c=Ember.View._parsePropertyPath(l);a=this.contextualizeBindingPath(c.path,r),a&&(n.classNameBindings[u]=a+c.classNames)}}return Ember.$.extend(t,n)},contextualizeBindingPath:function(e,t){var r=Ember.Handlebars.normalizePath(null,e,t);return r.isKeyword?"templateData.keywords."+e:Ember.isGlobalPath(e)?null:"this"===e||""===e?"_parentView.context":"_parentView.context."+e},helper:function(i,o,a){var s,u=a.data,l=a.fn;e(i,a),s="string"==typeof o?"STRING"===a.types[0]&&r.test(o)&&!n.test(o)?u.view.container.lookupFactory("view:"+o):t.get(i,o,a):o;var c=this.propertiesFromHTMLOptions(a,i),h=u.view;c.templateData=u;var m=s.proto?s.proto():s;l&&(c.template=l),m.controller||m.controllerBinding||c.controller||c.controllerBinding||(c._context=i),h.appendChild(s,c)}}),t.registerHelper("view",function(e,r){return e&&e.data&&e.data.isRenderData&&(r=e,e="Ember.View"),t.ViewHelper.helper(this,e,r)})}(),function(){{var e=Ember.get,t=Ember.Handlebars.get;Ember.String.fmt}Ember.Handlebars.registerHelper("collection",function(r,n){r&&r.data&&r.data.isRenderData&&(n=r,r=void 0);{var i,o,a,s=n.fn,u=n.data,l=n.inverse;n.data.view}r?(i=u.keywords.controller,o=i&&i.container,a=t(this,r,n)||o.lookupFactory("view:"+r)):a=Ember.CollectionView;var c,h,m=n.hash,p={},f=a.proto();m.itemView?(i=u.keywords.controller,o=i.container,h=o.lookupFactory("view:"+m.itemView)):h=m.itemViewClass?t(f,m.itemViewClass,n):f.itemViewClass,delete m.itemViewClass,delete m.itemView;for(var d in m)m.hasOwnProperty(d)&&(c=d.match(/^item(.)(.*)$/),c&&"itemController"!==d&&(p[c[1].toLowerCase()+c[2]]=m[d],delete m[d]));s&&(p.template=s,delete n.fn);var b;l&&l!==Ember.Handlebars.VM.noop?(b=e(f,"emptyViewClass"),b=b.extend({template:l,tagName:p.tagName})):m.emptyViewClass&&(b=t(this,m.emptyViewClass,n)),b&&(m.emptyView=b),m.keyword||(p._context=Ember.computed.alias("content"));var v=Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({data:u,hash:p},this);return m.itemViewClass=h.extend(v),Ember.Handlebars.helpers.view.call(this,a,n)})}(),function(){var e=Ember.Handlebars.get;Ember.Handlebars.registerHelper("unbound",function(t,r){var n,i,o,a=arguments[arguments.length-1];return arguments.length>2?(a.data.isUnbound=!0,n=Ember.Handlebars.helpers[arguments[0]]||Ember.Handlebars.helpers.helperMissing,o=n.apply(this,Array.prototype.slice.call(arguments,1)),delete a.data.isUnbound,o):(i=r.contexts&&r.contexts.length?r.contexts[0]:this,e(i,t,r))})}(),function(){var e=(Ember.get,Ember.Handlebars.get),t=Ember.Handlebars.normalizePath,r=[].slice;Ember.Handlebars.registerHelper("log",function(){var n=r.call(arguments,0,-1),i=arguments[arguments.length-1],o=Ember.Logger.log,a=[],s=!1;s=!0;for(var u=0;u<n.length;u++){var l=i.types[u];if("ID"!==l&&s)a.push(n[u]);else{var c=i.contexts&&i.contexts[u]||this,h=t(c,n[u],i.data);"this"===h.path?a.push(h.root):a.push(e(h.root,h.path,i))}}o.apply(o,a)}),Ember.Handlebars.registerHelper("debugger",function(){{var e=this;Ember.inspect(e)}})}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.Handlebars.EachView=Ember.CollectionView.extend(Ember._Metamorph,{init:function(){var r,n=e(this,"itemController");if(n){var i=e(this,"controller.container").lookupFactory("controller:array").create({_isVirtual:!0,parentController:e(this,"controller"),itemController:n,target:e(this,"controller"),_eachView:this});this.disableContentObservers(function(){t(this,"content",i),r=new Ember.Binding("content","_eachView.dataSource").oneWay(),r.connect(i)}),t(this,"_arrayController",i)}else this.disableContentObservers(function(){r=new Ember.Binding("content","dataSource").oneWay(),r.connect(this)});return this._super()},_assertArrayLike:function(){},disableContentObservers:function(e){Ember.removeBeforeObserver(this,"content",null,"_contentWillChange"),Ember.removeObserver(this,"content",null,"_contentDidChange"),e.call(this),Ember.addBeforeObserver(this,"content",null,"_contentWillChange"),Ember.addObserver(this,"content",null,"_contentDidChange")},itemViewClass:Ember._MetamorphView,emptyViewClass:Ember._MetamorphView,createChildView:function(r,n){r=this._super(r,n);var i=e(this,"keyword"),o=e(r,"content");if(i){var a=e(r,"templateData");a=Ember.copy(a),a.keywords=r.cloneKeywords(),t(r,"templateData",a),a.keywords[i]=o}return o&&o.isController&&t(r,"controller",o),r},destroy:function(){if(this._super()){var t=e(this,"_arrayController");return t&&t.destroy(),this}}});var r=Ember.Handlebars.GroupedEach=function(e,t,r){var n=this,i=Ember.Handlebars.normalizePath(e,t,r.data);this.context=e,this.path=t,this.options=r,this.template=r.fn,this.containingView=r.data.view,this.normalizedRoot=i.root,this.normalizedPath=i.path,this.content=this.lookupContent(),this.addContentObservers(),this.addArrayObservers(),this.containingView.on("willClearRender",function(){n.destroy()})};r.prototype={contentWillChange:function(){this.removeArrayObservers()},contentDidChange:function(){this.content=this.lookupContent(),this.addArrayObservers(),this.rerenderContainingView()},contentArrayWillChange:Ember.K,contentArrayDidChange:function(){this.rerenderContainingView()},lookupContent:function(){return Ember.Handlebars.get(this.normalizedRoot,this.normalizedPath,this.options)},addArrayObservers:function(){this.content&&this.content.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},removeArrayObservers:function(){this.content&&this.content.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},addContentObservers:function(){Ember.addBeforeObserver(this.normalizedRoot,this.normalizedPath,this,this.contentWillChange),Ember.addObserver(this.normalizedRoot,this.normalizedPath,this,this.contentDidChange)},removeContentObservers:function(){Ember.removeBeforeObserver(this.normalizedRoot,this.normalizedPath,this.contentWillChange),Ember.removeObserver(this.normalizedRoot,this.normalizedPath,this.contentDidChange)},render:function(){if(this.content){var t=this.content,r=e(t,"length"),n=this.options.data,i=this.template;n.insideEach=!0;for(var o=0;r>o;o++)i(t.objectAt(o),{data:n})}},rerenderContainingView:function(){var e=this;Ember.run.scheduleOnce("render",this,function(){e.destroyed||e.containingView.rerender()})},destroy:function(){this.removeContentObservers(),this.content&&this.removeArrayObservers(),this.destroyed=!0}},Ember.Handlebars.registerHelper("each",function(e,t){if(4===arguments.length){var r=arguments[0];t=arguments[3],e=arguments[2],""===e&&(e="this"),t.hash.keyword=r}return 1===arguments.length&&(t=e,e="this"),t.hash.dataSourceBinding=e,!t.data.insideGroup||t.hash.groupedRows||t.hash.itemViewClass?Ember.Handlebars.helpers.collection.call(this,"Ember.Handlebars.EachView",t):(new Ember.Handlebars.GroupedEach(this,e,t).render(),void 0)})}(),function(){Ember.Handlebars.registerHelper("template",function(){return Ember.Handlebars.helpers.partial.apply(this,arguments)})}(),function(){function e(e){return!Ember.isNone(e)}function t(e,t,r){var n=t.split("/"),i=n[n.length-1];n[n.length-1]="_"+i;var o=r.data.view,a=n.join("/"),s=o.templateForName(a),u=!s&&o.templateForName(t);(s=s||u)(e,{data:r.data})}Ember.Handlebars.registerHelper("partial",function(r,n){var i=n.contexts&&n.contexts.length?n.contexts[0]:this;return"ID"===n.types[0]?(n.fn=function(e,n){var i=Ember.Handlebars.get(e,r,n);t(e,i,n)},Ember.Handlebars.bind.call(i,r,n,!0,e)):(t(i,r,n),void 0)})}(),function(){{var e=Ember.get;Ember.set}Ember.Handlebars.registerHelper("yield",function(t){for(var r=t.data.view;r&&!e(r,"layout");)r=r._contextView?r._contextView:e(r,"parentView");r._yield(this,t)})}(),function(){Ember.Handlebars.registerHelper("loc",function(e){return Ember.String.loc(e)})}(),function(){{var e=Ember.set;Ember.get}Ember.Checkbox=Ember.View.extend({classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","indeterminate","disabled","tabindex","name","autofocus","form"],type:"checkbox",checked:!1,disabled:!1,indeterminate:!1,init:function(){this._super(),this.on("change",this,this._updateElementValue)},didInsertElement:function(){this._super(),this.get("element").indeterminate=!!this.get("indeterminate")},_updateElementValue:function(){e(this,"checked",this.$().prop("checked"))}})}(),function(){function e(e,r,n){var i=t(r,e),o=t(r,"onEvent"),a=t(r,"value");(o===e||"keyPress"===o&&"key-press"===e)&&r.sendAction("action",a),r.sendAction(e,a),(i||o===e)&&(t(r,"bubbles")||n.stopPropagation())}var t=Ember.get,r=Ember.set;Ember.TextSupport=Ember.Mixin.create(Ember.TargetActionSupport,{value:"",attributeBindings:["placeholder","disabled","maxlength","tabindex","readonly","autofocus","form","selectionDirection","spellcheck","required"],placeholder:null,disabled:!1,maxlength:null,init:function(){this._super(),this.on("focusOut",this,this._elementValueDidChange),this.on("change",this,this._elementValueDidChange),this.on("paste",this,this._elementValueDidChange),this.on("cut",this,this._elementValueDidChange),this.on("input",this,this._elementValueDidChange),this.on("keyUp",this,this.interpretKeyEvents)},action:null,onEvent:"enter",bubbles:!1,interpretKeyEvents:function(e){var t=Ember.TextSupport.KEY_EVENTS,r=t[e.keyCode];return this._elementValueDidChange(),r?this[r](e):void 0},_elementValueDidChange:function(){r(this,"value",this.$().val())},insertNewline:function(t){e("enter",this,t),e("insert-newline",this,t)},cancel:function(t){e("escape-press",this,t)},focusIn:function(t){e("focus-in",this,t)},focusOut:function(t){e("focus-out",this,t)},keyPress:function(t){e("key-press",this,t)}}),Ember.TextSupport.KEY_EVENTS={13:"insertNewline",27:"cancel"}}(),function(){Ember.get,Ember.set;Ember.TextField=Ember.Component.extend(Ember.TextSupport,{classNames:["ember-text-field"],tagName:"input",attributeBindings:["type","value","size","pattern","name","min","max","accept","autocomplete","autosave","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","list","multiple","pattern","step","width"],value:"",type:"text",size:null,pattern:null,min:null,max:null})}(),function(){{var e=Ember.get;Ember.set}Ember.TextArea=Ember.Component.extend(Ember.TextSupport,{classNames:["ember-text-area"],tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","wrap"],rows:null,cols:null,_updateElementValue:Ember.observer("value",function(){var t=e(this,"value"),r=this.$();r&&t!==r.val()&&r.val(t)}),init:function(){this._super(),this.on("didInsertElement",this,this._updateElementValue)}})}(),function(){{var e=Ember.set,t=Ember.get,r=Ember.EnumerableUtils.indexOf,n=Ember.EnumerableUtils.indexesOf,i=Ember.EnumerableUtils.forEach,o=Ember.EnumerableUtils.replace,a=Ember.isArray;Ember.Handlebars.compile}Ember.SelectOption=Ember.View.extend({tagName:"option",attributeBindings:["value","selected"],defaultTemplate:function(e,t){t={data:t.data,hash:{}},Ember.Handlebars.helpers.bind.call(e,"view.label",t)},init:function(){this.labelPathDidChange(),this.valuePathDidChange(),this._super()},selected:Ember.computed(function(){var e=t(this,"content"),n=t(this,"parentView.selection");return t(this,"parentView.multiple")?n&&r(n,e.valueOf())>-1:e==n
|
17 |
-
}).property("content","parentView.selection"),labelPathDidChange:Ember.observer("parentView.optionLabelPath",function(){var e=t(this,"parentView.optionLabelPath");e&&Ember.defineProperty(this,"label",Ember.computed(function(){return t(this,e)}).property(e))}),valuePathDidChange:Ember.observer("parentView.optionValuePath",function(){var e=t(this,"parentView.optionValuePath");e&&Ember.defineProperty(this,"value",Ember.computed(function(){return t(this,e)}).property(e))})}),Ember.SelectOptgroup=Ember.CollectionView.extend({tagName:"optgroup",attributeBindings:["label"],selectionBinding:"parentView.selection",multipleBinding:"parentView.multiple",optionLabelPathBinding:"parentView.optionLabelPath",optionValuePathBinding:"parentView.optionValuePath",itemViewClassBinding:"parentView.optionView"}),Ember.Select=Ember.View.extend({tagName:"select",classNames:["ember-select"],defaultTemplate:Ember.Handlebars.template(function(e,t,r,n,i){function o(e,t){var n,i="";return t.buffer.push('<option value="">'),n=r._triageMustache.call(e,"view.prompt",{hash:{},hashTypes:{},hashContexts:{},contexts:[e],types:["ID"],data:t}),(n||0===n)&&t.buffer.push(n),t.buffer.push("</option>"),i}function a(e,t){var n;n=r.each.call(e,"view.groupedContent",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(4,s,t),contexts:[e],types:["ID"],data:t}),n||0===n?t.buffer.push(n):t.buffer.push("")}function s(e,t){t.buffer.push(m(r.view.call(e,"view.groupView",{hash:{content:"content",label:"label"},hashTypes:{content:"ID",label:"ID"},hashContexts:{content:e,label:e},contexts:[e],types:["ID"],data:t})))}function u(e,t){var n;n=r.each.call(e,"view.content",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(7,l,t),contexts:[e],types:["ID"],data:t}),n||0===n?t.buffer.push(n):t.buffer.push("")}function l(e,t){t.buffer.push(m(r.view.call(e,"view.optionView",{hash:{content:""},hashTypes:{content:"ID"},hashContexts:{content:e},contexts:[e],types:["ID"],data:t})))}this.compilerInfo=[4,">= 1.0.0"],r=this.merge(r,Ember.Handlebars.helpers),i=i||{};var c,h="",m=this.escapeExpression,p=this;return c=r["if"].call(t,"view.prompt",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(1,o,i),contexts:[t],types:["ID"],data:i}),(c||0===c)&&i.buffer.push(c),c=r["if"].call(t,"view.optionGroupPath",{hash:{},hashTypes:{},hashContexts:{},inverse:p.program(6,u,i),fn:p.program(3,a,i),contexts:[t],types:["ID"],data:i}),(c||0===c)&&i.buffer.push(c),h}),attributeBindings:["multiple","disabled","tabindex","name","required","autofocus","form","size"],multiple:!1,disabled:!1,required:!1,content:null,selection:null,value:Ember.computed(function(e,r){if(2===arguments.length)return r;var n=t(this,"optionValuePath").replace(/^content\.?/,"");return n?t(this,"selection."+n):t(this,"selection")}).property("selection"),prompt:null,optionLabelPath:"content",optionValuePath:"content",optionGroupPath:null,groupView:Ember.SelectOptgroup,groupedContent:Ember.computed(function(){var e=t(this,"optionGroupPath"),r=Ember.A(),n=t(this,"content")||[];return i(n,function(n){var i=t(n,e);t(r,"lastObject.label")!==i&&r.pushObject({label:i,content:Ember.A()}),t(r,"lastObject.content").push(n)}),r}).property("optionGroupPath","content.@each"),optionView:Ember.SelectOption,_change:function(){t(this,"multiple")?this._changeMultiple():this._changeSingle()},selectionDidChange:Ember.observer("selection.@each",function(){var r=t(this,"selection");if(t(this,"multiple")){if(!a(r))return e(this,"selection",Ember.A([r])),void 0;this._selectionDidChangeMultiple()}else this._selectionDidChangeSingle()}),valueDidChange:Ember.observer("value",function(){var e,r=t(this,"content"),n=t(this,"value"),i=t(this,"optionValuePath").replace(/^content\.?/,""),o=i?t(this,"selection."+i):t(this,"selection");n!==o&&(e=r?r.find(function(e){return n===(i?t(e,i):e)}):null,this.set("selection",e))}),_triggerChange:function(){var e=t(this,"selection"),r=t(this,"value");Ember.isNone(e)||this.selectionDidChange(),Ember.isNone(r)||this.valueDidChange(),this._change()},_changeSingle:function(){var r=this.$()[0].selectedIndex,n=t(this,"content"),i=t(this,"prompt");if(n&&t(n,"length")){if(i&&0===r)return e(this,"selection",null),void 0;i&&(r-=1),e(this,"selection",n.objectAt(r))}},_changeMultiple:function(){var r=this.$("option:selected"),n=t(this,"prompt"),i=n?1:0,s=t(this,"content"),u=t(this,"selection");if(s&&r){var l=r.map(function(){return this.index-i}).toArray(),c=s.objectsAt(l);a(u)?o(u,0,t(u,"length"),c):e(this,"selection",c)}},_selectionDidChangeSingle:function(){var e=this.get("element");if(e){var n=t(this,"content"),i=t(this,"selection"),o=n?r(n,i):-1,a=t(this,"prompt");a&&(o+=1),e&&(e.selectedIndex=o)}},_selectionDidChangeMultiple:function(){var e,i=t(this,"content"),o=t(this,"selection"),a=i?n(i,o):[-1],s=t(this,"prompt"),u=s?1:0,l=this.$("option");l&&l.each(function(){e=this.index>-1?this.index-u:-1,this.selected=r(a,e)>-1})},init:function(){this._super(),this.on("didInsertElement",this,this._triggerChange),this.on("change",this,this._change)}})}(),function(){Ember.Handlebars.registerHelper("input",function(e){var t=e.hash,r=(e.hashTypes,t.type),n=t.on;return delete t.type,delete t.on,"checkbox"===r?Ember.Handlebars.helpers.view.call(this,Ember.Checkbox,e):(r&&(t.type=r),t.onEvent=n||"enter",Ember.Handlebars.helpers.view.call(this,Ember.TextField,e))}),Ember.Handlebars.registerHelper("textarea",function(e){e.hash,e.hashTypes;return Ember.Handlebars.helpers.view.call(this,Ember.TextArea,e)})}(),function(){Ember.ComponentLookup=Ember.Object.extend({lookupFactory:function(e,t){t=t||this.container;var r="component:"+e,n="template:components/"+e,i=t&&t.has(n);i&&t.injection(r,"layout",n);var o=t.lookupFactory(r);return i||o?(o||(t.register(r,Ember.Component),o=t.lookupFactory(r)),o):void 0}})}(),function(){function e(){Ember.Handlebars.bootstrap(Ember.$(document))}function t(e){e.register("component-lookup:main",Ember.ComponentLookup)}Ember.Handlebars.bootstrap=function(e){var t='script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';Ember.$(t,e).each(function(){var e=Ember.$(this),t="text/x-raw-handlebars"===e.attr("type")?Ember.$.proxy(Handlebars.compile,Handlebars):Ember.$.proxy(Ember.Handlebars.compile,Ember.Handlebars),r=e.attr("data-template-name")||e.attr("id")||"application",n=t(e.html());if(void 0!==Ember.TEMPLATES[r])throw new Ember.Error('Template named "'+r+'" already exists.');Ember.TEMPLATES[r]=n,e.remove()})},Ember.onLoad("Ember.Application",function(r){r.initializer({name:"domTemplates",initialize:e}),r.initializer({name:"registerComponentLookup",after:"domTemplates",initialize:t})})}(),function(){Ember.runLoadHooks("Ember.Handlebars",Ember.Handlebars)}(),function(){e("route-recognizer",["exports"],function(e){"use strict";function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){this.string=e}function n(e){this.name=e}function i(e){this.name=e}function o(){}function a(e,t,a){"/"===e.charAt(0)&&(e=e.substr(1));for(var s=e.split("/"),u=[],l=0,c=s.length;c>l;l++){var h,m=s[l];(h=m.match(/^:([^\/]+)$/))?(u.push(new n(h[1])),t.push(h[1]),a.dynamics++):(h=m.match(/^\*([^\/]+)$/))?(u.push(new i(h[1])),t.push(h[1]),a.stars++):""===m?u.push(new o):(u.push(new r(m)),a.statics++)}return u}function s(e){this.charSpec=e,this.nextStates=[]}function u(e){return e.sort(function(e,t){if(e.types.stars!==t.types.stars)return e.types.stars-t.types.stars;if(e.types.stars){if(e.types.statics!==t.types.statics)return t.types.statics-e.types.statics;if(e.types.dynamics!==t.types.dynamics)return t.types.dynamics-e.types.dynamics}return e.types.dynamics!==t.types.dynamics?e.types.dynamics-t.types.dynamics:e.types.statics!==t.types.statics?t.types.statics-e.types.statics:0})}function l(e,t){for(var r=[],n=0,i=e.length;i>n;n++){var o=e[n];r=r.concat(o.match(t))}return r}function c(e){this.queryParams=e||{}}function h(e,t,r){for(var n=e.handlers,i=e.regex,o=t.match(i),a=1,s=new c(r),u=0,l=n.length;l>u;u++){for(var h=n[u],m=h.names,p={},f=0,d=m.length;d>f;f++)p[m[f]]=o[a++];s.push({handler:h.handler,params:p,isDynamic:!!m.length})}return s}function m(e,t){return t.eachChar(function(t){e=e.put(t)}),e}function p(e,t,r){this.path=e,this.matcher=t,this.delegate=r}function f(e){this.routes={},this.children={},this.target=e}function d(e,t,r){return function(n,i){var o=e+n;return i?(i(d(o,t,r)),void 0):new p(e+n,t,r)}}function b(e,t,r){for(var n=0,i=0,o=e.length;o>i;i++)n+=e[i].path.length;t=t.substr(n);var a={path:t,handler:r};e.push(a)}function v(e,t,r,n){var i=t.routes;for(var o in i)if(i.hasOwnProperty(o)){var a=e.slice();b(a,o,i[o]),t.children[o]?v(a,t.children[o],r,n):r.call(n,a)}}var E=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],g=new RegExp("(\\"+E.join("|\\")+")","g");r.prototype={eachChar:function(e){for(var t,r=this.string,n=0,i=r.length;i>n;n++)t=r.charAt(n),e({validChars:t})},regex:function(){return this.string.replace(g,"\\$1")},generate:function(){return this.string}},n.prototype={eachChar:function(e){e({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(e){return e[this.name]}},i.prototype={eachChar:function(e){e({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(e){return e[this.name]}},o.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},s.prototype={get:function(e){for(var t=this.nextStates,r=0,n=t.length;n>r;r++){var i=t[r],o=i.charSpec.validChars===e.validChars;if(o=o&&i.charSpec.invalidChars===e.invalidChars)return i}},put:function(e){var t;return(t=this.get(e))?t:(t=new s(e),this.nextStates.push(t),e.repeat&&t.nextStates.push(t),t)},match:function(e){for(var t,r,n,i=this.nextStates,o=[],a=0,s=i.length;s>a;a++)t=i[a],r=t.charSpec,"undefined"!=typeof(n=r.validChars)?-1!==n.indexOf(e)&&o.push(t):"undefined"!=typeof(n=r.invalidChars)&&-1===n.indexOf(e)&&o.push(t);return o}};var y=Object.create||function(e){function t(){}return t.prototype=e,new t};c.prototype=y({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var _=function(){this.rootState=new s,this.names={}};_.prototype={add:function(e,t){for(var r,n=this.rootState,i="^",s={statics:0,dynamics:0,stars:0},u=[],l=[],c=!0,h=0,p=e.length;p>h;h++){var f=e[h],d=[],b=a(f.path,d,s);l=l.concat(b);for(var v=0,E=b.length;E>v;v++){var g=b[v];g instanceof o||(c=!1,n=n.put({validChars:"/"}),i+="/",n=m(n,g),i+=g.regex())}var y={handler:f.handler,names:d};u.push(y)}c&&(n=n.put({validChars:"/"}),i+="/"),n.handlers=u,n.regex=new RegExp(i+"$"),n.types=s,(r=t&&t.as)&&(this.names[r]={segments:l,handlers:u})},handlersFor:function(e){var t=this.names[e],r=[];if(!t)throw new Error("There is no route named "+e);for(var n=0,i=t.handlers.length;i>n;n++)r.push(t.handlers[n]);return r},hasRoute:function(e){return!!this.names[e]},generate:function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,a=0,s=i.length;s>a;a++){var u=i[a];u instanceof o||(n+="/",n+=u.generate(t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams,r.handlers)),n},generateQueryString:function(e){var r=[],n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(i);n.sort();for(var o=0,a=n.length;a>o;o++){i=n[o];var s=e[i];if(s!==!1&&null!=s){var u=i;if(t(s))for(var l=0,c=s.length;c>l;l++){var h=i+"[]="+encodeURIComponent(s[l]);r.push(h)}else s!==!0?(u+="="+encodeURIComponent(s),r.push(u)):r.push(u)}}return 0===r.length?"":"?"+r.join("&")},parseQueryString:function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i,o=t[n].split("="),a=decodeURIComponent(o[0]),s=a.length,u=!1;1===o.length?i=!0:(s>2&&"[]"===a.slice(s-2)&&(u=!0,a=a.slice(0,s-2),r[a]||(r[a]=[])),i=o[1]?decodeURIComponent(o[1]):""),u?r[a].push(i):r[a]=i}return r},recognize:function(e){var t,r,n,i,o=[this.rootState],a={},s=!1;if(e=decodeURI(e),i=e.indexOf("?"),-1!==i){var c=e.substr(i+1,e.length);e=e.substr(0,i),a=this.parseQueryString(c)}for("/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0,n=e.length;n>r&&(o=l(o,e.charAt(r)),o.length);r++);var m=[];for(r=0,n=o.length;n>r;r++)o[r].handlers&&m.push(o[r]);o=u(m);var p=m[0];return p&&p.handlers?(s&&"(.+)$"===p.regex.source.slice(-5)&&(e+="/"),h(p,e,a)):void 0}},e["default"]=_,p.prototype={to:function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}return this}},f.prototype={add:function(e,t){this.routes[e]=t},addChild:function(e,t,r,n){var i=new f(t);this.children[e]=i;var o=d(e,i,n);n&&n.contextEntered&&n.contextEntered(t,o),r(o)}},_.prototype.map=function(e,t){var r=new f;e(d("",r,this.delegate)),v([],r,function(e){t?t(this,e):this.add(e)},this)}})}(),function(){e("router/handler-info",["./utils","rsvp","exports"],function(e,t,r){"use strict";function n(e){e&&l(this,e)}function i(e){n.call(this,e)}function o(e){n.call(this,e),this.params=this.params||{}}function a(e){n.call(this,e)}function s(e,t){if(!e^!t)return!1;if(!e)return!0;for(var r in e)if(e.hasOwnProperty(r)&&e[r]!==t[r])return!1;return!0}var u=e.bind,l=e.merge,c=e.oCreate,h=e.serialize,m=e.promiseLabel,p=t.resolve;n.prototype={name:null,handler:null,params:null,context:null,log:function(e,t){e.log&&e.log(this.name+": "+t)},promiseLabel:function(e){return m("'"+this.name+"' "+e)},resolve:function(e,t,r){var n=u(this.checkForAbort,this,t),i=u(this.runBeforeModelHook,this,e,r),o=u(this.getModel,this,e,r),a=u(this.runAfterModelHook,this,e,r),s=u(this.becomeResolved,this,r);return p(void 0,this.promiseLabel("Start handler")).then(n,null,this.promiseLabel("Check for abort")).then(i,null,this.promiseLabel("Before model")).then(n,null,this.promiseLabel("Check if aborted during 'beforeModel' hook")).then(o,null,this.promiseLabel("Model")).then(n,null,this.promiseLabel("Check if aborted in 'model' hook")).then(a,null,this.promiseLabel("After model")).then(n,null,this.promiseLabel("Check if aborted in 'afterModel' hook")).then(s,null,this.promiseLabel("Become resolved"))},runBeforeModelHook:function(e,t){return t.trigger&&t.trigger(!0,"willResolveModel",t,this.handler),this.runSharedModelHook(e,t,"beforeModel",[])},runAfterModelHook:function(e,t,r){var n=this.name;return this.stashResolvedModel(t,r),this.runSharedModelHook(e,t,"afterModel",[r]).then(function(){return t.resolvedModels[n]},null,this.promiseLabel("Ignore fulfillment value and return model value"))},runSharedModelHook:function(e,t,r,n){this.log(t,"calling "+r+" hook"),this.queryParams&&n.push(this.queryParams),n.push(t);var i=this.handler;return e(function(){return i[r]&&i[r].apply(i,n)},this.promiseLabel("Handle "+r))},getModel:function(){throw new Error("This should be overridden by a subclass of HandlerInfo")},checkForAbort:function(e,t){return p(e(),this.promiseLabel("Check for abort")).then(function(){return t},null,this.promiseLabel("Ignore fulfillment value and continue"))},stashResolvedModel:function(e,t){e.resolvedModels=e.resolvedModels||{},e.resolvedModels[this.name]=t},becomeResolved:function(e,t){var r=this.params||h(this.handler,t,this.names);return e&&(this.stashResolvedModel(e,t),e.params=e.params||{},e.params[this.name]=r),new i({context:t,name:this.name,handler:this.handler,params:r})},shouldSupercede:function(e){if(!e)return!0;var t=e.context===this.context;return e.name!==this.name||this.hasOwnProperty("context")&&!t||this.hasOwnProperty("params")&&!s(this.params,e.params)}},i.prototype=c(n.prototype),i.prototype.resolve=function(e,t,r){return r&&r.resolvedModels&&(r.resolvedModels[this.name]=this.context),p(this,this.promiseLabel("Resolve"))},o.prototype=c(n.prototype),o.prototype.getModel=function(e,t){var r=this.params;t&&t.queryParams&&(r={},l(r,this.params),r.queryParams=t.queryParams);var n="function"==typeof this.handler.deserialize?"deserialize":"model";return this.runSharedModelHook(e,t,n,[r])},a.prototype=c(n.prototype),a.prototype.getModel=function(e,t){return this.log(t,this.name+": resolving provided model"),p(this.context)},r.HandlerInfo=n,r.ResolvedHandlerInfo=i,r.UnresolvedHandlerInfoByParam=o,r.UnresolvedHandlerInfoByObject=a}),e("router/router",["route-recognizer","rsvp","./utils","./transition-state","./transition","./transition-intent/named-transition-intent","./transition-intent/url-transition-intent","exports"],function(e,t,r,n,i,o,a,s){"use strict";function u(){this.recognizer=new v,this.reset()}function l(e,t,r){var n=h(e.state,t);C(n.exited,function(e){var t=e.handler;delete t.context,t.exit&&t.exit()});var i=e.oldState=e.state;e.state=t;var o=e.currentHandlerInfos=n.unchanged.slice();try{C(n.updatedContext,function(e){return c(o,e,!1,r)}),C(n.entered,function(e){return c(o,e,!0,r)})}catch(a){throw e.state=i,e.currentHandlerInfos=i.handlerInfos,a}e.state.queryParams=b(e,o,t.queryParams)}function c(e,t,r,n){var i=t.handler,o=t.context;if(r&&i.enter&&i.enter(n),n&&n.isAborted)throw new I;if(i.context=o,i.contextDidChange&&i.contextDidChange(),i.setup&&i.setup(o,n),n&&n.isAborted)throw new I;return e.push(t),!0}function h(e,t){var r,n,i,o,a,s=e.handlerInfos,u=t.handlerInfos,l={updatedContext:[],exited:[],entered:[],unchanged:[]};for(o=0,a=u.length;a>o;o++){var c=s[o],h=u[o];c&&c.handler===h.handler||(r=!0),r?(l.entered.push(h),c&&l.exited.unshift(c)):n||c.context!==h.context||i?(n=!0,l.updatedContext.push(h)):l.unchanged.push(c)}for(o=u.length,a=s.length;a>o;o++)l.exited.unshift(s[o]);return l}function m(e,t,r){var n=e.urlMethod;if(n){for(var i=e.router,o=t.handlerInfos,a=o[o.length-1].name,s={},u=o.length-1;u>=0;--u){var l=o[u];O(s,l.params),l.handler.inaccessibleByURL&&(n=null)}if(n){s.queryParams=t.queryParams;var c=i.recognizer.generate(a,s);"replaceQuery"===n?c!==r&&i.replaceURL(c):"replace"===n?i.replaceURL(c):i.updateURL(c)}}}function p(e,t){try{_(e.router,e.sequence,"Resolved all models on destination route; finalizing transition.");{var r=e.router,n=t.handlerInfos;e.sequence}return l(r,t,e),e.isAborted?(r.state.handlerInfos=r.currentHandlerInfos,E(V(e))):(m(e,t,e.intent.url),e.isActive=!1,r.activeTransition=null,y(r,r.currentHandlerInfos,!0,["didTransition"]),r.didTransition&&r.didTransition(r.currentHandlerInfos),_(r,e.sequence,"TRANSITION COMPLETE."),n[n.length-1].handler)}catch(i){if(!(i instanceof I)){var o=e.state.handlerInfos;e.trigger(!0,"error",i,e,o[o.length-1].handler),e.abort()}throw i}}function f(e,t,r){var n=t[0]||"/",i=t[t.length-1],o={};i&&i.hasOwnProperty("queryParams")&&(o=M.call(t).queryParams);var a;if(0===t.length){_(e,"Updating query params");var s=e.state.handlerInfos;a=new R({name:s[s.length-1].name,contexts:[],queryParams:o})}else"/"===n.charAt(0)?(_(e,"Attempting URL transition to "+n),a=new D({url:n})):(_(e,"Attempting transition to "+n),a=new R({name:t[0],contexts:w.call(t,1),queryParams:o}));return e.transitionByIntent(a,r)}function d(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;n>r;++r)if(e[r]!==t[r])return!1;return!0}function b(e,t,r){var n=[];y(e,t,!0,["finalizeQueryParamChange",r,n]);for(var i={},o=0,a=n.length;a>o;++o){var s=n[o];i[s.key]=s.value}return i}var v=e["default"],E=(t.resolve,t.reject),g=(t.async,t.Promise),y=r.trigger,_=r.log,w=r.slice,C=r.forEach,O=r.merge,A=r.serialize,P=r.extractQueryParams,T=r.getChangelist,x=r.promiseLabel,S=n.TransitionState,V=i.logAbort,N=i.Transition,I=i.TransitionAborted,R=o.NamedTransitionIntent,D=a.URLTransitionIntent,M=Array.prototype.pop;u.prototype={map:function(e){this.recognizer.delegate=this.delegate,this.recognizer.map(e,function(e,t){for(var r=t.length-1,n=!0;r>=0&&n;--r){var i=t[r];e.add(t,{as:i.handler}),n="/"===i.path||""===i.path||".index"===i.handler.slice(-6)}})},hasRoute:function(e){return this.recognizer.hasRoute(e)},transitionByIntent:function(e,t){var r,n=!!this.activeTransition,i=n?this.activeTransition.state:this.state,o=this;try{var a=e.applyToState(i,this.recognizer,this.getHandler,t);if(d(a.handlerInfos,i.handlerInfos)){var s=T(i.queryParams,a.queryParams);return s?(this._changedQueryParams=s.changed,y(this,a.handlerInfos,!0,["queryParamsDidChange",s.changed,s.all,s.removed]),this._changedQueryParams=null,!n&&this.activeTransition?this.activeTransition:(i.queryParams=b(this,a.handlerInfos,a.queryParams),r=new N(this),r.urlMethod="replace",r.promise=r.promise.then(function(e){return m(r,i,!0),o.didTransition&&o.didTransition(o.currentHandlerInfos),e},null,x("Transition complete")),r)):new N(this)}return t?(l(this,a),void 0):(r=new N(this,e,a),this.activeTransition&&this.activeTransition.abort(),this.activeTransition=r,r.promise=r.promise.then(function(e){return o.async(function(){return p(r,e.state)},"Finalize transition")},null,x("Settle transition promise when transition is finalized")),n||y(this,this.state.handlerInfos,!0,["willTransition",r]),r)}catch(u){return new N(this,e,null,u)}},reset:function(){this.state&&C(this.state.handlerInfos,function(e){var t=e.handler;t.exit&&t.exit()}),this.state=new S,this.currentHandlerInfos=null},activeTransition:null,handleURL:function(e){var t=w.call(arguments);return"/"!==e.charAt(0)&&(t[0]="/"+e),f(this,t).method("replaceQuery")},updateURL:function(){throw new Error("updateURL is not implemented")},replaceURL:function(e){this.updateURL(e)},transitionTo:function(){return f(this,arguments)},intermediateTransitionTo:function(){f(this,arguments,!0)},refresh:function(e){for(var t=this.activeTransition?this.activeTransition.state:this.state,r=t.handlerInfos,n={},i=0,o=r.length;o>i;++i){var a=r[i];n[a.name]=a.params||{}}_(this,"Starting a refresh transition");var s=new R({name:r[r.length-1].name,pivotHandler:e||r[0].handler,contexts:[],queryParams:this._changedQueryParams||t.queryParams||{}});return this.transitionByIntent(s,!1)},replaceWith:function(){return f(this,arguments).method("replace")},generate:function(e){for(var t=P(w.call(arguments,1)),r=t[0],n=t[1],i=new R({name:e,contexts:r}),o=i.applyToState(this.state,this.recognizer,this.getHandler),a={},s=0,u=o.handlerInfos.length;u>s;++s){var l=o.handlerInfos[s],c=l.params||A(l.handler,l.context,l.names);O(a,c)}return a.queryParams=n,this.recognizer.generate(e,a)},isActive:function(e){var t,r,n=P(w.call(arguments,1)),i=n[0],o=n[1],a=this.state.queryParams,s=this.state.handlerInfos;if(!s.length)return!1;var u=s[s.length-1].name,l=this.recognizer.handlersFor(u),c=0;for(r=l.length;r>c&&(t=s[c],t.name!==e);++c);if(c===l.length)return!1;var h=new S;h.handlerInfos=s.slice(0,c+1),l=l.slice(0,c+1);var m=new R({name:u,contexts:i}),p=m.applyToHandlers(h,l,this.getHandler,u,!0,!0),f={};O(f,o);for(var b in a)a.hasOwnProperty(b)&&f.hasOwnProperty(b)&&(f[b]=a[b]);return d(p.handlerInfos,h.handlerInfos)&&!T(f,o)},trigger:function(){var e=w.call(arguments);y(this,this.currentHandlerInfos,!1,e)},async:function(e,t){return new g(function(t){t(e())},t)},log:null},s.Router=u}),e("router/transition-intent",["./utils","exports"],function(e,t){"use strict";function r(e){e&&n(this,e),this.data=this.data||{}}var n=e.merge;r.prototype.applyToState=function(e){return e},t.TransitionIntent=r}),e("router/transition-intent/named-transition-intent",["../transition-intent","../transition-state","../handler-info","../utils","exports"],function(e,t,r,n,i){"use strict";function o(e){a.call(this,e)}var a=e.TransitionIntent,s=t.TransitionState,u=r.UnresolvedHandlerInfoByParam,l=r.UnresolvedHandlerInfoByObject,c=n.isParam,h=n.forEach,m=n.extractQueryParams,p=n.oCreate,f=n.merge;o.prototype=p(a.prototype),o.prototype.applyToState=function(e,t,r,n){var i=m([this.name].concat(this.contexts)),o=i[0],a=(i[1],t.handlersFor(o[0])),s=a[a.length-1].handler;return this.applyToHandlers(e,a,r,s,n)},o.prototype.applyToHandlers=function(e,t,r,n,i,o){var a,u=new s,l=this.contexts.slice(0),c=t.length,h=[];if(this.pivotHandler)for(a=0;a<t.length;++a)if(r(t[a].handler)===this.pivotHandler){c=a;break}!this.pivotHandler;for(a=t.length-1;a>=0;--a){var m=t[a],p=m.handler,d=r(p),b=e.handlerInfos[a],v=null;if(m.names.length>0?v=a>=c?this.createParamHandlerInfo(p,d,m.names,l,b):this.getHandlerInfoForDynamicSegment(p,d,m.names,l,b,n):(v=this.createParamHandlerInfo(p,d,m.names,l,b),h.unshift(a)),o){v=v.becomeResolved(null,v.context);var E=b&&b.context;m.names.length>0&&v.context===E&&(v.params=b&&b.params),v.context=E}var g=b;(a>=c||v.shouldSupercede(b))&&(c=Math.min(a,c),g=v),i&&!o&&(g=g.becomeResolved(null,g.context)),u.handlerInfos.unshift(g)}if(l.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+n);return i||this.invalidateNonDynamicHandlers(u.handlerInfos,h,c),f(u.queryParams,e.queryParams),f(u.queryParams,this.queryParams||{}),u},o.prototype.invalidateNonDynamicHandlers=function(e,t,r){h(t,function(t){if(t>=r){var n=e[t];e[t]=new u({name:n.name,handler:n.handler,params:{}})}})},o.prototype.getHandlerInfoForDynamicSegment=function(e,t,r,n,i){{var o;r.length}return n.length>0?(o=n[n.length-1],c(o)?this.createParamHandlerInfo(e,t,r,n,i):(n.pop(),new l({name:e,handler:t,context:o,names:r}))):i&&i.name===e?i:i},o.prototype.createParamHandlerInfo=function(e,t,r,n,i){for(var o={},a=r.length;a--;){var s=i&&e===i.name&&i.params||{},l=n[n.length-1],h=r[a];if(c(l))o[h]=""+n.pop();else{if(!s.hasOwnProperty(h))throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e);o[h]=s[h]}}return new u({name:e,handler:t,params:o})},i.NamedTransitionIntent=o}),e("router/transition-intent/url-transition-intent",["../transition-intent","../transition-state","../handler-info","../utils","exports"],function(e,t,r,n,i){"use strict";function o(e){s.call(this,e)}function a(e){this.message=e||"UnrecognizedURLError",this.name="UnrecognizedURLError"}var s=e.TransitionIntent,u=t.TransitionState,l=r.UnresolvedHandlerInfoByParam,c=n.oCreate,h=n.merge;o.prototype=c(s.prototype),o.prototype.applyToState=function(e,t,r){var n,i,o=new u,s=t.recognize(this.url);if(!s)throw new a(this.url);var c=!1;for(n=0,i=s.length;i>n;++n){var m=s[n],p=m.handler,f=r(p);if(f.inaccessibleByURL)throw new a(this.url);var d=new l({name:p,handler:f,params:m.params}),b=e.handlerInfos[n];c||d.shouldSupercede(b)?(c=!0,o.handlerInfos[n]=d):o.handlerInfos[n]=b}return h(o.queryParams,s.queryParams),o},i.URLTransitionIntent=o}),e("router/transition-state",["./handler-info","./utils","rsvp","exports"],function(e,t,r,n){"use strict";function i(){this.handlerInfos=[],this.queryParams={},this.params={}}var o=(e.ResolvedHandlerInfo,t.forEach),a=t.promiseLabel,s=r.resolve,u=r.reject;i.prototype={handlerInfos:null,queryParams:null,params:null,promiseLabel:function(e){var t="";return o(this.handlerInfos,function(e){""!==t&&(t+="."),t+=e.name}),a("'"+t+"': "+e)},resolve:function(e,t,r){function n(){return s(t(),a("Check if should continue"))["catch"](function(e){return p=!0,u(e)},a("Handle abort"))}function i(e){var t=m.handlerInfos,n=r.resolveIndex>=t.length?t.length-1:r.resolveIndex;return u({error:e,handlerWithError:m.handlerInfos[n].handler,wasAborted:p,state:m})}function l(e){m.handlerInfos[r.resolveIndex++]=e;var t=e.handler;return t&&t.redirect&&t.redirect(e.context,r),n().then(c,null,a("Resolve handler"))}function c(){if(r.resolveIndex===m.handlerInfos.length)return{error:null,state:m};var t=m.handlerInfos[r.resolveIndex];return t.resolve(e,n,r).then(l,null,a("Proceed"))}var h=this.params;o(this.handlerInfos,function(e){h[e.name]=e.params||{}}),r=r||{},r.resolveIndex=0;var m=this,p=!1;return s(null,this.promiseLabel("Start transition")).then(c,null,this.promiseLabel("Resolve handler"))["catch"](i,this.promiseLabel("Handle error"))}},n.TransitionState=i}),e("router/transition",["rsvp","./handler-info","./utils","exports"],function(e,t,r,n){"use strict";function i(e,t,r,n){function a(){return c.isAborted?s(void 0,p("Transition aborted - reject")):void 0}var c=this;if(this.state=r||e.state,this.intent=t,this.router=e,this.data=this.intent&&this.intent.data||{},this.resolvedModels={},this.queryParams={},n)return this.promise=s(n),void 0;if(r){this.params=r.params,this.queryParams=r.queryParams;var h=r.handlerInfos.length;h&&(this.targetName=r.handlerInfos[r.handlerInfos.length-1].name);for(var m=0;h>m;++m){var f=r.handlerInfos[m];if(!(f instanceof l))break;this.pivotHandler=f.handler}this.sequence=i.currentSequence++,this.promise=r.resolve(e.async,a,this)["catch"](function(e){return e.wasAborted?s(o(c)):(c.trigger("error",e.error,c,e.handlerWithError),c.abort(),s(e.error))},p("Handle Abort"))}else this.promise=u(this.state),this.params={}}function o(e){return m(e.router,e.sequence,"detected abort."),new a}function a(e){this.message=e||"TransitionAborted",this.name="TransitionAborted"}var s=e.reject,u=e.resolve,l=t.ResolvedHandlerInfo,c=r.trigger,h=r.slice,m=r.log,p=r.promiseLabel;i.currentSequence=0,i.prototype={targetName:null,urlMethod:"update",intent:null,params:null,pivotHandler:null,resolveIndex:0,handlerInfos:null,resolvedModels:null,isActive:!0,state:null,promise:null,data:null,then:function(e,t){return this.promise.then(e,t)},abort:function(){return this.isAborted?this:(m(this.router,this.sequence,this.targetName+": transition was aborted"),this.isAborted=!0,this.isActive=!1,this.router.activeTransition=null,this)},retry:function(){return this.abort(),this.router.transitionByIntent(this.intent,!1)},method:function(e){return this.urlMethod=e,this},trigger:function(e){var t=h.call(arguments);"boolean"==typeof e?t.shift():e=!1,c(this.router,this.state.handlerInfos.slice(0,this.resolveIndex+1),e,t)},followRedirects:function(){var e=this.router;return this.promise["catch"](function(t){return e.activeTransition?e.activeTransition.followRedirects():s(t)})},toString:function(){return"Transition (sequence "+this.sequence+")"},log:function(e){m(this.router,this.sequence,e)}},i.prototype.send=i.prototype.trigger,n.Transition=i,n.logAbort=o,n.TransitionAborted=a}),e("router/utils",["exports"],function(e){"use strict";function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function n(e){var t,r,n=e&&e.length;return n&&n>0&&e[n-1]&&e[n-1].hasOwnProperty("queryParams")?(r=e[n-1].queryParams,t=p.call(e,0,n-1),[t,r]):[e,null]}function i(e){for(var r in e)if("number"==typeof e[r])e[r]=""+e[r];else if(t(e[r]))for(var n=0,i=e[r].length;i>n;n++)e[r][n]=""+e[r][n]}function o(e,t,r){e.log&&(3===arguments.length?e.log("Transition #"+t+": "+r):(r=t,e.log(r)))}function a(e,t){var r=arguments;return function(n){var i=p.call(r,2);return i.push(n),e.apply(t,i)}}function s(e){return"string"==typeof e||e instanceof String||"number"==typeof e||e instanceof Number}function u(e,t){for(var r=0,n=e.length;n>r&&!1!==t(e[r]);r++);}function l(e,t,r){var n={};if(s(t))return n[r[0]]=t,n;if(e.serialize)return e.serialize(t,r);if(1===r.length){var i=r[0];return n[i]=/_id$/.test(i)?t.id:t,n}}function c(e,t,r,n){if(e.triggerEvent)return e.triggerEvent(t,r,n),void 0;var i=n.shift();if(!t){if(r)return;throw new Error("Could not trigger event '"+i+"'. There are no active handlers")}for(var o=!1,a=t.length-1;a>=0;a--){var s=t[a],u=s.handler;if(u.events&&u.events[i]){if(u.events[i].apply(u,n)!==!0)return;o=!0}}if(!o&&!r)throw new Error("Nothing handled the event '"+i+"'.")}function h(e,n){var o,a={all:{},changed:{},removed:{}};r(a.all,n);var s=!1;i(e),i(n);for(o in e)e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||(s=!0,a.removed[o]=e[o]));for(o in n)if(n.hasOwnProperty(o))if(t(e[o])&&t(n[o]))if(e[o].length!==n[o].length)a.changed[o]=n[o],s=!0;else for(var u=0,l=e[o].length;l>u;u++)e[o][u]!==n[o][u]&&(a.changed[o]=n[o],s=!0);else e[o]!==n[o]&&(a.changed[o]=n[o],s=!0);return s&&a}function m(e){return"Router: "+e}var p=Array.prototype.slice,f=Object.create||function(e){function t(){}return t.prototype=e,new t};e.trigger=c,e.log=o,e.oCreate=f,e.merge=r,e.extractQueryParams=n,e.bind=a,e.isParam=s,e.forEach=u,e.slice=p,e.serialize=l,e.getChangelist=h,e.coerceQueryParamsToString=i,e.promiseLabel=m}),e("router",["./router/router","exports"],function(e,t){"use strict";var r=e.Router;t.Router=r})}(),function(){function e(e){this.parent=e,this.matches=[]}function t(e,t,r){r=r||{},"string"!=typeof r.path&&(r.path="/"+t),e.parent&&"application"!==e.parent&&(t=e.parent+"."+t),e.push(r.path,t,null)}e.prototype={resource:function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n={}),1===arguments.length&&(n={}),"string"!=typeof n.path&&(n.path="/"+r),i){var o=new e(r);t(o,"loading"),t(o,"error",{path:"/_unused_dummy_error_path_route_"+r+"/:error"}),i.call(o),this.push(n.path,r,o.generate())
|
18 |
}else this.push(n.path,r,null)},push:function(e,t,r){var n=t.split(".");(""===e||"/"===e||"index"===n[n.length-1])&&(this.explicitIndex=!0),this.matches.push([e,t,r])},route:function(e,r){t(this,e,r)},generate:function(){var e=this.matches;return this.explicitIndex||this.route("index",{path:"/"}),function(t){for(var r=0,n=e.length;n>r;r++){var i=e[r];t(i[0]).to(i[1],i[2])}}}},e.map=function(t){var r=new e;return t.call(r),r},Ember.RouterDSL=e}(),function(){var e=Ember.get;Ember.controllerFor=function(e,t,r){return e.lookup("controller:"+t,r)},Ember.generateControllerFactory=function(e,t,r){var n,i,o,a;return a=r&&Ember.isArray(r)?"array":r?"object":"basic",o="controller:"+a,n=e.lookupFactory(o).extend({isGenerated:!0,toString:function(){return"(generated "+t+" controller)"}}),i="controller:"+t,e.register(i,n),n},Ember.generateController=function(t,r,n){Ember.generateControllerFactory(t,r,n);var i="controller:"+r,o=t.lookup(i);return e(o,"namespace.LOG_ACTIVE_GENERATION"),o}}(),function(){function e(e,t){var n=e.controllerName||e.routeName,i=r(n,e.container),o=h(i,"queryParams");o&&d(o,function(e){var r,i=e.split(":");r=i.length>1?i[1]:"application"!==n?n+"["+e+"]":e;var o=n+":"+e;t.queryParams[o]=r,t.translations[i[0]]=o})}function r(e,t){var r="controller:"+e;if(t.cache.has(r))return t.lookup(r);var n=t.lookupFactory(r);return n&&"function"==typeof n.proto?n.proto():{}}function n(e){var t,r,n={};for(r in e)t=Ember.Router._descopeQueryParam(e[r]),n[t]=n[t]?n[t]+1:1;for(r in e)t=Ember.Router._descopeQueryParam(e[r]),1===n[t]&&(e[r]=t)}function i(e,t,r){for(var n=t.state.handlerInfos,i=!1,o=n.length-1;o>=0;--o){var a=n[o],s=a.handler;if(i){if(r(s,n[o+1].handler)!==!0)return!1}else e===s&&(i=!0)}return!0}function o(e,t,r){var n,i=e.router,o=(t.routeName.split(".").pop(),"application"===e.routeName?"":e.routeName+".");return n=o+r,a(i,n)?n:void 0}function a(e,t){var r=e.container;return e.hasRoute(t)&&(r.has("template:"+t)||r.has("route:"+t))}function s(e,t,r){var n=r.shift();if(!e){if(t)return;throw new Ember.Error("Can't trigger action '"+n+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var i=!1,o=e.length-1;o>=0;o--){var a=e[o],s=a.handler;if(s._actions&&s._actions[n]){if(s._actions[n].apply(s,r)!==!0)return;i=!0}}if(v[n])return v[n].apply(null,r),void 0;if(!i&&!t)throw new Ember.Error("Nothing handled the action '"+n+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function u(e){var t=e.container.lookup("controller:application");if(t){var r=e.router.currentHandlerInfos,n=Ember.Router._routePath(r);"currentPath"in t||p(t,"currentPath"),m(t,"currentPath",n),"currentRouteName"in t||p(t,"currentRouteName"),m(t,"currentRouteName",r[r.length-1].name)}}var l=t("router"),c=l.Router,h=(l.Transition,Ember.get),m=Ember.set,p=(Ember.String.fmt,Ember.defineProperty),f=Array.prototype.slice,d=Ember.EnumerableUtils.forEach,b=Ember._MetamorphView;Ember.Router=Ember.Object.extend(Ember.Evented,{location:"hash",rootURL:"/",init:function(){this.router=this.constructor.router||this.constructor.map(Ember.K),this._activeViews={},this._setupLocation(),h(this,"namespace.LOG_TRANSITIONS_INTERNAL")&&(this.router.log=Ember.Logger.debug)},url:Ember.computed(function(){return h(this,"location").getURL()}),startRouting:function(){this.router=this.router||this.constructor.map(Ember.K);var e=this.router,t=h(this,"location"),r=this.container,n=this,i=h(this,"initialURL");h(t,"cancelRouterSetup")||(this._setupRouter(e,t),r.register("view:default",b),r.register("view:toplevel",Ember.View.extend()),t.onUpdateURL(function(e){n.handleURL(e)}),"undefined"==typeof i&&(i=t.getURL()),this.handleURL(i))},didTransition:function(e){u(this),this._cancelLoadingEvent(),this.notifyPropertyChange("url"),Ember.run.once(this,this.trigger,"didTransition"),h(this,"namespace").LOG_TRANSITIONS&&Ember.Logger.log("Transitioned into '"+Ember.Router._routePath(e)+"'")},handleURL:function(e){return this._doTransition("handleURL",[e])},transitionTo:function(){return this._doTransition("transitionTo",arguments)},intermediateTransitionTo:function(){this.router.intermediateTransitionTo.apply(this.router,arguments),u(this);var e=this.router.currentHandlerInfos;h(this,"namespace").LOG_TRANSITIONS&&Ember.Logger.log("Intermediate-transitioned into '"+Ember.Router._routePath(e)+"'")},replaceWith:function(){return this._doTransition("replaceWith",arguments)},generate:function(){var e=this.router.generate.apply(this.router,arguments);return this.location.formatURL(e)},isActive:function(){var e=this.router;return e.isActive.apply(e,arguments)},send:function(){this.router.trigger.apply(this.router,arguments)},hasRoute:function(e){return this.router.hasRoute(e)},reset:function(){this.router.reset()},_lookupActiveView:function(e){var t=this._activeViews[e];return t&&t[0]},_connectActiveView:function(e,t){var r=this._activeViews[e];r&&r[0].off("willDestroyElement",this,r[1]);var n=function(){delete this._activeViews[e]};this._activeViews[e]=[t,n],t.one("willDestroyElement",this,n)},_setupLocation:function(){var e=h(this,"location"),t=h(this,"rootURL");if(t&&!this.container.has("-location-setting:root-url")&&this.container.register("-location-setting:root-url",t,{instantiate:!1}),"string"==typeof e&&this.container){var r=this.container.lookup("location:"+e);if("undefined"!=typeof r)e=m(this,"location",r);else{var n={implementation:e};e=m(this,"location",Ember.Location.create(n))}}t&&"string"==typeof t&&(e.rootURL=t),"function"==typeof e.initState&&e.initState()},_getHandlerFunction:function(){var e={},t=this.container,r=t.lookupFactory("route:basic"),n=this;return function(i){var o="route:"+i,a=t.lookup(o);return e[i]?a:(e[i]=!0,a||(t.register(o,r.extend()),a=t.lookup(o),h(n,"namespace.LOG_ACTIVE_GENERATION")),a.routeName=i,a)}},_setupRouter:function(e,t){var r,n=this;e.getHandler=this._getHandlerFunction();var i=function(){t.setURL(r)};if(e.updateURL=function(e){r=e,Ember.run.once(i)},t.replaceURL){var o=function(){t.replaceURL(r)};e.replaceURL=function(e){r=e,Ember.run.once(o)}}e.didTransition=function(e){n.didTransition(e)}},_doTransition:function(e,t){t=f.call(t),t[0]=t[0]||"/";var r,n=t[0],i=!1;if(!i&&"/"!==n.charAt(0),r){if(!n){var o=this.router.activeTransition?this.router.activeTransition.state.handlerInfos:this.router.state.handlerInfos;n=o[o.length-1].name,t.unshift(n)}var a=this._queryParamNamesFor(n);Ember.Router._translateQueryParams(r,a.translations,n);var s;for(var u in r){var l=Ember.Router._descopeQueryParam(u);u in a.queryParams?(s=r[u],delete r[u],r[a.queryParams[u]]=s):l in a.validQueryParams&&(s=r[u],delete r[u],r[l]=s)}}var c=this.router[e].apply(this.router,t);return c.then(null,function(e){e&&"UnrecognizedURLError"===e.name},"Ember: Check for Router unrecognized URL error"),c},_scheduleLoadingEvent:function(e,t){this._cancelLoadingEvent(),this._loadingStateTimer=Ember.run.scheduleOnce("routerTransitions",this,"_fireLoadingEvent",e,t)},_fireLoadingEvent:function(e,t){this.router.activeTransition&&e.trigger(!0,"loading",e,t)},_cancelLoadingEvent:function(){this._loadingStateTimer&&Ember.run.cancel(this._loadingStateTimer),this._loadingStateTimer=null},_queryParamNamesFor:function(t){var r=this.router.recognizer.handlersFor(t),i={queryParams:Ember.create(null),translations:Ember.create(null),validQueryParams:Ember.create(null)},o=this.router;d(r,function(t){var r=o.getHandler(t.handler);e(r,i)}),n(i.queryParams);for(var a in i.queryParams)i.validQueryParams[i.queryParams[a]]=!0;return i},_queryParamNamesForSingle:function(t){var r={queryParams:Ember.create(null),translations:Ember.create(null)},n=this.router.getHandler(t);if(e(n,r),"application"!==t){var i=this._queryParamNamesFor(t);for(var o in r.queryParams)r.queryParams[o]=i.queryParams[o]}return r},_queryParamOverrides:function(e,t,n){for(var i in t){var o=i.split(":"),a=r(o[0],this.container);e[t[i]]=h(a,o[1]),n&&n(i,t[i],i)}}});var v={willResolveModel:function(e,t){t.router._scheduleLoadingEvent(e,t)},error:function(e,t,r){var n=r.router,s=i(r,t,function(t,r){var i=o(t,r,"error");return i?(n.intermediateTransitionTo(i,e),void 0):!0});return s?a(r.router,"application_error")?(n.intermediateTransitionTo("application_error",e),void 0):(Ember.Logger.error("Error while loading route: "+(e&&e.stack)),void 0):void 0},loading:function(e,t){var r=t.router,n=i(t,e,function(t,n){var i=o(t,n,"loading");return i?(r.intermediateTransitionTo(i),void 0):e.pivotHandler!==t?!0:void 0});return n&&a(t.router,"application_loading")?(r.intermediateTransitionTo("application_loading"),void 0):void 0}};Ember.Router.reopenClass({router:null,map:function(e){var t=this.router;t||(t=new c,t.callbacks=[],t.triggerEvent=s,this.reopenClass({router:t}));var r=Ember.RouterDSL.map(function(){this.resource("application",{path:"/"},function(){for(var r=0;r<t.callbacks.length;r++)t.callbacks[r].call(this);e.call(this)})});return t.callbacks.push(e),t.map(r.generate()),t},_routePath:function(e){function t(e,t){for(var r=0,n=e.length;n>r;++r)if(e[r]!==t[r])return!1;return!0}for(var r=[],n=1,i=e.length;i>n;n++){for(var o=e[n].name,a=o.split("."),s=f.call(r);s.length&&!t(s,a);)s.shift();r.push.apply(r,a.slice(s.length))}return r.join(".")},_translateQueryParams:function(e,t){for(var r in e)e.hasOwnProperty(r)&&r in t&&(e[t[r]]=e[r],delete e[r])},_descopeQueryParam:function(e){var t=/\[(.+)\]/,r=e.match(t);return r=r?r[1]:e}})}(),function(){function e(e){var t=e.router.router.state.handlerInfos;if(t)for(var r,n,i=0,o=t.length;o>i;i++){if(n=t[i].handler,n===e)return r;r=n}}function t(r){var n,i=e(r);if(i)return(n=i.lastRenderedTemplate)?n:t(i)}function r(e,r,n,i){i=i||{},i.into=i.into?i.into.replace(/\//g,"."):t(e),i.outlet=i.outlet||"main",i.name=r,i.template=n,i.LOG_VIEW_LOOKUPS=s(e.router,"namespace.LOG_VIEW_LOOKUPS");var o,a=i.controller;if(a=i.controller?i.controller:(o=e.container.lookup("controller:"+r))?o:e.controllerName||e.routeName,"string"==typeof a){var u=a;if(a=e.container.lookup("controller:"+u),!a)throw new Ember.Error("You passed `controller: '"+u+"'` into the `render` method, but no such controller could be found.")}return i.controller=a,i}function n(e,t,r){if(e)r.LOG_VIEW_LOOKUPS;else{var n=r.into?"view:default":"view:toplevel";e=t.lookup(n),r.LOG_VIEW_LOOKUPS}return s(e,"templateName")||(u(e,"template",r.template),u(e,"_debugTemplateName",r.name)),u(e,"renderedName",r.name),u(e,"controller",r.controller),e}function i(e,t,r){if(r.into){var n=e.router._lookupActiveView(r.into),i=a(n,r.outlet);e.teardownOutletViews||(e.teardownOutletViews=[]),h(e.teardownOutletViews,0,0,[i]),n.connectOutlet(r.outlet,t)}else{var u=s(e,"router.namespace.rootElement");e.teardownTopLevelView&&e.teardownTopLevelView(),e.router._connectActiveView(r.name,t),e.teardownTopLevelView=o(t),t.appendTo(u)}}function o(e){return function(){e.destroy()}}function a(e,t){return function(){e.disconnectOutlet(t)}}var s=Ember.get,u=Ember.set,l=Ember.getProperties,c=(Ember.String.classify,Ember.String.fmt,Ember.EnumerableUtils.forEach),h=Ember.EnumerableUtils.replace;Ember.Route=Ember.Object.extend(Ember.ActionHandler,{exit:function(){this.deactivate(),this.teardownViews()},enter:function(){this.activate()},viewName:null,templateName:null,controllerName:null,_actions:{finalizeQueryParamChange:function(){}},events:null,mergedProperties:["events"],deactivate:Ember.K,activate:Ember.K,transitionTo:function(){var e=this.router;return e.transitionTo.apply(e,arguments)},intermediateTransitionTo:function(){var e=this.router;e.intermediateTransitionTo.apply(e,arguments)},refresh:function(){return this.router.router.refresh(this).method("replace")},replaceWith:function(){var e=this.router;return e.replaceWith.apply(e,arguments)},send:function(){return this.router.send.apply(this.router,arguments)},setup:function(e){var t=this.controllerName||this.routeName,r=this.controllerFor(t,!0);r||(r=this.generateController(t,e)),this.controller=r,this.setupControllers?this.setupControllers(r,e):this.setupController(r,e),this.renderTemplates?this.renderTemplates(e):this.renderTemplate(r,e)},beforeModel:Ember.K,afterModel:Ember.K,redirect:Ember.K,contextDidChange:function(){this.currentModel=this.context},model:function(e,t){var r,n,i,o;for(var a in e)"queryParams"!==a&&((r=a.match(/^(.*)_id$/))&&(n=r[1],o=e[a]),i=!0);if(!n&&i)return Ember.copy(e);if(!n){if(t.resolveIndex!==t.state.handlerInfos.length-1)return;var s=t.state.handlerInfos[t.resolveIndex-1].context;return s}return this.findModel(n,o)},deserialize:function(e,t){return this.model(e,t)},findModel:function(){var e=s(this,"store");return e.find.apply(e,arguments)},store:Ember.computed(function(){{var e=this.container;this.routeName,s(this,"router.namespace")}return{find:function(t,r){var n=e.lookupFactory("model:"+t);if(n)return n.find(r)}}}),serialize:function(e,t){if(!(t.length<1)&&e){var r=t[0],n={};return/_id$/.test(r)&&1===t.length?n[r]=s(e,"id"):n=l(e,t),n}},setupController:function(e,t){e&&void 0!==t&&u(e,"model",t)},controllerFor:function(e){var t,r=this.container,n=r.lookup("route:"+e);return n&&n.controllerName&&(e=n.controllerName),t=r.lookup("controller:"+e)},generateController:function(e,t){var r=this.container;return t=t||this.modelFor(e),Ember.generateController(r,e,t)},modelFor:function(e){var t=this.container.lookup("route:"+e),r=this.router.router.activeTransition;if(r){var n=t&&t.routeName||e;if(r.resolvedModels.hasOwnProperty(n))return r.resolvedModels[n]}return t&&t.currentModel},renderTemplate:function(){this.render()},render:function(e,t){"object"!=typeof e||t||(t=e,e=this.routeName),t=t||{};var o;e?(e=e.replace(/\//g,"."),o=e):(e=this.routeName,o=this.templateName||e);var a=t.view||this.viewName||e,u=this.container,l=u.lookup("view:"+a),c=l?l.get("template"):null;return c||(c=u.lookup("template:"+o)),l||c?(t=r(this,e,c,t),l=n(l,u,t),"main"===t.outlet&&(this.lastRenderedTemplate=e),i(this,l,t),void 0):(s(this.router,"namespace.LOG_VIEW_LOOKUPS"),void 0)},disconnectOutlet:function(e){if(!e||"string"==typeof e){var r=e;e={},e.outlet=r}e.parentView=e.parentView?e.parentView.replace(/\//g,"."):t(this),e.outlet=e.outlet||"main";var n=this.router._lookupActiveView(e.parentView);n&&n.disconnectOutlet(e.outlet)},willDestroy:function(){this.teardownViews()},teardownViews:function(){this.teardownTopLevelView&&this.teardownTopLevelView();var e=this.teardownOutletViews||[];c(e,function(e){e()}),delete this.teardownTopLevelView,delete this.teardownOutletViews,delete this.lastRenderedTemplate}})}(),function(){Ember.onLoad("Ember.Handlebars",function(){function e(e,r,i){return n.call(t(e,r,i),function(t,n){return null===t?r[n]:o(e,t,i)})}function t(e,t,o){function a(e,t){return"controller"===t?t:Ember.ControllerMixin.detect(e)?a(i(e,"model"),t?t+".model":"model"):t}var s=r(e,t,o),u=o.types;return n.call(s,function(e,r){return"ID"===u[r]?a(e,t[r]):null})}var r=Ember.Handlebars.resolveParams,n=Ember.ArrayPolyfills.map,i=Ember.get,o=Ember.Handlebars.get;Ember.Router.resolveParams=e,Ember.Router.resolvePaths=t})}(),function(){var e=Ember.get,t=(Ember.set,Ember.String.fmt,Array.prototype.slice),r=function(e,t){for(var r=0,n=0,i=t.length;i>n&&(r+=t[n].names.length,t[n].handler!==e);n++);return r};Ember.onLoad("Ember.Handlebars",function(){function n(e){var t=e.options.types,r=e.options.data;return s(e.context,e.params,{types:t,data:r})}var i=Ember.Object.extend({values:null}),o=Ember.Router.resolveParams,a=Ember.Router._translateQueryParams,s=Ember.Router.resolvePaths,u=Ember.ViewUtils.isSimpleClick,l=Ember.LinkView=Ember.View.extend({tagName:"a",currentWhen:null,title:null,rel:null,activeClass:"active",loadingClass:"loading",disabledClass:"disabled",_isDisabled:!1,replace:!1,attributeBindings:["href","title","rel"],classNameBindings:["active","loading","disabled"],eventName:"click",init:function(){this._super.apply(this,arguments);var t=e(this,"eventName");this.on(t,this,this._invoke)},_paramsChanged:function(){this.notifyPropertyChange("resolvedParams")},_setupPathObservers:function(){var e,t,r,i=this.parameters,o=i.options.linkTextPath,a=n(i),s=a.length;for(o&&(r=Ember.Handlebars.normalizePath(i.context,o,i.options.data),this.registerObserver(r.root,r.path,this,this.rerender)),t=0;s>t;t++)e=a[t],null!==e&&(r=Ember.Handlebars.normalizePath(i.context,e,i.options.data),this.registerObserver(r.root,r.path,this,this._paramsChanged));var u=this.queryParamsObject;if(u){var l=u.values;for(var c in l)l.hasOwnProperty(c)&&"ID"===u.types[c]&&(r=Ember.Handlebars.normalizePath(i.context,l[c],i.options.data),this.registerObserver(r.root,r.path,this,this._paramsChanged))}},afterRender:function(){this._super.apply(this,arguments),this._setupPathObservers()},concreteView:Ember.computed(function(){return e(this,"parentView")}).property("parentView"),disabled:Ember.computed(function(t,r){return void 0!==r&&this.set("_isDisabled",r),r?e(this,"disabledClass"):!1}),active:Ember.computed(function(){if(e(this,"loading"))return!1;var t=e(this,"router"),n=e(this,"routeArgs"),i=n.slice(1),o=(e(this,"resolvedParams"),this.currentWhen||n[0]),a=r(o,t.router.recognizer.handlersFor(o));i.length>a&&(o=n[0]);var s=t.isActive.apply(t,[o].concat(i));return s?e(this,"activeClass"):void 0}).property("resolvedParams","routeArgs"),loading:Ember.computed(function(){return e(this,"routeArgs")?void 0:e(this,"loadingClass")}).property("routeArgs"),router:Ember.computed(function(){return e(this,"controller").container.lookup("router:main")}),_invoke:function(t){if(!u(t))return!0;if(this.preventDefault!==!1&&t.preventDefault(),this.bubbles===!1&&t.stopPropagation(),e(this,"_isDisabled"))return!1;if(e(this,"loading"))return Ember.Logger.warn("This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid."),!1;var r,n=e(this,"router"),i=e(this,"routeArgs");r=e(this,"replace")?n.replaceWith.apply(n,i):n.transitionTo.apply(n,i);var o=n.router.generate.apply(n.router,e(this,"routeArgs"));Ember.run.scheduleOnce("routerTransitions",this,this._eagerUpdateUrl,r,o)},_eagerUpdateUrl:function(t,r){if(t.isActive&&t.urlMethod){0===r.indexOf("#")&&(r=r.slice(1));var n=e(this,"router.router");"update"===t.urlMethod?n.updateURL(r):"replace"===t.urlMethod&&n.replaceURL(r),t.method(null)}},resolvedParams:Ember.computed(function(){var t=this.parameters,r=t.options,n=r.types,i=r.data;if(0===t.params.length){var a=this.container.lookup("controller:application");return[e(a,"currentRouteName")]}return o(t.context,t.params,{types:n,data:i})}).property("router.url"),routeArgs:Ember.computed(function(){var t=e(this,"resolvedParams").slice(0),r=e(this,"router"),n=t[0];if(n){var i=r.router.recognizer.handlersFor(n),o=i[i.length-1].handler;n!==o&&(this.set("currentWhen",n),n=i[i.length-1].handler,t[0]=n);for(var a=1,s=t.length;s>a;++a){var u=t[a];if(null===u||"undefined"==typeof u)return}return t}}).property("resolvedParams","queryParams"),queryParamsObject:null,queryParams:Ember.computed(function(){var t=e(this,"queryParamsObject"),r={};t&&Ember.merge(r,t.values);var n=e(this,"resolvedParams"),i=e(this,"router"),o=n[0],s=i._queryParamNamesFor(o),u=s.queryParams,l=s.translations,c={};a(r,l,o);var h=this.parameters;return i._queryParamOverrides(c,u,function(e,n){if(e in r){var i,o=e.split(":"),a=t.types[o[1]];if("ID"===a){var s=Ember.Handlebars.normalizePath(h.context,r[e],h.options.data);i=Ember.Handlebars.get(s.root,s.path,h.options)}else i=r[e];delete r[e],c[n]=i}}),c}).property("resolvedParams.[]"),href:Ember.computed(function(){if("a"===e(this,"tagName")){var t=e(this,"router"),r=e(this,"routeArgs");return r?t.generate.apply(t,r):e(this,"loadingHref")}}).property("routeArgs"),loadingHref:"#"});l.toString=function(){return"LinkView"},Ember.Handlebars.registerHelper("link-to",function(){var e=t.call(arguments,-1)[0],r=t.call(arguments,0,-1),n=e.hash;if(r[r.length-1]instanceof i&&(n.queryParamsObject=r.pop()),n.disabledBinding=n.disabledWhen,!e.fn){var o=r.shift(),a=e.types.shift(),s=this;"ID"===a?(e.linkTextPath=o,e.fn=function(){return Ember.Handlebars.getEscaped(s,o,e)}):e.fn=function(){return o}}return n.parameters={context:this,options:e,params:r},Ember.Handlebars.helpers.view.call(this,l,e)}),Ember.Handlebars.registerHelper("linkTo",function(){return Ember.Handlebars.helpers["link-to"].apply(this,arguments)})})}(),function(){Ember.get,Ember.set;Ember.onLoad("Ember.Handlebars",function(e){e.OutletView=Ember.ContainerView.extend(Ember._Metamorph),e.registerHelper("outlet",function(t,r){var n,i,o,a,s;for(t&&t.data&&t.data.isRenderData&&(r=t,t="main"),i=r.data.view.container,n=r.data.view;!n.get("template.isTop");)n=n.get("_parentView");return o=r.hash.view,o&&(s="view:"+o),a=o?i.lookupFactory(s):r.hash.viewClass||e.OutletView,r.data.view.set("outletSource",n),r.hash.currentViewBinding="_view.outletSource._outlets."+t,e.helpers.view.call(this,a,r)})})}(),function(){Ember.get,Ember.set;Ember.onLoad("Ember.Handlebars",function(){Ember.Handlebars.registerHelper("render",function(e,t,r){var n,i,o,a,s,u=arguments.length;if(n=(r||t).data.keywords.controller.container,i=n.lookup("router:main"),2===u)r=t,t=void 0;else{if(3!==u)throw Ember.Error("You must pass a templateName to render");s=Ember.Handlebars.get(r.contexts[1],t,r)}e=e.replace(/\//g,"."),a=n.lookup("view:"+e)||n.lookup("view:default");var l=r.hash.controller||e,c="controller:"+l;r.hash.controller;var h=r.data.keywords.controller;if(u>2){var m=n.lookupFactory(c)||Ember.generateControllerFactory(n,l,s);o=m.create({model:s,parentController:h,target:h})}else o=n.lookup(c)||Ember.generateController(n,l),o.setProperties({target:h,parentController:h});var p=r.contexts[1];p&&a.registerObserver(p,t,function(){o.set("model",Ember.Handlebars.get(p,t,r))}),r.hash.viewName=Ember.String.camelize(e);var f="template:"+e;r.hash.template=n.lookup(f),r.hash.controller=o,i&&!s&&i._connectActiveView(e,a),Ember.Handlebars.helpers.view.call(this,a,r)})})}(),function(){Ember.onLoad("Ember.Handlebars",function(){function e(e,r){var n=[];r&&n.push(r);var i=e.options.types.slice(1),o=e.options.data;return n.concat(t(e.context,e.params,{types:i,data:o}))}var t=Ember.Router.resolveParams,r=Ember.ViewUtils.isSimpleClick,n=Ember.Handlebars,i=n.get,o=n.SafeString,a=Ember.ArrayPolyfills.forEach,s=(Ember.get,Array.prototype.slice),u=n.ActionHelper={registeredActions:{}},l=["alt","shift","meta","ctrl"],c=/^click|mouse|touch/,h=function(e,t){if("undefined"==typeof t){if(c.test(e.type))return r(e);t=""}if(t.indexOf("any")>=0)return!0;var n=!0;return a.call(l,function(r){e[r+"Key"]&&-1===t.indexOf(r)&&(n=!1)}),n};u.registerAction=function(t,r,n){var o=++Ember.uuid;return u.registeredActions[o]={eventName:r.eventName,handler:function(o){if(!h(o,n))return!0;r.preventDefault!==!1&&o.preventDefault(),r.bubbles===!1&&o.stopPropagation();var a,s=r.target;s=s.target?i(s.root,s.target,s.options):s.root,r.boundProperty&&(a=i(s,t,r.options),("undefined"==typeof a||"function"==typeof a)&&(a=t)),a||(a=t),Ember.run(function(){s.send?s.send.apply(s,e(r.parameters,a)):s[a].apply(s,e(r.parameters))})}},r.view.on("willClearRender",function(){delete u.registeredActions[o]}),o},n.registerHelper("action",function(e){var t=arguments[arguments.length-1],r=s.call(arguments,1,-1),n=t.hash,i=t.data.keywords.controller,a={eventName:n.on||"click",parameters:{context:this,options:t,params:r},view:t.data.view,bubbles:n.bubbles,preventDefault:n.preventDefault,target:{options:t},boundProperty:"ID"===t.types[0]};n.target?(a.target.root=this,a.target.target=n.target):i&&(a.target.root=i);var l=u.registerAction(e,a,n.allowedKeys);return new o('data-ember-action="'+l+'"')})})}(),function(){{var e=Ember.get;Ember.set,Ember.EnumerableUtils.map}Ember.ControllerMixin.reopen({transitionToRoute:function(){var t=e(this,"target"),r=t.transitionToRoute||t.transitionTo;return r.apply(t,arguments)},transitionTo:function(){return this.transitionToRoute.apply(this,arguments)},replaceRoute:function(){var t=e(this,"target"),r=t.replaceRoute||t.replaceWith;return r.apply(t,arguments)},replaceWith:function(){return this.replaceRoute.apply(this,arguments)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.View.reopen({init:function(){t(this,"_outlets",{}),this._super()},connectOutlet:function(r,n){if(this._pendingDisconnections&&delete this._pendingDisconnections[r],this._hasEquivalentView(r,n))return n.destroy(),void 0;var i=e(this,"_outlets"),o=e(this,"container"),a=o&&o.lookup("router:main"),s=e(n,"renderedName");t(i,r,n),a&&s&&a._connectActiveView(s,n)},_hasEquivalentView:function(t,r){var n=e(this,"_outlets."+t);return n&&n.constructor===r.constructor&&n.get("template")===r.get("template")&&n.get("context")===r.get("context")},disconnectOutlet:function(e){this._pendingDisconnections||(this._pendingDisconnections={}),this._pendingDisconnections[e]=!0,Ember.run.once(this,"_finishDisconnections")},_finishDisconnections:function(){if(!this.isDestroyed){var r=e(this,"_outlets"),n=this._pendingDisconnections;this._pendingDisconnections=null;for(var i in n)t(r,i,null)}}})}(),function(){var e=Ember.run.queues,t=Ember.ArrayPolyfills.indexOf;e.splice(t.call(e,"actions")+1,0,"routerTransitions")}(),function(){Ember.get,Ember.set;Ember.Location={create:function(e){var t=e&&e.implementation,r=this.implementations[t];return r.create.apply(r,arguments)},registerImplementation:function(e,t){this.implementations[e]=t},implementations:{},_location:window.location,_getHash:function(){var e=(this._location||this.location).href,t=e.indexOf("#");return-1===t?"":e.substr(t)}}}(),function(){var e=Ember.get,t=Ember.set;Ember.NoneLocation=Ember.Object.extend({implementation:"none",path:"",getURL:function(){return e(this,"path")},setURL:function(e){t(this,"path",e)},onUpdateURL:function(e){this.updateCallback=e},handleURL:function(e){t(this,"path",e),this.updateCallback(e)},formatURL:function(e){return e}})}(),function(){var e=Ember.get,t=Ember.set;Ember.HashLocation=Ember.Object.extend({implementation:"hash",init:function(){t(this,"location",e(this,"_location")||window.location)},getHash:Ember.Location._getHash,getURL:function(){return this.getHash().substr(1)},setURL:function(r){e(this,"location").hash=r,t(this,"lastSetURL",r)},replaceURL:function(r){e(this,"location").replace("#"+r),t(this,"lastSetURL",r)},onUpdateURL:function(r){var n=this,i=Ember.guidFor(this);Ember.$(window).on("hashchange.ember-location-"+i,function(){Ember.run(function(){var i=n.getURL();e(n,"lastSetURL")!==i&&(t(n,"lastSetURL",null),r(i))})})},formatURL:function(e){return"#"+e},willDestroy:function(){var e=Ember.guidFor(this);Ember.$(window).off("hashchange.ember-location-"+e)}})}(),function(){var e=Ember.get,t=Ember.set,r=!1,n=window.history&&"state"in window.history;Ember.HistoryLocation=Ember.Object.extend({implementation:"history",init:function(){t(this,"location",e(this,"location")||window.location),t(this,"baseURL",Ember.$("base").attr("href")||"")},initState:function(){t(this,"history",e(this,"history")||window.history),this.replaceState(this.formatURL(this.getURL()))},rootURL:"/",getURL:function(){var t=e(this,"rootURL"),r=e(this,"location"),n=r.pathname,i=e(this,"baseURL");t=t.replace(/\/$/,""),i=i.replace(/\/$/,"");var o=n.replace(i,"").replace(t,"");return o},setURL:function(e){var t=this.getState();e=this.formatURL(e),t&&t.path===e||this.pushState(e)},replaceURL:function(e){var t=this.getState();e=this.formatURL(e),t&&t.path===e||this.replaceState(e)},getState:function(){return n?e(this,"history").state:this._historyState},pushState:function(t){var r={path:t};e(this,"history").pushState(r,null,t),n||(this._historyState=r),this._previousURL=this.getURL()},replaceState:function(t){var r={path:t};e(this,"history").replaceState(r,null,t),n||(this._historyState=r),this._previousURL=this.getURL()},onUpdateURL:function(e){var t=Ember.guidFor(this),n=this;Ember.$(window).on("popstate.ember-location-"+t,function(){(r||(r=!0,n.getURL()!==n._previousURL))&&e(n.getURL())})},formatURL:function(t){var r=e(this,"rootURL"),n=e(this,"baseURL");return""!==t?(r=r.replace(/\/$/,""),n=n.replace(/\/$/,"")):n.match(/^\//)&&r.match(/^\//)&&(n=n.replace(/\/$/,"")),n+r+t},willDestroy:function(){var e=Ember.guidFor(this);Ember.$(window).off("popstate.ember-location-"+e)}})}(),function(){{var e=(Ember.get,Ember.set),t=Ember.HistoryLocation,r=Ember.HashLocation,n=Ember.NoneLocation,i=Ember.Location;Ember.AutoLocation={cancelRouterSetup:!1,rootURL:"/",_window:window,_location:window.location,_history:window.history,_HistoryLocation:t,_HashLocation:r,_NoneLocation:n,_getOrigin:function(){var e=this._location,t=e.origin;return t||(t=e.protocol+"//"+e.hostname,e.port&&(t+=":"+e.port)),t},_getSupportsHistory:function(){var e=this._window.navigator.userAgent;return-1!==e.indexOf("Android 2")&&-1!==e.indexOf("Mobile Safari")&&-1===e.indexOf("Chrome")?!1:!!(this._history&&"pushState"in this._history)},_getSupportsHashChange:function(){var e=this._window,t=e.document.documentMode;return"onhashchange"in e&&(void 0===t||t>7)},_replacePath:function(e){this._location.replace(this._getOrigin()+e)},_getRootURL:function(){return this.rootURL},_getPath:function(){var e=this._location.pathname;return"/"!==e.charAt(0)&&(e="/"+e),e},_getHash:i._getHash,_getQuery:function(){return this._location.search},_getFullPath:function(){return this._getPath()+this._getQuery()+this._getHash()},_getHistoryPath:function(){{var e,t,r=this._getRootURL(),n=this._getPath(),i=this._getHash(),o=this._getQuery();n.indexOf(r)}return"#/"===i.substr(0,2)?(t=i.substr(1).split("#"),e=t.shift(),"/"===n.slice(-1)&&(e=e.substr(1)),n+=e,n+=o,t.length&&(n+="#"+t.join("#"))):(n+=o,n+=i),n},_getHashPath:function(){var e=this._getRootURL(),t=e,r=this._getHistoryPath(),n=r.substr(e.length);return""!==n&&("/"!==n.charAt(0)&&(n="/"+n),t+="#"+n),t},create:function(t){t&&t.rootURL&&(this.rootURL=t.rootURL);var r,n,i=!1,o=this._NoneLocation,a=this._getFullPath();this._getSupportsHistory()?(r=this._getHistoryPath(),a===r?o=this._HistoryLocation:(i=!0,this._replacePath(r))):this._getSupportsHashChange()&&(n=this._getHashPath(),a===n||"/"===a&&"/#/"===n?o=this._HashLocation:(i=!0,this._replacePath(n)));var s=o.create.apply(o,arguments);return i&&e(s,"cancelRouterSetup",!0),s}}}}(),function(){function e(t,r,n,i){var o,a=t.name,s=t.incoming,u=t.incomingNames,l=u.length;if(n||(n={}),i||(i=[]),!n.hasOwnProperty(a)){for(i.push(a),n[a]=!0,o=0;l>o;o++)e(s[u[o]],r,n,i);r(t,i),i.pop()}}function t(){this.names=[],this.vertices={}}t.prototype.add=function(e){if(e){if(this.vertices.hasOwnProperty(e))return this.vertices[e];var t={name:e,incoming:{},incomingNames:[],hasOutgoing:!1,value:null};return this.vertices[e]=t,this.names.push(e),t}},t.prototype.map=function(e,t){this.add(e).value=t},t.prototype.addEdge=function(t,r){function n(e,t){if(e.name===r)throw new Ember.Error("cycle detected: "+r+" <- "+t.join(" <- "))}if(t&&r&&t!==r){var i=this.add(t),o=this.add(r);o.incoming.hasOwnProperty(t)||(e(i,n),i.hasOutgoing=!0,o.incoming[t]=i,o.incomingNames.push(t))}},t.prototype.topsort=function(t){var r,n,i={},o=this.vertices,a=this.names,s=a.length;for(r=0;s>r;r++)n=o[a[r]],n.hasOutgoing||e(n,t,i)},t.prototype.addEdges=function(e,t,r,n){var i;if(this.map(e,t),r)if("string"==typeof r)this.addEdge(e,r);else for(i=0;i<r.length;i++)this.addEdge(e,r[i]);if(n)if("string"==typeof n)this.addEdge(n,e);else for(i=0;i<n.length;i++)this.addEdge(n[i],e)},Ember.DAG=t}(),function(){var e=Ember.get,t=Ember.String.classify,r=Ember.String.capitalize,n=Ember.String.decamelize;Ember.Resolver=Ember.Object.extend({namespace:null,normalize:function(){throw new Error("Invalid call to `resolver.normalize(fullName)`. Please override the 'normalize' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},resolve:function(){throw new Error("Invalid call to `resolver.resolve(parsedName)`. Please override the 'resolve' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},parseName:function(){throw new Error("Invalid call to `resolver.resolveByType(parsedName)`. Please override the 'resolveByType' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},lookupDescription:function(){throw new Error("Invalid call to `resolver.lookupDescription(fullName)`. Please override the 'lookupDescription' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},makeToString:function(){throw new Error("Invalid call to `resolver.makeToString(factory, fullName)`. Please override the 'makeToString' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")
|
19 |
-
},resolveOther:function(){throw new Error("Invalid call to `resolver.resolveDefault(parsedName)`. Please override the 'resolveDefault' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")}}),Ember.DefaultResolver=Ember.Object.extend({namespace:null,normalize:function(e){var t=e.split(":",2),r=t[0],n=t[1];if("template"!==r){var i=n;return i.indexOf(".")>-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),n.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r+":"+i}return e},resolve:function(e){var t=this.parseName(e),r=t.resolveMethodName;if(!t.name||!t.type)throw new TypeError("Invalid fullName: `"+e+"`, must be of the form `type:name` ");if(this[r]){var n=this[r](t);if(n)return n}return this.resolveOther(t)},parseName:function(n){var i=n.split(":"),o=i[0],a=i[1],s=a,u=e(this,"namespace"),l=u;if("template"!==o&&-1!==s.indexOf("/")){var c=s.split("/");s=c[c.length-1];var h=r(c.slice(0,-1).join("."));l=Ember.Namespace.byName(h)}return{fullName:n,type:o,fullNameWithoutType:a,name:s,root:l,resolveMethodName:"resolve"+t(o)}},lookupDescription:function(e){var r=this.parseName(e);if("template"===r.type)return"template at "+r.fullNameWithoutType.replace(/\./g,"/");var n=r.root+"."+t(r.name);return"model"!==r.type&&(n+=t(r.type)),n},makeToString:function(e){return e.toString()},useRouterNaming:function(e){e.name=e.name.replace(/\./g,"_"),"basic"===e.name&&(e.name="")},resolveTemplate:function(e){var t=e.fullNameWithoutType.replace(/\./g,"/");return Ember.TEMPLATES[t]?Ember.TEMPLATES[t]:(t=n(t),Ember.TEMPLATES[t]?Ember.TEMPLATES[t]:void 0)},resolveView:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveController:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveRoute:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveModel:function(r){var n=t(r.name),i=e(r.root,n);return i?i:void 0},resolveHelper:function(e){return this.resolveOther(e)||Ember.Handlebars.helpers[e.fullNameWithoutType]},resolveOther:function(r){var n=t(r.name)+t(r.type),i=e(r.root,n);return i?i:void 0}})}(),function(){function e(e){this._container=e}function t(e){function t(e){return n.resolve(e)}e.get("resolver");var r=e.get("resolver")||e.get("Resolver")||Ember.DefaultResolver,n=r.create({namespace:e});return t.describe=function(e){return n.lookupDescription(e)},t.makeToString=function(e,t){return n.makeToString(e,t)},t.normalize=function(e){return n.normalize?n.normalize(e):e},t.__resolver__=n,t}var r=Ember.get,n=Ember.set;e.deprecate=function(e){return function(){var t=this._container;return t[e].apply(t,arguments)}},e.prototype={_container:null,lookup:e.deprecate("lookup"),resolve:e.deprecate("resolve"),register:e.deprecate("register")};var i=Ember.Application=Ember.Namespace.extend(Ember.DeferredMixin,{rootElement:"body",eventDispatcher:null,customEvents:null,_readinessDeferrals:1,init:function(){if(this.$||(this.$=Ember.$),this.__container__=this.buildContainer(),this.Router=this.defaultRouter(),this._super(),this.scheduleInitialize(),Ember.libraries.registerCoreLibrary("Handlebars",Ember.Handlebars.VERSION),Ember.libraries.registerCoreLibrary("jQuery",Ember.$().jquery),Ember.LOG_VERSION){Ember.LOG_VERSION=!1;var e=Math.max.apply(this,Ember.A(Ember.libraries).mapBy("name.length"));Ember.libraries.each(function(t){new Array(e-t.length+1).join(" ")})}},buildContainer:function(){var e=this.__container__=i.buildContainer(this);return e},defaultRouter:function(){if(this.Router!==!1){var e=this.__container__;return this.Router&&(e.unregister("router:main"),e.register("router:main",this.Router)),e.lookupFactory("router:main")}},scheduleInitialize:function(){var e=this;!this.$||this.$.isReady?Ember.run.schedule("actions",e,"_initialize"):this.$().ready(function(){Ember.run(e,"_initialize")})},deferReadiness:function(){this._readinessDeferrals++},advanceReadiness:function(){this._readinessDeferrals--,0===this._readinessDeferrals&&Ember.run.once(this,this.didBecomeReady)},register:function(){var e=this.__container__;e.register.apply(e,arguments)},inject:function(){var e=this.__container__;e.injection.apply(e,arguments)},initialize:function(){},_initialize:function(){if(!this.isDestroyed){if(this.Router){var e=this.__container__;e.unregister("router:main"),e.register("router:main",this.Router)}return this.runInitializers(),Ember.runLoadHooks("application",this),this.advanceReadiness(),this}},reset:function(){function e(){var e=this.__container__.lookup("router:main");e.reset(),Ember.run(this.__container__,"destroy"),this.buildContainer(),Ember.run.schedule("actions",this,function(){this._initialize()})}this._readinessDeferrals=1,Ember.run.join(this,e)},runInitializers:function(){var e,t,n=r(this.constructor,"initializers"),i=this.__container__,o=new Ember.DAG,a=this;for(e in n)t=n[e],o.addEdges(t.name,t.initialize,t.before,t.after);o.topsort(function(e){var t=e.value;t(i,a)})},didBecomeReady:function(){this.setupEventDispatcher(),this.ready(),this.startRouting(),Ember.testing||(Ember.Namespace.processAll(),Ember.BOOTED=!0),this.resolve(this)},setupEventDispatcher:function(){var e=r(this,"customEvents"),t=r(this,"rootElement"),i=this.__container__.lookup("event_dispatcher:main");n(this,"eventDispatcher",i),i.setup(e,t)},startRouting:function(){var e=this.__container__.lookup("router:main");e&&e.startRouting()},handleURL:function(e){var t=this.__container__.lookup("router:main");t.handleURL(e)},ready:Ember.K,resolver:null,Resolver:null,willDestroy:function(){Ember.BOOTED=!1,this.__container__.lookup("router:main").reset(),this.__container__.destroy()},initializer:function(e){this.constructor.initializer(e)}});Ember.Application.reopenClass({initializers:{},initializer:function(e){void 0!==this.superclass.initializers&&this.superclass.initializers===this.initializers&&this.reopenClass({initializers:Ember.create(this.initializers)}),this.initializers[e.name]=e},buildContainer:function(r){var n=new Ember.Container;return Ember.Container.defaultContainer=new e(n),n.set=Ember.set,n.resolver=t(r),n.normalize=n.resolver.normalize,n.describe=n.resolver.describe,n.makeToString=n.resolver.makeToString,n.optionsForType("component",{singleton:!1}),n.optionsForType("view",{singleton:!1}),n.optionsForType("template",{instantiate:!1}),n.optionsForType("helper",{instantiate:!1}),n.register("application:main",r,{instantiate:!1}),n.register("controller:basic",Ember.Controller,{instantiate:!1}),n.register("controller:object",Ember.ObjectController,{instantiate:!1}),n.register("controller:array",Ember.ArrayController,{instantiate:!1}),n.register("route:basic",Ember.Route,{instantiate:!1}),n.register("event_dispatcher:main",Ember.EventDispatcher),n.register("router:main",Ember.Router),n.injection("router:main","namespace","application:main"),n.register("location:auto",Ember.AutoLocation),n.register("location:hash",Ember.HashLocation),n.register("location:history",Ember.HistoryLocation),n.register("location:none",Ember.NoneLocation),n.injection("controller","target","router:main"),n.injection("controller","namespace","application:main"),n.injection("route","router","router:main"),n.injection("location","rootURL","-location-setting:root-url"),n.register("resolver-for-debugging:main",n.resolver.__resolver__,{instantiate:!1}),n.injection("container-debug-adapter:main","resolver","resolver-for-debugging:main"),n.injection("data-adapter:main","containerDebugAdapter","container-debug-adapter:main"),n.register("container-debug-adapter:main",Ember.ContainerDebugAdapter),n}}),Ember.runLoadHooks("Ember.Application",Ember.Application)}(),function(){function e(e,t,r){var n,i,o,a=[];for(i=0,o=r.length;o>i;i++)n=r[i],-1===n.indexOf(":")&&(n="controller:"+n),t.has(n)||a.push(n);if(a.length)throw new Ember.Error(Ember.inspect(e)+" needs [ "+a.join(", ")+" ] but "+(a.length>1?"they":"it")+" could not be found")}var t=Ember.get,r=(Ember.set,Ember.computed(function(){var e=this;return{needs:t(e,"needs"),container:t(e,"container"),unknownProperty:function(t){var r,n,i,o=this.needs;for(n=0,i=o.length;i>n;n++)if(r=o[n],r===t)return this.container.lookup("controller:"+t);var a=Ember.inspect(e)+"#needs does not include `"+t+"`. To access the "+t+" controller from "+Ember.inspect(e)+", "+Ember.inspect(e)+" should have a `needs` property that is an array of the controllers it has access to.";throw new ReferenceError(a)},setUnknownProperty:function(t){throw new Error("You cannot overwrite the value of `controllers."+t+"` of "+Ember.inspect(e))}}}));Ember.ControllerMixin.reopen({concatenatedProperties:["needs"],needs:[],init:function(){var r=t(this,"needs"),n=t(r,"length");n>0&&(this.container&&e(this,this.container,r),t(this,"controllers")),this._super.apply(this,arguments)},controllerFor:function(e){return Ember.controllerFor(t(this,"container"),e)},controllers:r})}(),function(){Ember.ContainerDebugAdapter=Ember.Object.extend({container:null,resolver:null,canCatalogEntriesByType:function(e){return"model"===e||"template"===e?!1:!0},catalogEntriesByType:function(e){var t=Ember.A(Ember.Namespace.NAMESPACES),r=Ember.A(),n=new RegExp(Ember.String.classify(e)+"$");return t.forEach(function(e){if(e!==Ember)for(var t in e)if(e.hasOwnProperty(t)&&n.test(t)){var i=e[t];"class"===Ember.typeOf(i)&&r.push(Ember.String.dasherize(t.replace(n,"")))}}),r}})}(),function(){Ember.DataAdapter=Ember.Object.extend({init:function(){this._super(),this.releaseMethods=Ember.A()},container:null,containerDebugAdapter:void 0,attributeLimit:3,releaseMethods:Ember.A(),getFilters:function(){return Ember.A()},watchModelTypes:function(e,t){var r,n=this.getModelTypes(),i=this,o=Ember.A();r=n.map(function(e){var r=e.klass,n=i.wrapModelType(r,e.name);return o.push(i.observeModelType(r,t)),n}),e(r);var a=function(){o.forEach(function(e){e()}),i.releaseMethods.removeObject(a)};return this.releaseMethods.pushObject(a),a},_nameToClass:function(e){return"string"==typeof e&&(e=this.container.lookupFactory("model:"+e)),e},watchRecords:function(e,t,r,n){var i,o=this,a=Ember.A(),s=this.getRecords(e),u=function(e){r([e])},l=s.map(function(e){return a.push(o.observeRecord(e,u)),o.wrapRecord(e)}),c=function(e,r,i,s){for(var l=r;r+s>l;l++){var c=e.objectAt(l),h=o.wrapRecord(c);a.push(o.observeRecord(c,u)),t([h])}i&&n(r,i)},h={didChange:c,willChange:Ember.K};return s.addArrayObserver(o,h),i=function(){a.forEach(function(e){e()}),s.removeArrayObserver(o,h),o.releaseMethods.removeObject(i)},t(l),this.releaseMethods.pushObject(i),i},willDestroy:function(){this._super(),this.releaseMethods.forEach(function(e){e()})},detect:function(){return!1},columnsForType:function(){return Ember.A()},observeModelType:function(e,t){var r=this,n=this.getRecords(e),i=function(){t([r.wrapModelType(e)])},o={didChange:function(){Ember.run.scheduleOnce("actions",this,i)},willChange:Ember.K};n.addArrayObserver(this,o);var a=function(){n.removeArrayObserver(r,o)};return a},wrapModelType:function(e,t){var r,n=this.getRecords(e);return r={name:t||e.toString(),count:Ember.get(n,"length"),columns:this.columnsForType(e),object:e}},getModelTypes:function(){var e,t=this,r=this.get("containerDebugAdapter");return e=r.canCatalogEntriesByType("model")?r.catalogEntriesByType("model"):this._getObjectsOnNamespaces(),e.map(function(e){return{klass:t._nameToClass(e),name:e}}).filter(function(e){return t.detect(e.klass)})},_getObjectsOnNamespaces:function(){var e=Ember.A(Ember.Namespace.NAMESPACES),t=Ember.A();return e.forEach(function(e){for(var r in e)if(e.hasOwnProperty(r)){var n=Ember.String.dasherize(r);e instanceof Ember.Application||!e.toString()||(n=e+"/"+n),t.push(n)}}),t},getRecords:function(){return Ember.A()},wrapRecord:function(e){var t={object:e};return t.columnValues=this.getRecordColumnValues(e),t.searchKeywords=this.getRecordKeywords(e),t.filterValues=this.getRecordFilterValues(e),t.color=this.getRecordColor(e),t},getRecordColumnValues:function(){return{}},getRecordKeywords:function(){return Ember.A()},getRecordFilterValues:function(){return{}},getRecordColor:function(){return null},observeRecord:function(){return function(){}}})}()}(),"undefined"==typeof location||"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname||Ember.Logger.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
|
8 |
* @version 1.5.1
|
9 |
*/
|
10 |
!function(){var e,t,r,n;!function(){var i={},o={};e=function(e,t,r){i[e]={deps:t,callback:r}},n=r=t=function(e){function r(t){if("."!==t.charAt(0))return t;for(var r=t.split("/"),n=e.split("/").slice(0,-1),i=0,o=r.length;o>i;i++){var a=r[i];if(".."===a)n.pop();else{if("."===a)continue;n.push(a)}}return n.join("/")}if(n._eak_seen=i,o[e])return o[e];if(o[e]={},!i[e])throw new Error("Could not find module "+e);for(var a,s=i[e],u=s.deps,l=s.callback,c=[],h=0,m=u.length;m>h;h++)"exports"===u[h]?c.push(a={}):c.push(t(r(u[h])));var p=l.apply(this,c);return o[e]=a||p}}(),function(){"undefined"==typeof Ember&&(Ember={});{var e=(Ember.imports=Ember.imports||this,Ember.exports=Ember.exports||this);Ember.lookup=Ember.lookup||this}e.Em=e.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.5.1",Ember.ENV||(Ember.ENV="undefined"!=typeof EmberENV?EmberENV:"undefined"!=typeof ENV?ENV:{}),Ember.config=Ember.config||{},"undefined"==typeof Ember.ENV.DISABLE_RANGE_API&&(Ember.ENV.DISABLE_RANGE_API=!0),"undefined"==typeof MetamorphENV&&(e.MetamorphENV={}),MetamorphENV.DISABLE_RANGE_API=Ember.ENV.DISABLE_RANGE_API,Ember.FEATURES=Ember.ENV.FEATURES||{},Ember.FEATURES.isEnabled=function(e){var t=Ember.FEATURES[e];return Ember.ENV.ENABLE_ALL_FEATURES?!0:t===!0||t===!1||void 0===t?t:Ember.ENV.ENABLE_OPTIONAL_FEATURES?!0:!1},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,"undefined"==typeof Ember.EXTEND_PROTOTYPES&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.LOG_VERSION=Ember.ENV.LOG_VERSION===!1?!1:!0,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.debug&&(Ember.debug=Ember.K),"undefined"==typeof Ember.runInDebug&&(Ember.runInDebug=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(e,t){return t}),Ember.uuid=0,Ember.merge=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},Ember.isNone=function(e){return null===e||void 0===e},Ember.none=Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isNone instead.",Ember.isNone),Ember.isEmpty=function(e){return Ember.isNone(e)||0===e.length&&"function"!=typeof e||"object"==typeof e&&0===Ember.get(e,"length")},Ember.empty=Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.",Ember.isEmpty),Ember.isBlank=function(e){return Ember.isEmpty(e)||"string"==typeof e&&null===e.match(/\S/)}}(),function(){var e=Ember.platform={};if(Ember.create=Object.create,Ember.create&&2!==Ember.create({a:1},{a:{value:2}}).a&&(Ember.create=null),!Ember.create||Ember.ENV.STUB_OBJECT_CREATE){var t=function(){};Ember.create=function(e,r){if(t.prototype=e,e=new t,r){t.prototype=e;for(var n in r)t.prototype[n]=r[n].value;e=new t}return t.prototype=null,e},Ember.create.isSimulated=!0}var r,n,i=Object.defineProperty;if(i)try{i({},"a",{get:function(){}})}catch(o){i=null}i&&(r=function(){var e={};return i(e,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),i(e,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),e.a===!0}(),n=function(){try{return i(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(e){}return!1}(),r?n||(i=function(e,t,r){var n;return n="object"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName,n?e[t]=r.value:Object.defineProperty(e,t,r)}):i=null),e.defineProperty=i,e.hasPropertyAccessors=!0,e.defineProperty||(e.hasPropertyAccessors=!1,e.defineProperty=function(e,t,r){r.get||(e[t]=r.value)},e.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!e.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){var e=function(e){return e&&Function.prototype.toString.call(e).indexOf("[native code]")>-1},t=e(Array.prototype.map)?Array.prototype.map:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=new Array(r),i=arguments[1],o=0;r>o;o++)o in t&&(n[o]=e.call(i,t[o],o,t));return n},r=e(Array.prototype.forEach)?Array.prototype.forEach:function(e){if(void 0===this||null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=arguments[1],i=0;r>i;i++)i in t&&e.call(n,t[i],i,t)},n=e(Array.prototype.indexOf)?Array.prototype.indexOf:function(e,t){null===t||void 0===t?t=0:0>t&&(t=Math.max(0,this.length+t));for(var r=t,n=this.length;n>r;r++)if(this[r]===e)return r;return-1},i=e(Array.prototype.filter)?Array.prototype.filter:function(e,t){var r,n,i=[],o=this.length;for(r=0;o>r;r++)this.hasOwnProperty(r)&&(n=this[r],e.call(t,n,r,this)&&i.push(n));return i};Ember.ArrayPolyfills={map:t,forEach:r,filter:i,indexOf:n},Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=t),Array.prototype.forEach||(Array.prototype.forEach=r),Array.prototype.filter||(Array.prototype.filter=i),Array.prototype.indexOf||(Array.prototype.indexOf=n))}(),function(){var e=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var t=Error.apply(this,arguments);Error.captureStackTrace&&Error.captureStackTrace(this,Ember.Error);for(var r=0;r<e.length;r++)this[e[r]]=t[e[r]]},Ember.Error.prototype=Ember.create(Error.prototype),Ember.onerror=null}(),function(){function e(e){this.descs={},this.watching={},this.cache={},this.cacheMeta={},this.source=e}function t(e,t){return!(!e||"function"!=typeof e[t])}Ember.GUID_PREFIX="ember";var r=Ember.platform.defineProperty,n=Ember.create,i="__ember"+ +new Date,o=[],a={},s=0,u=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=i;var l={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,t){t||(t=Ember.GUID_PREFIX);var n=t+s++;return e&&(null===e[i]?e[i]=n:(l.value=n,r(e,i,l))),n},Ember.guidFor=function(e){if(void 0===e)return"(undefined)";if(null===e)return"(null)";var t,n=typeof e;switch(n){case"number":return t=o[e],t||(t=o[e]="nu"+e),t;case"string":return t=a[e],t||(t=a[e]="st"+s++),t;case"boolean":return e?"(true)":"(false)";default:return e[i]?e[i]:e===Object?"(Object)":e===Array?"(Array)":(t="ember"+s++,null===e[i]?e[i]=t:(l.value=t,r(e,i,l)),t)}};var c=Ember.META_DESC={writable:!0,configurable:!1,enumerable:!1,value:null},h=Ember.GUID_KEY+"_meta";Ember.META_KEY=h;var m=Ember.platform.defineProperty.isSimulated;e.prototype={descs:null,deps:null,watching:null,listeners:null,cache:null,cacheMeta:null,source:null,mixins:null,bindings:null,chains:null,chainWatchers:null,values:null,proto:null},m&&(e.prototype.__preventPlainObject__=!0,e.prototype.toJSON=function(){});var p=new e(null);u&&(p.values={}),Ember.EMPTY_META=p,Ember.meta=function(t,i){var o=t[h];return i===!1?o||p:(o?o.source!==t&&(m||r(t,h,c),o=n(o),o.descs=n(o.descs),o.watching=n(o.watching),o.cache={},o.cacheMeta={},o.source=t,u&&(o.values=n(o.values)),t[h]=o):(m||r(t,h,c),o=new e(t),u&&(o.values={}),t[h]=o,o.descs.constructor=null),o)},Ember.getMeta=function(e,t){var r=Ember.meta(e,!1);return r[t]},Ember.setMeta=function(e,t,r){var n=Ember.meta(e,!0);return n[t]=r,r},Ember.metaPath=function(e,t,r){for(var i,o,a=Ember.meta(e,r),s=0,u=t.length;u>s;s++){if(i=t[s],o=a[i]){if(o.__ember_source__!==e){if(!r)return void 0;o=a[i]=n(o),o.__ember_source__=e}}else{if(!r)return void 0;o=a[i]={__ember_source__:e}}a=o}return o},Ember.wrap=function(e,t){function r(){var r,n=this.__nextSuper;return this.__nextSuper=t,r=e.apply(this,arguments),this.__nextSuper=n,r}return r.wrappedFunction=e,r.__ember_observes__=e.__ember_observes__,r.__ember_observesBefore__=e.__ember_observesBefore__,r.__ember_listens__=e.__ember_listens__,r},Ember.isArray=function(e){return!e||e.setInterval?!1:Array.isArray&&Array.isArray(e)?!0:Ember.Array&&Ember.Array.detect(e)?!0:void 0!==e.length&&"object"==typeof e?!0:!1},Ember.makeArray=function(e){return null===e||void 0===e?[]:Ember.isArray(e)?e:[e]},Ember.canInvoke=t,Ember.tryInvoke=function(e,r,n){return t(e,r)?e[r].apply(e,n||[]):void 0};var f=function(){var e=0;try{try{}finally{throw e++,new Error("needsFinallyFixTest")}}catch(t){}return 1!==e}();Ember.tryFinally=f?function(e,t,r){var n,i,o;r=r||this;try{n=e.call(r)}finally{try{i=t.call(r)}catch(a){o=a}}if(o)throw o;return void 0===i?n:i}:function(e,t,r){var n,i;r=r||this;try{n=e.call(r)}finally{i=t.call(r)}return void 0===i?n:i},Ember.tryCatchFinally=f?function(e,t,r,n){var i,o,a;n=n||this;try{i=e.call(n)}catch(s){i=t.call(n,s)}finally{try{o=r.call(n)}catch(u){a=u}}if(a)throw a;return void 0===o?i:o}:function(e,t,r,n){var i,o;n=n||this;try{i=e.call(n)}catch(a){i=t.call(n,a)}finally{o=r.call(n)}return void 0===o?i:o};var d={},b="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(b,function(e){d["[object "+e+"]"]=e.toLowerCase()});var v=Object.prototype.toString;Ember.typeOf=function(e){var t;return t=null===e||void 0===e?String(e):d[v.call(e)]||"object","function"===t?Ember.Object&&Ember.Object.detect(e)&&(t="class"):"object"===t&&(e instanceof Error?t="error":Ember.Object&&e instanceof Ember.Object?t="instance":e instanceof Date&&(t="date")),t},Ember.inspect=function(e){var t=Ember.typeOf(e);if("array"===t)return"["+e+"]";if("object"!==t)return e+"";var r,n=[];for(var i in e)if(e.hasOwnProperty(i)){if(r=e[i],"toString"===r)continue;"function"===Ember.typeOf(r)&&(r="function() { ... }"),n.push(i+": "+r)}return"{"+n.join(", ")+"}"}}(),function(){Ember.Instrumentation={};var e=[],t={},r=function(r){for(var n,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.regex.test(r)&&i.push(n.object);return t[r]=i,i},n=function(){var e="undefined"!=typeof window?window.performance||{}:{},t=e.now||e.mozNow||e.webkitNow||e.msNow||e.oNow;return t?t.bind(e):function(){return+new Date}}();Ember.Instrumentation.instrument=function(e,i,o,a){function s(){for(f=0,d=m.length;d>f;f++)p=m[f],b[f]=p.before(e,n(),i);return o.call(a)}function u(e){i=i||{},i.exception=e}function l(){for(f=0,d=m.length;d>f;f++)p=m[f],p.after(e,n(),i,b[f]);Ember.STRUCTURED_PROFILE&&console.timeEnd(c)}var c,h,m=t[e];if(Ember.STRUCTURED_PROFILE&&(c=e+": "+i.object,console.time(c)),m||(m=r(e)),0===m.length)return h=o.call(a),Ember.STRUCTURED_PROFILE&&console.timeEnd(c),h;var p,f,d,b=[];return Ember.tryCatchFinally(s,u,l)},Ember.Instrumentation.subscribe=function(r,n){for(var i,o=r.split("."),a=[],s=0,u=o.length;u>s;s++)i=o[s],"*"===i?a.push("[^\\.]*"):a.push(i);a=a.join("\\."),a+="(\\..*)?";var l={pattern:r,regex:new RegExp("^"+a+"$"),object:n};return e.push(l),t={},l},Ember.Instrumentation.unsubscribe=function(r){for(var n,i=0,o=e.length;o>i;i++)e[i]===r&&(n=i);e.splice(n,1),t={}},Ember.Instrumentation.reset=function(){e=[],t={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var e,t,r,n,i;e=Array.prototype.map||Ember.ArrayPolyfills.map,t=Array.prototype.forEach||Ember.ArrayPolyfills.forEach,r=Array.prototype.indexOf||Ember.ArrayPolyfills.indexOf,i=Array.prototype.filter||Ember.ArrayPolyfills.filter,n=Array.prototype.splice;var o=Ember.EnumerableUtils={map:function(t,r,n){return t.map?t.map.call(t,r,n):e.call(t,r,n)},forEach:function(e,r,n){return e.forEach?e.forEach.call(e,r,n):t.call(e,r,n)},filter:function(e,t,r){return e.filter?e.filter.call(e,t,r):i.call(e,t,r)},indexOf:function(e,t,n){return e.indexOf?e.indexOf.call(e,t,n):r.call(e,t,n)},indexesOf:function(e,t){return void 0===t?[]:o.map(t,function(t){return o.indexOf(e,t)})},addObject:function(e,t){var r=o.indexOf(e,t);-1===r&&e.push(t)},removeObject:function(e,t){var r=o.indexOf(e,t);-1!==r&&e.splice(r,1)},_replace:function(e,t,r,i){for(var o,a,s=[].concat(i),u=[],l=6e4,c=t,h=r;s.length;)a=h>l?l:h,0>=a&&(a=0),o=s.splice(0,l),o=[c,a].concat(o),c+=l,h-=a,u=u.concat(n.apply(e,o));return u},replace:function(e,t,r,n){return e.replace?e.replace(t,r,n):o._replace(e,t,r,n)},intersection:function(e,t){var r=[];return o.forEach(e,function(e){o.indexOf(t,e)>=0&&r.push(e)}),r}}}(),function(){var e,t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,i=/^this[\.\*]/,o=/^([^\.\*]+)/;e=function(e,n){if(""===n)return e;if(n||"string"!=typeof e||(n=e,e=null),null===e||-1!==n.indexOf("."))return s(e,n);var i,o=e[t],a=o&&o.descs[n];return a?a.get(e,n):(i=r&&o&&o.watching[n]>0?o.values[n]:e[n],void 0!==i||"object"!=typeof e||n in e||"function"!=typeof e.unknownProperty?i:e.unknownProperty(n))},Ember.config.overrideAccessors&&(Ember.get=e,Ember.config.overrideAccessors(),e=Ember.get);var a=Ember.normalizeTuple=function(t,r){var a,s=i.test(r),u=!s&&n.test(r);if((!t||u)&&(t=Ember.lookup),s&&(r=r.slice(5)),t===Ember.lookup&&(a=r.match(o)[0],t=e(t,a),r=r.slice(a.length+1)),!r||0===r.length)throw new Ember.Error("Path cannot be empty");return[t,r]},s=Ember._getPath=function(t,r){var n,o,s,u,l;if(null===t&&-1===r.indexOf("."))return e(Ember.lookup,r);for(n=i.test(r),(!t||n)&&(s=a(t,r),t=s[0],r=s[1],s.length=0),o=r.split("."),l=o.length,u=0;null!=t&&l>u;u++)if(t=e(t,o[u],!0),t&&t.isDestroyed)return void 0;return t};Ember.getWithDefault=function(t,r,n){var i=e(t,r);return void 0===i?n:i},Ember.get=e}(),function(){function e(e,t,r){for(var n=-1,i=e.length-3;i>=0;i-=3)if(t===e[i]&&r===e[i+1]){n=i;break}return n}function t(e,t){var r,n=p(e,!0);return n.listeners||(n.listeners={}),n.hasOwnProperty("listeners")||(n.listeners=m(n.listeners)),r=n.listeners[t],r&&!n.listeners.hasOwnProperty(t)?r=n.listeners[t]=n.listeners[t].slice():r||(r=n.listeners[t]=[]),r}function r(t,r,n){var i=t[f],o=i&&i.listeners&&i.listeners[r];if(o)for(var a=o.length-3;a>=0;a-=3){var s=o[a],u=o[a+1],l=o[a+2],c=e(n,s,u);-1===c&&n.push(s,u,l)}}function n(t,r,n){var i=t[f],o=i&&i.listeners&&i.listeners[r],a=[];if(o){for(var s=o.length-3;s>=0;s-=3){var u=o[s],l=o[s+1],c=o[s+2],h=e(n,u,l);-1===h&&(n.push(u,l,c),a.push(u,l,c))}return a}}function i(r,n,i,o,a){o||"function"!=typeof i||(o=i,i=null);var s=t(r,n),u=e(s,i,o),l=0;a&&(l|=b),-1===u&&(s.push(i,o,l),"function"==typeof r.didAddListener&&r.didAddListener(n,i,o))}function o(r,n,i,o){function a(i,o){var a=t(r,n),s=e(a,i,o);-1!==s&&(a.splice(s,3),"function"==typeof r.didRemoveListener&&r.didRemoveListener(n,i,o))}if(o||"function"!=typeof i||(o=i,i=null),o)a(i,o);else{var s=r[f],u=s&&s.listeners&&s.listeners[n];if(!u)return;for(var l=u.length-3;l>=0;l-=3)a(u[l],u[l+1])}}function a(r,n,i,o,a){function s(){return a.call(i)}function u(){-1!==c&&(l[c+2]&=~v)}o||"function"!=typeof i||(o=i,i=null);var l=t(r,n),c=e(l,i,o);return-1!==c&&(l[c+2]|=v),Ember.tryFinally(s,u)}function s(r,n,i,o,a){function s(){return a.call(i)}function u(){for(var e=0,t=p.length;t>e;e++){var r=p[e];f[e][r+2]&=~v}}o||"function"!=typeof i||(o=i,i=null);var l,c,h,m,p=[],f=[];for(h=0,m=n.length;m>h;h++){l=n[h],c=t(r,l);var d=e(c,i,o);-1!==d&&(c[d+2]|=v,p.push(d),f.push(c))}return Ember.tryFinally(s,u)}function u(e){var t=e[f].listeners,r=[];if(t)for(var n in t)t[n]&&r.push(n);return r}function l(e,t,r,n){if(e!==Ember&&"function"==typeof e.sendEvent&&e.sendEvent(t,r),!n){var i=e[f];n=i&&i.listeners&&i.listeners[t]}if(n){for(var a=n.length-3;a>=0;a-=3){var s=n[a],u=n[a+1],l=n[a+2];u&&(l&v||(l&b&&o(e,t,s,u),s||(s=e),"string"==typeof u&&(u=s[u]),r?u.apply(s,r):u.call(s)))}return!0}}function c(e,t){var r=e[f],n=r&&r.listeners&&r.listeners[t];return!(!n||!n.length)}function h(e,t){var r=[],n=e[f],i=n&&n.listeners&&n.listeners[t];if(!i)return r;for(var o=0,a=i.length;a>o;o+=3){var s=i[o],u=i[o+1];r.push([s,u])}return r}var m=Ember.create,p=Ember.meta,f=Ember.META_KEY,d=[].slice,b=1,v=2;Ember.on=function(){var e=d.call(arguments,-1)[0],t=d.call(arguments,0,-1);return e.__ember_listens__=t,e},Ember.addListener=i,Ember.removeListener=o,Ember._suspendListener=a,Ember._suspendListeners=s,Ember.sendEvent=l,Ember.hasListeners=c,Ember.watchedEvents=u,Ember.listenersFor=h,Ember.listenersDiff=n,Ember.listenersUnion=r}(),function(){var e=Ember.guidFor,t=Ember.sendEvent,r=Ember._ObserverSet=function(){this.clear()};r.prototype.add=function(t,r,n){var i,o=this.observerSet,a=this.observers,s=e(t),u=o[s];return u||(o[s]=u={}),i=u[r],void 0===i&&(i=a.push({sender:t,keyName:r,eventName:n,listeners:[]})-1,u[r]=i),a[i].listeners},r.prototype.flush=function(){var e,r,n,i,o=this.observers;for(this.clear(),e=0,r=o.length;r>e;++e)n=o[e],i=n.sender,i.isDestroying||i.isDestroyed||t(i,n.eventName,[i,n.keyName],n.listeners)},r.prototype.clear=function(){this.observerSet={},this.observers=[]}}(),function(){function e(e,t){var n=e[h],i=n&&n.watching[t]>0||"length"===t,a=n&&n.proto,s=n&&n.descs[t];i&&a!==e&&(s&&s.willChange&&s.willChange(e,t),r(e,t,n),o(e,t,n),l(e,t))}function t(e,t){var r=e[h],i=r&&r.watching[t]>0||"length"===t,o=r&&r.proto,s=r&&r.descs[t];o!==e&&(s&&s.didChange&&s.didChange(e,t),(i||"length"===t)&&(n(e,t,r),a(e,t,r,!1),c(e,t)))}function r(t,r,n){if(!t.isDestroying){var o=_,a=!o;a&&(o=_={}),i(e,t,r,o,n),a&&(_=null)}}function n(e,r,n){if(!e.isDestroying){var o=w,a=!o;a&&(o=w={}),i(t,e,r,o,n),a&&(w=null)}}function i(e,t,r,n,i){var o=m(t);if(n[o]||(n[o]={}),!n[o][r]){n[o][r]=!0;var a=i.deps;if(a=a&&a[r])for(var s in a){var u=i.descs[s];u&&u._suspended===t||e(t,s)}}}function o(t,r,n){if(n.hasOwnProperty("chainWatchers")&&n.chainWatchers[r]){var i,o,a=n.chainWatchers[r],s=[];for(i=0,o=a.length;o>i;i++)a[i].willChange(s);for(i=0,o=s.length;o>i;i+=2)e(s[i],s[i+1])}}function a(e,r,n,i){if(n&&n.hasOwnProperty("chainWatchers")&&n.chainWatchers[r]){var o,a,s=n.chainWatchers[r],u=i?null:[];for(o=0,a=s.length;a>o;o++)s[o].didChange(u);if(!i)for(o=0,a=u.length;a>o;o+=2)t(u[o],u[o+1])}}function s(){y++}function u(){y--,0>=y&&(E.clear(),g.flush())}function l(e,t){if(!e.isDestroying){var r,n,i=t+":before";y?(r=E.add(e,t,i),n=b(e,i,r),f(e,i,[e,t],n)):f(e,i,[e,t])}}function c(e,t){if(!e.isDestroying){var r,n=t+":change";y?(r=g.add(e,t,n),d(e,n,r)):f(e,n,[e,t])}}var h=Ember.META_KEY,m=Ember.guidFor,p=Ember.tryFinally,f=Ember.sendEvent,d=Ember.listenersUnion,b=Ember.listenersDiff,v=Ember._ObserverSet,E=new v,g=new v,y=0;Ember.propertyWillChange=e,Ember.propertyDidChange=t;var _,w;Ember.overrideChains=function(e,t,r){a(e,t,r,!0)},Ember.beginPropertyChanges=s,Ember.endPropertyChanges=u,Ember.changeProperties=function(e,t){s(),p(e,u,t)}}(),function(){function e(e,t,r,o){var a;if(a=t.slice(t.lastIndexOf(".")+1),t=t===a?a:t.slice(0,t.length-(a.length+1)),"this"!==t&&(e=n(e,t)),!a||0===a.length)throw new Ember.Error("Property set failed: You passed an empty path");if(!e){if(o)return;throw new Ember.Error('Property set failed: object in path "'+t+'" could not be found or was destroyed.')}return i(e,a,r)}var t=Ember.META_KEY,r=Ember.ENV.MANDATORY_SETTER,n=Ember._getPath,i=function(n,i,o,a){if("string"==typeof n&&(o=i,i=n,n=null),!n||-1!==i.indexOf("."))return e(n,i,o,a);var s,u,l=n[t],c=l&&l.descs[i];return c?c.set(n,i,o):(s="object"==typeof n&&!(i in n),s&&"function"==typeof n.setUnknownProperty?n.setUnknownProperty(i,o):l&&l.watching[i]>0?(u=r?l.values[i]:n[i],o!==u&&(Ember.propertyWillChange(n,i),r?(void 0!==u||i in n)&&n.propertyIsEnumerable(i)?l.values[i]=o:Ember.defineProperty(n,i,null,o):n[i]=o,Ember.propertyDidChange(n,i))):n[i]=o),o};Ember.config.overrideAccessors&&(Ember.set=i,Ember.config.overrideAccessors(),i=Ember.set),Ember.set=i,Ember.trySet=function(e,t,r){return i(e,t,r,!0)}}(),function(){var e=Ember.set,t=Ember.guidFor,r=Ember.ArrayPolyfills.indexOf,n=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},i=function(e,t){var r=e.keys.copy(),i=n(e.values);return t.keys=r,t.values=i,t.length=e.length,t},o=Ember.OrderedSet=function(){this.clear()};o.create=function(){return new o},o.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(e){var r=t(e),n=this.presenceSet,i=this.list;r in n||(n[r]=!0,i.push(e))},remove:function(e){var n=t(e),i=this.presenceSet,o=this.list;delete i[n];var a=r.call(o,e);a>-1&&o.splice(a,1)},isEmpty:function(){return 0===this.list.length},has:function(e){var r=t(e),n=this.presenceSet;return r in n},forEach:function(e,t){for(var r=this.toArray(),n=0,i=r.length;i>n;n++)e.call(t,r[n])},toArray:function(){return this.list.slice()},copy:function(){var e=new o;return e.presenceSet=n(this.presenceSet),e.list=this.toArray(),e}};var a=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};a.create=function(){return new a},a.prototype={length:0,get:function(e){var r=this.values,n=t(e);return r[n]},set:function(r,n){var i=this.keys,o=this.values,a=t(r);i.add(r),o[a]=n,e(this,"length",i.list.length)},remove:function(r){var n=this.keys,i=this.values,o=t(r);return i.hasOwnProperty(o)?(n.remove(r),delete i[o],e(this,"length",n.list.length),!0):!1},has:function(e){var r=this.values,n=t(e);return r.hasOwnProperty(n)},forEach:function(e,r){var n=this.keys,i=this.values;n.forEach(function(n){var o=t(n);e.call(r,n,i[o])})},copy:function(){return i(this,new a)}};var s=Ember.MapWithDefault=function(e){a.call(this),this.defaultValue=e.defaultValue};s.create=function(e){return e?new s(e):new a},s.prototype=Ember.create(a.prototype),s.prototype.get=function(e){var t=this.has(e);if(t)return a.prototype.get.call(this,e);var r=this.defaultValue(e);return this.set(e,r),r},s.prototype.copy=function(){return i(this,new s({defaultValue:this.defaultValue}))}}(),function(){function e(e){var t,r;Ember.imports.console?t=Ember.imports.console:"undefined"!=typeof console&&(t=console);var n="object"==typeof t?t[e]:null;return n?"function"==typeof n.apply?(r=function(){n.apply(t,arguments)},r.displayName="console."+e,r):function(){var e=Array.prototype.join.call(arguments,", ");n(e)}:void 0}function t(e,t){if(!e)try{throw new Ember.Error("assertion failed: "+t)}catch(r){setTimeout(function(){throw r},0)}}Ember.Logger={log:e("log")||Ember.K,warn:e("warn")||Ember.K,error:e("error")||Ember.K,info:e("info")||Ember.K,debug:e("debug")||e("info")||Ember.K,assert:e("assert")||t}}(),function(){var e=Ember.META_KEY,t=Ember.meta,r=Ember.platform.defineProperty,n=Ember.ENV.MANDATORY_SETTER;Ember.Descriptor=function(){};var i=Ember.MANDATORY_SETTER_FUNCTION=function(){},o=Ember.DEFAULT_GETTER_FUNCTION=function(t){return function(){var r=this[e];return r&&r.values[t]}};if(Ember.defineProperty=function(e,s,u,l,c){var h,m,p,f;return c||(c=t(e)),h=c.descs,m=c.descs[s],p=c.watching[s]>0,m instanceof Ember.Descriptor&&m.teardown(e,s),u instanceof Ember.Descriptor?(f=u,h[s]=u,n&&p?r(e,s,{configurable:!0,enumerable:!0,writable:!0,value:void 0}):e[s]=void 0,Ember.FEATURES.isEnabled("composable-computed-properties")&&u.func&&u._dependentCPs&&a(e,u._dependentCPs,c)):(h[s]=void 0,null==u?(f=l,n&&p?(c.values[s]=l,r(e,s,{configurable:!0,enumerable:!0,set:i,get:o(s)})):e[s]=l):(f=u,r(e,s,u))),p&&Ember.overrideChains(e,s,c),e.didDefineProperty&&e.didDefineProperty(e,s,f),this},Ember.FEATURES.isEnabled("composable-computed-properties"))var a=function(e,t,r){for(var n,i,o=t.length,s=0;o>s;++s)n=t[s],i=n.implicitCPKey,Ember.defineProperty(e,i,n,void 0,r),n._dependentCPs&&a(e,n._dependentCPs,r)}}(),function(){var e=Ember.get;Ember.getProperties=function(t){var r={},n=arguments,i=1;2===arguments.length&&"array"===Ember.typeOf(arguments[1])&&(i=0,n=arguments[1]);for(var o=n.length;o>i;i++)r[n[i]]=e(t,n[i]);return r}}(),function(){var e=Ember.changeProperties,t=Ember.set;Ember.setProperties=function(r,n){return e(function(){for(var e in n)n.hasOwnProperty(e)&&t(r,e,n[e])}),r}}(),function(){var e=Ember.meta,t=Ember.typeOf,r=Ember.ENV.MANDATORY_SETTER,n=Ember.platform.defineProperty;Ember.watchKey=function(i,o,a){if("length"!==o||"array"!==t(i)){var s=a||e(i),u=s.watching;u[o]?u[o]=(u[o]||0)+1:(u[o]=1,"function"==typeof i.willWatchProperty&&i.willWatchProperty(o),r&&o in i&&(s.values[o]=i[o],n(i,o,{configurable:!0,enumerable:i.propertyIsEnumerable(o),set:Ember.MANDATORY_SETTER_FUNCTION,get:Ember.DEFAULT_GETTER_FUNCTION(o)})))}},Ember.unwatchKey=function(t,i,o){var a=o||e(t),s=a.watching;1===s[i]?(s[i]=0,"function"==typeof t.didUnwatchProperty&&t.didUnwatchProperty(i),r&&i in t&&n(t,i,{configurable:!0,enumerable:t.propertyIsEnumerable(i),set:function(e){n(t,i,{configurable:!0,writable:!0,enumerable:!0,value:e}),delete a.values[i]},get:Ember.DEFAULT_GETTER_FUNCTION(i)})):s[i]>1&&s[i]--}}(),function(){function e(e){return e.match(c)[0]}function t(e,t,r){if(e&&"object"==typeof e){var i=n(e),o=i.chainWatchers;i.hasOwnProperty("chainWatchers")||(o=i.chainWatchers={}),o[t]||(o[t]=[]),o[t].push(r),u(e,t,i)}}function r(e,t){if(!e)return void 0;var r=e[h];if(r&&r.proto===e)return void 0;if("@each"===t)return i(e,t);var n=r&&r.descs[t];return n&&n._cacheable?t in r.cache?r.cache[t]:void 0:i(e,t)}var n=Ember.meta,i=Ember.get,o=Ember.normalizeTuple,a=Ember.ArrayPolyfills.forEach,s=Ember.warn,u=Ember.watchKey,l=Ember.unwatchKey,c=/^([^\.\*]+)/,h=Ember.META_KEY,m=[];Ember.flushPendingChains=function(){if(0!==m.length){var e=m;m=[],a.call(e,function(e){e[0].add(e[1])}),s("Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos",0===m.length)}};var p=Ember.removeChainWatcher=function(e,t,r){if(e&&"object"==typeof e){var n=e[h];if(!n||n.hasOwnProperty("chainWatchers")){var i=n&&n.chainWatchers;if(i&&i[t]){i=i[t];for(var o=0,a=i.length;a>o;o++)i[o]===r&&i.splice(o,1)}l(e,t,n)}}},f=Ember._ChainNode=function(e,r,n){this._parent=e,this._key=r,this._watching=void 0===n,this._value=n,this._paths={},this._watching&&(this._object=e.value(),this._object&&t(this._object,this._key,this)),this._parent&&"@each"===this._parent._key&&this.value()},d=f.prototype;d.value=function(){if(void 0===this._value&&this._watching){var e=this._parent.value();this._value=r(e,this._key)}return this._value},d.destroy=function(){if(this._watching){var e=this._object;e&&p(e,this._key,this),this._watching=!1}},d.copy=function(e){var t,r=new f(null,null,e),n=this._paths;for(t in n)n[t]<=0||r.add(t);return r},d.add=function(t){var r,n,i,a,s;if(s=this._paths,s[t]=(s[t]||0)+1,r=this.value(),n=o(r,t),n[0]&&n[0]===r)t=n[1],i=e(t),t=t.slice(i.length+1);else{if(!n[0])return m.push([this,t]),n.length=0,void 0;a=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]}n.length=0,this.chain(i,t,a)},d.remove=function(t){var r,n,i,a,s;s=this._paths,s[t]>0&&s[t]--,r=this.value(),n=o(r,t),n[0]===r?(t=n[1],i=e(t),t=t.slice(i.length+1)):(a=n[0],i=t.slice(0,0-(n[1].length+1)),t=n[1]),n.length=0,this.unchain(i,t)},d.count=0,d.chain=function(t,r,n){var i,o=this._chains;o||(o=this._chains={}),i=o[t],i||(i=o[t]=new f(this,t,n)),i.count++,r&&r.length>0&&(t=e(r),r=r.slice(t.length+1),i.chain(t,r))},d.unchain=function(t,r){var n=this._chains,i=n[t];r&&r.length>1&&(t=e(r),r=r.slice(t.length+1),i.unchain(t,r)),i.count--,i.count<=0&&(delete n[i._key],i.destroy())},d.willChange=function(e){var t=this._chains;if(t)for(var r in t)t.hasOwnProperty(r)&&t[r].willChange(e);this._parent&&this._parent.chainWillChange(this,this._key,1,e)},d.chainWillChange=function(e,t,r,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainWillChange(this,t,r+1,n):(r>1&&n.push(this.value(),t),t="this."+t,this._paths[t]>0&&n.push(this.value(),t))},d.chainDidChange=function(e,t,r,n){this._key&&(t=this._key+"."+t),this._parent?this._parent.chainDidChange(this,t,r+1,n):(r>1&&n.push(this.value(),t),t="this."+t,this._paths[t]>0&&n.push(this.value(),t))},d.didChange=function(e){if(this._watching){var r=this._parent.value();r!==this._object&&(p(this._object,this._key,this),this._object=r,t(r,this._key,this)),this._value=void 0,this._parent&&"@each"===this._parent._key&&this.value()}var n=this._chains;if(n)for(var i in n)n.hasOwnProperty(i)&&n[i].didChange(e);null!==e&&this._parent&&this._parent.chainDidChange(this,this._key,1,e)},Ember.finishChains=function(e){var t=e[h],r=t&&t.chains;r&&(r.value()!==e?n(e).chains=r=r.copy(e):r.didChange(null))}}(),function(){var e=Ember.EnumerableUtils.forEach,t=/^((?:[^\.]*\.)*)\{(.*)\}$/;Ember.expandProperties=function(r,n){var i,o,a;(i=t.exec(r))?(o=i[1],a=i[2],e(a.split(","),function(e){n(o+e)})):n(r)}}(),function(){function e(e,r){var i=r||t(e),o=i.chains;return o?o.value()!==e&&(o=i.chains=o.copy(e)):o=i.chains=new n(null,null,e),o}var t=Ember.meta,r=Ember.typeOf,n=Ember._ChainNode;Ember.watchPath=function(n,i,o){if("length"!==i||"array"!==r(n)){var a=o||t(n),s=a.watching;s[i]?s[i]=(s[i]||0)+1:(s[i]=1,e(n,a).add(i))}},Ember.unwatchPath=function(r,n,i){var o=i||t(r),a=o.watching;1===a[n]?(a[n]=0,e(r,o).remove(n)):a[n]>1&&a[n]--}}(),function(){function e(e){return"*"===e||!c.test(e)}var t=(Ember.meta,Ember.GUID_KEY),r=Ember.META_KEY,n=Ember.removeChainWatcher,i=Ember.watchKey,o=Ember.unwatchKey,a=Ember.watchPath,s=Ember.unwatchPath,u=Ember.typeOf,l=Ember.generateGuid,c=/[\.\*]/;Ember.watch=function(t,r,n){("length"!==r||"array"!==u(t))&&(e(r)?i(t,r,n):a(t,r,n))},Ember.isWatching=function(e,t){var n=e[r];return(n&&n.watching[t])>0},Ember.watch.flushPending=Ember.flushPendingChains,Ember.unwatch=function(t,r,n){("length"!==r||"array"!==u(t))&&(e(r)?o(t,r,n):s(t,r,n))},Ember.rewatch=function(e){var n=e[r],i=n&&n.chains;t in e&&!e.hasOwnProperty(t)&&l(e),i&&i.value()!==e&&(n.chains=i.copy(e))};var h=[];Ember.destroy=function(e){var t,i,o,a,s=e[r];if(s&&(e[r]=null,t=s.chains))for(h.push(t);h.length>0;){if(t=h.pop(),i=t._chains)for(o in i)i.hasOwnProperty(o)&&h.push(i[o]);t._watching&&(a=t._object,a&&n(a,t._key,t))}}}(),function(){function e(e,t){var r=e[t];return r?e.hasOwnProperty(t)||(r=e[t]=h(r)):r=e[t]={},r}function t(t){return e(t,"deps")}function r(r,n,i,o){var a,s,u,l,c,h=r._dependentKeys;if(h)for(a=t(o),s=0,u=h.length;u>s;s++)l=h[s],c=e(a,l),c[i]=(c[i]||0)+1,p(n,l,o)}function n(r,n,i,o){var a,s,u,l,c,h=r._dependentKeys;if(h)for(a=t(o),s=0,u=h.length;u>s;s++)l=h[s],c=e(a,l),c[i]=(c[i]||0)-1,f(n,l,o)}function i(e,t){this.func=e,Ember.FEATURES.isEnabled("composable-computed-properties")?P(this,t&&t.dependentKeys):this._dependentKeys=t&&t.dependentKeys,this._cacheable=t&&void 0!==t.cacheable?t.cacheable:!0,this._readOnly=t&&(void 0!==t.readOnly||!!t.readOnly)}function o(e){for(var t=0,r=e.length;r>t;t++)e[t].didChange(null)}function a(e,t){for(var r={},n=0;n<t.length;n++)r[t[n]]=s(e,t[n]);return r}var s=Ember.get,u=Ember.set,l=Ember.meta,c=[].slice,h=Ember.create,m=Ember.META_KEY,p=Ember.watch,f=Ember.unwatch,d=Ember.expandProperties;Ember.ComputedProperty=i,i.prototype=new Ember.Descriptor;var b=i.prototype;b._dependentKeys=void 0,b._suspended=void 0,b._meta=void 0,Ember.FEATURES.isEnabled("composable-computed-properties")&&(b._dependentCPs=void 0,b.implicitCPKey=void 0,b.toString=function(){return this.implicitCPKey?this.implicitCPKey:Ember.Descriptor.prototype.toString.apply(this,arguments)}),b.cacheable=function(e){return this._cacheable=e!==!1,this},b.volatile=function(){return this.cacheable(!1)},b.readOnly=function(e){return this._readOnly=void 0===e||!!e,this},b.property=function(){var e,t=function(t){e.push(t)};e=[];for(var r=0,n=arguments.length;n>r;r++)d(arguments[r],t);return Ember.FEATURES.isEnabled("composable-computed-properties")?P(this,e):this._dependentKeys=e,this},b.meta=function(e){return 0===arguments.length?this._meta||{}:(this._meta=e,this)},b.didChange=function(e,t){if(this._cacheable&&this._suspended!==e){var r=l(e);t in r.cache&&(delete r.cache[t],n(this,e,t,r))}},b.get=function(e,t){var n,i,a,s;if(this._cacheable){if(a=l(e),i=a.cache,t in i)return i[t];n=i[t]=this.func.call(e,t),s=a.chainWatchers&&a.chainWatchers[t],s&&o(s),r(this,e,t,a)}else n=this.func.call(e,t);return n},b.set=function(e,t,n){var i,o,a,s=this._cacheable,u=this.func,c=l(e,s),h=c.watching[t],m=this._suspended,p=!1,f=c.cache;if(this._readOnly)throw new Ember.Error('Cannot set read-only property "'+t+'" on object: '+Ember.inspect(e));this._suspended=e;try{if(s&&f.hasOwnProperty(t)&&(o=f[t],p=!0),i=u.wrappedFunction?u.wrappedFunction.length:u.length,3===i)a=u.call(e,t,n,o);else{if(2!==i)return Ember.defineProperty(e,t,null,o),Ember.set(e,t,n),void 0;a=u.call(e,t,n)}if(p&&o===a)return;h&&Ember.propertyWillChange(e,t),p&&delete f[t],s&&(p||r(this,e,t,c),f[t]=a),h&&Ember.propertyDidChange(e,t)}finally{this._suspended=m}return a},b.teardown=function(e,t){var r=l(e);return t in r.cache&&n(this,e,t,r),this._cacheable&&delete r.cache[t],null},Ember.computed=function(e){var t;if(arguments.length>1&&(t=c.call(arguments,0,-1),e=c.call(arguments,-1)[0]),"function"!=typeof e)throw new Ember.Error("Computed Property declared without a property function");var r=new i(e);return t&&r.property.apply(r,t),r},Ember.cacheFor=function(e,t){var r=e[m],n=r&&r.cache;return n&&t in n?n[t]:void 0};var v,E;if(Ember.FEATURES.isEnabled("composable-computed-properties")){var g=Ember.guidFor,y=Ember.EnumerableUtils.map,_=Ember.EnumerableUtils.filter,w=(Ember.typeOf,function(e){return[g(e)].concat(e._dependentKeys).join("_").replace(/\./g,"_DOT_")
|
11 |
+
}),C=function(e){return e instanceof Ember.ComputedProperty?w(e):e},O=function(e){return y(e,function(e){return C(e)})},A=function(e){return _(e,function(e){return e instanceof Ember.ComputedProperty})},P=function(e,t){t?(e._dependentKeys=O(t),e._dependentCPs=A(t)):e._dependentKeys=e._dependentCPs=[],e.implicitCPKey=w(e)};Ember.computed.normalizeDependentKey=C,Ember.computed.normalizeDependentKeys=O,v=function(e,t){Ember.computed[e]=function(e){var r=O(c.call(arguments));return Ember.computed(e,function(){return t.apply(this,r)})}}}Ember.FEATURES.isEnabled("composable-computed-properties")?E=function(e,t){Ember.computed[e]=function(){var e=c.call(arguments),r=O(e),n=Ember.computed(function(){return t.apply(this,[a(this,r)])});return n.property.apply(n,e)}}:(v=function(e,t){Ember.computed[e]=function(e){var r=c.call(arguments);return Ember.computed(e,function(){return t.apply(this,r)})}},E=function(e,t){Ember.computed[e]=function(){var e=c.call(arguments),r=Ember.computed(function(){return t.apply(this,[a(this,e)])});return r.property.apply(r,e)}}),Ember.FEATURES.isEnabled("composable-computed-properties")&&(Ember.computed.literal=function(e){return Ember.computed(function(){return e})}),v("empty",function(e){return Ember.isEmpty(s(this,e))}),v("notEmpty",function(e){return!Ember.isEmpty(s(this,e))}),v("none",function(e){return Ember.isNone(s(this,e))}),v("not",function(e){return!s(this,e)}),v("bool",function(e){return!!s(this,e)}),v("match",function(e,t){var r=s(this,e);return"string"==typeof r?t.test(r):!1}),v("equal",function(e,t){return s(this,e)===t}),v("gt",function(e,t){return s(this,e)>t}),v("gte",function(e,t){return s(this,e)>=t}),v("lt",function(e,t){return s(this,e)<t}),v("lte",function(e,t){return s(this,e)<=t}),E("and",function(e){for(var t in e)if(e.hasOwnProperty(t)&&!e[t])return!1;return!0}),E("or",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!0;return!1}),E("any",function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return e[t];return null}),E("collect",function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&(Ember.isNone(e[r])?t.push(null):t.push(e[r]));return t}),Ember.computed.alias=function(e){return Ember.computed(e,function(t,r){return arguments.length>1?(u(this,e,r),r):s(this,e)})},Ember.computed.oneWay=function(e){return Ember.computed(e,function(){return s(this,e)})},Ember.computed.readOnly=function(e){return Ember.computed(e,function(){return s(this,e)}).readOnly()},Ember.computed.defaultTo=function(e){return Ember.computed(function(t,r,n){return 1===arguments.length?null!=n?n:s(this,e):null!=r?r:s(this,e)})}}(),function(){function e(e){return e+r}function t(e){return e+n}var r=":change",n=":before";Ember.addObserver=function(t,r,n,i){return Ember.addListener(t,e(r),n,i),Ember.watch(t,r),this},Ember.observersFor=function(t,r){return Ember.listenersFor(t,e(r))},Ember.removeObserver=function(t,r,n,i){return Ember.unwatch(t,r),Ember.removeListener(t,e(r),n,i),this},Ember.addBeforeObserver=function(e,r,n,i){return Ember.addListener(e,t(r),n,i),Ember.watch(e,r),this},Ember._suspendBeforeObserver=function(e,r,n,i,o){return Ember._suspendListener(e,t(r),n,i,o)},Ember._suspendObserver=function(t,r,n,i,o){return Ember._suspendListener(t,e(r),n,i,o)};var i=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(e,r,n,o,a){var s=i.call(r,t);return Ember._suspendListeners(e,s,n,o,a)},Ember._suspendObservers=function(t,r,n,o,a){var s=i.call(r,e);return Ember._suspendListeners(t,s,n,o,a)},Ember.beforeObserversFor=function(e,r){return Ember.listenersFor(e,t(r))},Ember.removeBeforeObserver=function(e,r,n,i){return Ember.unwatch(e,r),Ember.removeListener(e,t(r),n,i),this}}(),function(){e("backburner/queue",["exports"],function(e){"use strict";function t(e,t,r){this.daq=e,this.name=t,this.options=r,this._queue=[]}t.prototype={daq:null,name:null,options:null,_queue:null,push:function(e,t,r,n){var i=this._queue;return i.push(e,t,r,n),{queue:this,target:e,method:t}},pushUnique:function(e,t,r,n){var i,o,a,s,u=this._queue;for(a=0,s=u.length;s>a;a+=4)if(i=u[a],o=u[a+1],i===e&&o===t)return u[a+2]=r,u[a+3]=n,{queue:this,target:e,method:t};return this._queue.push(e,t,r,n),{queue:this,target:e,method:t}},flush:function(){var e,t,r,n,i,o=this._queue,a=this.options,s=a&&a.before,u=a&&a.after,l=o.length;for(l&&s&&s(),i=0;l>i;i+=4)e=o[i],t=o[i+1],r=o[i+2],n=o[i+3],r&&r.length>0?t.apply(e,r):t.call(e);l&&u&&u(),o.length>l?(this._queue=o.slice(l),this.flush()):this._queue.length=0},cancel:function(e){var t,r,n,i,o=this._queue;for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o.splice(n,4),!0;if(o=this._queueBeingFlushed)for(n=0,i=o.length;i>n;n+=4)if(t=o[n],r=o[n+1],t===e.target&&r===e.method)return o[n+1]=null,!0}},e.Queue=t}),e("backburner/deferred_action_queues",["backburner/queue","exports"],function(e,t){"use strict";function r(e,t){var r=this.queues={};this.queueNames=e=e||[];for(var n,o=0,a=e.length;a>o;o++)n=e[o],r[n]=new i(this,n,t[n])}function n(e,t){for(var r,n,i=0,o=t;o>=i;i++)if(r=e.queueNames[i],n=e.queues[r],n._queue.length)return i;return-1}var i=e.Queue;r.prototype={queueNames:null,queues:null,schedule:function(e,t,r,n,i,o){var a=this.queues,s=a[e];if(!s)throw new Error("You attempted to schedule an action in a queue ("+e+") that doesn't exist");return i?s.pushUnique(t,r,n,o):s.push(t,r,n,o)},flush:function(){for(var e,t,r,i,o=this.queues,a=this.queueNames,s=0,u=a.length;u>s;){e=a[s],t=o[e],r=t._queueBeingFlushed=t._queue.slice(),t._queue=[];var l,c,h,m,p=t.options,f=p&&p.before,d=p&&p.after,b=0,v=r.length;for(v&&f&&f();v>b;)l=r[b],c=r[b+1],h=r[b+2],m=r[b+3],"string"==typeof c&&(c=l[c]),c&&(h&&h.length>0?c.apply(l,h):c.call(l)),b+=4;t._queueBeingFlushed=null,v&&d&&d(),-1===(i=n(this,s))?s++:s=i}}},t.DeferredActionQueues=r}),e("backburner",["backburner/deferred_action_queues","exports"],function(e,t){"use strict";function r(e){return"number"==typeof e||g.test(e)}function n(e,t){this.queueNames=e,this.options=t||{},this.options.defaultQueue||(this.options.defaultQueue=e[0]),this.instanceStack=[]}function i(e){e.begin(),l=E.setTimeout(function(){l=null,e.end()})}function o(e,t,r){(!c||h>t)&&(c&&clearTimeout(c),c=E.setTimeout(function(){c=null,h=null,a(e)},r),h=t)}function a(e){var t,r,n,i,a=+new Date;e.run(function(){for(n=0,i=v.length;i>n&&(t=v[n],!(t>a));n+=2);for(r=v.splice(0,n),n=1,i=r.length;i>n;n+=2)e.schedule(e.options.defaultQueue,null,r[n])}),v.length&&o(e,v[0],v[0]-a)}function s(e,t){for(var r,n=-1,i=0,o=b.length;o>i;i++)if(r=b[i],r[0]===e&&r[1]===t){n=i;break}return n}function u(e,t){for(var r,n=-1,i=0,o=d.length;o>i;i++)if(r=d[i],r[0]===e&&r[1]===t){n=i;break}return n}var l,c,h,m=e.DeferredActionQueues,p=[].slice,f=[].pop,d=[],b=[],v=[],E=this,g=/\d+/;n.prototype={queueNames:null,options:null,currentInstance:null,instanceStack:null,begin:function(){var e=this.options&&this.options.onBegin,t=this.currentInstance;t&&this.instanceStack.push(t),this.currentInstance=new m(this.queueNames,this.options),e&&e(this.currentInstance,t)},end:function(){var e=this.options&&this.options.onEnd,t=this.currentInstance,r=null;try{t.flush()}finally{this.currentInstance=null,this.instanceStack.length&&(r=this.instanceStack.pop(),this.currentInstance=r),e&&e(t,r)}},run:function(e,t){var r;this.begin(),t||(t=e,e=null),"string"==typeof t&&(t=e[t]);var n=!1;try{r=arguments.length>2?t.apply(e,p.call(arguments,2)):t.call(e)}finally{n||(n=!0,this.end())}return r},defer:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var n=this.DEBUG?new Error:void 0,o=arguments.length>3?p.call(arguments,3):void 0;return this.currentInstance||i(this),this.currentInstance.schedule(e,t,r,o,!1,n)},deferOnce:function(e,t,r){r||(r=t,t=null),"string"==typeof r&&(r=t[r]);var n=this.DEBUG?new Error:void 0,o=arguments.length>3?p.call(arguments,3):void 0;return this.currentInstance||i(this),this.currentInstance.schedule(e,t,r,o,!0,n)},setTimeout:function(){function e(){t.apply(i,l)}var t,n,i,a,s,u,l=p.call(arguments),c=l.length,h=this;if(0!==c){if(1===c)t=l.shift(),n=0;else if(2===c)a=l[0],s=l[1],"function"==typeof s||"function"==typeof a[s]?(i=l.shift(),t=l.shift(),n=0):r(s)?(t=l.shift(),n=l.shift()):(t=l.shift(),n=0);else{var m=l[l.length-1];r(m)&&(n=l.pop()),a=l[0],u=l[1],"function"==typeof u||"string"==typeof u&&null!==a&&u in a?(i=l.shift(),t=l.shift()):t=l.shift()}var f=+new Date+parseInt(n,10);"string"==typeof t&&(t=i[t]);var d,b;for(d=0,b=v.length;b>d&&!(f<v[d]);d+=2);return v.splice(d,0,f,e),o(h,f,n),e}},throttle:function(e,t){var r,n,i,o,a=this,s=arguments,l=f.call(s);return"number"==typeof l||"string"==typeof l?(r=l,l=!0):r=f.call(s),r=parseInt(r,10),i=u(e,t),i>-1?d[i]:(o=E.setTimeout(function(){l||a.run.apply(a,s);var r=u(e,t);r>-1&&d.splice(r,1)},r),l&&a.run.apply(a,s),n=[e,t,o],d.push(n),n)},debounce:function(e,t){var r,n,i,o,a=this,u=arguments,l=f.call(u);return"number"==typeof l||"string"==typeof l?(r=l,l=!1):r=f.call(u),r=parseInt(r,10),n=s(e,t),n>-1&&(i=b[n],b.splice(n,1),clearTimeout(i[2])),o=E.setTimeout(function(){l||a.run.apply(a,u);var r=s(e,t);r>-1&&b.splice(r,1)},r),l&&-1===n&&a.run.apply(a,u),i=[e,t,o],b.push(i),i},cancelTimers:function(){var e,t;for(e=0,t=d.length;t>e;e++)clearTimeout(d[e][2]);for(d=[],e=0,t=b.length;t>e;e++)clearTimeout(b[e][2]);b=[],c&&(clearTimeout(c),c=null),v=[],l&&(clearTimeout(l),l=null)},hasTimers:function(){return!!v.length||l},cancel:function(e){var t=typeof e;if(e&&"object"===t&&e.queue&&e.method)return e.queue.cancel(e);if("function"!==t)return"[object Array]"===Object.prototype.toString.call(e)?this._cancelItem(u,d,e)||this._cancelItem(s,b,e):void 0;for(var r=0,n=v.length;n>r;r+=2)if(v[r+1]===e)return v.splice(r,2),!0},_cancelItem:function(e,t,r){var n,i;return r.length<3?!1:(i=e(r[0],r[1]),i>-1&&(n=t[i],n[2]===r[2])?(t.splice(i,1),clearTimeout(r[2]),!0):!1)}},n.prototype.schedule=n.prototype.defer,n.prototype.scheduleOnce=n.prototype.deferOnce,n.prototype.later=n.prototype.setTimeout,t.Backburner=n})}(),function(){function e(e){try{return a.run.apply(a,e)}catch(t){Ember.onerror(t)}}function r(){!Ember.run.currentRunLoop}{var n=function(e){Ember.run.currentRunLoop=e},i=function(e,t){Ember.run.currentRunLoop=t},o=t("backburner").Backburner,a=new o(["sync","actions","destroy"],{sync:{before:Ember.beginPropertyChanges,after:Ember.endPropertyChanges},defaultQueue:"actions",onBegin:n,onEnd:i}),s=[].slice;[].concat}Ember.run=function(){return Ember.onerror?e(arguments):a.run.apply(a,arguments)},Ember.run.join=function(){if(!Ember.run.currentRunLoop)return Ember.run.apply(Ember.run,arguments);var e=s.call(arguments);e.unshift("actions"),Ember.run.schedule.apply(Ember.run,e)},Ember.run.bind=function(){var e=s.call(arguments);return function(){return Ember.run.join.apply(Ember.run,e.concat(s.call(arguments)))}},Ember.run.backburner=a;Ember.run;Ember.run.currentRunLoop=null,Ember.run.queues=a.queueNames,Ember.run.begin=function(){a.begin()},Ember.run.end=function(){a.end()},Ember.run.schedule=function(){r(),a.schedule.apply(a,arguments)},Ember.run.hasScheduledTimers=function(){return a.hasTimers()},Ember.run.cancelTimers=function(){a.cancelTimers()},Ember.run.sync=function(){a.currentInstance&&a.currentInstance.queues.sync.flush()},Ember.run.later=function(){return a.later.apply(a,arguments)},Ember.run.once=function(){r();var e=s.call(arguments);return e.unshift("actions"),a.scheduleOnce.apply(a,e)},Ember.run.scheduleOnce=function(){return r(),a.scheduleOnce.apply(a,arguments)},Ember.run.next=function(){var e=s.call(arguments);return e.push(1),a.later.apply(a,e)},Ember.run.cancel=function(e){return a.cancel(e)},Ember.run.debounce=function(){return a.debounce.apply(a,arguments)},Ember.run.throttle=function(){return a.throttle.apply(a,arguments)}}(),function(){function e(e,t){return r(o(t)?Ember.lookup:e,t)}function t(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}Ember.LOG_BINDINGS=!1||!!Ember.ENV.LOG_BINDINGS;var r=Ember.get,n=(Ember.set,Ember.guidFor),i=/^([A-Z$]|([0-9][A-Z$]))/,o=Ember.isGlobalPath=function(e){return i.test(e)},a=function(e,t){this._direction="fwd",this._from=t,this._to=e,this._directionMap=Ember.Map.create()};a.prototype={copy:function(){var e=new a(this._to,this._from);return this._oneWay&&(e._oneWay=!0),e},from:function(e){return this._from=e,this},to:function(e){return this._to=e,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var e=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+n(this)+">("+this._from+" -> "+this._to+")"+e},connect:function(t){var r=this._from,n=this._to;return Ember.trySet(t,n,e(t,r)),Ember.addObserver(t,r,this,this.fromDidChange),this._oneWay||Ember.addObserver(t,n,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(e){var t=!this._oneWay;return Ember.removeObserver(e,this._from,this,this.fromDidChange),t&&Ember.removeObserver(e,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(e){this._scheduleSync(e,"fwd")},toDidChange:function(e){this._scheduleSync(e,"back")},_scheduleSync:function(e,t){var r=this._directionMap,n=r.get(e);n||(Ember.run.schedule("sync",this,this._sync,e),r.set(e,t)),"back"===n&&"fwd"===t&&r.set(e,"fwd")},_sync:function(t){var n=Ember.LOG_BINDINGS;if(!t.isDestroyed&&this._readyToSync){var i=this._directionMap,o=i.get(t),a=this._from,s=this._to;if(i.remove(t),"fwd"===o){var u=e(t,this._from);n&&Ember.Logger.log(" ",this.toString(),"->",u,t),this._oneWay?Ember.trySet(t,s,u):Ember._suspendObserver(t,s,this,this.toDidChange,function(){Ember.trySet(t,s,u)})}else if("back"===o){var l=r(t,this._to);n&&Ember.Logger.log(" ",this.toString(),"<-",l,t),Ember._suspendObserver(t,a,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(a)?Ember.lookup:t,a,l)})}}}},t(a,{from:function(){var e=this,t=new e;return t.from.apply(t,arguments)},to:function(){var e=this,t=new e;return t.to.apply(t,arguments)},oneWay:function(e,t){var r=this,n=new r(null,e);return n.oneWay(t)}}),Ember.Binding=a,Ember.bind=function(e,t,r){return new Ember.Binding(t,r).connect(e)},Ember.oneWay=function(e,t,r){return new Ember.Binding(t,r).oneWay().connect(e)}}(),function(){function e(){var e,t=this.__nextSuper;return t&&(this.__nextSuper=null,e=t.apply(this,arguments),this.__nextSuper=t),e}function t(e){var t=N(e,!0),r=t.mixins;return r?t.hasOwnProperty("mixins")||(r=t.mixins=x(r)):r=t.mixins={},r}function r(e,t){return t&&t.length>0&&(e.mixins=O.call(t,function(e){if(e instanceof _)return e;var t=new _;return t.properties=e,t})),e}function n(e){return"function"==typeof e&&e.isMethod!==!1&&e!==Boolean&&e!==Object&&e!==Number&&e!==Array&&e!==Date&&e!==String}function i(e,t){var r;return t instanceof _?(r=V(t),e[r]?D:(e[r]=t,t.properties)):t}function o(e,t,r,n){var i;return i=r[e]||n[e],t[e]&&(i=i?i.concat(t[e]):t[e]),i}function a(e,t,r,n,i){var o;return void 0===n[t]&&(o=i[t]),o=o||e.descs[t],o&&o instanceof Ember.ComputedProperty?(r=x(r),r.func=Ember.wrap(r.func,o.func),r):r}function s(e,t,r,n,i){var o;return void 0===i[t]&&(o=n[t]),o=o||e[t],"function"!=typeof o?r:Ember.wrap(r,o)}function u(e,t,r,n){var i=n[t]||e[t];return i?"function"==typeof i.concat?i.concat(r):Ember.makeArray(i).concat(r):Ember.makeArray(r)}function l(t,r,i,o){var a=o[r]||t[r];if(!a)return i;var u=Ember.merge({},a),l=!1;for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];n(h)?(l=!0,u[c]=s(t,c,h,a,{})):u[c]=h}return l&&(u._super=e),u}function c(e,t,r,i,o,c,h,m){if(r instanceof Ember.Descriptor){if(r===w&&o[t])return D;r.func&&(r=a(i,t,r,c,o)),o[t]=r,c[t]=void 0}else h&&A.call(h,t)>=0||"concatenatedProperties"===t||"mergedProperties"===t?r=u(e,t,r,c):m&&A.call(m,t)>=0?r=l(e,t,r,c):n(r)&&(r=s(e,t,r,c,o)),o[t]=void 0,c[t]=r}function h(e,t,r,n,a,s){function u(e){delete r[e],delete n[e]}for(var l,m,p,f,d,b,v=0,E=e.length;E>v;v++)if(l=e[v],m=i(t,l),m!==D)if(m){b=N(a),a.willMergeMixin&&a.willMergeMixin(m),f=o("concatenatedProperties",m,n,a),d=o("mergedProperties",m,n,a);for(p in m)m.hasOwnProperty(p)&&(s.push(p),c(a,p,m[p],b,r,n,f,d));m.hasOwnProperty("toString")&&(a.toString=m.toString)}else l.mixins&&(h(l.mixins,t,r,n,a,s),l._without&&P.call(l._without,u))}function m(e,t,r,n){if(j.test(t)){var i=n.bindings;i?n.hasOwnProperty("bindings")||(i=n.bindings=x(n.bindings)):i=n.bindings={},i[t]=r}}function p(e,t){var r,n,i,o=t.bindings;if(o){for(r in o)n=o[r],n&&(i=r.slice(0,-7),n instanceof Ember.Binding?(n=n.copy(),n.to(i)):n=new Ember.Binding(i,n),n.connect(e),e[r]=n);t.bindings={}}}function f(e,t){return p(e,t||N(e)),e}function d(e,t,r,n,i){var o,a=t.methodName;return n[a]||i[a]?(o=i[a],t=n[a]):r.descs[a]?(t=r.descs[a],o=void 0):(t=void 0,o=e[a]),{desc:t,value:o}}function b(e,t,r,n,i){var o=r[n];if(o)for(var a=0,s=o.length;s>a;a++)Ember[i](e,o[a],null,t)}function v(e,t,r){var n=e[t];"function"==typeof n&&(b(e,t,n,"__ember_observesBefore__","removeBeforeObserver"),b(e,t,n,"__ember_observes__","removeObserver"),b(e,t,n,"__ember_listens__","removeListener")),"function"==typeof r&&(b(e,t,r,"__ember_observesBefore__","addBeforeObserver"),b(e,t,r,"__ember_observes__","addObserver"),b(e,t,r,"__ember_listens__","addListener"))}function E(r,n,i){var o,a,s,u={},l={},c=N(r),p=[];r._super=e,h(n,t(r),u,l,r,p);for(var b=0,E=p.length;E>b;b++)if(o=p[b],"constructor"!==o&&l.hasOwnProperty(o)&&(s=u[o],a=l[o],s!==w)){for(;s&&s instanceof C;){var g=d(r,s,c,u,l);s=g.desc,a=g.value}(void 0!==s||void 0!==a)&&(v(r,o,a),m(r,o,a,c),S(r,o,s,a,c))}return i||f(r,c),r}function g(e,t,r){var n=V(e);if(r[n])return!1;if(r[n]=!0,e===t)return!0;for(var i=e.mixins,o=i?i.length:0;--o>=0;)if(g(i[o],t,r))return!0;return!1}function y(e,t,r){if(!r[V(t)])if(r[V(t)]=!0,t.properties){var n=t.properties;for(var i in n)n.hasOwnProperty(i)&&(e[i]=!0)}else t.mixins&&P.call(t.mixins,function(t){y(e,t,r)})}var _,w,C,O=Ember.ArrayPolyfills.map,A=Ember.ArrayPolyfills.indexOf,P=Ember.ArrayPolyfills.forEach,T=[].slice,x=Ember.create,S=Ember.defineProperty,V=Ember.guidFor,N=Ember.meta,I=Ember.META_KEY,R=Ember.expandProperties,D={},j=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(e){var t=T.call(arguments,1);return E(e,t,!1),e},Ember.Mixin=function(){return r(this,arguments)},_=Ember.Mixin,_.prototype={properties:null,mixins:null,ownerConstructor:null},_._apply=E,_.applyPartial=function(e){var t=T.call(arguments,1);return E(e,t,!0)},_.finishPartial=f,Ember.anyUnprocessedMixins=!1,_.create=function(){Ember.anyUnprocessedMixins=!0;var e=this;return r(new e,arguments)};var M=_.prototype;M.reopen=function(){var e,t;this.properties?(e=_.create(),e.properties=this.properties,delete this.properties,this.mixins=[e]):this.mixins||(this.mixins=[]);var r,n=arguments.length,i=this.mixins;for(r=0;n>r;r++)e=arguments[r],e instanceof _?i.push(e):(t=_.create(),t.properties=e,i.push(t));return this},M.apply=function(e){return E(e,[this],!1)},M.applyPartial=function(e){return E(e,[this],!0)},M.detect=function(e){if(!e)return!1;if(e instanceof _)return g(e,this,{});var t=e[I],r=t&&t.mixins;return r?!!r[V(this)]:!1},M.without=function(){var e=new _(this);return e._without=T.call(arguments),e},M.keys=function(){var e={},t={},r=[];y(e,this,t);for(var n in e)e.hasOwnProperty(n)&&r.push(n);return r},_.mixins=function(e){var t=e[I],r=t&&t.mixins,n=[];if(!r)return n;for(var i in r){var o=r[i];o.properties||n.push(o)}return n},w=new Ember.Descriptor,w.toString=function(){return"(Required Property)"},Ember.required=function(){return w},C=function(e){this.methodName=e},C.prototype=new Ember.Descriptor,Ember.aliasMethod=function(e){return new C(e)},Ember.observer=function(){var e,t=T.call(arguments,-1)[0],r=function(t){e.push(t)},n=T.call(arguments,0,-1);"function"!=typeof t&&(t=arguments[0],n=T.call(arguments,1)),e=[];for(var i=0;i<n.length;++i)R(n[i],r);if("function"!=typeof t)throw new Ember.Error("Ember.observer called without a function");return t.__ember_observes__=e,t},Ember.immediateObserver=function(){for(var e=0,t=arguments.length;t>e;e++){arguments[e]}return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(){var e,t=T.call(arguments,-1)[0],r=function(t){e.push(t)},n=T.call(arguments,0,-1);"function"!=typeof t&&(t=arguments[0],n=T.call(arguments,1)),e=[];for(var i=0;i<n.length;++i)R(n[i],r);if("function"!=typeof t)throw new Ember.Error("Ember.beforeObserver called without a function");return t.__ember_observesBefore__=e,t}}(),function(){var e=Ember.EnumerableUtils.forEach,t=Ember.EnumerableUtils.indexOf;Ember.libraries=function(){var r=[],n=0,i=function(e){for(var t=0;t<r.length;t++)if(r[t].name===e)return r[t]};return r.register=function(e,t){i(e)||r.push({name:e,version:t})},r.registerCoreLibrary=function(e,t){i(e)||r.splice(n++,0,{name:e,version:t})},r.deRegister=function(e){var n=i(e);n&&r.splice(t(r,n),1)},r.each=function(t){e(r,function(e){t(e.name,e.version)})},r}(),Ember.libraries.registerCoreLibrary("Ember",Ember.VERSION)}(),function(){e("rsvp/all",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.all(e,t)}}),e("rsvp/all_settled",["./promise","./utils","exports"],function(e,t,r){"use strict";function n(e){return{state:"fulfilled",value:e}}function i(e){return{state:"rejected",reason:e}}var o=e["default"],a=t.isArray,s=t.isNonThenable;r["default"]=function(e,t){return new o(function(t){function r(e){return function(t){l(e,n(t))}}function u(e){return function(t){l(e,i(t))}}function l(e,r){m[e]=r,0===--h&&t(m)}if(!a(e))throw new TypeError("You must pass an array to allSettled.");var c,h=e.length;if(0===h)return t([]),void 0;for(var m=new Array(h),p=0;p<e.length;p++)c=e[p],s(c)?l(p,n(c)):o.cast(c).then(r(p),u(p))},t)}}),e("rsvp/config",["./events","exports"],function(e,t){"use strict";function r(e,t){return"onerror"===e?(i.on("error",t),void 0):2!==arguments.length?i[e]:(i[e]=t,void 0)}var n=e["default"],i={instrument:!1};n.mixin(i),t.config=i,t.configure=r}),e("rsvp/defer",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e){var t={};return t.promise=new r(function(e,r){t.resolve=e,t.reject=r},e),t}}),e("rsvp/events",["exports"],function(e){"use strict";var t=function(e,t){for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1},r=function(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t};e["default"]={mixin:function(e){return e.on=this.on,e.off=this.off,e.trigger=this.trigger,e._promiseCallbacks=void 0,e},on:function(e,n){var i,o=r(this);i=o[e],i||(i=o[e]=[]),-1===t(i,n)&&i.push(n)},off:function(e,n){var i,o,a=r(this);return n?(i=a[e],o=t(i,n),-1!==o&&i.splice(o,1),void 0):(a[e]=[],void 0)},trigger:function(e,t){var n,i,o=r(this);if(n=o[e])for(var a=0;a<n.length;a++)(i=n[a])(t)}}}),e("rsvp/filter",["./all","./map","./utils","exports"],function(e,t,r,n){"use strict";function i(e,t,r){return o(e,r).then(function(n){if(!u(e))throw new TypeError("You must pass an array to filter.");if(!s(t))throw new TypeError("You must pass a function to filter's second argument.");return a(e,t,r).then(function(e){var t,r=n.length,i=[];for(t=0;r>t;t++)e[t]&&i.push(n[t]);return i})})}var o=e["default"],a=t["default"],s=r.isFunction,u=r.isArray;n["default"]=i}),e("rsvp/hash",["./promise","./utils","exports"],function(e,t,r){"use strict";var n=e["default"],i=t.isNonThenable,o=t.keysOf;r["default"]=function(e){return new n(function(t,r){function a(e){return function(r){c[e]=r,0===--m&&t(c)}}function s(e){m=0,r(e)}var u,l,c={},h=o(e),m=h.length;if(0===m)return t(c),void 0;for(var p=0;p<h.length;p++)l=h[p],u=e[l],i(u)?(c[l]=u,0===--m&&t(c)):n.cast(u).then(a(l),s)})}}),e("rsvp/instrument",["./config","./utils","exports"],function(e,t,r){"use strict";var n=e.config,i=t.now;r["default"]=function(e,t,r){try{n.trigger(e,{guid:t._guidKey+t._id,eventName:e,detail:t._detail,childGuid:r&&t._guidKey+r._id,label:t._label,timeStamp:i(),stack:new Error(t._label).stack})}catch(o){setTimeout(function(){throw o},0)}}}),e("rsvp/map",["./promise","./all","./utils","exports"],function(e,t,r,n){"use strict";var i=(e["default"],t["default"]),o=r.isArray,a=r.isFunction;n["default"]=function(e,t,r){return i(e,r).then(function(n){if(!o(e))throw new TypeError("You must pass an array to map.");if(!a(t))throw new TypeError("You must pass a function to map's second argument.");var s,u=n.length,l=[];for(s=0;u>s;s++)l.push(t(n[s]));return i(l,r)})}}),e("rsvp/node",["./promise","exports"],function(e,t){"use strict";function r(e,t){return function(r,n){r?t(r):arguments.length>2?e(i.call(arguments,1)):e(n)}}var n=e["default"],i=Array.prototype.slice;t["default"]=function(e,t){return function(){var o=i.call(arguments),a=this||t;return new n(function(t,i){n.all(o).then(function(n){try{n.push(r(t,i)),e.apply(a,n)}catch(o){i(o)}})})}}}),e("rsvp/promise",["./config","./events","./instrument","./utils","./promise/cast","./promise/all","./promise/race","./promise/resolve","./promise/reject","exports"],function(e,t,r,n,i,o,a,s,u,l){"use strict";function c(){}function h(e,t){if(!A(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof h))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._id=R++,this._label=t,this._subscribers=[],w.instrument&&C("created",this),c!==e&&m(e,this)}function m(e,t){function r(e){v(t,e)}function n(e){g(t,e)}try{e(r,n)}catch(i){n(i)}}function p(e,t,r,n){var i=e._subscribers,o=i.length;i[o]=t,i[o+M]=r,i[o+k]=n}function f(e,t){var r,n,i=e._subscribers,o=e._detail;w.instrument&&C(t===M?"fulfilled":"rejected",e);for(var a=0;a<i.length;a+=3)r=i[a],n=i[a+t],d(t,r,n,o);e._subscribers=null}function d(e,t,r,n){var i,o,a,s,u=A(r);if(u)try{i=r(n),a=!0}catch(l){s=!0,o=l}else i=n,a=!0;b(t,i)||(u&&a?v(t,i):s?g(t,o):e===M?v(t,i):e===k&&g(t,i))}function b(e,t){var r,n=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(O(t)&&(n=t.then,A(n)))return n.call(t,function(n){return r?!0:(r=!0,t!==n?v(e,n):E(e,n),void 0)},function(t){return r?!0:(r=!0,g(e,t),void 0)},"derived from: "+(e._label||" unknown promise")),!0}catch(i){return r?!0:(g(e,i),!0)}return!1}function v(e,t){e===t?E(e,t):b(e,t)||E(e,t)}function E(e,t){e._state===D&&(e._state=j,e._detail=t,w.async(y,e))}function g(e,t){e._state===D&&(e._state=j,e._detail=t,w.async(_,e))}function y(e){f(e,e._state=M)}function _(e){e._onerror&&e._onerror(e._detail),f(e,e._state=k)}var w=e.config,C=(t["default"],r["default"]),O=n.objectOrFunction,A=n.isFunction,P=n.now,T=i["default"],x=o["default"],S=a["default"],V=s["default"],N=u["default"],I="rsvp_"+P()+"-",R=0;l["default"]=h,h.cast=T,h.all=x,h.race=S,h.resolve=V,h.reject=N;var D=void 0,j=0,M=1,k=2;h.prototype={constructor:h,_id:void 0,_guidKey:I,_label:void 0,_state:void 0,_detail:void 0,_subscribers:void 0,_onerror:function(e){w.trigger("error",e)},then:function(e,t,r){var n=this;this._onerror=null;var i=new this.constructor(c,r);if(this._state){var o=arguments;w.async(function(){d(n._state,i,o[n._state-1],n._detail)})}else p(this,i,e,t);return w.instrument&&C("chained",n,i),i},"catch":function(e,t){return this.then(null,e,t)},"finally":function(e,t){var r=this.constructor;return this.then(function(t){return r.cast(e()).then(function(){return t})},function(t){return r.cast(e()).then(function(){throw t})},t)}}}),e("rsvp/promise/all",["../utils","exports"],function(e,t){"use strict";var r=e.isArray,n=e.isNonThenable;t["default"]=function(e,t){var i=this;return new i(function(t,o){function a(e){return function(r){c[e]=r,0===--l&&t(c)}}function s(e){l=0,o(e)}if(!r(e))throw new TypeError("You must pass an array to all.");var u,l=e.length,c=new Array(l);if(0===l)return t(c),void 0;for(var h=0;h<e.length;h++)u=e[h],n(u)?(c[h]=u,0===--l&&t(c)):i.cast(u).then(a(h),s)},t)}}),e("rsvp/promise/cast",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)},t)}}),e("rsvp/promise/race",["../utils","exports"],function(e,t){"use strict";var r=e.isArray,n=(e.isFunction,e.isNonThenable);t["default"]=function(e,t){var i,o=this;return new o(function(t,a){function s(e){l&&(l=!1,t(e))}function u(e){l&&(l=!1,a(e))}if(!r(e))throw new TypeError("You must pass an array to race.");for(var l=!0,c=0;c<e.length;c++){if(i=e[c],n(i))return l=!1,t(i),void 0;o.cast(i).then(s,u)}},t)}}),e("rsvp/promise/reject",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return new r(function(t,r){r(e)},t)}}),e("rsvp/promise/resolve",["exports"],function(e){"use strict";e["default"]=function(e,t){var r=this;return new r(function(t){t(e)},t)}}),e("rsvp/race",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.race(e,t)}}),e("rsvp/reject",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.reject(e,t)}}),e("rsvp/resolve",["./promise","exports"],function(e,t){"use strict";var r=e["default"];t["default"]=function(e,t){return r.resolve(e,t)}}),e("rsvp/rethrow",["exports"],function(e){"use strict";e["default"]=function(e){throw setTimeout(function(){throw e}),e}}),e("rsvp/utils",["exports"],function(e){"use strict";function t(e){return"function"==typeof e||"object"==typeof e&&null!==e}function r(e){return"function"==typeof e}function n(e){return!t(e)}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}e.objectOrFunction=t,e.isFunction=r,e.isNonThenable=n,e.isArray=i;var o=Date.now||function(){return(new Date).getTime()};e.now=o;var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.keysOf=a}),e("rsvp",["./rsvp/promise","./rsvp/events","./rsvp/node","./rsvp/all","./rsvp/all_settled","./rsvp/race","./rsvp/hash","./rsvp/rethrow","./rsvp/defer","./rsvp/config","./rsvp/map","./rsvp/resolve","./rsvp/reject","./rsvp/filter","exports"],function(e,t,r,n,i,o,a,s,u,l,c,h,m,p,f){"use strict";function d(e,t){T.async(e,t)}function b(){T.on.apply(T,arguments)}function v(){T.off.apply(T,arguments)}var E=e["default"],g=t["default"],y=r["default"],_=n["default"],w=i["default"],C=o["default"],O=a["default"],A=s["default"],P=u["default"],T=l.config,x=l.configure,S=c["default"],V=h["default"],N=m["default"],I=p["default"];if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var R=window.__PROMISE_INSTRUMENTATION__;x("instrument",!0);for(var D in R)R.hasOwnProperty(D)&&b(D,R[D])}f.Promise=E,f.EventTarget=g,f.all=_,f.allSettled=w,f.race=C,f.hash=O,f.rethrow=A,f.defer=P,f.denodeify=y,f.configure=x,f.on=b,f.off=v,f.resolve=V,f.reject=N,f.async=d,f.map=S,f.filter=I})}(),function(){e("container/container",["container/inheriting_dict","exports"],function(e,t){"use strict";function r(e){this.parent=e,this.children=[],this.resolver=e&&e.resolver||function(){},this.registry=new E(e&&e.registry),this.cache=new E(e&&e.cache),this.factoryCache=new E(e&&e.factoryCache),this.resolveCache=new E(e&&e.resolveCache),this.typeInjections=new E(e&&e.typeInjections),this.injections={},this.factoryTypeInjections=new E(e&&e.factoryTypeInjections),this.factoryInjections={},this._options=new E(e&&e._options),this._typeOptions=new E(e&&e._typeOptions)}function n(e,t){return e.cache.has(t)?!0:!!e.resolve(t)}function i(e,t,r){if(r=r||{},e.cache.has(t)&&r.singleton!==!1)return e.cache.get(t);var n=m(e,t);return void 0!==n?(a(e,t)&&r.singleton!==!1&&e.cache.set(t,n),n):void 0}function o(e){throw new Error(e+" is not currently supported on child containers")}function a(e,t){var r=u(e,t,"singleton");return r!==!1}function s(e,t){var r={};if(!t)return r;for(var n,o,a=0,s=t.length;s>a;a++){if(n=t[a],o=i(e,n.fullName),void 0===o)throw new Error("Attempting to inject an unknown injection: `"+n.fullName+"`");r[n.property]=o}return r}function u(e,t,r){var n=e._options.get(t);if(n&&void 0!==n[r])return n[r];var i=t.split(":")[0];return n=e._typeOptions.get(i),n?n[r]:void 0}function l(e,t){var r,n=t,i=e.resolve(n),o=e.factoryCache,a=t.split(":")[0];if(void 0!==i){if(o.has(t))return o.get(t);if(!i||"function"!=typeof i.extend||!Ember.MODEL_FACTORY_INJECTIONS&&"model"===a)return i;var s=c(e,t),u=h(e,t);return u._toString=e.makeToString(i,t),r=i.extend(s),r.reopenClass(u),o.set(t,r),r}}function c(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.typeInjections.get(n)||[]),i=i.concat(e.injections[t]||[]),i=s(e,i),i._debugContainerKey=t,i.container=e,i}function h(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.factoryTypeInjections.get(n)||[]),i=i.concat(e.factoryInjections[t]||[]),i=s(e,i),i._debugContainerKey=t,i}function m(e,t){var r=l(e,t);return u(e,t,"instantiate")===!1?r:r?"function"==typeof r.extend?r.create():r.create(c(e,t)):void 0}function p(e,t){e.cache.eachLocal(function(r,n){u(e,r,"instantiate")!==!1&&t(n)
|
12 |
})}function f(e){e.cache.eachLocal(function(t,r){u(e,t,"instantiate")!==!1&&r.destroy()}),e.cache.dict={}}function d(e,t,r,n){var i=e.get(t);i||(i=[],e.set(t,i)),i.push({property:r,fullName:n})}function b(e){if(!g.test(e))throw new TypeError("Invalid Fullname, expected: `type:name` got: "+e)}function v(e,t,r,n){var i=e[t]=e[t]||[];i.push({property:r,fullName:n})}var E=e["default"];r.prototype={parent:null,children:null,resolver:null,registry:null,cache:null,typeInjections:null,injections:null,_options:null,_typeOptions:null,child:function(){var e=new r(this);return this.children.push(e),e},set:function(e,t,r){e[t]=r},register:function(e,t,r){if(b(e),void 0===t)throw new TypeError("Attempting to register an unknown factory: `"+e+"`");var n=this.normalize(e);if(this.cache.has(n))throw new Error("Cannot re-register: `"+e+"`, as it has already been looked up.");this.registry.set(n,t),this._options.set(n,r||{})},unregister:function(e){b(e);var t=this.normalize(e);this.registry.remove(t),this.cache.remove(t),this.factoryCache.remove(t),this.resolveCache.remove(t),this._options.remove(t)},resolve:function(e){b(e);var t=this.normalize(e),r=this.resolveCache.get(t);if(r)return r;var n=this.resolver(t)||this.registry.get(t);return this.resolveCache.set(t,n),n},describe:function(e){return e},normalize:function(e){return e},makeToString:function(e){return e.toString()},lookup:function(e,t){return b(e),i(this,this.normalize(e),t)},lookupFactory:function(e){return b(e),l(this,this.normalize(e))},has:function(e){return b(e),n(this,this.normalize(e))},optionsForType:function(e,t){this.parent&&o("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){b(r),this.parent&&o("typeInjection"),d(this.typeInjections,e,t,r)},injection:function(e,t,r){this.parent&&o("injection"),b(r);var n=this.normalize(r);if(-1===e.indexOf(":"))return this.typeInjection(e,t,n);b(e);var i=this.normalize(e);v(this.injections,i,t,n)},factoryTypeInjection:function(e,t,r){this.parent&&o("factoryTypeInjection"),d(this.factoryTypeInjections,e,t,this.normalize(r))},factoryInjection:function(e,t,r){this.parent&&o("injection");var n=this.normalize(e),i=this.normalize(r);return b(r),-1===e.indexOf(":")?this.factoryTypeInjection(n,t,i):(b(e),v(this.factoryInjections,n,t,i),void 0)},destroy:function(){for(var e=0,t=this.children.length;t>e;e++)this.children[e].destroy();this.children=[],p(this,function(e){e.destroy()}),this.parent=void 0,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;t>e;e++)f(this.children[e]);f(this)}};var g=/^[^:]+.+:[^:]+$/;t["default"]=r}),e("container/inheriting_dict",["exports"],function(e){"use strict";function t(e){this.parent=e,this.dict={}}t.prototype={parent:null,dict:null,get:function(e){var t=this.dict;return t.hasOwnProperty(e)?t[e]:this.parent?this.parent.get(e):void 0},set:function(e,t){this.dict[e]=t},remove:function(e){delete this.dict[e]},has:function(e){var t=this.dict;return t.hasOwnProperty(e)?!0:this.parent?this.parent.has(e):!1},eachLocal:function(e,t){var r=this.dict;for(var n in r)r.hasOwnProperty(n)&&e.call(t,n,r[n])}},e["default"]=t}),e("container",["container/container","exports"],function(e,t){"use strict";Ember.MODEL_FACTORY_INJECTIONS=!1||!!Ember.ENV.MODEL_FACTORY_INJECTIONS;var r=e["default"];t["default"]=r})}(),function(){function e(r,n,i,o){var a,s,u;if("object"!=typeof r||null===r)return r;if(n&&(s=t(i,r))>=0)return o[s];if("array"===Ember.typeOf(r)){if(a=r.slice(),n)for(s=a.length;--s>=0;)a[s]=e(a[s],n,i,o)}else if(Ember.Copyable&&Ember.Copyable.detect(r))a=r.copy(n,i,o);else if(r instanceof Date)a=new Date(r.getTime());else{a={};for(u in r)r.hasOwnProperty(u)&&"__"!==u.substring(0,2)&&(a[u]=n?e(r[u],n,i,o):r[u])}return n&&(i.push(r),o.push(a)),a}var t=Ember.EnumerableUtils.indexOf;if(Ember.compare=function i(e,t){if(e===t)return 0;var r=Ember.typeOf(e),n=Ember.typeOf(t),o=Ember.Comparable;if(o){if("instance"===r&&o.detect(e.constructor))return e.constructor.compare(e,t);if("instance"===n&&o.detect(t.constructor))return 1-t.constructor.compare(t,e)}var a=Ember.ORDER_DEFINITION_MAPPING;if(!a){var s=Ember.ORDER_DEFINITION;a=Ember.ORDER_DEFINITION_MAPPING={};var u,l;for(u=0,l=s.length;l>u;++u)a[s[u]]=u;delete Ember.ORDER_DEFINITION}var c=a[r],h=a[n];if(h>c)return-1;if(c>h)return 1;switch(r){case"boolean":case"number":return t>e?-1:e>t?1:0;case"string":var m=e.localeCompare(t);return 0>m?-1:m>0?1:0;case"array":for(var p=e.length,f=t.length,d=Math.min(p,f),b=0,v=0;0===b&&d>v;)b=i(e[v],t[v]),v++;return 0!==b?b:f>p?-1:p>f?1:0;case"instance":return Ember.Comparable&&Ember.Comparable.detect(e)?e.compare(e,t):0;case"date":var E=e.getTime(),g=t.getTime();return g>E?-1:E>g?1:0;default:return 0}},Ember.copy=function(t,r){return"object"!=typeof t||null===t?t:Ember.Copyable&&Ember.Copyable.detect(t)?t.copy(r):e(t,r,r?[]:null,r?[]:null)},Ember.isEqual=function(e,t){return e&&"function"==typeof e.isEqual?e.isEqual(t):e===t},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,!Ember.keys||Ember.create.isSimulated){var r=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","toString"],n=function(e,r,n){"__"!==n.substring(0,2)&&"_super"!==n&&(t(r,n)>=0||e.hasOwnProperty(n)&&r.push(n))};Ember.keys=function(e){var t,i=[];for(t in e)n(e,i,t);for(var o=0,a=r.length;a>o;o++)t=r[o],n(e,i,t);return i}}}(),function(){var e=/[ _]/g,t={},r=/([a-z\d])([A-Z])/g,n=/(\-|_|\.|\s)+(.)?/g,i=/([a-z\d])([A-Z]+)/g,o=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(e,t){var r=0;return e.replace(/%@([0-9]+)?/g,function(e,n){return n=n?parseInt(n,10)-1:r++,e=t[n],null===e?"(null)":void 0===e?"":Ember.inspect(e)})},loc:function(e,t){return e=Ember.STRINGS[e]||e,Ember.String.fmt(e,t)},w:function(e){return e.split(/\s+/)},decamelize:function(e){return e.replace(r,"$1_$2").toLowerCase()},dasherize:function(r){var n,i=t,o=i.hasOwnProperty(r);return o?i[r]:(n=Ember.String.decamelize(r).replace(e,"-"),i[r]=n,n)},camelize:function(e){return e.replace(n,function(e,t,r){return r?r.toUpperCase():""}).replace(/^([A-Z])/,function(e){return e.toLowerCase()})},classify:function(e){for(var t=e.split("."),r=[],n=0,i=t.length;i>n;n++){var o=Ember.String.camelize(t[n]);r.push(o.charAt(0).toUpperCase()+o.substr(1))}return r.join(".")},underscore:function(e){return e.replace(i,"$1_$2").replace(o,"_").toLowerCase()},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1)}}}(),function(){var e=Ember.String.fmt,t=Ember.String.w,r=Ember.String.loc,n=Ember.String.camelize,i=Ember.String.decamelize,o=Ember.String.dasherize,a=Ember.String.underscore,s=Ember.String.capitalize,u=Ember.String.classify;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.fmt=function(){return e(this,arguments)},String.prototype.w=function(){return t(this)},String.prototype.loc=function(){return r(this,arguments)},String.prototype.camelize=function(){return n(this)},String.prototype.decamelize=function(){return i(this)},String.prototype.dasherize=function(){return o(this)},String.prototype.underscore=function(){return a(this)},String.prototype.classify=function(){return u(this)},String.prototype.capitalize=function(){return s(this)})}(),function(){var e=Ember.get,t=Ember.set,r=Array.prototype.slice,n=Ember.getProperties;Ember.Observable=Ember.Mixin.create({get:function(t){return e(this,t)},getProperties:function(){return n.apply(null,[this].concat(r.call(arguments)))},set:function(e,r){return t(this,e,r),this},setProperties:function(e){return Ember.setProperties(this,e)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(e){return Ember.propertyWillChange(this,e),this},propertyDidChange:function(e){return Ember.propertyDidChange(this,e),this},notifyPropertyChange:function(e){return this.propertyWillChange(e),this.propertyDidChange(e),this},addBeforeObserver:function(e,t,r){Ember.addBeforeObserver(this,e,t,r)},addObserver:function(e,t,r){Ember.addObserver(this,e,t,r)},removeObserver:function(e,t,r){Ember.removeObserver(this,e,t,r)},hasObserverFor:function(e){return Ember.hasListeners(this,e+":change")},getWithDefault:function(e,t){return Ember.getWithDefault(this,e,t)},incrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)+n),e(this,r)},decrementProperty:function(r,n){return Ember.isNone(n)&&(n=1),t(this,r,(e(this,r)||0)-n),e(this,r)},toggleProperty:function(r){return t(this,r,!e(this,r)),e(this,r)},cacheFor:function(e){return Ember.cacheFor(this,e)},observersForKey:function(e){return Ember.observersFor(this,e)}})}(),function(){function e(){var e,t,o=!1,a=function(){o||a.proto(),n(this,i,_),n(this,"__nextSuper",y);var u=s(this),l=u.proto;if(u.proto=this,e){var m=e;e=null,this.reopen.apply(this,m)}if(t){var p=t;t=null;for(var f=this.concatenatedProperties,d=0,v=p.length;v>d;d++){var w=p[d];if("object"!=typeof w&&void 0!==w)throw new Ember.Error("Ember.Object.create only accepts objects.");if(w)for(var C=Ember.keys(w),O=0,A=C.length;A>O;O++){var P=C[O];if(w.hasOwnProperty(P)){var T=w[P],x=Ember.IS_BINDING;if(x.test(P)){var S=u.bindings;S?u.hasOwnProperty("bindings")||(S=u.bindings=r(u.bindings)):S=u.bindings={},S[P]=T}var V=u.descs[P];if(f&&g(f,P)>=0){var N=this[P];T=N?"function"==typeof N.concat?N.concat(T):Ember.makeArray(N).concat(T):Ember.makeArray(T)}V?V.set(this,P,T):"function"!=typeof this.setUnknownProperty||P in this?E?Ember.defineProperty(this,P,null,T):this[P]=T:this.setUnknownProperty(P,T)}}}}b(this,u),this.init.apply(this,arguments),u.proto=l,c(this),h(this,"init")};return a.toString=f.prototype.toString,a.willReopen=function(){o&&(a.PrototypeMixin=f.create(a.PrototypeMixin)),o=!1},a._initMixins=function(t){e=t},a._initProperties=function(e){t=e},a.proto=function(){var e=a.superclass;return e&&e.proto(),o||(o=!0,a.PrototypeMixin.applyPartial(a.prototype),l(a.prototype)),this.prototype},a}function t(e){return function(){return e}}var r=(Ember.set,Ember.get,Ember.create),n=Ember.platform.defineProperty,i=Ember.GUID_KEY,o=Ember.guidFor,a=Ember.generateGuid,s=Ember.meta,u=Ember.META_KEY,l=Ember.rewatch,c=Ember.finishChains,h=Ember.sendEvent,m=Ember.destroy,p=Ember.run.schedule,f=Ember.Mixin,d=f._apply,b=f.finishPartial,v=f.prototype.reopen,E=Ember.ENV.MANDATORY_SETTER,g=Ember.EnumerableUtils.indexOf,y={configurable:!0,writable:!0,enumerable:!1,value:void 0},_={configurable:!0,writable:!0,enumerable:!1,value:null},w=e();w.toString=function(){return"Ember.CoreObject"},w.PrototypeMixin=f.create({reopen:function(){return d(this,arguments,!0),this},init:function(){},concatenatedProperties:null,isDestroyed:!1,isDestroying:!1,destroy:function(){return this.isDestroying?void 0:(this.isDestroying=!0,p("actions",this,this.willDestroy),p("destroy",this,this._scheduledDestroy),this)},willDestroy:Ember.K,_scheduledDestroy:function(){this.isDestroyed||(m(this),this.isDestroyed=!0)},bind:function(e,t){return t instanceof Ember.Binding||(t=Ember.Binding.from(t)),t.to(e).connect(this),t},toString:function(){var e="function"==typeof this.toStringExtension,r=e?":"+this.toStringExtension():"",n="<"+this.constructor.toString()+":"+o(this)+r+">";return this.toString=t(n),n}}),w.PrototypeMixin.ownerConstructor=w,Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(w.PrototypeMixin),w.__super__=null;var C=f.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var t,n=e();return n.ClassMixin=f.create(this.ClassMixin),n.PrototypeMixin=f.create(this.PrototypeMixin),n.ClassMixin.ownerConstructor=n,n.PrototypeMixin.ownerConstructor=n,v.apply(n.PrototypeMixin,arguments),n.superclass=this,n.__super__=this.prototype,t=n.prototype=r(this.prototype),t.constructor=n,a(t),s(t).proto=t,n.ClassMixin.apply(n),n},createWithMixins:function(){var e=this;return arguments.length>0&&this._initMixins(arguments),new e},create:function(){var e=this;return arguments.length>0&&this._initProperties(arguments),new e},reopen:function(){return this.willReopen(),v.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return v.apply(this.ClassMixin,arguments),d(this,arguments,!1),this},detect:function(e){if("function"!=typeof e)return!1;for(;e;){if(e===this)return!0;e=e.superclass}return!1},detectInstance:function(e){return e instanceof this},metaForProperty:function(e){var t=this.proto()[u],r=t&&t.descs[e];return r._meta||{}},eachComputedProperty:function(e,t){var r,n=this.proto(),i=s(n).descs,o={};for(var a in i)r=i[a],r instanceof Ember.ComputedProperty&&e.call(t||this,a,r._meta||o)}});C.ownerConstructor=w,Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(C),w.ClassMixin=C,C.apply(w),Ember.CoreObject=w}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable),Ember.Object.toString=function(){return"Ember.Object"}}(),function(){function e(t,r,i){var a=t.length;l[t.join(".")]=r;for(var s in r)if(c.call(r,s)){var u=r[s];if(t[a]=s,u&&u.toString===n)u.toString=o(t.join(".")),u[m]=t.join(".");else if(u&&u.isNamespace){if(i[h(u)])continue;i[h(u)]=!0,e(t,u,i)}}t.length=a}function t(){var e,t,r=Ember.Namespace,n=Ember.lookup;if(!r.PROCESSED)for(var i in n)if("parent"!==i&&"top"!==i&&"frameElement"!==i&&"webkitStorageInfo"!==i&&!("globalStorage"===i&&n.StorageList&&n.globalStorage instanceof n.StorageList||n.hasOwnProperty&&!n.hasOwnProperty(i))){try{e=Ember.lookup[i],t=e&&e.isNamespace}catch(o){continue}t&&(e[m]=i)}}function r(e){var t=e.superclass;return t?t[m]?t[m]:r(t):void 0}function n(){Ember.BOOTED||this[m]||i();var e;if(this[m])e=this[m];else if(this._toString)e=this._toString;else{var t=r(this);e=t?"(subclass of "+t+")":"(unknown mixin)",this.toString=o(e)}return e}function i(){var r=!u.PROCESSED,n=Ember.anyUnprocessedMixins;if(r&&(t(),u.PROCESSED=!0),r||n){for(var i,o=u.NAMESPACES,a=0,s=o.length;s>a;a++)i=o[a],e([i.toString()],i,{});Ember.anyUnprocessedMixins=!1}}function o(e){return function(){return e}}var a=Ember.get,s=Ember.ArrayPolyfills.indexOf,u=Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){var e=a(this,"name");return e?e:(t(),this[Ember.GUID_KEY+"_name"])},nameClasses:function(){e([this.toString()],this,{})},destroy:function(){var e=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=void 0,delete Ember.Namespace.NAMESPACES_BY_ID[this.toString()],e.splice(s.call(e,this),1),this._super()}});u.reopenClass({NAMESPACES:[Ember],NAMESPACES_BY_ID:{},PROCESSED:!1,processAll:i,byName:function(e){return Ember.BOOTED||i(),l[e]}});var l=u.NAMESPACES_BY_ID,c={}.hasOwnProperty,h=Ember.guidFor,m=Ember.NAME_KEY=Ember.GUID_KEY+"_name";Ember.Mixin.prototype.toString=n}(),function(){function e(e,t){var r=t.slice(8);r in this||u(this,r)}function t(e,t){var r=t.slice(8);r in this||l(this,r)}var r=Ember.get,n=Ember.set,i=(Ember.String.fmt,Ember.addBeforeObserver),o=Ember.addObserver,a=Ember.removeBeforeObserver,s=Ember.removeObserver,u=Ember.propertyWillChange,l=Ember.propertyDidChange,c=Ember.meta,h=Ember.defineProperty;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer("content",function(){}),isTruthy:Ember.computed.bool("content"),_debugContainerKey:null,willWatchProperty:function(r){var n="content."+r;i(this,n,null,e),o(this,n,null,t)},didUnwatchProperty:function(r){var n="content."+r;a(this,n,null,e),s(this,n,null,t)},unknownProperty:function(e){var t=r(this,"content");return t?r(t,e):void 0},setUnknownProperty:function(e,t){var i=c(this);if(i.proto===this)return h(this,e,null,t),t;var o=r(this,"content");return n(o,e,t)}})}(),function(){function e(){return 0===s.length?{}:s.pop()}function t(e){return s.push(e),null}function r(e,t){function r(r){var o=n(r,e);return i?t===o:!!o}var i=2===arguments.length;return r}var n=Ember.get,i=Ember.set,o=Array.prototype.slice,a=Ember.EnumerableUtils.indexOf,s=[];Ember.Enumerable=Ember.Mixin.create({nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(0===n(this,"length"))return void 0;var r,i=e();return r=this.nextObject(0,null,i),t(i),r}).property("[]"),lastObject:Ember.computed(function(){var r=n(this,"length");if(0===r)return void 0;var i,o=e(),a=0,s=null;do s=i,i=this.nextObject(a++,s,o);while(void 0!==i);return t(o),s}).property("[]"),contains:function(e){return void 0!==this.find(function(t){return t===e})},forEach:function(r,i){if("function"!=typeof r)throw new TypeError;var o=n(this,"length"),a=null,s=e();void 0===i&&(i=null);for(var u=0;o>u;u++){var l=this.nextObject(u,a,s);r.call(i,l,u,this),a=l}return a=null,s=t(s),this},getEach:function(e){return this.mapBy(e)},setEach:function(e,t){return this.forEach(function(r){i(r,e,t)})},map:function(e,t){var r=Ember.A();return this.forEach(function(n,i,o){r[i]=e.call(t,n,i,o)}),r},mapBy:function(e){return this.map(function(t){return n(t,e)})},mapProperty:Ember.aliasMethod("mapBy"),filter:function(e,t){var r=Ember.A();return this.forEach(function(n,i,o){e.call(t,n,i,o)&&r.push(n)}),r},reject:function(e,t){return this.filter(function(){return!e.apply(t,arguments)})},filterBy:function(){return this.filter(r.apply(this,arguments))},filterProperty:Ember.aliasMethod("filterBy"),rejectBy:function(e,t){var r=function(r){return n(r,e)===t},i=function(t){return!!n(t,e)},o=2===arguments.length?r:i;return this.reject(o)},rejectProperty:Ember.aliasMethod("rejectBy"),find:function(r,i){var o=n(this,"length");void 0===i&&(i=null);for(var a,s,u=null,l=!1,c=e(),h=0;o>h&&!l;h++)a=this.nextObject(h,u,c),(l=r.call(i,a,h,this))&&(s=a),u=a;return a=u=null,c=t(c),s},findBy:function(){return this.find(r.apply(this,arguments))},findProperty:Ember.aliasMethod("findBy"),every:function(e,t){return!this.find(function(r,n,i){return!e.call(t,r,n,i)})},everyBy:Ember.aliasMethod("isEvery"),everyProperty:Ember.aliasMethod("isEvery"),isEvery:function(){return this.every(r.apply(this,arguments))},any:function(r,i){var o,a,s=n(this,"length"),u=e(),l=!1,c=null;for(void 0===i&&(i=null),a=0;s>a&&!l;a++)o=this.nextObject(a,c,u),l=r.call(i,o,a,this),c=o;return o=c=null,u=t(u),l},some:Ember.aliasMethod("any"),isAny:function(){return this.any(r.apply(this,arguments))},anyBy:Ember.aliasMethod("isAny"),someProperty:Ember.aliasMethod("isAny"),reduce:function(e,t,r){if("function"!=typeof e)throw new TypeError;var n=t;return this.forEach(function(t,i){n=e(n,t,i,this,r)},this),n},invoke:function(e){var t,r=Ember.A();return arguments.length>1&&(t=o.call(arguments,1)),this.forEach(function(n,i){var o=n&&n[e];"function"==typeof o&&(r[i]=t?o.apply(n,t):n[e]())},this),r},toArray:function(){var e=Ember.A();return this.forEach(function(t,r){e[r]=t}),e},compact:function(){return this.filter(function(e){return null!=e})},without:function(e){if(!this.contains(e))return this;var t=Ember.A();return this.forEach(function(r){r!==e&&(t[t.length]=r)}),t},uniq:function(){var e=Ember.A();return this.forEach(function(t){a(e,t)<0&&e.push(t)}),e},"[]":Ember.computed(function(){return this}),addEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",e,r),Ember.addListener(this,"@enumerable:change",e,i),o||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(e,t){var r=t&&t.willChange||"enumerableWillChange",i=t&&t.didChange||"enumerableDidChange",o=n(this,"hasEnumerableObservers");return o&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",e,r),Ember.removeListener(this,"@enumerable:change",e,i),o&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}),enumerableContentWillChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||i-r!==0,-1===e&&(e=null),-1===t&&(t=null),Ember.propertyWillChange(this,"[]"),o&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,e,t]),this},enumerableContentDidChange:function(e,t){var r,i,o;return r="number"==typeof e?e:e?n(e,"length"):e=-1,i="number"==typeof t?t:t?n(t,"length"):t=-1,o=0>i||0>r||i-r!==0,-1===e&&(e=null),-1===t&&(t=null),Ember.sendEvent(this,"@enumerable:change",[this,e,t]),o&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this},sortBy:function(){var e=arguments;return this.toArray().sort(function(t,r){for(var i=0;i<e.length;i++){var o=e[i],a=n(t,o),s=n(r,o),u=Ember.compare(a,s);if(u)return u}return 0})}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.isNone),r=Ember.EnumerableUtils.map,n=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{length:Ember.required(),objectAt:function(t){return 0>t||t>=e(this,"length")?void 0:e(this,t)},objectsAt:function(e){var t=this;return r(e,function(e){return t.objectAt(e)})},nextObject:function(e){return this.objectAt(e)},"[]":Ember.computed(function(t,r){return void 0!==r&&this.replace(0,e(this,"length"),r),this}),firstObject:Ember.computed(function(){return this.objectAt(0)}),lastObject:Ember.computed(function(){return this.objectAt(e(this,"length")-1)}),contains:function(e){return this.indexOf(e)>=0},slice:function(r,n){var i=Ember.A(),o=e(this,"length");for(t(r)&&(r=0),(t(n)||n>o)&&(n=o),0>r&&(r=o+r),0>n&&(n=o+n);n>r;)i[i.length]=this.objectAt(r++);return i},indexOf:function(t,r){var n,i=e(this,"length");for(void 0===r&&(r=0),0>r&&(r+=i),n=r;i>n;n++)if(this.objectAt(n)===t)return n;return-1},lastIndexOf:function(t,r){var n,i=e(this,"length");for((void 0===r||r>=i)&&(r=i-1),0>r&&(r+=i),n=r;n>=0;n--)if(this.objectAt(n)===t)return n;return-1},addArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",t,n),Ember.addListener(this,"@array:change",t,i),o||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(t,r){var n=r&&r.willChange||"arrayWillChange",i=r&&r.didChange||"arrayDidChange",o=e(this,"hasArrayObservers");return o&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",t,n),Ember.removeListener(this,"@array:change",t,i),o&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}),arrayContentWillChange:function(t,r,n){void 0===t?(t=0,r=n=-1):(void 0===r&&(r=-1),void 0===n&&(n=-1)),Ember.isWatching(this,"@each")&&e(this,"@each"),Ember.sendEvent(this,"@array:before",[this,t,r,n]);var i,o;if(t>=0&&r>=0&&e(this,"hasEnumerableObservers")){i=[],o=t+r;for(var a=t;o>a;a++)i.push(this.objectAt(a))}else i=r;return this.enumerableContentWillChange(i,n),this},arrayContentDidChange:function(t,r,i){void 0===t?(t=0,r=i=-1):(void 0===r&&(r=-1),void 0===i&&(i=-1));var o,a;if(t>=0&&i>=0&&e(this,"hasEnumerableObservers")){o=[],a=t+i;for(var s=t;a>s;s++)o.push(this.objectAt(s))}else o=i;this.enumerableContentDidChange(r,o),Ember.sendEvent(this,"@array:change",[this,t,r,i]);var u=e(this,"length"),l=n(this,"firstObject"),c=n(this,"lastObject");return this.objectAt(0)!==l&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(u-1)!==c&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each})})}(),function(){function e(e,t){return"@this"===t?e:m(e,t)}function t(e,t,r){this.callbacks=e,this.cp=t,this.instanceMeta=r,this.dependentKeysByGuid={},this.trackedArraysByGuid={},this.suspended=!1,this.changedItems={}}function r(e,t,r){this.dependentArray=e,this.index=t,this.item=e.objectAt(t),this.trackedArray=r,this.beforeObserver=null,this.observer=null,this.destroyed=!1}function n(e,t,r){return 0>e?Math.max(0,t+e):t>e?e:Math.min(t-r,e)}function i(e,t,r){return Math.min(r,t-e)}function o(e,t,r,n,i,o){var a={arrayChanged:e,index:r,item:t,propertyName:n,property:i};return o&&(a.previousValues=o),a}function a(e,t,r,n,i){O(e,function(a,s){i.setValue(t.addedItem.call(this,i.getValue(),a,o(e,a,s,n,r),i.sugarMeta))},this)}function s(e,t){{var r;e._callbacks()}e._hasInstanceMeta(this,t)?(r=e._instanceMeta(this,t),r.setValue(e.resetValue(r.getValue()))):r=e._instanceMeta(this,t),e.options.initialize&&e.options.initialize.call(this,r.getValue(),{property:e,propertyName:t},r.sugarMeta)}function u(t,r){if(T.test(r))return!1;var n=e(t,r);return Ember.Array.detect(n)}function l(e,t,r){this.context=e,this.propertyName=t,this.cache=f(e).cache,this.dependentArrays={},this.sugarMeta={},this.initialValue=r}function c(t){var r=this;this.options=t,this._dependentKeys=null,this._itemPropertyKeys={},this._previousItemPropertyKeys={},this.readOnly(),this.cacheable(),this.recomputeOnce=function(e){Ember.run.once(this,n,e)};var n=function(t){var n=(r._dependentKeys,r._instanceMeta(this,t)),i=r._callbacks();s.call(this,r,t),n.dependentArraysObserver.suspendArrayObservers(function(){O(r._dependentKeys,function(t){if(u(this,t)){var i=e(this,t),o=n.dependentArrays[t];i===o?r._previousItemPropertyKeys[t]&&(delete r._previousItemPropertyKeys[t],n.dependentArraysObserver.setupPropertyObservers(t,r._itemPropertyKeys[t])):(n.dependentArrays[t]=i,o&&n.dependentArraysObserver.teardownObservers(o,t),i&&n.dependentArraysObserver.setupObservers(i,t))}},this)},this),O(r._dependentKeys,function(o){if(u(this,o)){var s=e(this,o);s&&a.call(this,s,i,r,t,n)}},this)};this.func=function(e){return n.call(this,e),r._instanceMeta(this,e).getValue()}}function h(e){return e}var m=Ember.get,p=(Ember.set,Ember.guidFor),f=Ember.meta,d=Ember.propertyWillChange,b=Ember.propertyDidChange,v=Ember.addBeforeObserver,E=Ember.removeBeforeObserver,g=Ember.addObserver,y=Ember.removeObserver,_=Ember.ComputedProperty,w=[].slice,C=Ember.create,O=Ember.EnumerableUtils.forEach,A=(Ember.cacheFor.set,Ember.cacheFor.get,Ember.cacheFor.remove,/^(.*)\.@each\.(.*)/),P=/(.*\.@each){2,}/,T=/\.\[\]$/,x=Ember.expandProperties;t.prototype={setValue:function(e){this.instanceMeta.setValue(e,!0)},getValue:function(){return this.instanceMeta.getValue()},setupObservers:function(e,t){this.dependentKeysByGuid[p(e)]=t,e.addArrayObserver(this,{willChange:"dependentArrayWillChange",didChange:"dependentArrayDidChange"}),this.cp._itemPropertyKeys[t]&&this.setupPropertyObservers(t,this.cp._itemPropertyKeys[t])},teardownObservers:function(e,t){var r=this.cp._itemPropertyKeys[t]||[];delete this.dependentKeysByGuid[p(e)],this.teardownPropertyObservers(t,r),e.removeArrayObserver(this,{willChange:"dependentArrayWillChange",didChange:"dependentArrayDidChange"})},suspendArrayObservers:function(e,t){var r=this.suspended;this.suspended=!0,e.call(t),this.suspended=r},setupPropertyObservers:function(t,r){var n=e(this.instanceMeta.context,t),i=e(n,"length"),o=new Array(i);this.resetTransformations(t,o),O(n,function(e,i){var a=this.createPropertyObserverContext(n,i,this.trackedArraysByGuid[t]);o[i]=a,O(r,function(t){v(e,t,this,a.beforeObserver),g(e,t,this,a.observer)},this)},this)},teardownPropertyObservers:function(e,t){var r,n,i,o=this,a=this.trackedArraysByGuid[e];a&&a.apply(function(e,a,s){s!==Ember.TrackedArray.DELETE&&O(e,function(e){e.destroyed=!0,r=e.beforeObserver,n=e.observer,i=e.item,O(t,function(e){E(i,e,o,r),y(i,e,o,n)})})})},createPropertyObserverContext:function(e,t,n){var i=new r(e,t,n);return this.createPropertyObserver(i),i},createPropertyObserver:function(e){var t=this;e.beforeObserver=function(r,n){return t.itemPropertyWillChange(r,n,e.dependentArray,e)},e.observer=function(r,n){return t.itemPropertyDidChange(r,n,e.dependentArray,e)}},resetTransformations:function(e,t){this.trackedArraysByGuid[e]=new Ember.TrackedArray(t)},trackAdd:function(e,t,r){var n=this.trackedArraysByGuid[e];n&&n.addItems(t,r)},trackRemove:function(e,t,r){var n=this.trackedArraysByGuid[e];return n?n.removeItems(t,r):[]},updateIndexes:function(t,r){var n=e(r,"length");t.apply(function(e,t,r){r!==Ember.TrackedArray.DELETE&&(r!==Ember.TrackedArray.RETAIN||e.length!==n||0!==t)&&O(e,function(e,r){e.index=r+t})})},dependentArrayWillChange:function(t,r,a){function s(e){m[h].destroyed=!0,E(l,e,this,m[h].beforeObserver),y(l,e,this,m[h].observer)}if(!this.suspended){var u,l,c,h,m,f=this.callbacks.removedItem,d=p(t),b=this.dependentKeysByGuid[d],v=this.cp._itemPropertyKeys[b]||[],g=e(t,"length"),_=n(r,g,0),w=i(_,g,a);for(m=this.trackRemove(b,_,w),h=w-1;h>=0&&(c=_+h,!(c>=g));--h)l=t.objectAt(c),O(v,s,this),u=o(t,l,c,this.instanceMeta.propertyName,this.cp),this.setValue(f.call(this.instanceMeta.context,this.getValue(),l,u,this.instanceMeta.sugarMeta))}},dependentArrayDidChange:function(t,r,i,a){if(!this.suspended){var s,u,l=this.callbacks.addedItem,c=p(t),h=this.dependentKeysByGuid[c],m=new Array(a),f=this.cp._itemPropertyKeys[h],d=e(t,"length"),b=n(r,d,a);O(t.slice(b,b+a),function(e,r){f&&(u=m[r]=this.createPropertyObserverContext(t,b+r,this.trackedArraysByGuid[h]),O(f,function(t){v(e,t,this,u.beforeObserver),g(e,t,this,u.observer)},this)),s=o(t,e,b+r,this.instanceMeta.propertyName,this.cp),this.setValue(l.call(this.instanceMeta.context,this.getValue(),e,s,this.instanceMeta.sugarMeta))},this),this.trackAdd(h,b,m)}},itemPropertyWillChange:function(t,r,n,i){var o=p(t);this.changedItems[o]||(this.changedItems[o]={array:n,observerContext:i,obj:t,previousValues:{}}),this.changedItems[o].previousValues[r]=e(t,r)},itemPropertyDidChange:function(){this.flushChanges()},flushChanges:function(){var e,t,r,n=this.changedItems;for(e in n)t=n[e],t.observerContext.destroyed||(this.updateIndexes(t.observerContext.trackedArray,t.observerContext.dependentArray),r=o(t.array,t.obj,t.observerContext.index,this.instanceMeta.propertyName,this.cp,t.previousValues),this.setValue(this.callbacks.removedItem.call(this.instanceMeta.context,this.getValue(),t.obj,r,this.instanceMeta.sugarMeta)),this.setValue(this.callbacks.addedItem.call(this.instanceMeta.context,this.getValue(),t.obj,r,this.instanceMeta.sugarMeta)));this.changedItems={}}},l.prototype={getValue:function(){return this.propertyName in this.cache?this.cache[this.propertyName]:this.initialValue},setValue:function(e,t){e!==this.cache[this.propertyName]&&(t&&d(this.context,this.propertyName),void 0===e?delete this.cache[this.propertyName]:this.cache[this.propertyName]=e,t&&b(this.context,this.propertyName))}},Ember.ReduceComputedProperty=c,c.prototype=C(_.prototype),c.prototype._callbacks=function(){if(!this.callbacks){var e=this.options;this.callbacks={removedItem:e.removedItem||h,addedItem:e.addedItem||h}}return this.callbacks},c.prototype._hasInstanceMeta=function(e,t){return!!f(e).cacheMeta[t]},c.prototype._instanceMeta=function(e,r){var n=f(e).cacheMeta,i=n[r];return i||(i=n[r]=new l(e,r,this.initialValue()),i.dependentArraysObserver=new t(this._callbacks(),this,i,e,r,i.sugarMeta)),i},c.prototype.initialValue=function(){return"function"==typeof this.options.initialValue?this.options.initialValue():this.options.initialValue},c.prototype.resetValue=function(){return this.initialValue()},c.prototype.itemPropertyKey=function(e,t){this._itemPropertyKeys[e]=this._itemPropertyKeys[e]||[],this._itemPropertyKeys[e].push(t)},c.prototype.clearItemPropertyKeys=function(e){this._itemPropertyKeys[e]&&(this._previousItemPropertyKeys[e]=this._itemPropertyKeys[e],this._itemPropertyKeys[e]=[])},c.prototype.property=function(){var e,t,r=this,n=w.call(arguments),i=new Ember.Set;return O(n,function(n){if(P.test(n))throw new Ember.Error("Nested @each properties not supported: "+n);if(e=A.exec(n)){t=e[1];var o=e[2],a=function(e){r.itemPropertyKey(t,e)};x(o,a),i.add(t)}else i.add(n)}),_.prototype.property.apply(this,i.toArray())},Ember.reduceComputed=function(e){var t;if(arguments.length>1&&(t=w.call(arguments,0,-1),e=w.call(arguments,-1)[0]),"object"!=typeof e)throw new Ember.Error("Reduce Computed Property declared without an options hash");if(!("initialValue"in e))throw new Ember.Error("Reduce Computed Property declared without an initial value");var r=new c(e);return t&&r.property.apply(r,t),r}}(),function(){function e(){var e=this;
|
13 |
return t.apply(this,arguments),this.func=function(t){return function(r){return e._hasInstanceMeta(this,r)||i(e._dependentKeys,function(t){Ember.addObserver(this,t,function(){e.recomputeOnce.call(this,r)})},this),t.apply(this,arguments)}}(this.func),this}var t=Ember.ReduceComputedProperty,r=[].slice,n=Ember.create,i=Ember.EnumerableUtils.forEach;Ember.ArrayComputedProperty=e,e.prototype=n(t.prototype),e.prototype.initialValue=function(){return Ember.A()},e.prototype.resetValue=function(e){return e.clear(),e},e.prototype.didChange=function(){},Ember.arrayComputed=function(t){var n;if(arguments.length>1&&(n=r.call(arguments,0,-1),t=r.call(arguments,-1)[0]),"object"!=typeof t)throw new Ember.Error("Array Computed Property declared without an options hash");var i=new e(t);return n&&i.property.apply(i,n),i}}(),function(){function e(e,i,o,a){function s(e){return t.detectInstance(e)?n(r(e,"content")):n(e)}var u,l,c,h,m;return arguments.length<4&&(a=r(e,"length")),arguments.length<3&&(o=0),o===a?o:(u=o+Math.floor((a-o)/2),l=e.objectAt(u),h=s(l),m=s(i),h===m?u:(c=this.order(l,i),0===c&&(c=m>h?-1:1),0>c?this.binarySearch(e,i,u+1,a):c>0?this.binarySearch(e,i,o,u):u))}var t,r=Ember.get,n=(Ember.set,Ember.guidFor),i=Ember.merge,o=[].slice,a=Ember.EnumerableUtils.forEach,s=Ember.EnumerableUtils.map;Ember.computed.sum=function(e){return Ember.reduceComputed(e,{initialValue:0,addedItem:function(e,t){return e+t},removedItem:function(e,t){return e-t}})},Ember.computed.max=function(e){return Ember.reduceComputed(e,{initialValue:-1/0,addedItem:function(e,t){return Math.max(e,t)},removedItem:function(e,t){return e>t?e:void 0}})},Ember.computed.min=function(e){return Ember.reduceComputed(e,{initialValue:1/0,addedItem:function(e,t){return Math.min(e,t)},removedItem:function(e,t){return t>e?e:void 0}})},Ember.computed.map=function(e,t){var r={addedItem:function(e,r,n){var i=t.call(this,r);return e.insertAt(n.index,i),e},removedItem:function(e,t,r){return e.removeAt(r.index,1),e}};return Ember.arrayComputed(e,r)},Ember.computed.mapBy=function(e,t){var n=function(e){return r(e,t)};return Ember.computed.map(e+".@each."+t,n)},Ember.computed.mapProperty=Ember.computed.mapBy,Ember.computed.filter=function(e,t){var r={initialize:function(e,t,r){r.filteredArrayIndexes=new Ember.SubArray},addedItem:function(e,r,n,i){var o=!!t.call(this,r),a=i.filteredArrayIndexes.addItem(n.index,o);return o&&e.insertAt(a,r),e},removedItem:function(e,t,r,n){var i=n.filteredArrayIndexes.removeItem(r.index);return i>-1&&e.removeAt(i),e}};return Ember.arrayComputed(e,r)},Ember.computed.filterBy=function(e,t,n){var i;return i=2===arguments.length?function(e){return r(e,t)}:function(e){return r(e,t)===n},Ember.computed.filter(e+".@each."+t,i)},Ember.computed.filterProperty=Ember.computed.filterBy,Ember.computed.uniq=function(){var e=o.call(arguments);return e.push({initialize:function(e,t,r){r.itemCounts={}},addedItem:function(e,t,r,i){var o=n(t);return i.itemCounts[o]?++i.itemCounts[o]:i.itemCounts[o]=1,e.addObject(t),e},removedItem:function(e,t,r,i){var o=n(t),a=i.itemCounts;return 0===--a[o]&&e.removeObject(t),e}}),Ember.arrayComputed.apply(null,e)},Ember.computed.union=Ember.computed.uniq,Ember.computed.intersect=function(){var e=function(e){return s(e.property._dependentKeys,function(e){return n(e)})},t=o.call(arguments);return t.push({initialize:function(e,t,r){r.itemCounts={}},addedItem:function(t,r,i,o){var a=n(r),s=(e(i),n(i.arrayChanged)),u=i.property._dependentKeys.length,l=o.itemCounts;return l[a]||(l[a]={}),void 0===l[a][s]&&(l[a][s]=0),1===++l[a][s]&&u===Ember.keys(l[a]).length&&t.addObject(r),t},removedItem:function(t,r,i,o){var a,s=n(r),u=(e(i),n(i.arrayChanged)),l=(i.property._dependentKeys.length,o.itemCounts);return void 0===l[s][u]&&(l[s][u]=0),0===--l[s][u]&&(delete l[s][u],a=Ember.keys(l[s]).length,0===a&&delete l[s],t.removeObject(r)),t}}),Ember.arrayComputed.apply(null,t)},Ember.computed.setDiff=function(e,t){if(2!==arguments.length)throw new Ember.Error("setDiff requires exactly two dependent arrays.");return Ember.arrayComputed(e,t,{addedItem:function(n,i,o){var a=r(this,e),s=r(this,t);return o.arrayChanged===a?s.contains(i)||n.addObject(i):n.removeObject(i),n},removedItem:function(n,i,o){var a=r(this,e),s=r(this,t);return o.arrayChanged===s?a.contains(i)&&n.addObject(i):n.removeObject(i),n}})},t=Ember.ObjectProxy.extend(),Ember.computed.sort=function(n,o){var s,u;return"function"==typeof o?s=function(t,r,n){n.order=o,n.binarySearch=e}:(u=o,s=function(i,o,s){function l(){var e,t,i,l=r(this,u),h=s.sortProperties=[],m=s.sortPropertyAscending={};o.property.clearItemPropertyKeys(n),a(l,function(r){-1!==(t=r.indexOf(":"))?(e=r.substring(0,t),i="desc"!==r.substring(t+1).toLowerCase()):(e=r,i=!0),h.push(e),m[e]=i,o.property.itemPropertyKey(n,e)}),l.addObserver("@each",this,c)}function c(){Ember.run.once(this,h,o.propertyName)}function h(e){l.call(this),o.property.recomputeOnce.call(this,e)}Ember.addObserver(this,u,c),l.call(this),s.order=function(e,n){for(var i,o,a,s=n instanceof t,u=0;u<this.sortProperties.length;++u)if(i=this.sortProperties[u],o=Ember.compare(r(e,i),s?n[i]:r(n,i)),0!==o)return a=this.sortPropertyAscending[i],a?o:-1*o;return 0},s.binarySearch=e}),Ember.arrayComputed(n,{initialize:s,addedItem:function(e,t,r,n){var i=n.binarySearch(e,t);return e.insertAt(i,t),e},removedItem:function(e,r,n,o){var a,s,u;return n.previousValues?(a=i({content:r},n.previousValues),u=t.create(a)):u=r,s=o.binarySearch(e,u),e.removeAt(s),e}})}}(),function(){Ember.RSVP=t("rsvp"),Ember.RSVP.onerrorDefault=function(e){if(e instanceof Error)if(Ember.testing){if(!Ember.Test||!Ember.Test.adapter)throw e;Ember.Test.adapter.exception(e)}else Ember.Logger.error(e.stack)},Ember.RSVP.on("error",Ember.RSVP.onerrorDefault)}(),function(){var e=Array.prototype.slice,t=Ember.expandProperties;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)&&(Function.prototype.property=function(){var e=Ember.computed(this);return e.property.apply(e,arguments)},Function.prototype.observes=function(){for(var e=function(e){r.push(e)},r=[],n=0;n<arguments.length;++n)t(arguments[n],e);return this.__ember_observes__=r,this},Function.prototype.observesImmediately=function(){for(var e=0,t=arguments.length;t>e;e++){arguments[e]}return this.observes.apply(this,arguments)},Function.prototype.observesBefore=function(){for(var e=function(e){r.push(e)},r=[],n=0;n<arguments.length;++n)t(arguments[n],e);return this.__ember_observesBefore__=r,this},Function.prototype.on=function(){var t=e.call(arguments);return this.__ember_listens__=t,this})}(),function(){Ember.Comparable=Ember.Mixin.create({compare:Ember.required(Function)})}(),function(){{var e=Ember.get;Ember.set}Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return e(this,"isFrozen")?this:this.copy().freeze();throw new Ember.Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var e=Ember.get,t=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return e(this,"isFrozen")?this:(t(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var e=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.addObject(e)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(t){return Ember.beginPropertyChanges(this),e(t,function(e){this.removeObject(e)},this),Ember.endPropertyChanges(this),this}})}(),function(){{var e="Index out of range",t=[],r=Ember.get;Ember.set}Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var e=r(this,"length");return 0===e?this:(this.replace(0,e,t),this)},insertAt:function(t,n){if(t>r(this,"length"))throw new Ember.Error(e);return this.replace(t,0,[n]),this},removeAt:function(n,i){if("number"==typeof n){if(0>n||n>=r(this,"length"))throw new Ember.Error(e);void 0===i&&(i=1),this.replace(n,i,t)}return this},pushObject:function(e){return this.insertAt(r(this,"length"),e),e},pushObjects:function(e){if(!Ember.Enumerable.detect(e)&&!Ember.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this.replace(r(this,"length"),0,e),this},popObject:function(){var e=r(this,"length");if(0===e)return null;var t=this.objectAt(e-1);return this.removeAt(e-1,1),t},shiftObject:function(){if(0===r(this,"length"))return null;var e=this.objectAt(0);return this.removeAt(0),e},unshiftObject:function(e){return this.insertAt(0,e),e},unshiftObjects:function(e){return this.replace(0,0,e),this},reverseObjects:function(){var e=r(this,"length");if(0===e)return this;var t=this.toArray().reverse();return this.replace(0,e,t),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this.replace(0,t,e),this},removeObject:function(e){for(var t=r(this,"length")||0;--t>=0;){var n=this.objectAt(t);n===e&&this.removeAt(t)}return this},addObject:function(e){return this.contains(e)||this.pushObject(e),this}})}(),function(){{var e=Ember.get;Ember.set}Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,actionContext:null,targetObject:Ember.computed(function(){var t=e(this,"target");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("target"),actionContextObject:Ember.computed(function(){var t=e(this,"actionContext");if("string"===Ember.typeOf(t)){var r=e(this,t);return void 0===r&&(r=e(Ember.lookup,t)),r}return t}).property("actionContext"),triggerAction:function(t){function r(e,t){var r=[];return t&&r.push(t),r.concat(e)}t=t||{};var n=t.action||e(this,"action"),i=t.target||e(this,"targetObject"),o=t.actionContext;if("undefined"==typeof o&&(o=e(this,"actionContextObject")||this),i&&n){var a;return a=i.send?i.send.apply(i,r(o,n)):i[n].apply(i,r(o)),a!==!1&&(a=!0),a}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(e,t,r){return Ember.addListener(this,e,t,r),this},one:function(e,t,r){return r||(r=t,t=null),Ember.addListener(this,e,t,r,!0),this},trigger:function(e){var t,r,n=[];for(t=1,r=arguments.length;r>t;t++)n.push(arguments[t]);Ember.sendEvent(this,e,n)},off:function(e,t,r){return Ember.removeListener(this,e,t,r),this},has:function(e){return Ember.hasListeners(this,e)}})}(),function(){var e=t("rsvp");if(Ember.FEATURES["ember-runtime-test-friendly-promises"]){var r=function(){Ember.Test&&Ember.Test.adapter&&Ember.Test.adapter.asyncStart()},n=function(){Ember.Test&&Ember.Test.adapter&&Ember.Test.adapter.asyncEnd()};e.configure("async",function(e,t){var i=!Ember.run.currentRunLoop;Ember.testing&&i&&r(),Ember.run.backburner.schedule("actions",function(){Ember.testing&&i&&n(),e(t)})})}else e.configure("async",function(e,t){Ember.run.backburner.schedule("actions",function(){e(t)})});e.Promise.prototype.fail=function(e,t){return this["catch"](e,t)};var i=Ember.get;Ember.DeferredMixin=Ember.Mixin.create({then:function(e,t,r){function n(t){return t===a?e(s):e(t)}var o,a,s;return s=this,o=i(this,"_deferred"),a=o.promise,a.then(e&&n,t,r)},resolve:function(e){var t,r;t=i(this,"_deferred"),r=t.promise,e===this?t.resolve(r):t.resolve(e)},reject:function(e){i(this,"_deferred").reject(e)},_deferred:Ember.computed(function(){return e.defer("Ember: DeferredMixin - "+this)})})}(),function(){var e=Ember.get,t=Ember.typeOf;Ember.ActionHandler=Ember.Mixin.create({mergedProperties:["_actions"],willMergeMixin:function(e){var r;e._actions||("object"===t(e.actions)?r="actions":"object"===t(e.events)&&(r="events"),r&&(e._actions=Ember.merge(e._actions||{},e[r])),delete e[r])},send:function(t){var r,n=[].slice.call(arguments,1);if(this._actions&&this._actions[t]){if(this._actions[t].apply(this,n)!==!0)return}else if(!Ember.FEATURES.isEnabled("ember-routing-drop-deprecated-action-style")&&this.deprecatedSend&&this.deprecatedSendHandles&&this.deprecatedSendHandles(t)&&this.deprecatedSend.apply(this,[].slice.call(arguments))!==!0)return;(r=e(this,"target"))&&r.send.apply(r,arguments)}})}(),function(){function e(e,t){return r(e,"isFulfilled",!1),r(e,"isRejected",!1),t.then(function(t){return r(e,"isFulfilled",!0),r(e,"content",t),t},function(t){throw r(e,"isRejected",!0),r(e,"reason",t),t},"Ember: PromiseProxy")}function t(e){return function(){var t=n(this,"promise");return t[e].apply(t,arguments)}}var r=Ember.set,n=Ember.get,i=Ember.computed.not,o=Ember.computed.or;Ember.PromiseProxyMixin=Ember.Mixin.create({reason:null,isPending:i("isSettled").readOnly(),isSettled:o("isRejected","isFulfilled").readOnly(),isRejected:!1,isFulfilled:!1,promise:Ember.computed(function(t,r){if(2===arguments.length)return e(this,r);throw new Ember.Error("PromiseProxy's promise must be set")}),then:t("then"),"catch":t("catch"),"finally":t("finally")})}(),function(){function e(e,t,r){this.type=e,this.count=t,this.items=r}function t(e,t,r,n){this.operation=e,this.index=t,this.split=r,this.rangeStart=n}var r=Ember.get,n=Ember.EnumerableUtils.forEach,i="r",o="i",a="d";Ember.TrackedArray=function(t){arguments.length<1&&(t=[]);var n=r(t,"length");this._operations=n?[new e(i,n,t)]:[]},Ember.TrackedArray.RETAIN=i,Ember.TrackedArray.INSERT=o,Ember.TrackedArray.DELETE=a,Ember.TrackedArray.prototype={addItems:function(t,n){var i=r(n,"length");if(!(1>i)){var a,s,u=this._findArrayOperation(t),l=u.operation,c=u.index,h=u.rangeStart;s=new e(o,i,n),l?u.split?(this._split(c,t-h,s),a=c+1):(this._operations.splice(c,0,s),a=c):(this._operations.push(s),a=c),this._composeInsert(a)}},removeItems:function(t,r){if(!(1>r)){var n,i,o=this._findArrayOperation(t),s=(o.operation,o.index),u=o.rangeStart;return n=new e(a,r),o.split?(this._split(s,t-u,n),i=s+1):(this._operations.splice(s,0,n),i=s),this._composeDelete(i)}},apply:function(t){var r=[],o=0;n(this._operations,function(e){t(e.items,o,e.type),e.type!==a&&(o+=e.count,r=r.concat(e.items))}),this._operations=[new e(i,r.length,r)]},_findArrayOperation:function(e){var r,n,i,o,s,u=!1;for(r=o=0,n=this._operations.length;n>r;++r)if(i=this._operations[r],i.type!==a){if(s=o+i.count-1,e===o)break;if(e>o&&s>=e){u=!0;break}o=s+1}return new t(i,r,u,o)},_split:function(t,r,n){var i=this._operations[t],o=i.items.slice(r),a=new e(i.type,o.length,o);i.count=r,i.items=i.items.slice(0,r),this._operations.splice(t+1,0,n,a)},_composeInsert:function(e){var t=this._operations[e],r=this._operations[e-1],n=this._operations[e+1],i=r&&r.type,a=n&&n.type;i===o?(r.count+=t.count,r.items=r.items.concat(t.items),a===o?(r.count+=n.count,r.items=r.items.concat(n.items),this._operations.splice(e,2)):this._operations.splice(e,1)):a===o&&(t.count+=n.count,t.items=t.items.concat(n.items),this._operations.splice(e+1,1))},_composeDelete:function(e){var t,r,n,i=this._operations[e],s=i.count,u=this._operations[e-1],l=u&&u.type,c=!1,h=[];l===a&&(i=u,e-=1);for(var m=e+1;s>0;++m)t=this._operations[m],r=t.type,n=t.count,r!==a?(n>s?(h=h.concat(t.items.splice(0,s)),t.count-=s,m-=1,n=s,s=0):(n===s&&(c=!0),h=h.concat(t.items),s-=n),r===o&&(i.count-=n)):i.count+=n;return i.count>0?this._operations.splice(e+1,m-1-e):this._operations.splice(e,c?2:1),h},toString:function(){var e="";return n(this._operations,function(t){e+=" "+t.type+":"+t.count}),e.substring(1)}}}(),function(){function e(e,t){this.type=e,this.count=t}var t=(Ember.get,Ember.EnumerableUtils.forEach),r="r",n="f";Ember.SubArray=function(t){arguments.length<1&&(t=0),this._operations=t>0?[new e(r,t)]:[]},Ember.SubArray.prototype={addItem:function(t,i){var o=-1,a=i?r:n,s=this;return this._findOperation(t,function(n,u,l,c,h){var m,p;a===n.type?++n.count:t===l?s._operations.splice(u,0,new e(a,1)):(m=new e(a,1),p=new e(n.type,c-t+1),n.count=t-l,s._operations.splice(u+1,0,m,p)),i&&(o=n.type===r?h+(t-l):h),s._composeAt(u)},function(t){s._operations.push(new e(a,1)),i&&(o=t),s._composeAt(s._operations.length-1)}),o},removeItem:function(e){var t=-1,n=this;return this._findOperation(e,function(i,o,a,s,u){i.type===r&&(t=u+(e-a)),i.count>1?--i.count:(n._operations.splice(o,1),n._composeAt(o))},function(){throw new Ember.Error("Can't remove an item that has never been added.")}),t},_findOperation:function(e,t,n){var i,o,a,s,u,l=0;for(i=s=0,o=this._operations.length;o>i;s=u+1,++i){if(a=this._operations[i],u=s+a.count-1,e>=s&&u>=e)return t(a,i,s,u,l),void 0;a.type===r&&(l+=a.count)}n(l)},_composeAt:function(e){var t,r=this._operations[e];r&&(e>0&&(t=this._operations[e-1],t.type===r.type&&(r.count+=t.count,this._operations.splice(e-1,1),--e)),e<this._operations.length-1&&(t=this._operations[e+1],t.type===r.type&&(r.count+=t.count,this._operations.splice(e+1,1))))},toString:function(){var e="";return t(this._operations,function(t){e+=" "+t.type+":"+t.count}),e.substring(1)}}}(),function(){Ember.Container=t("container")["default"],Ember.Container.set=Ember.set}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){{var e="Index out of range",t=[],r=Ember.get;Ember.set}Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed.alias("content"),objectAtContent:function(e){return r(this,"arrangedContent").objectAt(e)},replaceContent:function(e,t,n){r(this,"content").replace(e,t,n)},_contentWillChange:Ember.beforeObserver("content",function(){this._teardownContent()}),_teardownContent:function(){var e=r(this,"content");e&&e.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer("content",function(){r(this,"content");this._setupContent()}),_setupContent:function(){var e=r(this,"content");e&&e.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver("arrangedContent",function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this.arrangedContentArrayWillChange(this,0,t,void 0),this.arrangedContentWillChange(this),this._teardownArrangedContent(e)}),_arrangedContentDidChange:Ember.observer("arrangedContent",function(){var e=r(this,"arrangedContent"),t=e?r(e,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,void 0,t)}),_setupArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var e=r(this,"arrangedContent");e&&e.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(e){return r(this,"content")&&this.objectAtContent(e)},length:Ember.computed(function(){var e=r(this,"arrangedContent");return e?r(e,"length"):0}),_replace:function(e,t,n){var i=r(this,"content");return i&&this.replaceContent(e,t,n),this},replace:function(){if(r(this,"arrangedContent")!==r(this,"content"))throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");this._replace.apply(this,arguments)},_insertAt:function(t,n){if(t>r(this,"content.length"))throw new Ember.Error(e);return this._replace(t,0,[n]),this},insertAt:function(e,t){if(r(this,"arrangedContent")===r(this,"content"))return this._insertAt(e,t);throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.")},removeAt:function(n,i){if("number"==typeof n){var o,a=r(this,"content"),s=r(this,"arrangedContent"),u=[];if(0>n||n>=r(this,"length"))throw new Ember.Error(e);for(void 0===i&&(i=1),o=n;n+i>o;o++)u.push(a.indexOf(s.objectAt(o)));for(u.sort(function(e,t){return t-e}),Ember.beginPropertyChanges(),o=0;o<u.length;o++)this._replace(u[o],1,t);Ember.endPropertyChanges()}return this},pushObject:function(e){return this._insertAt(r(this,"content.length"),e),e},pushObjects:function(e){if(!Ember.Enumerable.detect(e)&&!Ember.isArray(e))throw new TypeError("Must pass Ember.Enumerable to Ember.MutableArray#pushObjects");return this._replace(r(this,"length"),0,e),this},setObjects:function(e){if(0===e.length)return this.clear();var t=r(this,"length");return this._replace(0,t,e),this},unshiftObject:function(e){return this._insertAt(0,e),e},unshiftObjects:function(e){return this._replace(0,0,e),this},slice:function(){var e=this.toArray();return e.slice.apply(e,arguments)},arrangedContentArrayWillChange:function(e,t,r,n){this.arrayContentWillChange(t,r,n)},arrangedContentArrayDidChange:function(e,t,r,n){this.arrayContentDidChange(t,r,n)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function e(e,t,r,i,o){var a,s=r._objects;for(s||(s=r._objects={});--o>=i;){var u=e.objectAt(o);u&&(Ember.addBeforeObserver(u,t,r,"contentKeyWillChange"),Ember.addObserver(u,t,r,"contentKeyDidChange"),a=n(u),s[a]||(s[a]=[]),s[a].push(o))}}function t(e,t,r,i,a){var s=r._objects;s||(s=r._objects={});for(var u,l;--a>=i;){var c=e.objectAt(a);c&&(Ember.removeBeforeObserver(c,t,r,"contentKeyWillChange"),Ember.removeObserver(c,t,r,"contentKeyDidChange"),l=n(c),u=s[l],u[o.call(u,a)]=null)}}var r=(Ember.set,Ember.get),n=Ember.guidFor,i=Ember.EnumerableUtils.forEach,o=Ember.ArrayPolyfills.indexOf,a=Ember.Object.extend(Ember.Array,{init:function(e,t,r){this._super(),this._keyName=t,this._owner=r,this._content=e},objectAt:function(e){var t=this._content.objectAt(e);return t&&r(t,this._keyName)},length:Ember.computed(function(){var e=this._content;return e?r(e,"length"):0})}),s=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(e){this._super(),this._content=e,e.addArrayObserver(this),i(Ember.watchedEvents(this),function(e){this.didAddListener(e)},this)},unknownProperty:function(e){var t;return t=new a(this._content,e,this),Ember.defineProperty(this,e,null,t),this.beginObservingContentKey(e),t},arrayWillChange:function(e,r,n){var i,o,a=this._keys;o=n>0?r+n:-1,Ember.beginPropertyChanges(this);for(i in a)a.hasOwnProperty(i)&&(o>0&&t(e,i,this,r,o),Ember.propertyWillChange(this,i));Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(t,r,n,i){var o,a=this._keys;o=i>0?r+i:-1,Ember.changeProperties(function(){for(var n in a)a.hasOwnProperty(n)&&(o>0&&e(t,n,this,r,o),Ember.propertyDidChange(this,n));Ember.propertyDidChange(this._content,"@each")},this)},didAddListener:function(e){s.test(e)&&this.beginObservingContentKey(e.slice(0,-7))},didRemoveListener:function(e){s.test(e)&&this.stopObservingContentKey(e.slice(0,-7))},beginObservingContentKey:function(t){var n=this._keys;if(n||(n=this._keys={}),n[t])n[t]++;else{n[t]=1;var i=this._content,o=r(i,"length");e(i,t,this,0,o)}},stopObservingContentKey:function(e){var n=this._keys;if(n&&n[e]>0&&--n[e]<=0){var i=this._content,o=r(i,"length");t(i,e,this,0,o)}},contentKeyWillChange:function(e,t){Ember.propertyWillChange(this,t)},contentKeyDidChange:function(e,t){Ember.propertyDidChange(this,t)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils._replace),r=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(e){return"length"===e?this.length:"number"==typeof e?this[e]:this._super(e)},objectAt:function(e){return this[e]},replace:function(r,n,i){if(this.isFrozen)throw Ember.FROZEN_ERROR;var o=i?e(i,"length"):0;return this.arrayContentWillChange(r,n,o),0===o?this.splice(r,n):t(this,r,n,i),this.arrayContentDidChange(r,n,o),this},unknownProperty:function(e,t){var r;return void 0!==t&&void 0===r&&(r=this[e]=t),r},indexOf:function(e,t){var r,n=this.length;for(t=void 0===t?0:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;n>r;r++)if(this[r]===e)return r;return-1},lastIndexOf:function(e,t){var r,n=this.length;for(t=void 0===t?n-1:0>t?Math.ceil(t):Math.floor(t),0>t&&(t+=n),r=t;r>=0;r--)if(this[r]===e)return r;return-1},copy:function(e){return e?this.map(function(e){return Ember.copy(e,!0)}):this.slice()}}),n=["length"];Ember.EnumerableUtils.forEach(r.keys(),function(e){Array.prototype[e]&&n.push(e)}),n.length>0&&(r=r.without.apply(r,n)),Ember.NativeArray=r,Ember.A=function(e){return void 0===e&&(e=[]),Ember.Array.detect(e)?e:Ember.NativeArray.apply(e)},Ember.NativeArray.activate=function(){r.apply(Array.prototype),Ember.A=function(e){return e||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var e=Ember.get,t=Ember.set,r=Ember.guidFor,n=Ember.isNone,i=Ember.String.fmt;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Ember.Error(Ember.FROZEN_ERROR);var n=e(this,"length");if(0===n)return this;var i;this.enumerableContentWillChange(n,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var o=0;n>o;o++)i=r(this[o]),delete this[i],delete this[o];return t(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(n,0),this},isEqual:function(t){if(!Ember.Enumerable.detect(t))return!1;var r=e(this,"length");if(e(t,"length")!==r)return!1;for(;--r>=0;)if(!t.contains(this[r]))return!1;return!0},add:Ember.aliasMethod("addObject"),remove:Ember.aliasMethod("removeObject"),pop:function(){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);var t=this.length>0?this[this.length-1]:null;return this.remove(t),t},push:Ember.aliasMethod("addObject"),shift:Ember.aliasMethod("pop"),unshift:Ember.aliasMethod("push"),addEach:Ember.aliasMethod("addObjects"),removeEach:Ember.aliasMethod("removeObjects"),init:function(e){this._super(),e&&this.addObjects(e)},nextObject:function(e){return this[e]},firstObject:Ember.computed(function(){return this.length>0?this[0]:void 0}),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:void 0}),addObject:function(i){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,a=r(i),s=this[a],u=e(this,"length");return s>=0&&u>s&&this[s]===i?this:(o=[i],this.enumerableContentWillChange(null,o),Ember.propertyWillChange(this,"lastObject"),u=e(this,"length"),this[a]=u,this[u]=i,t(this,"length",u+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,o),this)},removeObject:function(i){if(e(this,"isFrozen"))throw new Ember.Error(Ember.FROZEN_ERROR);if(n(i))return this;var o,a,s=r(i),u=this[s],l=e(this,"length"),c=0===u,h=u===l-1;return u>=0&&l>u&&this[u]===i&&(a=[i],this.enumerableContentWillChange(a,null),c&&Ember.propertyWillChange(this,"firstObject"),h&&Ember.propertyWillChange(this,"lastObject"),l-1>u&&(o=this[l-1],this[u]=o,this[r(o)]=u),delete this[s],delete this[l-1],t(this,"length",l-1),c&&Ember.propertyDidChange(this,"firstObject"),h&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(a,null)),this},contains:function(e){return this[r(e)]>=0},copy:function(){var n=this.constructor,i=new n,o=e(this,"length");for(t(i,"length",o);--o>=0;)i[o]=this[o],i[r(this[o])]=o;return i},toString:function(){var e,t=this.length,r=[];for(e=0;t>e;e++)r[e]=this[e];return i("Ember.Set<%@>",[r.join(",")])}})}(),function(){var e=Ember.DeferredMixin,t=(Ember.get,Ember.Object.extend(e));t.reopenClass({promise:function(e,r){var n=t.create();return e.call(r,n),n}}),Ember.Deferred=t}(),function(){var e=Ember.ArrayPolyfills.forEach,t=Ember.ENV.EMBER_LOAD_HOOKS||{},r={};Ember.onLoad=function(e,n){var i;t[e]=t[e]||Ember.A(),t[e].pushObject(n),(i=r[e])&&n(i)},Ember.runLoadHooks=function(n,i){if(r[n]=i,"object"==typeof window&&"function"==typeof window.dispatchEvent&&"function"==typeof CustomEvent){var o=new CustomEvent(n,{detail:i,name:n});window.dispatchEvent(o)}t[n]&&e.call(t[n],function(e){e(i)})}}(),function(){Ember.get;Ember.ControllerMixin=Ember.Mixin.create(Ember.ActionHandler,{isController:!0,target:null,container:null,parentController:null,store:null,model:Ember.computed.alias("content"),deprecatedSendHandles:function(e){return!!this[e]},deprecatedSend:function(e){var t=[].slice.call(arguments,1);this[e].apply(this,t)}}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach);Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,sortFunction:Ember.compare,orderBy:function(r,n){var i=0,o=e(this,"sortProperties"),a=e(this,"sortAscending"),s=e(this,"sortFunction");return t(o,function(t){0===i&&(i=s(e(r,t),e(n,t)),0===i||a||(i=-1*i))}),i},destroy:function(){var r=e(this,"content"),n=e(this,"sortProperties");return r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed.bool("sortProperties"),arrangedContent:Ember.computed("content","sortProperties.@each",function(){var r=e(this,"content"),n=e(this,"isSorted"),i=e(this,"sortProperties"),o=this;return r&&n?(r=r.slice(),r.sort(function(e,t){return o.orderBy(e,t)}),t(r,function(e){t(i,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(r)):r}),_contentWillChange:Ember.beforeObserver("content",function(){var r=e(this,"content"),n=e(this,"sortProperties");r&&n&&t(r,function(e){t(n,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this),this._super()}),sortAscendingWillChange:Ember.beforeObserver("sortAscending",function(){this._lastSortAscending=e(this,"sortAscending")}),sortAscendingDidChange:Ember.observer("sortAscending",function(){if(e(this,"sortAscending")!==this._lastSortAscending){var t=e(this,"arrangedContent");t.reverseObjects()}}),contentArrayWillChange:function(r,n,i,o){var a=e(this,"isSorted");if(a){var s=e(this,"arrangedContent"),u=r.slice(n,n+i),l=e(this,"sortProperties");t(u,function(e){s.removeObject(e),t(l,function(t){Ember.removeObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},contentArrayDidChange:function(r,n,i,o){var a=e(this,"isSorted"),s=e(this,"sortProperties");if(a){var u=r.slice(n,n+o);t(u,function(e){this.insertItemSorted(e),t(s,function(t){Ember.addObserver(e,t,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(r,n,i,o)},insertItemSorted:function(t){var r=e(this,"arrangedContent"),n=e(r,"length"),i=this._binarySearch(t,0,n);r.insertAt(i,t)},contentItemSortPropertyDidChange:function(t){var r=e(this,"arrangedContent"),n=r.indexOf(t),i=r.objectAt(n-1),o=r.objectAt(n+1),a=i&&this.orderBy(t,i),s=o&&this.orderBy(t,o);(0>a||s>0)&&(r.removeObject(t),this.insertItemSorted(t))},_binarySearch:function(t,r,n){var i,o,a,s;return r===n?r:(s=e(this,"arrangedContent"),i=r+Math.floor((n-r)/2),o=s.objectAt(i),a=this.orderBy(o,t),0>a?this._binarySearch(t,i+1,n):a>0?this._binarySearch(t,r,i):i)}})}(),function(){var e=Ember.get,t=(Ember.set,Ember.EnumerableUtils.forEach),r=Ember.EnumerableUtils.replace;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin,{itemController:null,lookupItemController:function(){return e(this,"itemController")},objectAtContent:function(t){var r=e(this,"length"),n=e(this,"arrangedContent"),i=n&&n.objectAt(t);if(t>=0&&r>t){var o=this.lookupItemController(i);if(o)return this.controllerAt(t,i,o)}return i},arrangedContentDidChange:function(){this._super(),this._resetSubControllers()},arrayContentDidChange:function(n,i,o){var a=e(this,"_subControllers"),s=a.slice(n,n+i);t(s,function(e){e&&e.destroy()}),r(a,n,i,new Array(o)),this._super(n,i,o)},init:function(){this._super(),this.set("_subControllers",Ember.A())},content:Ember.computed(function(){return Ember.A()}),_isVirtual:!1,controllerAt:function(t,r,n){var i,o=e(this,"container"),a=e(this,"_subControllers"),s=a[t];if(s)return s;if(i="controller:"+n,!o.has(i))throw new Ember.Error('Could not resolve itemController: "'+n+'"');var u;return this._isVirtual&&(u=e(this,"parentController")),u=u||this,s=o.lookupFactory(i).create({target:this,parentController:u,content:r}),a[t]=s,s},_subControllers:null,_resetSubControllers:function(){var r=e(this,"_subControllers");r&&t(r,function(e){e&&e.destroy()}),this.set("_subControllers",Ember.A())}})}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){var e=Ember.imports&&Ember.imports.jQuery||this&&this.jQuery;e||"function"!=typeof r||(e=r("jquery")),Ember.$=e}(),function(){if(Ember.$){var e=Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");
|
14 |
Ember.EnumerableUtils.forEach(e,function(e){Ember.$.event.fixHooks[e]={props:["dataTransfer"]}})}}(),function(){function e(e){var t=e.shiftKey||e.metaKey||e.altKey||e.ctrlKey,r=e.which>1;return!t&&!r}var t="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="<div></div>",e.firstChild.innerHTML="<script></script>",""===e.firstChild.innerHTML}(),r="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="Test: <script type='text/x-placeholder'></script>Value","Test:"===e.childNodes[0].nodeValue&&" Value"===e.childNodes[2].nodeValue}(),n=function(e,t){if(e.getAttribute("id")===t)return e;var r,i,o,a=e.childNodes.length;for(r=0;a>r;r++)if(i=e.childNodes[r],o=1===i.nodeType&&n(i,t))return o},i=function(e,i){t&&(i="­"+i);var o=[];if(r&&(i=i.replace(/(\s+)(<script id='([^']+)')/g,function(e,t,r,n){return o.push([n,t]),r})),e.innerHTML=i,o.length>0){var a,s=o.length;for(a=0;s>a;a++){var u=n(e,o[a][0]),l=document.createTextNode(o[a][1]);u.parentNode.insertBefore(l,u)}}if(t){for(var c=e.firstChild;1===c.nodeType&&!c.nodeName;)c=c.firstChild;3===c.nodeType&&""===c.nodeValue.charAt(0)&&(c.nodeValue=c.nodeValue.slice(1))}},o={},a=function(e){if(void 0!==o[e])return o[e];var t=!0;if("select"===e.toLowerCase()){var r=document.createElement("select");i(r,'<option value="test">Test</option>'),t=1===r.options.length}return o[e]=t,t},s=function(e,t){var r=e.tagName;if(a(r))i(e,t);else{var n=e.outerHTML||(new XMLSerializer).serializeToString(e),o=n.match(new RegExp("<"+r+"([^>]*)>","i"))[0],s="</"+r+">",u=document.createElement("div");for(i(u,o+t+s),e=u.firstChild;e.tagName!==r;)e=e.nextSibling}return e};Ember.ViewUtils={setInnerHTML:s,isSimpleClick:e}}(),function(){function e(e){return e?n.test(e)?e.replace(i,""):e:e}function t(e){var t={"<":"<",">":">",'"':""","'":"'","`":"`"},r=function(e){return t[e]||"&"},n=e.toString();return a.test(n)?n.replace(o,r):n}var r=(Ember.get,Ember.set,function(){this.seen={},this.list=[]});r.prototype={add:function(e){e in this.seen||(this.seen[e]=!0,this.list.push(e))},toDOM:function(){return this.list.join(" ")}};var n=/[^a-zA-Z0-9\-]/,i=/[^a-zA-Z0-9\-]/g,o=/&(?!\w+;)|[<>"'`]/g,a=/[&<>"'`]/,s=function(){var e=document.createElement("div"),t=document.createElement("input");return t.setAttribute("name","foo"),e.appendChild(t),!!e.innerHTML.match("foo")}();Ember.RenderBuffer=function(e){return new Ember._RenderBuffer(e)},Ember._RenderBuffer=function(e){this.tagNames=[e||null],this.buffer=""},Ember._RenderBuffer.prototype={_element:null,_hasElement:!0,elementClasses:null,classes:null,elementId:null,elementAttributes:null,elementProperties:null,elementTag:null,elementStyle:null,parentBuffer:null,push:function(e){return this.buffer+=e,this},addClass:function(e){return this.elementClasses=this.elementClasses||new r,this.elementClasses.add(e),this.classes=this.elementClasses.list,this},setClasses:function(e){this.elementClasses=null;var t,r=e.length;for(t=0;r>t;t++)this.addClass(e[t])},id:function(e){return this.elementId=e,this},attr:function(e,t){var r=this.elementAttributes=this.elementAttributes||{};return 1===arguments.length?r[e]:(r[e]=t,this)},removeAttr:function(e){var t=this.elementAttributes;return t&&delete t[e],this},prop:function(e,t){var r=this.elementProperties=this.elementProperties||{};return 1===arguments.length?r[e]:(r[e]=t,this)},removeProp:function(e){var t=this.elementProperties;return t&&delete t[e],this},style:function(e,t){return this.elementStyle=this.elementStyle||{},this.elementStyle[e]=t,this},begin:function(e){return this.tagNames.push(e||null),this},pushOpeningTag:function(){var r=this.currentTagName();if(r){if(this._hasElement&&!this._element&&0===this.buffer.length)return this._element=this.generateElement(),void 0;var n,i,o=this.buffer,a=this.elementId,s=this.classes,u=this.elementAttributes,l=this.elementProperties,c=this.elementStyle;if(o+="<"+e(r),a&&(o+=' id="'+t(a)+'"',this.elementId=null),s&&(o+=' class="'+t(s.join(" "))+'"',this.classes=null,this.elementClasses=null),c){o+=' style="';for(i in c)c.hasOwnProperty(i)&&(o+=i+":"+t(c[i])+";");o+='"',this.elementStyle=null}if(u){for(n in u)u.hasOwnProperty(n)&&(o+=" "+n+'="'+t(u[n])+'"');this.elementAttributes=null}if(l){for(i in l)if(l.hasOwnProperty(i)){var h=l[i];(h||"number"==typeof h)&&(o+=h===!0?" "+i+'="'+i+'"':" "+i+'="'+t(l[i])+'"')}this.elementProperties=null}o+=">",this.buffer=o}},pushClosingTag:function(){var t=this.tagNames.pop();t&&(this.buffer+="</"+e(t)+">")},currentTagName:function(){return this.tagNames[this.tagNames.length-1]},generateElement:function(){var r,n,i,o=this.tagNames.pop(),a=this.elementId,u=this.classes,l=this.elementAttributes,c=this.elementProperties,h=this.elementStyle,m="";i=l&&l.name&&!s?"<"+e(o)+' name="'+t(l.name)+'">':o;var p=document.createElement(i),f=Ember.$(p);if(a&&(f.attr("id",a),this.elementId=null),u&&(f.attr("class",u.join(" ")),this.classes=null,this.elementClasses=null),h){for(n in h)h.hasOwnProperty(n)&&(m+=n+":"+h[n]+";");f.attr("style",m),this.elementStyle=null}if(l){for(r in l)l.hasOwnProperty(r)&&f.attr(r,l[r]);this.elementAttributes=null}if(c){for(n in c)c.hasOwnProperty(n)&&f.prop(n,c[n]);this.elementProperties=null}return p},element:function(){var e=this.innerString();return e&&(this._element=Ember.ViewUtils.setInnerHTML(this._element,e)),this._element},string:function(){if(this._hasElement&&this._element){var e=this.element(),t=e.outerHTML;return"undefined"==typeof t?Ember.$("<div/>").append(e).html():t}return this.innerString()},innerString:function(){return this.buffer}}}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.EventDispatcher=Ember.Object.extend({events:{touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",mousemove:"mouseMove",focusin:"focusIn",focusout:"focusOut",mouseenter:"mouseEnter",mouseleave:"mouseLeave",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"},rootElement:"body",setup:function(r,n){var i,o=e(this,"events");Ember.$.extend(o,r||{}),Ember.isNone(n)||t(this,"rootElement",n),n=Ember.$(e(this,"rootElement")),n.addClass("ember-application");for(i in o)o.hasOwnProperty(i)&&this.setupHandler(n,i,o[i])},setupHandler:function(e,t,r){var n=this;e.on(t+".ember",".ember-view",function(e,t){var i=Ember.View.views[this.id],o=!0,a=null;return a=n._findNearestEventManager(i,r),a&&a!==t?o=n._dispatchEvent(a,e,r,i):i?o=n._bubbleEvent(i,e,r):e.stopPropagation(),o}),e.on(t+".ember","[data-ember-action]",function(e){var t=Ember.$(e.currentTarget).attr("data-ember-action"),n=Ember.Handlebars.ActionHelper.registeredActions[t];return n&&n.eventName===r?n.handler(e):void 0})},_findNearestEventManager:function(t,r){for(var n=null;t&&(n=e(t,"eventManager"),!n||!n[r]);)t=e(t,"parentView");return n},_dispatchEvent:function(e,t,r,n){var i=!0,o=e[r];return"function"===Ember.typeOf(o)?(i=Ember.run(e,o,t,n),t.stopPropagation()):i=this._bubbleEvent(n,t,r),i},_bubbleEvent:function(e,t,r){return Ember.run(e,e.handleEvent,r,t)},destroy:function(){var t=e(this,"rootElement");return Ember.$(t).off(".ember","**").removeClass("ember-application"),this._super()}})}(),function(){var e=Ember.run.queues,t=Ember.ArrayPolyfills.indexOf;e.splice(t.call(e,"actions")+1,0,"render","afterRender")}(),function(){function e(e){e.buffer=null}function t(){Ember.run.once(Ember.View,"notifyMutationListeners")}var r={},n=Ember.get,i=Ember.set,o=Ember.guidFor,a=Ember.EnumerableUtils.forEach,s=Ember.EnumerableUtils.addObject,u=Ember.meta,l=Ember.defineProperty,c=Ember.computed(function(){var e=this._childViews,t=Ember.A(),r=this;return a(e,function(e){var r;e.isVirtual?(r=n(e,"childViews"))&&t.pushObjects(r):t.push(e)}),t.replace=function(e,t,n){if(r instanceof Ember.ContainerView)return r.replace(e,t,n);throw new Ember.Error("childViews is immutable")},t});Ember.TEMPLATES={},Ember.CoreView=Ember.Object.extend(Ember.Evented,Ember.ActionHandler,{isView:!0,states:r,init:function(){this._super(),this.transitionTo("preRender"),this._isVisible=n(this,"isVisible")},parentView:Ember.computed("_parentView",function(){var e=this._parentView;return e&&e.isVirtual?n(e,"parentView"):e}),state:null,_parentView:null,concreteView:Ember.computed("parentView",function(){return this.isVirtual?n(this,"parentView"):this}),instrumentName:"core_view",instrumentDetails:function(e){e.object=this.toString()},renderToBuffer:function(e,t){var r="render."+this.instrumentName,n={};return this.instrumentDetails(n),Ember.instrument(r,n,function(){return this._renderToBuffer(e,t)},this)},_renderToBuffer:function(e){var t=this.tagName;(null===t||void 0===t)&&(t="div");var r=this.buffer=e&&e.begin(t)||Ember.RenderBuffer(t);return this.transitionTo("inBuffer",!1),this.beforeRender(r),this.render(r),this.afterRender(r),r},trigger:function(e){this._super.apply(this,arguments);var t=this[e];if(t){var r,n,i=[];for(r=1,n=arguments.length;n>r;r++)i.push(arguments[r]);return t.apply(this,i)}},deprecatedSendHandles:function(e){return!!this[e]},deprecatedSend:function(e){var t=[].slice.call(arguments,1);this[e].apply(this,t)},has:function(e){return"function"===Ember.typeOf(this[e])||this._super(e)},destroy:function(){var e=this._parentView;if(this._super())return this.removedFromDOM||this.destroyElement(),e&&e.removeChild(this),this.transitionTo("destroying",!1),this},clearRenderedChildren:Ember.K,triggerRecursively:Ember.K,invokeRecursively:Ember.K,transitionTo:Ember.K,destroyElement:Ember.K});var h=Ember._ViewCollection=function(e){var t=this.views=e||[];this.length=t.length};h.prototype={length:0,trigger:function(e){for(var t,r=this.views,n=0,i=r.length;i>n;n++)t=r[n],t.trigger&&t.trigger(e)},triggerRecursively:function(e){for(var t=this.views,r=0,n=t.length;n>r;r++)t[r].triggerRecursively(e)},invokeRecursively:function(e){for(var t,r=this.views,n=0,i=r.length;i>n;n++)t=r[n],e(t)},transitionTo:function(e,t){for(var r=this.views,n=0,i=r.length;i>n;n++)r[n].transitionTo(e,t)},push:function(){this.length+=arguments.length;var e=this.views;return e.push.apply(e,arguments)},objectAt:function(e){return this.views[e]},forEach:function(e){var t=this.views;return a(t,e)},clear:function(){this.length=0,this.views.length=0}};var m=[];Ember.View=Ember.CoreView.extend({concatenatedProperties:["classNames","classNameBindings","attributeBindings"],isView:!0,templateName:null,layoutName:null,template:Ember.computed("templateName",function(e,t){if(void 0!==t)return t;var r=n(this,"templateName"),i=this.templateForName(r,"template");return i||n(this,"defaultTemplate")}),controller:Ember.computed("_parentView",function(){var e=n(this,"_parentView");return e?n(e,"controller"):null}),layout:Ember.computed(function(){var e=n(this,"layoutName"),t=this.templateForName(e,"layout");return t||n(this,"defaultLayout")}).property("layoutName"),_yield:function(e,t){var r=n(this,"template");r&&r(e,t)},templateForName:function(e){if(e){var t=this.container||Ember.Container&&Ember.Container.defaultContainer;return t&&t.lookup("template:"+e)}},context:Ember.computed(function(e,t){return 2===arguments.length?(i(this,"_context",t),t):n(this,"_context")}).volatile(),_context:Ember.computed(function(){var e,t;return(t=n(this,"controller"))?t:(e=this._parentView,e?n(e,"_context"):null)}),_contextDidChange:Ember.observer("context",function(){this.rerender()}),isVisible:!0,childViews:c,_childViews:m,_childViewsWillChange:Ember.beforeObserver("childViews",function(){if(this.isVirtual){var e=n(this,"parentView");e&&Ember.propertyWillChange(e,"childViews")}}),_childViewsDidChange:Ember.observer("childViews",function(){if(this.isVirtual){var e=n(this,"parentView");e&&Ember.propertyDidChange(e,"childViews")}}),nearestInstanceOf:function(e){for(var t=n(this,"parentView");t;){if(t instanceof e)return t;t=n(t,"parentView")}},nearestOfType:function(e){for(var t=n(this,"parentView"),r=e instanceof Ember.Mixin?function(t){return e.detect(t)}:function(t){return e.detect(t.constructor)};t;){if(r(t))return t;t=n(t,"parentView")}},nearestWithProperty:function(e){for(var t=n(this,"parentView");t;){if(e in t)return t;t=n(t,"parentView")}},nearestChildOf:function(e){for(var t=n(this,"parentView");t;){if(n(t,"parentView")instanceof e)return t;t=n(t,"parentView")}},_parentViewDidChange:Ember.observer("_parentView",function(){this.isDestroying||(this.trigger("parentViewDidChange"),n(this,"parentView.controller")&&!n(this,"controller")&&this.notifyPropertyChange("controller"))}),_controllerDidChange:Ember.observer("controller",function(){this.isDestroying||(this.rerender(),this.forEachChildView(function(e){e.propertyDidChange("controller")}))}),cloneKeywords:function(){var e=n(this,"templateData"),t=e?Ember.copy(e.keywords):{};return i(t,"view",n(this,"concreteView")),i(t,"_view",this),i(t,"controller",n(this,"controller")),t},render:function(e){var t=n(this,"layout")||n(this,"template");if(t){var r,i=n(this,"context"),o=this.cloneKeywords(),a={view:this,buffer:e,isRenderData:!0,keywords:o,insideGroup:n(this,"templateData.insideGroup")};r=t(i,{data:a}),void 0!==r&&e.push(r)}},rerender:function(){return this.currentState.rerender(this)},clearRenderedChildren:function(){for(var e=this.lengthBeforeRender,t=this.lengthAfterRender,r=this._childViews,n=t-1;n>=e;n--)r[n]&&r[n].destroy()},_applyClassNameBindings:function(e){var t,r,n,i=this.classNames;a(e,function(e){var o,a=Ember.View._parsePropertyPath(e),u=function(){r=this._classStringForProperty(e),t=this.$(),o&&(t.removeClass(o),i.removeObject(o)),r?(t.addClass(r),o=r):o=null};n=this._classStringForProperty(e),n&&(s(i,n),o=n),this.registerObserver(this,a.path,u),this.one("willClearRender",function(){o&&(i.removeObject(o),o=null)})},this)},_unspecifiedAttributeBindings:null,_applyAttributeBindings:function(e,t){var r,i=this._unspecifiedAttributeBindings=this._unspecifiedAttributeBindings||{};a(t,function(t){var o=t.split(":"),a=o[0],s=o[1]||a;a in this?(this._setupAttributeBindingObservation(a,s),r=n(this,a),Ember.View.applyAttributeBindings(e,s,r)):i[a]=s},this),this.setUnknownProperty=this._setUnknownProperty},_setupAttributeBindingObservation:function(e,t){var r,i,o=function(){i=this.$(),r=n(this,e),Ember.View.applyAttributeBindings(i,t,r)};this.registerObserver(this,e,o)},setUnknownProperty:null,_setUnknownProperty:function(e,t){var r=this._unspecifiedAttributeBindings&&this._unspecifiedAttributeBindings[e];return r&&this._setupAttributeBindingObservation(e,r),l(this,e),i(this,e,t)},_classStringForProperty:function(e){var t=Ember.View._parsePropertyPath(e),r=t.path,i=n(this,r);return void 0===i&&Ember.isGlobalPath(r)&&(i=n(Ember.lookup,r)),Ember.View._classStringForValue(r,i,t.className,t.falsyClassName)},element:Ember.computed("_parentView",function(e,t){return void 0!==t?this.currentState.setElement(this,t):this.currentState.getElement(this)}),$:function(e){return this.currentState.$(this,e)},mutateChildViews:function(e){for(var t,r=this._childViews,n=r.length;--n>=0;)t=r[n],e(this,t,n);return this},forEachChildView:function(e){var t=this._childViews;if(!t)return this;var r,n,i=t.length;for(n=0;i>n;n++)r=t[n],e(r);return this},appendTo:function(e){return this._insertElementLater(function(){this.$().appendTo(e)}),this},replaceIn:function(e){return this._insertElementLater(function(){Ember.$(e).empty(),this.$().appendTo(e)}),this},_insertElementLater:function(e){this._scheduledInsert=Ember.run.scheduleOnce("render",this,"_insertElement",e)},_insertElement:function(e){this._scheduledInsert=null,this.currentState.insertElement(this,e)},append:function(){return this.appendTo(document.body)},remove:function(){this.removedFromDOM||this.destroyElement(),this.invokeRecursively(function(e){e.clearRenderedChildren&&e.clearRenderedChildren()})},elementId:null,findElementInParentElement:function(e){var t="#"+this.elementId;return Ember.$(t)[0]||Ember.$(t,e)[0]},createElement:function(){if(n(this,"element"))return this;var e=this.renderToBuffer();return i(this,"element",e.element()),this},willInsertElement:Ember.K,didInsertElement:Ember.K,willClearRender:Ember.K,invokeRecursively:function(e,t){for(var r,n,i,o=t===!1?this._childViews:[this];o.length;){r=o.slice(),o=[];for(var a=0,s=r.length;s>a;a++)n=r[a],i=n._childViews?n._childViews.slice(0):null,e(n),i&&o.push.apply(o,i)}},triggerRecursively:function(e){for(var t,r,n,i=[this];i.length;){t=i.slice(),i=[];for(var o=0,a=t.length;a>o;o++)r=t[o],n=r._childViews?r._childViews.slice(0):null,r.trigger&&r.trigger(e),n&&i.push.apply(i,n)}},viewHierarchyCollection:function(){for(var e,t=new h([this]),r=0;r<t.length;r++)e=t.objectAt(r),e._childViews&&t.push.apply(t,e._childViews);return t},destroyElement:function(){return this.currentState.destroyElement(this)},willDestroyElement:Ember.K,_notifyWillDestroyElement:function(){var e=this.viewHierarchyCollection();return e.trigger("willClearRender"),e.trigger("willDestroyElement"),e},_elementDidChange:Ember.observer("element",function(){this.forEachChildView(function(e){delete u(e).cache.element})}),parentViewDidChange:Ember.K,instrumentName:"view",instrumentDetails:function(e){e.template=n(this,"templateName"),this._super(e)},_renderToBuffer:function(e,t){this.lengthBeforeRender=this._childViews.length;var r=this._super(e,t);return this.lengthAfterRender=this._childViews.length,r},renderToBufferIfNeeded:function(e){return this.currentState.renderToBufferIfNeeded(this,e)},beforeRender:function(e){this.applyAttributesToBuffer(e),e.pushOpeningTag()},afterRender:function(e){e.pushClosingTag()},applyAttributesToBuffer:function(e){var t=n(this,"classNameBindings");t.length&&this._applyClassNameBindings(t);var r=n(this,"attributeBindings");r.length&&this._applyAttributeBindings(e,r),e.setClasses(this.classNames),e.id(this.elementId);var i=n(this,"ariaRole");i&&e.attr("role",i),n(this,"isVisible")===!1&&e.style("display","none")},tagName:null,ariaRole:null,classNames:["ember-view"],classNameBindings:m,attributeBindings:m,init:function(){this.elementId=this.elementId||o(this),this._super(),this._childViews=this._childViews.slice(),this.classNameBindings=Ember.A(this.classNameBindings.slice()),this.classNames=Ember.A(this.classNames.slice())},appendChild:function(e,t){return this.currentState.appendChild(this,e,t)},removeChild:function(e){if(!this.isDestroying){i(e,"_parentView",null);var t=this._childViews;return Ember.EnumerableUtils.removeObject(t,e),this.propertyDidChange("childViews"),this}},removeAllChildren:function(){return this.mutateChildViews(function(e,t){e.removeChild(t)})},destroyAllChildren:function(){return this.mutateChildViews(function(e,t){t.destroy()})},removeFromParent:function(){var e=this._parentView;return this.remove(),e&&e.removeChild(this),this},destroy:function(){var e,t,r=this._childViews,i=n(this,"parentView"),o=this.viewName;if(this._super()){for(e=r.length,t=e-1;t>=0;t--)r[t].removedFromDOM=!0;for(o&&i&&i.set(o,null),e=r.length,t=e-1;t>=0;t--)r[t].destroy();return this}},createChildView:function(e,t){if(!e)throw new TypeError("createChildViews first argument must exist");if(e.isView&&e._parentView===this&&e.container===this.container)return e;if(t=t||{},t._parentView=this,Ember.CoreView.detect(e))t.templateData=t.templateData||n(this,"templateData"),t.container=this.container,e=e.create(t),e.viewName&&i(n(this,"concreteView"),e.viewName,e);else if("string"==typeof e){var r="view:"+e,o=this.container.lookupFactory(r);t.templateData=n(this,"templateData"),e=o.create(t)}else t.container=this.container,n(e,"templateData")||(t.templateData=n(this,"templateData")),Ember.setProperties(e,t);return e},becameVisible:Ember.K,becameHidden:Ember.K,_isVisibleDidChange:Ember.observer("isVisible",function(){this._isVisible!==n(this,"isVisible")&&Ember.run.scheduleOnce("render",this,this._toggleVisibility)}),_toggleVisibility:function(){var e=this.$();if(e){var t=n(this,"isVisible");this._isVisible!==t&&(e.toggle(t),this._isVisible=t,this._isAncestorHidden()||(t?this._notifyBecameVisible():this._notifyBecameHidden()))}},_notifyBecameVisible:function(){this.trigger("becameVisible"),this.forEachChildView(function(e){var t=n(e,"isVisible");(t||null===t)&&e._notifyBecameVisible()})},_notifyBecameHidden:function(){this.trigger("becameHidden"),this.forEachChildView(function(e){var t=n(e,"isVisible");(t||null===t)&&e._notifyBecameHidden()})},_isAncestorHidden:function(){for(var e=n(this,"parentView");e;){if(n(e,"isVisible")===!1)return!0;e=n(e,"parentView")}return!1},clearBuffer:function(){this.invokeRecursively(e)},transitionTo:function(e,t){var r=this.currentState,n=this.currentState=this.states[e];this.state=e,r&&r.exit&&r.exit(this),n.enter&&n.enter(this),"inDOM"===e&&delete Ember.meta(this).cache.element,t!==!1&&this.forEachChildView(function(t){t.transitionTo(e)})},handleEvent:function(e,t){return this.currentState.handleEvent(this,e,t)},registerObserver:function(e,t,r,n){if(n||"function"!=typeof r||(n=r,r=null),e&&"object"==typeof e){var i=this,o=function(){i.currentState.invokeObserver(this,n)},a=function(){Ember.run.scheduleOnce("render",this,o)};Ember.addObserver(e,t,r,a),this.one("willClearRender",function(){Ember.removeObserver(e,t,r,a)})}}});var p={prepend:function(e,r){e.$().prepend(r),t()},after:function(e,r){e.$().after(r),t()},html:function(e,r){e.$().html(r),t()},replace:function(e){var r=n(e,"element");i(e,"element",null),e._insertElementLater(function(){Ember.$(r).replaceWith(n(e,"element")),t()})},remove:function(e){e.$().remove(),t()},empty:function(e){e.$().empty(),t()}};Ember.View.reopen({domManager:p}),Ember.View.reopenClass({_parsePropertyPath:function(e){var t,r,n=e.split(":"),i=n[0],o="";return n.length>1&&(t=n[1],3===n.length&&(r=n[2]),o=":"+t,r&&(o+=":"+r)),{path:i,classNames:o,className:""===t?void 0:t,falsyClassName:r}},_classStringForValue:function(e,t,r,n){if(r||n)return r&&t?r:n&&!t?n:null;if(t===!0){var i=e.split(".");return Ember.String.dasherize(i[i.length-1])}return t!==!1&&null!=t?t:null}});var f=Ember.Object.extend(Ember.Evented).create();Ember.View.addMutationListener=function(e){f.on("change",e)},Ember.View.removeMutationListener=function(e){f.off("change",e)},Ember.View.notifyMutationListeners=function(){f.trigger("change")},Ember.View.views={},Ember.View.childViewsProperty=c,Ember.View.applyAttributeBindings=function(e,t,r){var n=Ember.typeOf(r);"value"===t||"string"!==n&&("number"!==n||isNaN(r))?"value"===t||"boolean"===n?Ember.isNone(r)||r===!1?(e.removeAttr(t),e.prop(t,"")):r!==e.prop(t)&&e.prop(t,r):r||e.removeAttr(t):r!==e.attr(t)&&e.attr(t,r)},Ember.View.states=r}(),function(){var e=(Ember.get,Ember.set);Ember.View.states._default={appendChild:function(){throw"You can't use appendChild outside of the rendering process"},$:function(){return void 0},getElement:function(){return null},handleEvent:function(){return!0},destroyElement:function(t){return e(t,"element",null),t._scheduledInsert&&(Ember.run.cancel(t._scheduledInsert),t._scheduledInsert=null),t},renderToBufferIfNeeded:function(){return!1},rerender:Ember.K,invokeObserver:Ember.K}}(),function(){var e=Ember.View.states.preRender=Ember.create(Ember.View.states._default);Ember.merge(e,{insertElement:function(e,t){e.createElement();var r=e.viewHierarchyCollection();r.trigger("willInsertElement"),t.call(e);var n=e.get("element");document.body.contains(n)&&(r.transitionTo("inDOM",!1),r.trigger("didInsertElement"))},renderToBufferIfNeeded:function(e,t){return e.renderToBuffer(t),!0},empty:Ember.K,setElement:function(e,t){return null!==t&&e.transitionTo("hasElement"),t}})}(),function(){var e=(Ember.get,Ember.set,Ember.View.states.inBuffer=Ember.create(Ember.View.states._default));Ember.merge(e,{$:function(e){return e.rerender(),Ember.$()},rerender:function(){throw new Ember.Error("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.")},appendChild:function(e,t,r){var n=e.buffer,i=e._childViews;return t=e.createChildView(t,r),i.length||(i=e._childViews=i.slice()),i.push(t),t.renderToBuffer(n),e.propertyDidChange("childViews"),t},destroyElement:function(e){e.clearBuffer();var t=e._notifyWillDestroyElement();return t.transitionTo("preRender",!1),e},empty:function(){},renderToBufferIfNeeded:function(){return!1},insertElement:function(){throw"You can't insert an element that has already been rendered"},setElement:function(e,t){return null===t?e.transitionTo("preRender"):(e.clearBuffer(),e.transitionTo("hasElement")),t},invokeObserver:function(e,t){t.call(e)}})}(),function(){var e=Ember.get,t=Ember.set,r=Ember.View.states.hasElement=Ember.create(Ember.View.states._default);Ember.merge(r,{$:function(t,r){var n=e(t,"element");return r?Ember.$(r,n):Ember.$(n)},getElement:function(t){var r=e(t,"parentView");return r&&(r=e(r,"element")),r?t.findElementInParentElement(r):Ember.$("#"+e(t,"elementId"))[0]},setElement:function(e,t){if(null!==t)throw"You cannot set an element to a non-null value when the element is already in the DOM.";return e.transitionTo("preRender"),t},rerender:function(e){return e.triggerRecursively("willClearRender"),e.clearRenderedChildren(),e.domManager.replace(e),e},destroyElement:function(e){return e._notifyWillDestroyElement(),e.domManager.remove(e),t(e,"element",null),e._scheduledInsert&&(Ember.run.cancel(e._scheduledInsert),e._scheduledInsert=null),e},empty:function(e){var t,r,n=e._childViews;if(n)for(t=n.length,r=0;t>r;r++)n[r]._notifyWillDestroyElement();e.domManager.empty(e)},handleEvent:function(e,t,r){return e.has(t)?e.trigger(t,r):!0},invokeObserver:function(e,t){t.call(e)}})}(),function(){var e=Ember.View.states.hasElement,t=Ember.View.states.inDOM=Ember.create(e);Ember.merge(t,{enter:function(e){e.isVirtual||(Ember.View.views[e.elementId]=e),e.addBeforeObserver("elementId",function(){throw new Ember.Error("Changing a view's elementId after creation is not allowed")})},exit:function(e){this.isVirtual||delete Ember.View.views[e.elementId]},insertElement:function(){throw"You can't insert an element into the DOM that has already been inserted"}})}(),function(){var e="You can't call %@ on a view being destroyed",t=Ember.String.fmt,r=Ember.View.states.destroying=Ember.create(Ember.View.states._default);Ember.merge(r,{appendChild:function(){throw t(e,["appendChild"])},rerender:function(){throw t(e,["rerender"])},destroyElement:function(){throw t(e,["destroyElement"])},empty:function(){throw t(e,["empty"])},setElement:function(){throw t(e,["set('element', ...)"])},renderToBufferIfNeeded:function(){return!1},insertElement:Ember.K})}(),function(){Ember.View.cloneStates=function(e){var t={};t._default={},t.preRender=Ember.create(t._default),t.destroying=Ember.create(t._default),t.inBuffer=Ember.create(t._default),t.hasElement=Ember.create(t._default),t.inDOM=Ember.create(t.hasElement);for(var r in e)e.hasOwnProperty(r)&&Ember.merge(t[r],e[r]);return t}}(),function(){function e(e,t,r,n){t.triggerRecursively("willInsertElement"),r?r.domManager.after(r,n.string()):e.domManager.prepend(e,n.string()),t.forEach(function(e){e.transitionTo("inDOM"),e.propertyDidChange("element"),e.triggerRecursively("didInsertElement")})}var t=Ember.View.cloneStates(Ember.View.states),r=Ember.get,n=Ember.set,i=Ember.EnumerableUtils.forEach,o=Ember._ViewCollection;Ember.ContainerView=Ember.View.extend(Ember.MutableArray,{states:t,init:function(){this._super();var e=r(this,"childViews");Ember.defineProperty(this,"childViews",Ember.View.childViewsProperty);var t=this._childViews;i(e,function(e,i){var o;"string"==typeof e?(o=r(this,e),o=this.createChildView(o),n(this,e,o)):o=this.createChildView(e),t[i]=o},this);var o=r(this,"currentView");o&&(t.length||(t=this._childViews=this._childViews.slice()),t.push(this.createChildView(o)))},replace:function(e,t,n){var i=n?r(n,"length"):0;if(this.arrayContentWillChange(e,t,i),this.childViewsWillChange(this._childViews,e,t),0===i)this._childViews.splice(e,t);else{var o=[e,t].concat(n);n.length&&!this._childViews.length&&(this._childViews=this._childViews.slice()),this._childViews.splice.apply(this._childViews,o)}return this.arrayContentDidChange(e,t,i),this.childViewsDidChange(this._childViews,e,t,i),this},objectAt:function(e){return this._childViews[e]},length:Ember.computed(function(){return this._childViews.length}).volatile(),render:function(e){this.forEachChildView(function(t){t.renderToBuffer(e)})},instrumentName:"container",childViewsWillChange:function(e,t,r){if(this.propertyWillChange("childViews"),r>0){var n=e.slice(t,t+r);this.currentState.childViewsWillChange(this,e,t,r),this.initializeViews(n,null,null)}},removeChild:function(e){return this.removeObject(e),this},childViewsDidChange:function(e,t,n,i){if(i>0){var o=e.slice(t,t+i);this.initializeViews(o,this,r(this,"templateData")),this.currentState.childViewsDidChange(this,e,t,i)}this.propertyDidChange("childViews")},initializeViews:function(e,t,o){i(e,function(e){n(e,"_parentView",t),!e.container&&t&&n(e,"container",t.container),r(e,"templateData")||n(e,"templateData",o)})},currentView:null,_currentViewWillChange:Ember.beforeObserver("currentView",function(){var e=r(this,"currentView");e&&e.destroy()}),_currentViewDidChange:Ember.observer("currentView",function(){var e=r(this,"currentView");e&&this.pushObject(e)}),_ensureChildrenAreInDOM:function(){this.currentState.ensureChildrenAreInDOM(this)}}),Ember.merge(t._default,{childViewsWillChange:Ember.K,childViewsDidChange:Ember.K,ensureChildrenAreInDOM:Ember.K}),Ember.merge(t.inBuffer,{childViewsDidChange:function(){throw new Ember.Error("You cannot modify child views while in the inBuffer state")}}),Ember.merge(t.hasElement,{childViewsWillChange:function(e,t,r,n){for(var i=r;r+n>i;i++)t[i].remove()},childViewsDidChange:function(e){Ember.run.scheduleOnce("render",e,"_ensureChildrenAreInDOM")},ensureChildrenAreInDOM:function(t){var r,n,i,a,s,u=t._childViews,l=new o;for(r=0,n=u.length;n>r;r++)i=u[r],s||(s=Ember.RenderBuffer(),s._hasElement=!1),i.renderToBufferIfNeeded(s)?l.push(i):l.length?(e(t,l,a,s),s=null,a=i,l.clear()):a=i;l.length&&e(t,l,a,s)}})}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.CollectionView=Ember.ContainerView.extend({content:null,emptyViewClass:Ember.View,emptyView:null,itemViewClass:Ember.View,init:function(){var e=this._super();return this._contentDidChange(),e},_contentWillChange:Ember.beforeObserver("content",function(){var t=this.get("content");t&&t.removeArrayObserver(this);var r=t?e(t,"length"):0;this.arrayWillChange(t,0,r)}),_contentDidChange:Ember.observer("content",function(){var t=e(this,"content");t&&(this._assertArrayLike(t),t.addArrayObserver(this));var r=t?e(t,"length"):0;this.arrayDidChange(t,0,null,r)}),_assertArrayLike:function(){},destroy:function(){if(this._super()){var t=e(this,"content");return t&&t.removeArrayObserver(this),this._createdEmptyView&&this._createdEmptyView.destroy(),this}},arrayWillChange:function(t,r,n){var i=e(this,"emptyView");i&&i instanceof Ember.View&&i.removeFromParent();var o,a,s,u=this._childViews;s=this._childViews.length;var l=n===s;for(l&&(this.currentState.empty(this),this.invokeRecursively(function(e){e.removedFromDOM=!0},!1)),a=r+n-1;a>=r;a--)o=u[a],o.destroy()},arrayDidChange:function(r,n,i,o){var a,s,u,l,c,h,m=[];if(l=r?e(r,"length"):0)for(c=e(this,"itemViewClass"),"string"==typeof c&&(c=e(c)||c),u=n;n+o>u;u++)s=r.objectAt(u),a=this.createChildView(c,{content:s,contentIndex:u}),m.push(a);else{if(h=e(this,"emptyView"),!h)return;"string"==typeof h&&(h=e(h)||h),h=this.createChildView(h),m.push(h),t(this,"emptyView",h),Ember.CoreView.detect(h)&&(this._createdEmptyView=h)}this.replace(n,0,m)},createChildView:function(r,n){r=this._super(r,n);var i=e(r,"tagName");return(null===i||void 0===i)&&(i=Ember.CollectionView.CONTAINER_MAP[e(this,"tagName")],t(r,"tagName",i)),r}}),Ember.CollectionView.CONTAINER_MAP={ul:"li",ol:"li",table:"tr",thead:"tr",tbody:"tr",tfoot:"tr",tr:"td",select:"option"}}(),function(){var e=Ember.get;Ember.ComponentTemplateDeprecation=Ember.Mixin.create({willMergeMixin:function(t){this._super.apply(this,arguments);var r,n,i=t.layoutName||t.layout||e(this,"layoutName");t.templateName&&!i&&(r="templateName",n="layoutName",t.layoutName=t.templateName,delete t.templateName),t.template&&!i&&(r="template",n="layout",t.layout=t.template,delete t.template)}})}(),function(){var e=Ember.get,t=Ember.set,r=(Ember.isNone,Array.prototype.slice);Ember.Component=Ember.View.extend(Ember.TargetActionSupport,Ember.ComponentTemplateDeprecation,{init:function(){this._super(),t(this,"context",this),t(this,"controller",this)
|
15 |
},defaultLayout:function(e,t){Ember.Handlebars.helpers.yield.call(e,t)},template:Ember.computed(function(t,r){if(void 0!==r)return r;var n=e(this,"templateName"),i=this.templateForName(n,"template");return i||e(this,"defaultTemplate")}).property("templateName"),templateName:null,cloneKeywords:function(){return{view:this,controller:this}},_yield:function(t,r){var n=r.data.view,i=this._parentView,o=e(this,"template");o&&n.appendChild(Ember.View,{isVirtual:!0,tagName:"",_contextView:i,template:o,context:e(i,"context"),controller:e(i,"controller"),templateData:{keywords:i.cloneKeywords()}})},targetObject:Ember.computed(function(){var t=e(this,"_parentView");return t?e(t,"controller"):null}).property("_parentView"),sendAction:function(t){var n,i=r.call(arguments,1);n=void 0===t?e(this,"action"):e(this,t),void 0!==n&&this.triggerAction({action:n,actionContext:i})}})}(),function(){Ember.ViewTargetActionSupport=Ember.Mixin.create(Ember.TargetActionSupport,{target:Ember.computed.alias("controller"),actionContext:Ember.computed.alias("context")})}(),function(){e("metamorph",[],function(){"use strict";// Copyright: ©2014 Tilde, Inc. All rights reserved.
|
16 |
var e=function(){},t=0,r=function(){return"undefined"!=typeof MetamorphENV?MetamorphENV.DISABLE_RANGE_API:"undefined"!==ENV?ENV.DISABLE_RANGE_API:!1}(),n=!r&&"undefined"!=typeof document&&"createRange"in document&&"undefined"!=typeof Range&&Range.prototype.createContextualFragment,i="undefined"!=typeof document&&function(){var e=document.createElement("div");return e.innerHTML="<div></div>",e.firstChild.innerHTML="<script></script>",""===e.firstChild.innerHTML}(),o=document&&function(){var e=document.createElement("div");return e.innerHTML="Test: <script type='text/x-placeholder'></script>Value","Test:"===e.childNodes[0].nodeValue&&" Value"===e.childNodes[2].nodeValue}(),a=function(r){var n;n=this instanceof a?this:new e,n.innerHTML=r;var i="metamorph-"+t++;return n.start=i+"-start",n.end=i+"-end",n};e.prototype=a.prototype;var s,u,l,c,h,m,p,f,d;if(c=function(){return this.startTag()+this.innerHTML+this.endTag()},f=function(){return"<script id='"+this.start+"' type='text/x-placeholder'></script>"},d=function(){return"<script id='"+this.end+"' type='text/x-placeholder'></script>"},n)s=function(e,t){var r=document.createRange(),n=document.getElementById(e.start),i=document.getElementById(e.end);return t?(r.setStartBefore(n),r.setEndAfter(i)):(r.setStartAfter(n),r.setEndBefore(i)),r},u=function(e,t){var r=s(this,t);r.deleteContents();var n=r.createContextualFragment(e);r.insertNode(n)},l=function(){var e=s(this,!0);e.deleteContents()},h=function(e){var t=document.createRange();t.setStart(e),t.collapse(!1);var r=t.createContextualFragment(this.outerHTML());e.appendChild(r)},m=function(e){var t=document.createRange(),r=document.getElementById(this.end);t.setStartAfter(r),t.setEndAfter(r);var n=t.createContextualFragment(e);t.insertNode(n)},p=function(e){var t=document.createRange(),r=document.getElementById(this.start);t.setStartAfter(r),t.setEndAfter(r);var n=t.createContextualFragment(e);t.insertNode(n)};else{var b={select:[1,"<select multiple='multiple'>","</select>"],fieldset:[1,"<fieldset>","</fieldset>"],table:[1,"<table>","</table>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"],colgroup:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],map:[1,"<map>","</map>"],_default:[0,"",""]},v=function(e,t){if(e.getAttribute("id")===t)return e;var r,n,i,o=e.childNodes.length;for(r=0;o>r;r++)if(n=e.childNodes[r],i=1===n.nodeType&&v(n,t))return i},E=function(e,t){var r=[];if(o&&(t=t.replace(/(\s+)(<script id='([^']+)')/g,function(e,t,n,i){return r.push([i,t]),n})),e.innerHTML=t,r.length>0){var n,i=r.length;for(n=0;i>n;n++){var a=v(e,r[n][0]),s=document.createTextNode(r[n][1]);a.parentNode.insertBefore(s,a)}}},g=function(e,t){var r=b[e.tagName.toLowerCase()]||b._default,n=r[0],o=r[1],a=r[2];i&&(t="­"+t);var s=document.createElement("div");E(s,o+t+a);for(var u=0;n>=u;u++)s=s.firstChild;if(i){for(var l=s;1===l.nodeType&&!l.nodeName;)l=l.firstChild;3===l.nodeType&&""===l.nodeValue.charAt(0)&&(l.nodeValue=l.nodeValue.slice(1))}return s},y=function(e){for(;""===e.parentNode.tagName;)e=e.parentNode;return e},_=function(e,t){e.parentNode!==t.parentNode&&t.parentNode.insertBefore(e,t.parentNode.firstChild)};u=function(e,t){var r,n,i,o=y(document.getElementById(this.start)),a=document.getElementById(this.end),s=a.parentNode;for(_(o,a),r=o.nextSibling;r;){if(n=r.nextSibling,i=r===a){if(!t)break;a=r.nextSibling}if(r.parentNode.removeChild(r),i)break;r=n}for(r=g(o.parentNode,e),t&&o.parentNode.removeChild(o);r;)n=r.nextSibling,s.insertBefore(r,a),r=n},l=function(){var e=y(document.getElementById(this.start)),t=document.getElementById(this.end);this.html(""),e.parentNode.removeChild(e),t.parentNode.removeChild(t)},h=function(e){for(var t,r=g(e,this.outerHTML());r;)t=r.nextSibling,e.appendChild(r),r=t},m=function(e){var t,r,n=document.getElementById(this.end),i=n.nextSibling,o=n.parentNode;for(r=g(o,e);r;)t=r.nextSibling,o.insertBefore(r,i),r=t},p=function(e){var t,r,n=document.getElementById(this.start),i=n.parentNode;r=g(i,e);for(var o=n.nextSibling;r;)t=r.nextSibling,i.insertBefore(r,o),r=t}}return a.prototype.html=function(e){return this.checkRemoved(),void 0===e?this.innerHTML:(u.call(this,e),this.innerHTML=e,void 0)},a.prototype.replaceWith=function(e){this.checkRemoved(),u.call(this,e,!0)},a.prototype.remove=l,a.prototype.outerHTML=c,a.prototype.appendTo=h,a.prototype.after=m,a.prototype.prepend=p,a.prototype.startTag=f,a.prototype.endTag=d,a.prototype.isRemoved=function(){var e=document.getElementById(this.start),t=document.getElementById(this.end);return!e||!t},a.prototype.checkRemoved=function(){if(this.isRemoved())throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")},a})}(),function(){var e=Object.create||function(e){function t(){}return t.prototype=e,new t},t=Ember.imports&&Ember.imports.Handlebars||this&&this.Handlebars;t||"function"!=typeof r||(t=r("handlebars")),Ember.Handlebars=e(t),Ember.Handlebars.helper=function(e,t){Ember.View.detect(t)?Ember.Handlebars.registerHelper(e,Ember.Handlebars.makeViewHelper(t)):Ember.Handlebars.registerBoundHelper.apply(null,arguments)},Ember.Handlebars.makeViewHelper=function(e){return function(t){return Ember.Handlebars.helpers.view.call(this,e,t)}},Ember.Handlebars.helpers=e(t.helpers),Ember.Handlebars.Compiler=function(){},t.Compiler&&(Ember.Handlebars.Compiler.prototype=e(t.Compiler.prototype)),Ember.Handlebars.Compiler.prototype.compiler=Ember.Handlebars.Compiler,Ember.Handlebars.JavaScriptCompiler=function(){},t.JavaScriptCompiler&&(Ember.Handlebars.JavaScriptCompiler.prototype=e(t.JavaScriptCompiler.prototype),Ember.Handlebars.JavaScriptCompiler.prototype.compiler=Ember.Handlebars.JavaScriptCompiler),Ember.Handlebars.JavaScriptCompiler.prototype.namespace="Ember.Handlebars",Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer=function(){return"''"},Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer=function(e){return"data.buffer.push("+e+");"};var n=/helpers\.(.*?)\)/,i=/helpers\['(.*?)'/,o=/(.*blockHelperMissing\.call\(.*)(stack[0-9]+)(,.*)/;Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation=function(e){var t=e[e.length-1],r=(n.exec(t)||i.exec(t))[1],a=o.exec(t);e[e.length-1]=a[1]+"'"+r+"'"+a[3]};var a=Ember.Handlebars.JavaScriptCompiler.stringifyLastBlockHelperMissingInvocation,s=Ember.Handlebars.JavaScriptCompiler.prototype.blockValue;Ember.Handlebars.JavaScriptCompiler.prototype.blockValue=function(){s.apply(this,arguments),a(this.source)};var u=Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue;Ember.Handlebars.JavaScriptCompiler.prototype.ambiguousBlockValue=function(){u.apply(this,arguments),a(this.source)},Ember.Handlebars.Compiler.prototype.mustache=function(e){if(!e.params.length&&!e.hash){var r=new t.AST.IdNode([{part:"_triageMustache"}]);e.escaped||(e.hash=e.hash||new t.AST.HashNode([]),e.hash.pairs.push(["unescaped",new t.AST.StringNode("true")])),e=new t.AST.MustacheNode([r].concat([e.id]),e.hash,!e.escaped)}return t.Compiler.prototype.mustache.call(this,e)},Ember.Handlebars.precompile=function(e){var r=t.parse(e),n={knownHelpers:{action:!0,unbound:!0,"bind-attr":!0,template:!0,view:!0,_triageMustache:!0},data:!0,stringParams:!0},i=(new Ember.Handlebars.Compiler).compile(r,n);return(new Ember.Handlebars.JavaScriptCompiler).compile(i,n,void 0,!0)},t.compile&&(Ember.Handlebars.compile=function(e){var r=t.parse(e),n={data:!0,stringParams:!0},i=(new Ember.Handlebars.Compiler).compile(r,n),o=(new Ember.Handlebars.JavaScriptCompiler).compile(i,n,void 0,!0),a=Ember.Handlebars.template(o);return a.isMethod=!1,a})}(),function(){function e(e,r,n,i){var o,a,s,u,l,c=[],h=i.hash,m=h.boundOptions,p=t.call(i.types,1);for(l in m)m.hasOwnProperty(l)&&(h[l]=Ember.Handlebars.get(e,m[l],i));for(o=0,a=n.length;a>o;++o)s=n[o],u=p[o],"ID"===u?c.push(Ember.Handlebars.get(s.root,s.path,i)):c.push(s.path);return c.push(i),r.apply(e,c)}var t=Array.prototype.slice,r=Ember.Handlebars.template,n=Ember.Handlebars.normalizePath=function(e,t,r){var n,i,o=r&&r.keywords||{};return n=t.split(".",1)[0],o.hasOwnProperty(n)&&(e=o[n],i=!0,t=t===n?"":t.substr(n.length+1)),{root:e,path:t,isKeyword:i}},i=Ember.Handlebars.get=function(e,t,r){var i,o=r&&r.data,a=n(e,t,o);return e=a.root,t=a.path,i=Ember.get(e,t),void 0===i&&e!==Ember.lookup&&Ember.isGlobalPath(t)&&(i=Ember.get(Ember.lookup,t)),i};Ember.Handlebars.getEscaped=function(e,t,r){var n=i(e,t,r);return null===n||void 0===n?n="":n instanceof Handlebars.SafeString||(n=String(n)),r.hash.unescaped||(n=Handlebars.Utils.escapeExpression(n)),n},Ember.Handlebars.resolveParams=function(e,t,r){for(var n,o,a=[],s=r.types,u=0,l=t.length;l>u;u++)n=t[u],o=s[u],"ID"===o?a.push(i(e,n,r)):a.push(n);return a},Ember.Handlebars.resolveHash=function(e,t,r){var n,o={},a=r.hashTypes;for(var s in t)t.hasOwnProperty(s)&&(n=a[s],o[s]="ID"===n?i(e,t[s],r):t[s]);return o},Ember.Handlebars.registerHelper("helperMissing",function(e){var r,n="",i=arguments[arguments.length-1],o=Ember.Handlebars.resolveHelper(i.data.view.container,e);if(o)return o.apply(this,t.call(arguments,1));throw r="%@ Handlebars error: Could not find property '%@' on object %@.",i.data&&(n=i.data.view),new Ember.Error(Ember.String.fmt(r,[n,e,this]))}),Ember.Handlebars.registerHelper("blockHelperMissing",function(e){var r=arguments[arguments.length-1],n=Ember.Handlebars.resolveHelper(r.data.view.container,e);return n?n.apply(this,t.call(arguments,1)):Handlebars.helpers.helperMissing.call(this,e)}),Ember.Handlebars.registerBoundHelper=function(e){var r=t.call(arguments,1),n=Ember.Handlebars.makeBoundHelper.apply(this,r);Ember.Handlebars.registerHelper(e,n)},Ember.Handlebars.makeBoundHelper=function(r){function i(){var i,a,s,u,l,c=t.call(arguments,0,-1),h=c.length,m=arguments[arguments.length-1],p=[],f=m.data,d=f.isUnbound?t.call(m.types,1):m.types,b=m.hash,v=f.view,E=m.contexts,g=E&&E.length?E[0]:this,y="",_=Ember._SimpleHandlebarsView.prototype.normalizedValue,w=b.boundOptions={};for(s in b)Ember.IS_BINDING.test(s)&&(w[s.slice(0,-7)]=b[s]);var C=[];for(f.properties=[],i=0;h>i;++i)if(f.properties.push(c[i]),"ID"===d[i]){var O=n(g,c[i],f);p.push(O),C.push(O)}else f.isUnbound?p.push({path:c[i]}):p.push(null);if(f.isUnbound)return e(this,r,p,m);var A=new Ember._SimpleHandlebarsView(null,null,!m.hash.unescaped,m.data);A.normalizedValue=function(){var e,t=[];for(e in w)w.hasOwnProperty(e)&&(l=n(g,w[e],f),A.path=l.path,A.pathRoot=l.root,b[e]=_.call(A));for(i=0;h>i;++i)l=p[i],l?(A.path=l.path,A.pathRoot=l.root,t.push(_.call(A))):t.push(c[i]);return t.push(m),r.apply(g,t)},v.appendChild(A);for(u in w)w.hasOwnProperty(u)&&C.push(n(g,w[u],f));for(i=0,a=C.length;a>i;++i)l=C[i],v.registerObserver(l.root,l.path,A,A.rerender);if("ID"===d[0]&&0!==p.length){var P=p[0],T=P.root,x=P.path;Ember.isEmpty(x)||(y=x+".");for(var S=0,V=o.length;V>S;S++)v.registerObserver(T,y+o[S],A,A.rerender)}}var o=t.call(arguments,1);return i._rawFunction=r,i},Ember.Handlebars.template=function(e){var t=r(e);return t.isTop=!0,t}}(),function(){Ember.String.htmlSafe=function(e){return new Handlebars.SafeString(e)};var e=Ember.String.htmlSafe;(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.htmlSafe=function(){return e(this)})}(),function(){Ember.Handlebars.resolvePaths=function(e){for(var t=[],r=e.contexts,n=e.roots,i=e.data,o=0,a=r.length;a>o;o++)t.push(Ember.Handlebars.get(n[o],r[o],{data:i}));return t}}(),function(){function e(){Ember.run.once(Ember.View,"notifyMutationListeners")}var r=(Ember.set,Ember.get,t("metamorph")),n={remove:function(t){t.morph.remove(),e()},prepend:function(t,r){t.morph.prepend(r),e()},after:function(t,r){t.morph.after(r),e()},html:function(t,r){t.morph.html(r),e()},replace:function(t){var r=t.morph;t.transitionTo("preRender"),Ember.run.schedule("render",this,function(){if(!t.isDestroying){t.clearRenderedChildren();var n=t.renderToBuffer();t.invokeRecursively(function(e){e.propertyWillChange("element")}),t.triggerRecursively("willInsertElement"),r.replaceWith(n.string()),t.transitionTo("inDOM"),t.invokeRecursively(function(e){e.propertyDidChange("element")}),t.triggerRecursively("didInsertElement"),e()}})},empty:function(t){t.morph.html(""),e()}};Ember._Metamorph=Ember.Mixin.create({isVirtual:!0,tagName:"",instrumentName:"metamorph",init:function(){this._super(),this.morph=r()},beforeRender:function(e){e.push(this.morph.startTag()),e.pushOpeningTag()},afterRender:function(e){e.pushClosingTag(),e.push(this.morph.endTag())},createElement:function(){var e=this.renderToBuffer();this.outerHTML=e.string(),this.clearBuffer()},domManager:n}),Ember._MetamorphView=Ember.View.extend(Ember._Metamorph),Ember._SimpleMetamorphView=Ember.CoreView.extend(Ember._Metamorph)}(),function(){function e(e,t,r,n){this.path=e,this.pathRoot=t,this.isEscaped=r,this.templateData=n,this.morph=o(),this.state="preRender",this.updateId=null,this._parentView=null,this.buffer=null}var r=Ember.get,n=Ember.set,i=Ember.Handlebars.get,o=t("metamorph");Ember._SimpleHandlebarsView=e,e.prototype={isVirtual:!0,isView:!0,destroy:function(){this.updateId&&(Ember.run.cancel(this.updateId),this.updateId=null),this._parentView&&this._parentView.removeChild(this),this.morph=null,this.state="destroyed"},propertyWillChange:Ember.K,propertyDidChange:Ember.K,normalizedValue:function(){var e,t,r=this.path,n=this.pathRoot;return""===r?e=n:(t=this.templateData,e=i(n,r,{data:t})),e},renderToBuffer:function(e){var t="";t+=this.morph.startTag(),t+=this.render(),t+=this.morph.endTag(),e.push(t)},render:function(){var e=this.isEscaped,t=this.normalizedValue();return null===t||void 0===t?t="":t instanceof Handlebars.SafeString||(t=String(t)),e&&(t=Handlebars.Utils.escapeExpression(t)),t},rerender:function(){switch(this.state){case"preRender":case"destroyed":break;case"inBuffer":throw new Ember.Error("Something you did tried to replace an {{expression}} before it was inserted into the DOM.");case"hasElement":case"inDOM":this.updateId=Ember.run.scheduleOnce("render",this,"update")}return this},update:function(){this.updateId=null,this.morph.html(this.render())},transitionTo:function(e){this.state=e}};var a=Ember.View.cloneStates(Ember.View.states),s=Ember.merge;s(a._default,{rerenderIfNeeded:Ember.K}),s(a.inDOM,{rerenderIfNeeded:function(e){e.normalizedValue()!==e._lastNormalizedValue&&e.rerender()}}),Ember._HandlebarsBoundView=Ember._MetamorphView.extend({instrumentName:"boundHandlebars",states:a,shouldDisplayFunc:null,preserveContext:!1,previousContext:null,displayTemplate:null,inverseTemplate:null,path:null,pathRoot:null,normalizedValue:function(){var e,t,n=r(this,"path"),o=r(this,"pathRoot"),a=r(this,"valueNormalizerFunc");return""===n?e=o:(t=r(this,"templateData"),e=i(o,n,{data:t})),a?a(e):e},rerenderIfNeeded:function(){this.currentState.rerenderIfNeeded(this)},render:function(e){var t=r(this,"isEscaped"),i=r(this,"shouldDisplayFunc"),o=r(this,"preserveContext"),a=r(this,"previousContext"),s=r(this,"_contextController"),u=r(this,"inverseTemplate"),l=r(this,"displayTemplate"),c=this.normalizedValue();if(this._lastNormalizedValue=c,i(c))if(n(this,"template",l),o)n(this,"_context",a);else{if(!l)return null===c||void 0===c?c="":c instanceof Handlebars.SafeString||(c=String(c)),t&&(c=Handlebars.Utils.escapeExpression(c)),e.push(c),void 0;s&&(n(s,"content",c),c=s),n(this,"_context",c)}else u?(n(this,"template",u),o?n(this,"_context",a):n(this,"_context",c)):n(this,"template",function(){return""});return this._super(e)}})}(),function(){function e(e){return!Ember.isNone(e)}function t(e,t,r,n,i,u){var l,c,h,m=t.data,p=t.fn,f=t.inverse,d=m.view,b=this;if(l=a(b,e,m),"object"==typeof this){if(m.insideGroup){c=function(){Ember.run.once(d,"rerender")};var v,E,g=o(b,e,t);g=i?i(g):g,E=r?b:g,n(g)?v=p:f&&(v=f),v(E,{data:t.data})}else{var y=d.createChildView(Ember._HandlebarsBoundView,{preserveContext:r,shouldDisplayFunc:n,valueNormalizerFunc:i,displayTemplate:p,inverseTemplate:f,path:e,pathRoot:b,previousContext:b,isEscaped:!t.hash.unescaped,templateData:t.data});t.hash.controller&&y.set("_contextController",this.container.lookupFactory("controller:"+t.hash.controller).create({container:b.container,parentController:b,target:b})),d.appendChild(y),c=function(){Ember.run.scheduleOnce("render",y,"rerenderIfNeeded")}}if(""!==l.path&&(d.registerObserver(l.root,l.path,c),u))for(h=0;h<u.length;h++)d.registerObserver(l.root,l.path+"."+u[h],c)}else m.buffer.push(s(b,e,t))}function r(e,t,r){var n,i,o,u,l=r.data,c=l.view;if(n=a(e,t,l),o=n.root,o&&"object"==typeof o){if(l.insideGroup)i=function(){Ember.run.once(c,"rerender")},u=s(e,t,r),l.buffer.push(u);else{var h=new Ember._SimpleHandlebarsView(t,e,!r.hash.unescaped,r.data);h._parentView=c,c.appendChild(h),i=function(){Ember.run.scheduleOnce("render",h,"rerender")}}""!==n.path&&c.registerObserver(n.root,n.path,i)}else u=s(e,t,r),l.buffer.push(u)}function n(e){var t=e&&i(e,"isTruthy");return"boolean"==typeof t?t:Ember.isArray(e)?0!==i(e,"length"):!!e}var i=Ember.get,o=(Ember.set,Ember.String.fmt,Ember.Handlebars.get),a=Ember.Handlebars.normalizePath,s=Ember.Handlebars.getEscaped,u=Ember.ArrayPolyfills.forEach,l=Ember.create,c=Ember.Handlebars,h=c.helpers;c.bind=t,c.registerHelper("_triageMustache",function(e,t){if(h[e])return h[e].call(this,t);var r=Ember.Handlebars.resolveHelper(t.data.view.container,e);return r?r.call(this,t):h.bind.call(this,e,t)}),Ember.Handlebars.resolveHelper=function(e,t){if(e&&-1!==t.indexOf("-")){var r=e.lookup("helper:"+t);if(!r){var n=e.lookup("component-lookup:main"),i=n.lookupFactory(t,e);i&&(r=c.makeViewHelper(i),e.register("helper:"+t,r))}return r}},c.registerHelper("bind",function(n,i){var o=i.contexts&&i.contexts.length?i.contexts[0]:this;return i.fn?t.call(o,n,i,!1,e):r(o,n,i)}),c.registerHelper("boundIf",function(e,r){var i=r.contexts&&r.contexts.length?r.contexts[0]:this;return t.call(i,e,r,!0,n,n,["isTruthy","length"])}),c.registerHelper("unboundIf",function(e,t){var r,i,s=t.contexts&&t.contexts.length?t.contexts[0]:this,u=t.data,l=t.fn,c=t.inverse;r=a(s,e,u),i=o(s,e,t),n(i)||(l=c),l(s,{data:u})}),c.registerHelper("with",function(r,n){if(4===arguments.length){var i,o,s,u,c;n=arguments[3],i=arguments[2],o=arguments[0];var m=l(n);if(m.data=l(n.data),m.data.keywords=l(n.data.keywords||{}),Ember.isGlobalPath(o))c=o;else{u=a(this,o,n.data),o=u.path,s=u.root;var p=Ember.$.expando+Ember.guidFor(s);m.data.keywords[p]=s,c=o?p+"."+o:p}return Ember.bind(m.data.keywords,i,c),t.call(this,o,m,!0,e)}return h.bind.call(n.contexts[0],r,n)}),c.registerHelper("if",function(e,t){return t.data.isUnbound?h.unboundIf.call(t.contexts[0],e,t):h.boundIf.call(t.contexts[0],e,t)}),c.registerHelper("unless",function(e,t){var r=t.fn,n=t.inverse;return t.fn=n,t.inverse=r,t.data.isUnbound?h.unboundIf.call(t.contexts[0],e,t):h.boundIf.call(t.contexts[0],e,t)}),c.registerHelper("bind-attr",function(e){var t=e.hash,r=e.data.view,n=[],i=this,s=++Ember.uuid,l=t["class"];if(null!=l){var h=c.bindClasses(this,l,r,s,e);n.push('class="'+Handlebars.Utils.escapeExpression(h.join(" "))+'"'),delete t["class"]}var m=Ember.keys(t);return u.call(m,function(u){var l,c=t[u];l=a(i,c,e.data);var h,m,p="this"===c?l.root:o(i,c,e),f=Ember.typeOf(p);h=function(){var t=o(i,c,e),n=r.$("[data-bindattr-"+s+"='"+s+"']");return n&&0!==n.length?(Ember.View.applyAttributeBindings(n,u,t),void 0):(Ember.removeObserver(l.root,l.path,m),void 0)},"this"===c||l.isKeyword&&""===l.path||r.registerObserver(l.root,l.path,h),"string"===f||"number"===f&&!isNaN(p)?n.push(u+'="'+Handlebars.Utils.escapeExpression(p)+'"'):p&&"boolean"===f&&n.push(u+'="'+u+'"')},this),n.push("data-bindattr-"+s+'="'+s+'"'),new c.SafeString(n.join(" "))}),c.registerHelper("bindAttr",function(){return c.helpers["bind-attr"].apply(this,arguments)}),c.bindClasses=function(e,t,r,n,i){var s,l,c,h=[],m=function(e,t,r){var n,i=t.path;return n="this"===i?e:""===i?!0:o(e,i,r),Ember.View._classStringForValue(i,n,t.className,t.falsyClassName)};return u.call(t.split(" "),function(t){var o,u,p,f,d=Ember.View._parsePropertyPath(t),b=d.path,v=e;""!==b&&"this"!==b&&(f=a(e,b,i.data),v=f.root,b=f.path),u=function(){s=m(e,d,i),c=n?r.$("[data-bindattr-"+n+"='"+n+"']"):r.$(),c&&0!==c.length?(o&&c.removeClass(o),s?(c.addClass(s),o=s):o=null):Ember.removeObserver(v,b,p)},""!==b&&"this"!==b&&r.registerObserver(v,b,u),l=m(e,d,i),l&&(h.push(l),o=l)}),h}}(),function(){function e(e,r){var n=r.hash,i=r.hashTypes;for(var o in n)if("ID"===i[o]){var a=n[o];Ember.IS_BINDING.test(o)||(n[o+"Binding"]=a,i[o+"Binding"]="STRING",delete n[o],delete i[o])}n.hasOwnProperty("idBinding")&&(n.id=t.get(e,n.idBinding,r),i.id="STRING",delete n.idBinding,delete i.idBinding)}var t=(Ember.get,Ember.set,Ember.Handlebars),r=/^[a-z]/,n=/^view\./;t.ViewHelper=Ember.Object.create({propertiesFromHTMLOptions:function(e){var t=e.hash,r=e.data,n={},i=t["class"],o=!1;t.id&&(n.elementId=t.id,o=!0),t.tag&&(n.tagName=t.tag,o=!0),i&&(i=i.split(" "),n.classNames=i,o=!0),t.classBinding&&(n.classNameBindings=t.classBinding.split(" "),o=!0),t.classNameBindings&&(void 0===n.classNameBindings&&(n.classNameBindings=[]),n.classNameBindings=n.classNameBindings.concat(t.classNameBindings.split(" ")),o=!0),t.attributeBindings&&(n.attributeBindings=null,o=!0),o&&(t=Ember.$.extend({},t),delete t.id,delete t.tag,delete t["class"],delete t.classBinding);var a;for(var s in t)t.hasOwnProperty(s)&&Ember.IS_BINDING.test(s)&&"string"==typeof t[s]&&(a=this.contextualizeBindingPath(t[s],r),a&&(t[s]=a));if(n.classNameBindings)for(var u in n.classNameBindings){var l=n.classNameBindings[u];if("string"==typeof l){var c=Ember.View._parsePropertyPath(l);a=this.contextualizeBindingPath(c.path,r),a&&(n.classNameBindings[u]=a+c.classNames)}}return Ember.$.extend(t,n)},contextualizeBindingPath:function(e,t){var r=Ember.Handlebars.normalizePath(null,e,t);return r.isKeyword?"templateData.keywords."+e:Ember.isGlobalPath(e)?null:"this"===e||""===e?"_parentView.context":"_parentView.context."+e},helper:function(i,o,a){var s,u=a.data,l=a.fn;e(i,a),s="string"==typeof o?"STRING"===a.types[0]&&r.test(o)&&!n.test(o)?u.view.container.lookupFactory("view:"+o):t.get(i,o,a):o;var c=this.propertiesFromHTMLOptions(a,i),h=u.view;c.templateData=u;var m=s.proto?s.proto():s;l&&(c.template=l),m.controller||m.controllerBinding||c.controller||c.controllerBinding||(c._context=i),h.appendChild(s,c)}}),t.registerHelper("view",function(e,r){return e&&e.data&&e.data.isRenderData&&(r=e,e="Ember.View"),t.ViewHelper.helper(this,e,r)})}(),function(){{var e=Ember.get,t=Ember.Handlebars.get;Ember.String.fmt}Ember.Handlebars.registerHelper("collection",function(r,n){r&&r.data&&r.data.isRenderData&&(n=r,r=void 0);{var i,o,a,s=n.fn,u=n.data,l=n.inverse;n.data.view}r?(i=u.keywords.controller,o=i&&i.container,a=t(this,r,n)||o.lookupFactory("view:"+r)):a=Ember.CollectionView;var c,h,m=n.hash,p={},f=a.proto();m.itemView?(i=u.keywords.controller,o=i.container,h=o.lookupFactory("view:"+m.itemView)):h=m.itemViewClass?t(f,m.itemViewClass,n):f.itemViewClass,delete m.itemViewClass,delete m.itemView;for(var d in m)m.hasOwnProperty(d)&&(c=d.match(/^item(.)(.*)$/),c&&"itemController"!==d&&(p[c[1].toLowerCase()+c[2]]=m[d],delete m[d]));s&&(p.template=s,delete n.fn);var b;l&&l!==Ember.Handlebars.VM.noop?(b=e(f,"emptyViewClass"),b=b.extend({template:l,tagName:p.tagName})):m.emptyViewClass&&(b=t(this,m.emptyViewClass,n)),b&&(m.emptyView=b),m.keyword||(p._context=Ember.computed.alias("content"));var v=Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({data:u,hash:p},this);return m.itemViewClass=h.extend(v),Ember.Handlebars.helpers.view.call(this,a,n)})}(),function(){var e=Ember.Handlebars.get;Ember.Handlebars.registerHelper("unbound",function(t,r){var n,i,o,a=arguments[arguments.length-1];return arguments.length>2?(a.data.isUnbound=!0,n=Ember.Handlebars.helpers[arguments[0]]||Ember.Handlebars.helpers.helperMissing,o=n.apply(this,Array.prototype.slice.call(arguments,1)),delete a.data.isUnbound,o):(i=r.contexts&&r.contexts.length?r.contexts[0]:this,e(i,t,r))})}(),function(){var e=(Ember.get,Ember.Handlebars.get),t=Ember.Handlebars.normalizePath,r=[].slice;Ember.Handlebars.registerHelper("log",function(){var n=r.call(arguments,0,-1),i=arguments[arguments.length-1],o=Ember.Logger.log,a=[],s=!1;s=!0;for(var u=0;u<n.length;u++){var l=i.types[u];if("ID"!==l&&s)a.push(n[u]);else{var c=i.contexts&&i.contexts[u]||this,h=t(c,n[u],i.data);"this"===h.path?a.push(h.root):a.push(e(h.root,h.path,i))}}o.apply(o,a)}),Ember.Handlebars.registerHelper("debugger",function(){{var e=this;Ember.inspect(e)}})}(),function(){{var e=Ember.get,t=Ember.set;Ember.String.fmt}Ember.Handlebars.EachView=Ember.CollectionView.extend(Ember._Metamorph,{init:function(){var r,n=e(this,"itemController");if(n){var i=e(this,"controller.container").lookupFactory("controller:array").create({_isVirtual:!0,parentController:e(this,"controller"),itemController:n,target:e(this,"controller"),_eachView:this});this.disableContentObservers(function(){t(this,"content",i),r=new Ember.Binding("content","_eachView.dataSource").oneWay(),r.connect(i)}),t(this,"_arrayController",i)}else this.disableContentObservers(function(){r=new Ember.Binding("content","dataSource").oneWay(),r.connect(this)});return this._super()},_assertArrayLike:function(){},disableContentObservers:function(e){Ember.removeBeforeObserver(this,"content",null,"_contentWillChange"),Ember.removeObserver(this,"content",null,"_contentDidChange"),e.call(this),Ember.addBeforeObserver(this,"content",null,"_contentWillChange"),Ember.addObserver(this,"content",null,"_contentDidChange")},itemViewClass:Ember._MetamorphView,emptyViewClass:Ember._MetamorphView,createChildView:function(r,n){r=this._super(r,n);var i=e(this,"keyword"),o=e(r,"content");if(i){var a=e(r,"templateData");a=Ember.copy(a),a.keywords=r.cloneKeywords(),t(r,"templateData",a),a.keywords[i]=o}return o&&o.isController&&t(r,"controller",o),r},destroy:function(){if(this._super()){var t=e(this,"_arrayController");return t&&t.destroy(),this}}});var r=Ember.Handlebars.GroupedEach=function(e,t,r){var n=this,i=Ember.Handlebars.normalizePath(e,t,r.data);this.context=e,this.path=t,this.options=r,this.template=r.fn,this.containingView=r.data.view,this.normalizedRoot=i.root,this.normalizedPath=i.path,this.content=this.lookupContent(),this.addContentObservers(),this.addArrayObservers(),this.containingView.on("willClearRender",function(){n.destroy()})};r.prototype={contentWillChange:function(){this.removeArrayObservers()},contentDidChange:function(){this.content=this.lookupContent(),this.addArrayObservers(),this.rerenderContainingView()},contentArrayWillChange:Ember.K,contentArrayDidChange:function(){this.rerenderContainingView()},lookupContent:function(){return Ember.Handlebars.get(this.normalizedRoot,this.normalizedPath,this.options)},addArrayObservers:function(){this.content&&this.content.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},removeArrayObservers:function(){this.content&&this.content.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},addContentObservers:function(){Ember.addBeforeObserver(this.normalizedRoot,this.normalizedPath,this,this.contentWillChange),Ember.addObserver(this.normalizedRoot,this.normalizedPath,this,this.contentDidChange)},removeContentObservers:function(){Ember.removeBeforeObserver(this.normalizedRoot,this.normalizedPath,this.contentWillChange),Ember.removeObserver(this.normalizedRoot,this.normalizedPath,this.contentDidChange)},render:function(){if(this.content){var t=this.content,r=e(t,"length"),n=this.options.data,i=this.template;n.insideEach=!0;for(var o=0;r>o;o++)i(t.objectAt(o),{data:n})}},rerenderContainingView:function(){var e=this;Ember.run.scheduleOnce("render",this,function(){e.destroyed||e.containingView.rerender()})},destroy:function(){this.removeContentObservers(),this.content&&this.removeArrayObservers(),this.destroyed=!0}},Ember.Handlebars.registerHelper("each",function(e,t){if(4===arguments.length){var r=arguments[0];t=arguments[3],e=arguments[2],""===e&&(e="this"),t.hash.keyword=r}return 1===arguments.length&&(t=e,e="this"),t.hash.dataSourceBinding=e,!t.data.insideGroup||t.hash.groupedRows||t.hash.itemViewClass?Ember.Handlebars.helpers.collection.call(this,"Ember.Handlebars.EachView",t):(new Ember.Handlebars.GroupedEach(this,e,t).render(),void 0)})}(),function(){Ember.Handlebars.registerHelper("template",function(){return Ember.Handlebars.helpers.partial.apply(this,arguments)})}(),function(){function e(e){return!Ember.isNone(e)}function t(e,t,r){var n=t.split("/"),i=n[n.length-1];n[n.length-1]="_"+i;var o=r.data.view,a=n.join("/"),s=o.templateForName(a),u=!s&&o.templateForName(t);(s=s||u)(e,{data:r.data})}Ember.Handlebars.registerHelper("partial",function(r,n){var i=n.contexts&&n.contexts.length?n.contexts[0]:this;return"ID"===n.types[0]?(n.fn=function(e,n){var i=Ember.Handlebars.get(e,r,n);t(e,i,n)},Ember.Handlebars.bind.call(i,r,n,!0,e)):(t(i,r,n),void 0)})}(),function(){{var e=Ember.get;Ember.set}Ember.Handlebars.registerHelper("yield",function(t){for(var r=t.data.view;r&&!e(r,"layout");)r=r._contextView?r._contextView:e(r,"parentView");r._yield(this,t)})}(),function(){Ember.Handlebars.registerHelper("loc",function(e){return Ember.String.loc(e)})}(),function(){{var e=Ember.set;Ember.get}Ember.Checkbox=Ember.View.extend({classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","indeterminate","disabled","tabindex","name","autofocus","form"],type:"checkbox",checked:!1,disabled:!1,indeterminate:!1,init:function(){this._super(),this.on("change",this,this._updateElementValue)},didInsertElement:function(){this._super(),this.get("element").indeterminate=!!this.get("indeterminate")},_updateElementValue:function(){e(this,"checked",this.$().prop("checked"))}})}(),function(){function e(e,r,n){var i=t(r,e),o=t(r,"onEvent"),a=t(r,"value");(o===e||"keyPress"===o&&"key-press"===e)&&r.sendAction("action",a),r.sendAction(e,a),(i||o===e)&&(t(r,"bubbles")||n.stopPropagation())}var t=Ember.get,r=Ember.set;Ember.TextSupport=Ember.Mixin.create(Ember.TargetActionSupport,{value:"",attributeBindings:["placeholder","disabled","maxlength","tabindex","readonly","autofocus","form","selectionDirection","spellcheck","required"],placeholder:null,disabled:!1,maxlength:null,init:function(){this._super(),this.on("focusOut",this,this._elementValueDidChange),this.on("change",this,this._elementValueDidChange),this.on("paste",this,this._elementValueDidChange),this.on("cut",this,this._elementValueDidChange),this.on("input",this,this._elementValueDidChange),this.on("keyUp",this,this.interpretKeyEvents)},action:null,onEvent:"enter",bubbles:!1,interpretKeyEvents:function(e){var t=Ember.TextSupport.KEY_EVENTS,r=t[e.keyCode];return this._elementValueDidChange(),r?this[r](e):void 0},_elementValueDidChange:function(){r(this,"value",this.$().val())},insertNewline:function(t){e("enter",this,t),e("insert-newline",this,t)},cancel:function(t){e("escape-press",this,t)},focusIn:function(t){e("focus-in",this,t)},focusOut:function(t){e("focus-out",this,t)},keyPress:function(t){e("key-press",this,t)}}),Ember.TextSupport.KEY_EVENTS={13:"insertNewline",27:"cancel"}}(),function(){Ember.get,Ember.set;Ember.TextField=Ember.Component.extend(Ember.TextSupport,{classNames:["ember-text-field"],tagName:"input",attributeBindings:["type","value","size","pattern","name","min","max","accept","autocomplete","autosave","formaction","formenctype","formmethod","formnovalidate","formtarget","height","inputmode","list","multiple","pattern","step","width"],value:"",type:"text",size:null,pattern:null,min:null,max:null})}(),function(){{var e=Ember.get;Ember.set}Ember.TextArea=Ember.Component.extend(Ember.TextSupport,{classNames:["ember-text-area"],tagName:"textarea",attributeBindings:["rows","cols","name","selectionEnd","selectionStart","wrap"],rows:null,cols:null,_updateElementValue:Ember.observer("value",function(){var t=e(this,"value"),r=this.$();r&&t!==r.val()&&r.val(t)}),init:function(){this._super(),this.on("didInsertElement",this,this._updateElementValue)}})}(),function(){{var e=Ember.set,t=Ember.get,r=Ember.EnumerableUtils.indexOf,n=Ember.EnumerableUtils.indexesOf,i=Ember.EnumerableUtils.forEach,o=Ember.EnumerableUtils.replace,a=Ember.isArray;Ember.Handlebars.compile}Ember.SelectOption=Ember.View.extend({tagName:"option",attributeBindings:["value","selected"],defaultTemplate:function(e,t){t={data:t.data,hash:{}},Ember.Handlebars.helpers.bind.call(e,"view.label",t)},init:function(){this.labelPathDidChange(),this.valuePathDidChange(),this._super()},selected:Ember.computed(function(){var e=t(this,"content"),n=t(this,"parentView.selection");return t(this,"parentView.multiple")?n&&r(n,e.valueOf())>-1:e==n
|
17 |
+
}).property("content","parentView.selection"),labelPathDidChange:Ember.observer("parentView.optionLabelPath",function(){var e=t(this,"parentView.optionLabelPath");e&&Ember.defineProperty(this,"label",Ember.computed(function(){return t(this,e)}).property(e))}),valuePathDidChange:Ember.observer("parentView.optionValuePath",function(){var e=t(this,"parentView.optionValuePath");e&&Ember.defineProperty(this,"value",Ember.computed(function(){return t(this,e)}).property(e))})}),Ember.SelectOptgroup=Ember.CollectionView.extend({tagName:"optgroup",attributeBindings:["label"],selectionBinding:"parentView.selection",multipleBinding:"parentView.multiple",optionLabelPathBinding:"parentView.optionLabelPath",optionValuePathBinding:"parentView.optionValuePath",itemViewClassBinding:"parentView.optionView"}),Ember.Select=Ember.View.extend({tagName:"select",classNames:["ember-select"],defaultTemplate:Ember.Handlebars.template(function(e,t,r,n,i){function o(e,t){var n,i="";return t.buffer.push('<option value="">'),n=r._triageMustache.call(e,"view.prompt",{hash:{},hashTypes:{},hashContexts:{},contexts:[e],types:["ID"],data:t}),(n||0===n)&&t.buffer.push(n),t.buffer.push("</option>"),i}function a(e,t){var n;n=r.each.call(e,"view.groupedContent",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(4,s,t),contexts:[e],types:["ID"],data:t}),n||0===n?t.buffer.push(n):t.buffer.push("")}function s(e,t){t.buffer.push(m(r.view.call(e,"view.groupView",{hash:{content:"content",label:"label"},hashTypes:{content:"ID",label:"ID"},hashContexts:{content:e,label:e},contexts:[e],types:["ID"],data:t})))}function u(e,t){var n;n=r.each.call(e,"view.content",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(7,l,t),contexts:[e],types:["ID"],data:t}),n||0===n?t.buffer.push(n):t.buffer.push("")}function l(e,t){t.buffer.push(m(r.view.call(e,"view.optionView",{hash:{content:""},hashTypes:{content:"ID"},hashContexts:{content:e},contexts:[e],types:["ID"],data:t})))}this.compilerInfo=[4,">= 1.0.0"],r=this.merge(r,Ember.Handlebars.helpers),i=i||{};var c,h="",m=this.escapeExpression,p=this;return c=r["if"].call(t,"view.prompt",{hash:{},hashTypes:{},hashContexts:{},inverse:p.noop,fn:p.program(1,o,i),contexts:[t],types:["ID"],data:i}),(c||0===c)&&i.buffer.push(c),c=r["if"].call(t,"view.optionGroupPath",{hash:{},hashTypes:{},hashContexts:{},inverse:p.program(6,u,i),fn:p.program(3,a,i),contexts:[t],types:["ID"],data:i}),(c||0===c)&&i.buffer.push(c),h}),attributeBindings:["multiple","disabled","tabindex","name","required","autofocus","form","size"],multiple:!1,disabled:!1,required:!1,content:null,selection:null,value:Ember.computed(function(e,r){if(2===arguments.length)return r;var n=t(this,"optionValuePath").replace(/^content\.?/,"");return n?t(this,"selection."+n):t(this,"selection")}).property("selection"),prompt:null,optionLabelPath:"content",optionValuePath:"content",optionGroupPath:null,groupView:Ember.SelectOptgroup,groupedContent:Ember.computed(function(){var e=t(this,"optionGroupPath"),r=Ember.A(),n=t(this,"content")||[];return i(n,function(n){var i=t(n,e);t(r,"lastObject.label")!==i&&r.pushObject({label:i,content:Ember.A()}),t(r,"lastObject.content").push(n)}),r}).property("optionGroupPath","content.@each"),optionView:Ember.SelectOption,_change:function(){t(this,"multiple")?this._changeMultiple():this._changeSingle()},selectionDidChange:Ember.observer("selection.@each",function(){var r=t(this,"selection");if(t(this,"multiple")){if(!a(r))return e(this,"selection",Ember.A([r])),void 0;this._selectionDidChangeMultiple()}else this._selectionDidChangeSingle()}),valueDidChange:Ember.observer("value",function(){var e,r=t(this,"content"),n=t(this,"value"),i=t(this,"optionValuePath").replace(/^content\.?/,""),o=i?t(this,"selection."+i):t(this,"selection");n!==o&&(e=r?r.find(function(e){return n===(i?t(e,i):e)}):null,this.set("selection",e))}),_triggerChange:function(){var e=t(this,"selection"),r=t(this,"value");Ember.isNone(e)||this.selectionDidChange(),Ember.isNone(r)||this.valueDidChange(),this._change()},_changeSingle:function(){var r=this.$()[0].selectedIndex,n=t(this,"content"),i=t(this,"prompt");if(n&&t(n,"length")){if(i&&0===r)return e(this,"selection",null),void 0;i&&(r-=1),e(this,"selection",n.objectAt(r))}},_changeMultiple:function(){var r=this.$("option:selected"),n=t(this,"prompt"),i=n?1:0,s=t(this,"content"),u=t(this,"selection");if(s&&r){var l=r.map(function(){return this.index-i}).toArray(),c=s.objectsAt(l);a(u)?o(u,0,t(u,"length"),c):e(this,"selection",c)}},_selectionDidChangeSingle:function(){var e=this.get("element");if(e){var n=t(this,"content"),i=t(this,"selection"),o=n?r(n,i):-1,a=t(this,"prompt");a&&(o+=1),e&&(e.selectedIndex=o)}},_selectionDidChangeMultiple:function(){var e,i=t(this,"content"),o=t(this,"selection"),a=i?n(i,o):[-1],s=t(this,"prompt"),u=s?1:0,l=this.$("option");l&&l.each(function(){e=this.index>-1?this.index-u:-1,this.selected=r(a,e)>-1})},init:function(){this._super(),this.on("didInsertElement",this,this._triggerChange),this.on("change",this,this._change)}})}(),function(){Ember.Handlebars.registerHelper("input",function(e){var t=e.hash,r=(e.hashTypes,t.type),n=t.on;return delete t.type,delete t.on,"checkbox"===r?Ember.Handlebars.helpers.view.call(this,Ember.Checkbox,e):(r&&(t.type=r),t.onEvent=n||"enter",Ember.Handlebars.helpers.view.call(this,Ember.TextField,e))}),Ember.Handlebars.registerHelper("textarea",function(e){e.hash,e.hashTypes;return Ember.Handlebars.helpers.view.call(this,Ember.TextArea,e)})}(),function(){Ember.ComponentLookup=Ember.Object.extend({lookupFactory:function(e,t){t=t||this.container;var r="component:"+e,n="template:components/"+e,i=t&&t.has(n);i&&t.injection(r,"layout",n);var o=t.lookupFactory(r);return i||o?(o||(t.register(r,Ember.Component),o=t.lookupFactory(r)),o):void 0}})}(),function(){function e(){Ember.Handlebars.bootstrap(Ember.$(document))}function t(e){e.register("component-lookup:main",Ember.ComponentLookup)}Ember.Handlebars.bootstrap=function(e){var t='script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';Ember.$(t,e).each(function(){var e=Ember.$(this),t="text/x-raw-handlebars"===e.attr("type")?Ember.$.proxy(Handlebars.compile,Handlebars):Ember.$.proxy(Ember.Handlebars.compile,Ember.Handlebars),r=e.attr("data-template-name")||e.attr("id")||"application",n=t(e.html());if(void 0!==Ember.TEMPLATES[r])throw new Ember.Error('Template named "'+r+'" already exists.');Ember.TEMPLATES[r]=n,e.remove()})},Ember.onLoad("Ember.Application",function(r){r.initializer({name:"domTemplates",initialize:e}),r.initializer({name:"registerComponentLookup",after:"domTemplates",initialize:t})})}(),function(){Ember.runLoadHooks("Ember.Handlebars",Ember.Handlebars)}(),function(){e("route-recognizer",["exports"],function(e){"use strict";function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e){this.string=e}function n(e){this.name=e}function i(e){this.name=e}function o(){}function a(e,t,a){"/"===e.charAt(0)&&(e=e.substr(1));for(var s=e.split("/"),u=[],l=0,c=s.length;c>l;l++){var h,m=s[l];(h=m.match(/^:([^\/]+)$/))?(u.push(new n(h[1])),t.push(h[1]),a.dynamics++):(h=m.match(/^\*([^\/]+)$/))?(u.push(new i(h[1])),t.push(h[1]),a.stars++):""===m?u.push(new o):(u.push(new r(m)),a.statics++)}return u}function s(e){this.charSpec=e,this.nextStates=[]}function u(e){return e.sort(function(e,t){if(e.types.stars!==t.types.stars)return e.types.stars-t.types.stars;if(e.types.stars){if(e.types.statics!==t.types.statics)return t.types.statics-e.types.statics;if(e.types.dynamics!==t.types.dynamics)return t.types.dynamics-e.types.dynamics}return e.types.dynamics!==t.types.dynamics?e.types.dynamics-t.types.dynamics:e.types.statics!==t.types.statics?t.types.statics-e.types.statics:0})}function l(e,t){for(var r=[],n=0,i=e.length;i>n;n++){var o=e[n];r=r.concat(o.match(t))}return r}function c(e){this.queryParams=e||{}}function h(e,t,r){for(var n=e.handlers,i=e.regex,o=t.match(i),a=1,s=new c(r),u=0,l=n.length;l>u;u++){for(var h=n[u],m=h.names,p={},f=0,d=m.length;d>f;f++)p[m[f]]=o[a++];s.push({handler:h.handler,params:p,isDynamic:!!m.length})}return s}function m(e,t){return t.eachChar(function(t){e=e.put(t)}),e}function p(e,t,r){this.path=e,this.matcher=t,this.delegate=r}function f(e){this.routes={},this.children={},this.target=e}function d(e,t,r){return function(n,i){var o=e+n;return i?(i(d(o,t,r)),void 0):new p(e+n,t,r)}}function b(e,t,r){for(var n=0,i=0,o=e.length;o>i;i++)n+=e[i].path.length;t=t.substr(n);var a={path:t,handler:r};e.push(a)}function v(e,t,r,n){var i=t.routes;for(var o in i)if(i.hasOwnProperty(o)){var a=e.slice();b(a,o,i[o]),t.children[o]?v(a,t.children[o],r,n):r.call(n,a)}}var E=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],g=new RegExp("(\\"+E.join("|\\")+")","g");r.prototype={eachChar:function(e){for(var t,r=this.string,n=0,i=r.length;i>n;n++)t=r.charAt(n),e({validChars:t})},regex:function(){return this.string.replace(g,"\\$1")},generate:function(){return this.string}},n.prototype={eachChar:function(e){e({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(e){return e[this.name]}},i.prototype={eachChar:function(e){e({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(e){return e[this.name]}},o.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},s.prototype={get:function(e){for(var t=this.nextStates,r=0,n=t.length;n>r;r++){var i=t[r],o=i.charSpec.validChars===e.validChars;if(o=o&&i.charSpec.invalidChars===e.invalidChars)return i}},put:function(e){var t;return(t=this.get(e))?t:(t=new s(e),this.nextStates.push(t),e.repeat&&t.nextStates.push(t),t)},match:function(e){for(var t,r,n,i=this.nextStates,o=[],a=0,s=i.length;s>a;a++)t=i[a],r=t.charSpec,"undefined"!=typeof(n=r.validChars)?-1!==n.indexOf(e)&&o.push(t):"undefined"!=typeof(n=r.invalidChars)&&-1===n.indexOf(e)&&o.push(t);return o}};var y=Object.create||function(e){function t(){}return t.prototype=e,new t};c.prototype=y({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var _=function(){this.rootState=new s,this.names={}};_.prototype={add:function(e,t){for(var r,n=this.rootState,i="^",s={statics:0,dynamics:0,stars:0},u=[],l=[],c=!0,h=0,p=e.length;p>h;h++){var f=e[h],d=[],b=a(f.path,d,s);l=l.concat(b);for(var v=0,E=b.length;E>v;v++){var g=b[v];g instanceof o||(c=!1,n=n.put({validChars:"/"}),i+="/",n=m(n,g),i+=g.regex())}var y={handler:f.handler,names:d};u.push(y)}c&&(n=n.put({validChars:"/"}),i+="/"),n.handlers=u,n.regex=new RegExp(i+"$"),n.types=s,(r=t&&t.as)&&(this.names[r]={segments:l,handlers:u})},handlersFor:function(e){var t=this.names[e],r=[];if(!t)throw new Error("There is no route named "+e);for(var n=0,i=t.handlers.length;i>n;n++)r.push(t.handlers[n]);return r},hasRoute:function(e){return!!this.names[e]},generate:function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,a=0,s=i.length;s>a;a++){var u=i[a];u instanceof o||(n+="/",n+=u.generate(t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams,r.handlers)),n},generateQueryString:function(e){var r=[],n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(i);n.sort();for(var o=0,a=n.length;a>o;o++){i=n[o];var s=e[i];if(s!==!1&&null!=s){var u=i;if(t(s))for(var l=0,c=s.length;c>l;l++){var h=i+"[]="+encodeURIComponent(s[l]);r.push(h)}else s!==!0?(u+="="+encodeURIComponent(s),r.push(u)):r.push(u)}}return 0===r.length?"":"?"+r.join("&")},parseQueryString:function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i,o=t[n].split("="),a=decodeURIComponent(o[0]),s=a.length,u=!1;1===o.length?i=!0:(s>2&&"[]"===a.slice(s-2)&&(u=!0,a=a.slice(0,s-2),r[a]||(r[a]=[])),i=o[1]?decodeURIComponent(o[1]):""),u?r[a].push(i):r[a]=i}return r},recognize:function(e){var t,r,n,i,o=[this.rootState],a={},s=!1;if(e=decodeURI(e),i=e.indexOf("?"),-1!==i){var c=e.substr(i+1,e.length);e=e.substr(0,i),a=this.parseQueryString(c)}for("/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0,n=e.length;n>r&&(o=l(o,e.charAt(r)),o.length);r++);var m=[];for(r=0,n=o.length;n>r;r++)o[r].handlers&&m.push(o[r]);o=u(m);var p=m[0];return p&&p.handlers?(s&&"(.+)$"===p.regex.source.slice(-5)&&(e+="/"),h(p,e,a)):void 0}},e["default"]=_,p.prototype={to:function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}return this}},f.prototype={add:function(e,t){this.routes[e]=t},addChild:function(e,t,r,n){var i=new f(t);this.children[e]=i;var o=d(e,i,n);n&&n.contextEntered&&n.contextEntered(t,o),r(o)}},_.prototype.map=function(e,t){var r=new f;e(d("",r,this.delegate)),v([],r,function(e){t?t(this,e):this.add(e)},this)}})}(),function(){e("router/handler-info",["./utils","rsvp","exports"],function(e,t,r){"use strict";function n(e){e&&l(this,e)}function i(e){n.call(this,e)}function o(e){n.call(this,e),this.params=this.params||{}}function a(e){n.call(this,e)}function s(e,t){if(!e^!t)return!1;if(!e)return!0;for(var r in e)if(e.hasOwnProperty(r)&&e[r]!==t[r])return!1;return!0}var u=e.bind,l=e.merge,c=e.oCreate,h=e.serialize,m=e.promiseLabel,p=t.resolve;n.prototype={name:null,handler:null,params:null,context:null,log:function(e,t){e.log&&e.log(this.name+": "+t)},promiseLabel:function(e){return m("'"+this.name+"' "+e)},resolve:function(e,t,r){var n=u(this.checkForAbort,this,t),i=u(this.runBeforeModelHook,this,e,r),o=u(this.getModel,this,e,r),a=u(this.runAfterModelHook,this,e,r),s=u(this.becomeResolved,this,r);return p(void 0,this.promiseLabel("Start handler")).then(n,null,this.promiseLabel("Check for abort")).then(i,null,this.promiseLabel("Before model")).then(n,null,this.promiseLabel("Check if aborted during 'beforeModel' hook")).then(o,null,this.promiseLabel("Model")).then(n,null,this.promiseLabel("Check if aborted in 'model' hook")).then(a,null,this.promiseLabel("After model")).then(n,null,this.promiseLabel("Check if aborted in 'afterModel' hook")).then(s,null,this.promiseLabel("Become resolved"))},runBeforeModelHook:function(e,t){return t.trigger&&t.trigger(!0,"willResolveModel",t,this.handler),this.runSharedModelHook(e,t,"beforeModel",[])},runAfterModelHook:function(e,t,r){var n=this.name;return this.stashResolvedModel(t,r),this.runSharedModelHook(e,t,"afterModel",[r]).then(function(){return t.resolvedModels[n]},null,this.promiseLabel("Ignore fulfillment value and return model value"))},runSharedModelHook:function(e,t,r,n){this.log(t,"calling "+r+" hook"),this.queryParams&&n.push(this.queryParams),n.push(t);var i=this.handler;return e(function(){return i[r]&&i[r].apply(i,n)},this.promiseLabel("Handle "+r))},getModel:function(){throw new Error("This should be overridden by a subclass of HandlerInfo")},checkForAbort:function(e,t){return p(e(),this.promiseLabel("Check for abort")).then(function(){return t},null,this.promiseLabel("Ignore fulfillment value and continue"))},stashResolvedModel:function(e,t){e.resolvedModels=e.resolvedModels||{},e.resolvedModels[this.name]=t},becomeResolved:function(e,t){var r=this.params||h(this.handler,t,this.names);return e&&(this.stashResolvedModel(e,t),e.params=e.params||{},e.params[this.name]=r),new i({context:t,name:this.name,handler:this.handler,params:r})},shouldSupercede:function(e){if(!e)return!0;var t=e.context===this.context;return e.name!==this.name||this.hasOwnProperty("context")&&!t||this.hasOwnProperty("params")&&!s(this.params,e.params)}},i.prototype=c(n.prototype),i.prototype.resolve=function(e,t,r){return r&&r.resolvedModels&&(r.resolvedModels[this.name]=this.context),p(this,this.promiseLabel("Resolve"))},o.prototype=c(n.prototype),o.prototype.getModel=function(e,t){var r=this.params;t&&t.queryParams&&(r={},l(r,this.params),r.queryParams=t.queryParams);var n="function"==typeof this.handler.deserialize?"deserialize":"model";return this.runSharedModelHook(e,t,n,[r])},a.prototype=c(n.prototype),a.prototype.getModel=function(e,t){return this.log(t,this.name+": resolving provided model"),p(this.context)},r.HandlerInfo=n,r.ResolvedHandlerInfo=i,r.UnresolvedHandlerInfoByParam=o,r.UnresolvedHandlerInfoByObject=a}),e("router/router",["route-recognizer","rsvp","./utils","./transition-state","./transition","./transition-intent/named-transition-intent","./transition-intent/url-transition-intent","exports"],function(e,t,r,n,i,o,a,s){"use strict";function u(){this.recognizer=new v,this.reset()}function l(e,t,r){var n=h(e.state,t);C(n.exited,function(e){var t=e.handler;delete t.context,t.exit&&t.exit()});var i=e.oldState=e.state;e.state=t;var o=e.currentHandlerInfos=n.unchanged.slice();try{C(n.updatedContext,function(e){return c(o,e,!1,r)}),C(n.entered,function(e){return c(o,e,!0,r)})}catch(a){throw e.state=i,e.currentHandlerInfos=i.handlerInfos,a}e.state.queryParams=b(e,o,t.queryParams)}function c(e,t,r,n){var i=t.handler,o=t.context;if(r&&i.enter&&i.enter(n),n&&n.isAborted)throw new I;if(i.context=o,i.contextDidChange&&i.contextDidChange(),i.setup&&i.setup(o,n),n&&n.isAborted)throw new I;return e.push(t),!0}function h(e,t){var r,n,i,o,a,s=e.handlerInfos,u=t.handlerInfos,l={updatedContext:[],exited:[],entered:[],unchanged:[]};for(o=0,a=u.length;a>o;o++){var c=s[o],h=u[o];c&&c.handler===h.handler||(r=!0),r?(l.entered.push(h),c&&l.exited.unshift(c)):n||c.context!==h.context||i?(n=!0,l.updatedContext.push(h)):l.unchanged.push(c)}for(o=u.length,a=s.length;a>o;o++)l.exited.unshift(s[o]);return l}function m(e,t,r){var n=e.urlMethod;if(n){for(var i=e.router,o=t.handlerInfos,a=o[o.length-1].name,s={},u=o.length-1;u>=0;--u){var l=o[u];O(s,l.params),l.handler.inaccessibleByURL&&(n=null)}if(n){s.queryParams=t.queryParams;var c=i.recognizer.generate(a,s);"replaceQuery"===n?c!==r&&i.replaceURL(c):"replace"===n?i.replaceURL(c):i.updateURL(c)}}}function p(e,t){try{_(e.router,e.sequence,"Resolved all models on destination route; finalizing transition.");{var r=e.router,n=t.handlerInfos;e.sequence}return l(r,t,e),e.isAborted?(r.state.handlerInfos=r.currentHandlerInfos,E(V(e))):(m(e,t,e.intent.url),e.isActive=!1,r.activeTransition=null,y(r,r.currentHandlerInfos,!0,["didTransition"]),r.didTransition&&r.didTransition(r.currentHandlerInfos),_(r,e.sequence,"TRANSITION COMPLETE."),n[n.length-1].handler)}catch(i){if(!(i instanceof I)){var o=e.state.handlerInfos;e.trigger(!0,"error",i,e,o[o.length-1].handler),e.abort()}throw i}}function f(e,t,r){var n=t[0]||"/",i=t[t.length-1],o={};i&&i.hasOwnProperty("queryParams")&&(o=j.call(t).queryParams);var a;if(0===t.length){_(e,"Updating query params");var s=e.state.handlerInfos;a=new R({name:s[s.length-1].name,contexts:[],queryParams:o})}else"/"===n.charAt(0)?(_(e,"Attempting URL transition to "+n),a=new D({url:n})):(_(e,"Attempting transition to "+n),a=new R({name:t[0],contexts:w.call(t,1),queryParams:o}));return e.transitionByIntent(a,r)}function d(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;n>r;++r)if(e[r]!==t[r])return!1;return!0}function b(e,t,r){var n=[];y(e,t,!0,["finalizeQueryParamChange",r,n]);for(var i={},o=0,a=n.length;a>o;++o){var s=n[o];i[s.key]=s.value}return i}var v=e["default"],E=(t.resolve,t.reject),g=(t.async,t.Promise),y=r.trigger,_=r.log,w=r.slice,C=r.forEach,O=r.merge,A=r.serialize,P=r.extractQueryParams,T=r.getChangelist,x=r.promiseLabel,S=n.TransitionState,V=i.logAbort,N=i.Transition,I=i.TransitionAborted,R=o.NamedTransitionIntent,D=a.URLTransitionIntent,j=Array.prototype.pop;u.prototype={map:function(e){this.recognizer.delegate=this.delegate,this.recognizer.map(e,function(e,t){for(var r=t.length-1,n=!0;r>=0&&n;--r){var i=t[r];e.add(t,{as:i.handler}),n="/"===i.path||""===i.path||".index"===i.handler.slice(-6)}})},hasRoute:function(e){return this.recognizer.hasRoute(e)},transitionByIntent:function(e,t){var r,n=!!this.activeTransition,i=n?this.activeTransition.state:this.state,o=this;try{var a=e.applyToState(i,this.recognizer,this.getHandler,t);if(d(a.handlerInfos,i.handlerInfos)){var s=T(i.queryParams,a.queryParams);return s?(this._changedQueryParams=s.changed,y(this,a.handlerInfos,!0,["queryParamsDidChange",s.changed,s.all,s.removed]),this._changedQueryParams=null,!n&&this.activeTransition?this.activeTransition:(i.queryParams=b(this,a.handlerInfos,a.queryParams),r=new N(this),r.urlMethod="replace",r.promise=r.promise.then(function(e){return m(r,i,!0),o.didTransition&&o.didTransition(o.currentHandlerInfos),e},null,x("Transition complete")),r)):new N(this)}return t?(l(this,a),void 0):(r=new N(this,e,a),this.activeTransition&&this.activeTransition.abort(),this.activeTransition=r,r.promise=r.promise.then(function(e){return o.async(function(){return p(r,e.state)},"Finalize transition")},null,x("Settle transition promise when transition is finalized")),n||y(this,this.state.handlerInfos,!0,["willTransition",r]),r)}catch(u){return new N(this,e,null,u)}},reset:function(){this.state&&C(this.state.handlerInfos,function(e){var t=e.handler;t.exit&&t.exit()}),this.state=new S,this.currentHandlerInfos=null},activeTransition:null,handleURL:function(e){var t=w.call(arguments);return"/"!==e.charAt(0)&&(t[0]="/"+e),f(this,t).method("replaceQuery")},updateURL:function(){throw new Error("updateURL is not implemented")},replaceURL:function(e){this.updateURL(e)},transitionTo:function(){return f(this,arguments)},intermediateTransitionTo:function(){f(this,arguments,!0)},refresh:function(e){for(var t=this.activeTransition?this.activeTransition.state:this.state,r=t.handlerInfos,n={},i=0,o=r.length;o>i;++i){var a=r[i];n[a.name]=a.params||{}}_(this,"Starting a refresh transition");var s=new R({name:r[r.length-1].name,pivotHandler:e||r[0].handler,contexts:[],queryParams:this._changedQueryParams||t.queryParams||{}});return this.transitionByIntent(s,!1)},replaceWith:function(){return f(this,arguments).method("replace")},generate:function(e){for(var t=P(w.call(arguments,1)),r=t[0],n=t[1],i=new R({name:e,contexts:r}),o=i.applyToState(this.state,this.recognizer,this.getHandler),a={},s=0,u=o.handlerInfos.length;u>s;++s){var l=o.handlerInfos[s],c=l.params||A(l.handler,l.context,l.names);O(a,c)}return a.queryParams=n,this.recognizer.generate(e,a)},isActive:function(e){var t,r,n=P(w.call(arguments,1)),i=n[0],o=n[1],a=this.state.queryParams,s=this.state.handlerInfos;if(!s.length)return!1;var u=s[s.length-1].name,l=this.recognizer.handlersFor(u),c=0;for(r=l.length;r>c&&(t=s[c],t.name!==e);++c);if(c===l.length)return!1;var h=new S;h.handlerInfos=s.slice(0,c+1),l=l.slice(0,c+1);var m=new R({name:u,contexts:i}),p=m.applyToHandlers(h,l,this.getHandler,u,!0,!0),f={};O(f,o);for(var b in a)a.hasOwnProperty(b)&&f.hasOwnProperty(b)&&(f[b]=a[b]);return d(p.handlerInfos,h.handlerInfos)&&!T(f,o)},trigger:function(){var e=w.call(arguments);y(this,this.currentHandlerInfos,!1,e)},async:function(e,t){return new g(function(t){t(e())},t)},log:null},s.Router=u}),e("router/transition-intent",["./utils","exports"],function(e,t){"use strict";function r(e){e&&n(this,e),this.data=this.data||{}}var n=e.merge;r.prototype.applyToState=function(e){return e},t.TransitionIntent=r}),e("router/transition-intent/named-transition-intent",["../transition-intent","../transition-state","../handler-info","../utils","exports"],function(e,t,r,n,i){"use strict";function o(e){a.call(this,e)}var a=e.TransitionIntent,s=t.TransitionState,u=r.UnresolvedHandlerInfoByParam,l=r.UnresolvedHandlerInfoByObject,c=n.isParam,h=n.forEach,m=n.extractQueryParams,p=n.oCreate,f=n.merge;o.prototype=p(a.prototype),o.prototype.applyToState=function(e,t,r,n){var i=m([this.name].concat(this.contexts)),o=i[0],a=(i[1],t.handlersFor(o[0])),s=a[a.length-1].handler;return this.applyToHandlers(e,a,r,s,n)},o.prototype.applyToHandlers=function(e,t,r,n,i,o){var a,u=new s,l=this.contexts.slice(0),c=t.length,h=[];if(this.pivotHandler)for(a=0;a<t.length;++a)if(r(t[a].handler)===this.pivotHandler){c=a;break}!this.pivotHandler;for(a=t.length-1;a>=0;--a){var m=t[a],p=m.handler,d=r(p),b=e.handlerInfos[a],v=null;if(m.names.length>0?v=a>=c?this.createParamHandlerInfo(p,d,m.names,l,b):this.getHandlerInfoForDynamicSegment(p,d,m.names,l,b,n):(v=this.createParamHandlerInfo(p,d,m.names,l,b),h.unshift(a)),o){v=v.becomeResolved(null,v.context);var E=b&&b.context;m.names.length>0&&v.context===E&&(v.params=b&&b.params),v.context=E}var g=b;(a>=c||v.shouldSupercede(b))&&(c=Math.min(a,c),g=v),i&&!o&&(g=g.becomeResolved(null,g.context)),u.handlerInfos.unshift(g)}if(l.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+n);return i||this.invalidateNonDynamicHandlers(u.handlerInfos,h,c),f(u.queryParams,e.queryParams),f(u.queryParams,this.queryParams||{}),u},o.prototype.invalidateNonDynamicHandlers=function(e,t,r){h(t,function(t){if(t>=r){var n=e[t];e[t]=new u({name:n.name,handler:n.handler,params:{}})}})},o.prototype.getHandlerInfoForDynamicSegment=function(e,t,r,n,i){{var o;r.length}return n.length>0?(o=n[n.length-1],c(o)?this.createParamHandlerInfo(e,t,r,n,i):(n.pop(),new l({name:e,handler:t,context:o,names:r}))):i&&i.name===e?i:i},o.prototype.createParamHandlerInfo=function(e,t,r,n,i){for(var o={},a=r.length;a--;){var s=i&&e===i.name&&i.params||{},l=n[n.length-1],h=r[a];if(c(l))o[h]=""+n.pop();else{if(!s.hasOwnProperty(h))throw new Error("You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route "+e);o[h]=s[h]}}return new u({name:e,handler:t,params:o})},i.NamedTransitionIntent=o}),e("router/transition-intent/url-transition-intent",["../transition-intent","../transition-state","../handler-info","../utils","exports"],function(e,t,r,n,i){"use strict";function o(e){s.call(this,e)}function a(e){this.message=e||"UnrecognizedURLError",this.name="UnrecognizedURLError"}var s=e.TransitionIntent,u=t.TransitionState,l=r.UnresolvedHandlerInfoByParam,c=n.oCreate,h=n.merge;o.prototype=c(s.prototype),o.prototype.applyToState=function(e,t,r){var n,i,o=new u,s=t.recognize(this.url);if(!s)throw new a(this.url);var c=!1;for(n=0,i=s.length;i>n;++n){var m=s[n],p=m.handler,f=r(p);if(f.inaccessibleByURL)throw new a(this.url);var d=new l({name:p,handler:f,params:m.params}),b=e.handlerInfos[n];c||d.shouldSupercede(b)?(c=!0,o.handlerInfos[n]=d):o.handlerInfos[n]=b}return h(o.queryParams,s.queryParams),o},i.URLTransitionIntent=o}),e("router/transition-state",["./handler-info","./utils","rsvp","exports"],function(e,t,r,n){"use strict";function i(){this.handlerInfos=[],this.queryParams={},this.params={}}var o=(e.ResolvedHandlerInfo,t.forEach),a=t.promiseLabel,s=r.resolve,u=r.reject;i.prototype={handlerInfos:null,queryParams:null,params:null,promiseLabel:function(e){var t="";return o(this.handlerInfos,function(e){""!==t&&(t+="."),t+=e.name}),a("'"+t+"': "+e)},resolve:function(e,t,r){function n(){return s(t(),a("Check if should continue"))["catch"](function(e){return p=!0,u(e)},a("Handle abort"))}function i(e){var t=m.handlerInfos,n=r.resolveIndex>=t.length?t.length-1:r.resolveIndex;return u({error:e,handlerWithError:m.handlerInfos[n].handler,wasAborted:p,state:m})}function l(e){m.handlerInfos[r.resolveIndex++]=e;var t=e.handler;return t&&t.redirect&&t.redirect(e.context,r),n().then(c,null,a("Resolve handler"))}function c(){if(r.resolveIndex===m.handlerInfos.length)return{error:null,state:m};var t=m.handlerInfos[r.resolveIndex];return t.resolve(e,n,r).then(l,null,a("Proceed"))}var h=this.params;o(this.handlerInfos,function(e){h[e.name]=e.params||{}}),r=r||{},r.resolveIndex=0;var m=this,p=!1;return s(null,this.promiseLabel("Start transition")).then(c,null,this.promiseLabel("Resolve handler"))["catch"](i,this.promiseLabel("Handle error"))}},n.TransitionState=i}),e("router/transition",["rsvp","./handler-info","./utils","exports"],function(e,t,r,n){"use strict";function i(e,t,r,n){function a(){return c.isAborted?s(void 0,p("Transition aborted - reject")):void 0}var c=this;if(this.state=r||e.state,this.intent=t,this.router=e,this.data=this.intent&&this.intent.data||{},this.resolvedModels={},this.queryParams={},n)return this.promise=s(n),void 0;if(r){this.params=r.params,this.queryParams=r.queryParams;var h=r.handlerInfos.length;h&&(this.targetName=r.handlerInfos[r.handlerInfos.length-1].name);for(var m=0;h>m;++m){var f=r.handlerInfos[m];if(!(f instanceof l))break;this.pivotHandler=f.handler}this.sequence=i.currentSequence++,this.promise=r.resolve(e.async,a,this)["catch"](function(e){return e.wasAborted?s(o(c)):(c.trigger("error",e.error,c,e.handlerWithError),c.abort(),s(e.error))},p("Handle Abort"))}else this.promise=u(this.state),this.params={}}function o(e){return m(e.router,e.sequence,"detected abort."),new a}function a(e){this.message=e||"TransitionAborted",this.name="TransitionAborted"}var s=e.reject,u=e.resolve,l=t.ResolvedHandlerInfo,c=r.trigger,h=r.slice,m=r.log,p=r.promiseLabel;i.currentSequence=0,i.prototype={targetName:null,urlMethod:"update",intent:null,params:null,pivotHandler:null,resolveIndex:0,handlerInfos:null,resolvedModels:null,isActive:!0,state:null,promise:null,data:null,then:function(e,t){return this.promise.then(e,t)},abort:function(){return this.isAborted?this:(m(this.router,this.sequence,this.targetName+": transition was aborted"),this.isAborted=!0,this.isActive=!1,this.router.activeTransition=null,this)},retry:function(){return this.abort(),this.router.transitionByIntent(this.intent,!1)},method:function(e){return this.urlMethod=e,this},trigger:function(e){var t=h.call(arguments);"boolean"==typeof e?t.shift():e=!1,c(this.router,this.state.handlerInfos.slice(0,this.resolveIndex+1),e,t)},followRedirects:function(){var e=this.router;return this.promise["catch"](function(t){return e.activeTransition?e.activeTransition.followRedirects():s(t)})},toString:function(){return"Transition (sequence "+this.sequence+")"},log:function(e){m(this.router,this.sequence,e)}},i.prototype.send=i.prototype.trigger,n.Transition=i,n.logAbort=o,n.TransitionAborted=a}),e("router/utils",["exports"],function(e){"use strict";function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function r(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function n(e){var t,r,n=e&&e.length;return n&&n>0&&e[n-1]&&e[n-1].hasOwnProperty("queryParams")?(r=e[n-1].queryParams,t=p.call(e,0,n-1),[t,r]):[e,null]}function i(e){for(var r in e)if("number"==typeof e[r])e[r]=""+e[r];else if(t(e[r]))for(var n=0,i=e[r].length;i>n;n++)e[r][n]=""+e[r][n]}function o(e,t,r){e.log&&(3===arguments.length?e.log("Transition #"+t+": "+r):(r=t,e.log(r)))}function a(e,t){var r=arguments;return function(n){var i=p.call(r,2);return i.push(n),e.apply(t,i)}}function s(e){return"string"==typeof e||e instanceof String||"number"==typeof e||e instanceof Number}function u(e,t){for(var r=0,n=e.length;n>r&&!1!==t(e[r]);r++);}function l(e,t,r){var n={};if(s(t))return n[r[0]]=t,n;if(e.serialize)return e.serialize(t,r);if(1===r.length){var i=r[0];return n[i]=/_id$/.test(i)?t.id:t,n}}function c(e,t,r,n){if(e.triggerEvent)return e.triggerEvent(t,r,n),void 0;var i=n.shift();if(!t){if(r)return;throw new Error("Could not trigger event '"+i+"'. There are no active handlers")}for(var o=!1,a=t.length-1;a>=0;a--){var s=t[a],u=s.handler;if(u.events&&u.events[i]){if(u.events[i].apply(u,n)!==!0)return;o=!0}}if(!o&&!r)throw new Error("Nothing handled the event '"+i+"'.")}function h(e,n){var o,a={all:{},changed:{},removed:{}};r(a.all,n);var s=!1;i(e),i(n);for(o in e)e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||(s=!0,a.removed[o]=e[o]));for(o in n)if(n.hasOwnProperty(o))if(t(e[o])&&t(n[o]))if(e[o].length!==n[o].length)a.changed[o]=n[o],s=!0;else for(var u=0,l=e[o].length;l>u;u++)e[o][u]!==n[o][u]&&(a.changed[o]=n[o],s=!0);else e[o]!==n[o]&&(a.changed[o]=n[o],s=!0);return s&&a}function m(e){return"Router: "+e}var p=Array.prototype.slice,f=Object.create||function(e){function t(){}return t.prototype=e,new t};e.trigger=c,e.log=o,e.oCreate=f,e.merge=r,e.extractQueryParams=n,e.bind=a,e.isParam=s,e.forEach=u,e.slice=p,e.serialize=l,e.getChangelist=h,e.coerceQueryParamsToString=i,e.promiseLabel=m}),e("router",["./router/router","exports"],function(e,t){"use strict";var r=e.Router;t.Router=r})}(),function(){function e(e){this.parent=e,this.matches=[]}function t(e,t,r){r=r||{},"string"!=typeof r.path&&(r.path="/"+t),e.parent&&"application"!==e.parent&&(t=e.parent+"."+t),e.push(r.path,t,null)}e.prototype={resource:function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n={}),1===arguments.length&&(n={}),"string"!=typeof n.path&&(n.path="/"+r),i){var o=new e(r);t(o,"loading"),t(o,"error",{path:"/_unused_dummy_error_path_route_"+r+"/:error"}),i.call(o),this.push(n.path,r,o.generate())
|
18 |
}else this.push(n.path,r,null)},push:function(e,t,r){var n=t.split(".");(""===e||"/"===e||"index"===n[n.length-1])&&(this.explicitIndex=!0),this.matches.push([e,t,r])},route:function(e,r){t(this,e,r)},generate:function(){var e=this.matches;return this.explicitIndex||this.route("index",{path:"/"}),function(t){for(var r=0,n=e.length;n>r;r++){var i=e[r];t(i[0]).to(i[1],i[2])}}}},e.map=function(t){var r=new e;return t.call(r),r},Ember.RouterDSL=e}(),function(){var e=Ember.get;Ember.controllerFor=function(e,t,r){return e.lookup("controller:"+t,r)},Ember.generateControllerFactory=function(e,t,r){var n,i,o,a;return a=r&&Ember.isArray(r)?"array":r?"object":"basic",o="controller:"+a,n=e.lookupFactory(o).extend({isGenerated:!0,toString:function(){return"(generated "+t+" controller)"}}),i="controller:"+t,e.register(i,n),n},Ember.generateController=function(t,r,n){Ember.generateControllerFactory(t,r,n);var i="controller:"+r,o=t.lookup(i);return e(o,"namespace.LOG_ACTIVE_GENERATION"),o}}(),function(){function e(e,t){var n=e.controllerName||e.routeName,i=r(n,e.container),o=h(i,"queryParams");o&&d(o,function(e){var r,i=e.split(":");r=i.length>1?i[1]:"application"!==n?n+"["+e+"]":e;var o=n+":"+e;t.queryParams[o]=r,t.translations[i[0]]=o})}function r(e,t){var r="controller:"+e;if(t.cache.has(r))return t.lookup(r);var n=t.lookupFactory(r);return n&&"function"==typeof n.proto?n.proto():{}}function n(e){var t,r,n={};for(r in e)t=Ember.Router._descopeQueryParam(e[r]),n[t]=n[t]?n[t]+1:1;for(r in e)t=Ember.Router._descopeQueryParam(e[r]),1===n[t]&&(e[r]=t)}function i(e,t,r){for(var n=t.state.handlerInfos,i=!1,o=n.length-1;o>=0;--o){var a=n[o],s=a.handler;if(i){if(r(s,n[o+1].handler)!==!0)return!1}else e===s&&(i=!0)}return!0}function o(e,t,r){var n,i=e.router,o=(t.routeName.split(".").pop(),"application"===e.routeName?"":e.routeName+".");return n=o+r,a(i,n)?n:void 0}function a(e,t){var r=e.container;return e.hasRoute(t)&&(r.has("template:"+t)||r.has("route:"+t))}function s(e,t,r){var n=r.shift();if(!e){if(t)return;throw new Ember.Error("Can't trigger action '"+n+"' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.")}for(var i=!1,o=e.length-1;o>=0;o--){var a=e[o],s=a.handler;if(s._actions&&s._actions[n]){if(s._actions[n].apply(s,r)!==!0)return;i=!0}}if(v[n])return v[n].apply(null,r),void 0;if(!i&&!t)throw new Ember.Error("Nothing handled the action '"+n+"'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.")}function u(e){var t=e.container.lookup("controller:application");if(t){var r=e.router.currentHandlerInfos,n=Ember.Router._routePath(r);"currentPath"in t||p(t,"currentPath"),m(t,"currentPath",n),"currentRouteName"in t||p(t,"currentRouteName"),m(t,"currentRouteName",r[r.length-1].name)}}var l=t("router"),c=l.Router,h=(l.Transition,Ember.get),m=Ember.set,p=(Ember.String.fmt,Ember.defineProperty),f=Array.prototype.slice,d=Ember.EnumerableUtils.forEach,b=Ember._MetamorphView;Ember.Router=Ember.Object.extend(Ember.Evented,{location:"hash",rootURL:"/",init:function(){this.router=this.constructor.router||this.constructor.map(Ember.K),this._activeViews={},this._setupLocation(),h(this,"namespace.LOG_TRANSITIONS_INTERNAL")&&(this.router.log=Ember.Logger.debug)},url:Ember.computed(function(){return h(this,"location").getURL()}),startRouting:function(){this.router=this.router||this.constructor.map(Ember.K);var e=this.router,t=h(this,"location"),r=this.container,n=this,i=h(this,"initialURL");h(t,"cancelRouterSetup")||(this._setupRouter(e,t),r.register("view:default",b),r.register("view:toplevel",Ember.View.extend()),t.onUpdateURL(function(e){n.handleURL(e)}),"undefined"==typeof i&&(i=t.getURL()),this.handleURL(i))},didTransition:function(e){u(this),this._cancelLoadingEvent(),this.notifyPropertyChange("url"),Ember.run.once(this,this.trigger,"didTransition"),h(this,"namespace").LOG_TRANSITIONS&&Ember.Logger.log("Transitioned into '"+Ember.Router._routePath(e)+"'")},handleURL:function(e){return this._doTransition("handleURL",[e])},transitionTo:function(){return this._doTransition("transitionTo",arguments)},intermediateTransitionTo:function(){this.router.intermediateTransitionTo.apply(this.router,arguments),u(this);var e=this.router.currentHandlerInfos;h(this,"namespace").LOG_TRANSITIONS&&Ember.Logger.log("Intermediate-transitioned into '"+Ember.Router._routePath(e)+"'")},replaceWith:function(){return this._doTransition("replaceWith",arguments)},generate:function(){var e=this.router.generate.apply(this.router,arguments);return this.location.formatURL(e)},isActive:function(){var e=this.router;return e.isActive.apply(e,arguments)},send:function(){this.router.trigger.apply(this.router,arguments)},hasRoute:function(e){return this.router.hasRoute(e)},reset:function(){this.router.reset()},_lookupActiveView:function(e){var t=this._activeViews[e];return t&&t[0]},_connectActiveView:function(e,t){var r=this._activeViews[e];r&&r[0].off("willDestroyElement",this,r[1]);var n=function(){delete this._activeViews[e]};this._activeViews[e]=[t,n],t.one("willDestroyElement",this,n)},_setupLocation:function(){var e=h(this,"location"),t=h(this,"rootURL");if(t&&!this.container.has("-location-setting:root-url")&&this.container.register("-location-setting:root-url",t,{instantiate:!1}),"string"==typeof e&&this.container){var r=this.container.lookup("location:"+e);if("undefined"!=typeof r)e=m(this,"location",r);else{var n={implementation:e};e=m(this,"location",Ember.Location.create(n))}}t&&"string"==typeof t&&(e.rootURL=t),"function"==typeof e.initState&&e.initState()},_getHandlerFunction:function(){var e={},t=this.container,r=t.lookupFactory("route:basic"),n=this;return function(i){var o="route:"+i,a=t.lookup(o);return e[i]?a:(e[i]=!0,a||(t.register(o,r.extend()),a=t.lookup(o),h(n,"namespace.LOG_ACTIVE_GENERATION")),a.routeName=i,a)}},_setupRouter:function(e,t){var r,n=this;e.getHandler=this._getHandlerFunction();var i=function(){t.setURL(r)};if(e.updateURL=function(e){r=e,Ember.run.once(i)},t.replaceURL){var o=function(){t.replaceURL(r)};e.replaceURL=function(e){r=e,Ember.run.once(o)}}e.didTransition=function(e){n.didTransition(e)}},_doTransition:function(e,t){t=f.call(t),t[0]=t[0]||"/";var r,n=t[0],i=!1;if(!i&&"/"!==n.charAt(0),r){if(!n){var o=this.router.activeTransition?this.router.activeTransition.state.handlerInfos:this.router.state.handlerInfos;n=o[o.length-1].name,t.unshift(n)}var a=this._queryParamNamesFor(n);Ember.Router._translateQueryParams(r,a.translations,n);var s;for(var u in r){var l=Ember.Router._descopeQueryParam(u);u in a.queryParams?(s=r[u],delete r[u],r[a.queryParams[u]]=s):l in a.validQueryParams&&(s=r[u],delete r[u],r[l]=s)}}var c=this.router[e].apply(this.router,t);return c.then(null,function(e){e&&"UnrecognizedURLError"===e.name},"Ember: Check for Router unrecognized URL error"),c},_scheduleLoadingEvent:function(e,t){this._cancelLoadingEvent(),this._loadingStateTimer=Ember.run.scheduleOnce("routerTransitions",this,"_fireLoadingEvent",e,t)},_fireLoadingEvent:function(e,t){this.router.activeTransition&&e.trigger(!0,"loading",e,t)},_cancelLoadingEvent:function(){this._loadingStateTimer&&Ember.run.cancel(this._loadingStateTimer),this._loadingStateTimer=null},_queryParamNamesFor:function(t){var r=this.router.recognizer.handlersFor(t),i={queryParams:Ember.create(null),translations:Ember.create(null),validQueryParams:Ember.create(null)},o=this.router;d(r,function(t){var r=o.getHandler(t.handler);e(r,i)}),n(i.queryParams);for(var a in i.queryParams)i.validQueryParams[i.queryParams[a]]=!0;return i},_queryParamNamesForSingle:function(t){var r={queryParams:Ember.create(null),translations:Ember.create(null)},n=this.router.getHandler(t);if(e(n,r),"application"!==t){var i=this._queryParamNamesFor(t);for(var o in r.queryParams)r.queryParams[o]=i.queryParams[o]}return r},_queryParamOverrides:function(e,t,n){for(var i in t){var o=i.split(":"),a=r(o[0],this.container);e[t[i]]=h(a,o[1]),n&&n(i,t[i],i)}}});var v={willResolveModel:function(e,t){t.router._scheduleLoadingEvent(e,t)},error:function(e,t,r){var n=r.router,s=i(r,t,function(t,r){var i=o(t,r,"error");return i?(n.intermediateTransitionTo(i,e),void 0):!0});return s?a(r.router,"application_error")?(n.intermediateTransitionTo("application_error",e),void 0):(Ember.Logger.error("Error while loading route: "+(e&&e.stack)),void 0):void 0},loading:function(e,t){var r=t.router,n=i(t,e,function(t,n){var i=o(t,n,"loading");return i?(r.intermediateTransitionTo(i),void 0):e.pivotHandler!==t?!0:void 0});return n&&a(t.router,"application_loading")?(r.intermediateTransitionTo("application_loading"),void 0):void 0}};Ember.Router.reopenClass({router:null,map:function(e){var t=this.router;t||(t=new c,t.callbacks=[],t.triggerEvent=s,this.reopenClass({router:t}));var r=Ember.RouterDSL.map(function(){this.resource("application",{path:"/"},function(){for(var r=0;r<t.callbacks.length;r++)t.callbacks[r].call(this);e.call(this)})});return t.callbacks.push(e),t.map(r.generate()),t},_routePath:function(e){function t(e,t){for(var r=0,n=e.length;n>r;++r)if(e[r]!==t[r])return!1;return!0}for(var r=[],n=1,i=e.length;i>n;n++){for(var o=e[n].name,a=o.split("."),s=f.call(r);s.length&&!t(s,a);)s.shift();r.push.apply(r,a.slice(s.length))}return r.join(".")},_translateQueryParams:function(e,t){for(var r in e)e.hasOwnProperty(r)&&r in t&&(e[t[r]]=e[r],delete e[r])},_descopeQueryParam:function(e){var t=/\[(.+)\]/,r=e.match(t);return r=r?r[1]:e}})}(),function(){function e(e){var t=e.router.router.state.handlerInfos;if(t)for(var r,n,i=0,o=t.length;o>i;i++){if(n=t[i].handler,n===e)return r;r=n}}function t(r){var n,i=e(r);if(i)return(n=i.lastRenderedTemplate)?n:t(i)}function r(e,r,n,i){i=i||{},i.into=i.into?i.into.replace(/\//g,"."):t(e),i.outlet=i.outlet||"main",i.name=r,i.template=n,i.LOG_VIEW_LOOKUPS=s(e.router,"namespace.LOG_VIEW_LOOKUPS");var o,a=i.controller;if(a=i.controller?i.controller:(o=e.container.lookup("controller:"+r))?o:e.controllerName||e.routeName,"string"==typeof a){var u=a;if(a=e.container.lookup("controller:"+u),!a)throw new Ember.Error("You passed `controller: '"+u+"'` into the `render` method, but no such controller could be found.")}return i.controller=a,i}function n(e,t,r){if(e)r.LOG_VIEW_LOOKUPS;else{var n=r.into?"view:default":"view:toplevel";e=t.lookup(n),r.LOG_VIEW_LOOKUPS}return s(e,"templateName")||(u(e,"template",r.template),u(e,"_debugTemplateName",r.name)),u(e,"renderedName",r.name),u(e,"controller",r.controller),e}function i(e,t,r){if(r.into){var n=e.router._lookupActiveView(r.into),i=a(n,r.outlet);e.teardownOutletViews||(e.teardownOutletViews=[]),h(e.teardownOutletViews,0,0,[i]),n.connectOutlet(r.outlet,t)}else{var u=s(e,"router.namespace.rootElement");e.teardownTopLevelView&&e.teardownTopLevelView(),e.router._connectActiveView(r.name,t),e.teardownTopLevelView=o(t),t.appendTo(u)}}function o(e){return function(){e.destroy()}}function a(e,t){return function(){e.disconnectOutlet(t)}}var s=Ember.get,u=Ember.set,l=Ember.getProperties,c=(Ember.String.classify,Ember.String.fmt,Ember.EnumerableUtils.forEach),h=Ember.EnumerableUtils.replace;Ember.Route=Ember.Object.extend(Ember.ActionHandler,{exit:function(){this.deactivate(),this.teardownViews()},enter:function(){this.activate()},viewName:null,templateName:null,controllerName:null,_actions:{finalizeQueryParamChange:function(){}},events:null,mergedProperties:["events"],deactivate:Ember.K,activate:Ember.K,transitionTo:function(){var e=this.router;return e.transitionTo.apply(e,arguments)},intermediateTransitionTo:function(){var e=this.router;e.intermediateTransitionTo.apply(e,arguments)},refresh:function(){return this.router.router.refresh(this).method("replace")},replaceWith:function(){var e=this.router;return e.replaceWith.apply(e,arguments)},send:function(){return this.router.send.apply(this.router,arguments)},setup:function(e){var t=this.controllerName||this.routeName,r=this.controllerFor(t,!0);r||(r=this.generateController(t,e)),this.controller=r,this.setupControllers?this.setupControllers(r,e):this.setupController(r,e),this.renderTemplates?this.renderTemplates(e):this.renderTemplate(r,e)},beforeModel:Ember.K,afterModel:Ember.K,redirect:Ember.K,contextDidChange:function(){this.currentModel=this.context},model:function(e,t){var r,n,i,o;for(var a in e)"queryParams"!==a&&((r=a.match(/^(.*)_id$/))&&(n=r[1],o=e[a]),i=!0);if(!n&&i)return Ember.copy(e);if(!n){if(t.resolveIndex!==t.state.handlerInfos.length-1)return;var s=t.state.handlerInfos[t.resolveIndex-1].context;return s}return this.findModel(n,o)},deserialize:function(e,t){return this.model(e,t)},findModel:function(){var e=s(this,"store");return e.find.apply(e,arguments)},store:Ember.computed(function(){{var e=this.container;this.routeName,s(this,"router.namespace")}return{find:function(t,r){var n=e.lookupFactory("model:"+t);if(n)return n.find(r)}}}),serialize:function(e,t){if(!(t.length<1)&&e){var r=t[0],n={};return/_id$/.test(r)&&1===t.length?n[r]=s(e,"id"):n=l(e,t),n}},setupController:function(e,t){e&&void 0!==t&&u(e,"model",t)},controllerFor:function(e){var t,r=this.container,n=r.lookup("route:"+e);return n&&n.controllerName&&(e=n.controllerName),t=r.lookup("controller:"+e)},generateController:function(e,t){var r=this.container;return t=t||this.modelFor(e),Ember.generateController(r,e,t)},modelFor:function(e){var t=this.container.lookup("route:"+e),r=this.router.router.activeTransition;if(r){var n=t&&t.routeName||e;if(r.resolvedModels.hasOwnProperty(n))return r.resolvedModels[n]}return t&&t.currentModel},renderTemplate:function(){this.render()},render:function(e,t){"object"!=typeof e||t||(t=e,e=this.routeName),t=t||{};var o;e?(e=e.replace(/\//g,"."),o=e):(e=this.routeName,o=this.templateName||e);var a=t.view||this.viewName||e,u=this.container,l=u.lookup("view:"+a),c=l?l.get("template"):null;return c||(c=u.lookup("template:"+o)),l||c?(t=r(this,e,c,t),l=n(l,u,t),"main"===t.outlet&&(this.lastRenderedTemplate=e),i(this,l,t),void 0):(s(this.router,"namespace.LOG_VIEW_LOOKUPS"),void 0)},disconnectOutlet:function(e){if(!e||"string"==typeof e){var r=e;e={},e.outlet=r}e.parentView=e.parentView?e.parentView.replace(/\//g,"."):t(this),e.outlet=e.outlet||"main";var n=this.router._lookupActiveView(e.parentView);n&&n.disconnectOutlet(e.outlet)},willDestroy:function(){this.teardownViews()},teardownViews:function(){this.teardownTopLevelView&&this.teardownTopLevelView();var e=this.teardownOutletViews||[];c(e,function(e){e()}),delete this.teardownTopLevelView,delete this.teardownOutletViews,delete this.lastRenderedTemplate}})}(),function(){Ember.onLoad("Ember.Handlebars",function(){function e(e,r,i){return n.call(t(e,r,i),function(t,n){return null===t?r[n]:o(e,t,i)})}function t(e,t,o){function a(e,t){return"controller"===t?t:Ember.ControllerMixin.detect(e)?a(i(e,"model"),t?t+".model":"model"):t}var s=r(e,t,o),u=o.types;return n.call(s,function(e,r){return"ID"===u[r]?a(e,t[r]):null})}var r=Ember.Handlebars.resolveParams,n=Ember.ArrayPolyfills.map,i=Ember.get,o=Ember.Handlebars.get;Ember.Router.resolveParams=e,Ember.Router.resolvePaths=t})}(),function(){var e=Ember.get,t=(Ember.set,Ember.String.fmt,Array.prototype.slice),r=function(e,t){for(var r=0,n=0,i=t.length;i>n&&(r+=t[n].names.length,t[n].handler!==e);n++);return r};Ember.onLoad("Ember.Handlebars",function(){function n(e){var t=e.options.types,r=e.options.data;return s(e.context,e.params,{types:t,data:r})}var i=Ember.Object.extend({values:null}),o=Ember.Router.resolveParams,a=Ember.Router._translateQueryParams,s=Ember.Router.resolvePaths,u=Ember.ViewUtils.isSimpleClick,l=Ember.LinkView=Ember.View.extend({tagName:"a",currentWhen:null,title:null,rel:null,activeClass:"active",loadingClass:"loading",disabledClass:"disabled",_isDisabled:!1,replace:!1,attributeBindings:["href","title","rel"],classNameBindings:["active","loading","disabled"],eventName:"click",init:function(){this._super.apply(this,arguments);var t=e(this,"eventName");this.on(t,this,this._invoke)},_paramsChanged:function(){this.notifyPropertyChange("resolvedParams")},_setupPathObservers:function(){var e,t,r,i=this.parameters,o=i.options.linkTextPath,a=n(i),s=a.length;for(o&&(r=Ember.Handlebars.normalizePath(i.context,o,i.options.data),this.registerObserver(r.root,r.path,this,this.rerender)),t=0;s>t;t++)e=a[t],null!==e&&(r=Ember.Handlebars.normalizePath(i.context,e,i.options.data),this.registerObserver(r.root,r.path,this,this._paramsChanged));var u=this.queryParamsObject;if(u){var l=u.values;for(var c in l)l.hasOwnProperty(c)&&"ID"===u.types[c]&&(r=Ember.Handlebars.normalizePath(i.context,l[c],i.options.data),this.registerObserver(r.root,r.path,this,this._paramsChanged))}},afterRender:function(){this._super.apply(this,arguments),this._setupPathObservers()},concreteView:Ember.computed(function(){return e(this,"parentView")}).property("parentView"),disabled:Ember.computed(function(t,r){return void 0!==r&&this.set("_isDisabled",r),r?e(this,"disabledClass"):!1}),active:Ember.computed(function(){if(e(this,"loading"))return!1;var t=e(this,"router"),n=e(this,"routeArgs"),i=n.slice(1),o=(e(this,"resolvedParams"),this.currentWhen||n[0]),a=r(o,t.router.recognizer.handlersFor(o));i.length>a&&(o=n[0]);var s=t.isActive.apply(t,[o].concat(i));return s?e(this,"activeClass"):void 0}).property("resolvedParams","routeArgs"),loading:Ember.computed(function(){return e(this,"routeArgs")?void 0:e(this,"loadingClass")}).property("routeArgs"),router:Ember.computed(function(){return e(this,"controller").container.lookup("router:main")}),_invoke:function(t){if(!u(t))return!0;if(this.preventDefault!==!1&&t.preventDefault(),this.bubbles===!1&&t.stopPropagation(),e(this,"_isDisabled"))return!1;if(e(this,"loading"))return Ember.Logger.warn("This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid."),!1;var r,n=e(this,"router"),i=e(this,"routeArgs");r=e(this,"replace")?n.replaceWith.apply(n,i):n.transitionTo.apply(n,i);var o=n.router.generate.apply(n.router,e(this,"routeArgs"));Ember.run.scheduleOnce("routerTransitions",this,this._eagerUpdateUrl,r,o)},_eagerUpdateUrl:function(t,r){if(t.isActive&&t.urlMethod){0===r.indexOf("#")&&(r=r.slice(1));var n=e(this,"router.router");"update"===t.urlMethod?n.updateURL(r):"replace"===t.urlMethod&&n.replaceURL(r),t.method(null)}},resolvedParams:Ember.computed(function(){var t=this.parameters,r=t.options,n=r.types,i=r.data;if(0===t.params.length){var a=this.container.lookup("controller:application");return[e(a,"currentRouteName")]}return o(t.context,t.params,{types:n,data:i})}).property("router.url"),routeArgs:Ember.computed(function(){var t=e(this,"resolvedParams").slice(0),r=e(this,"router"),n=t[0];if(n){var i=r.router.recognizer.handlersFor(n),o=i[i.length-1].handler;n!==o&&(this.set("currentWhen",n),n=i[i.length-1].handler,t[0]=n);for(var a=1,s=t.length;s>a;++a){var u=t[a];if(null===u||"undefined"==typeof u)return}return t}}).property("resolvedParams","queryParams"),queryParamsObject:null,queryParams:Ember.computed(function(){var t=e(this,"queryParamsObject"),r={};t&&Ember.merge(r,t.values);var n=e(this,"resolvedParams"),i=e(this,"router"),o=n[0],s=i._queryParamNamesFor(o),u=s.queryParams,l=s.translations,c={};a(r,l,o);var h=this.parameters;return i._queryParamOverrides(c,u,function(e,n){if(e in r){var i,o=e.split(":"),a=t.types[o[1]];if("ID"===a){var s=Ember.Handlebars.normalizePath(h.context,r[e],h.options.data);i=Ember.Handlebars.get(s.root,s.path,h.options)}else i=r[e];delete r[e],c[n]=i}}),c}).property("resolvedParams.[]"),href:Ember.computed(function(){if("a"===e(this,"tagName")){var t=e(this,"router"),r=e(this,"routeArgs");return r?t.generate.apply(t,r):e(this,"loadingHref")}}).property("routeArgs"),loadingHref:"#"});l.toString=function(){return"LinkView"},Ember.Handlebars.registerHelper("link-to",function(){var e=t.call(arguments,-1)[0],r=t.call(arguments,0,-1),n=e.hash;if(r[r.length-1]instanceof i&&(n.queryParamsObject=r.pop()),n.disabledBinding=n.disabledWhen,!e.fn){var o=r.shift(),a=e.types.shift(),s=this;"ID"===a?(e.linkTextPath=o,e.fn=function(){return Ember.Handlebars.getEscaped(s,o,e)}):e.fn=function(){return o}}return n.parameters={context:this,options:e,params:r},Ember.Handlebars.helpers.view.call(this,l,e)}),Ember.Handlebars.registerHelper("linkTo",function(){return Ember.Handlebars.helpers["link-to"].apply(this,arguments)})})}(),function(){Ember.get,Ember.set;Ember.onLoad("Ember.Handlebars",function(e){e.OutletView=Ember.ContainerView.extend(Ember._Metamorph),e.registerHelper("outlet",function(t,r){var n,i,o,a,s;for(t&&t.data&&t.data.isRenderData&&(r=t,t="main"),i=r.data.view.container,n=r.data.view;!n.get("template.isTop");)n=n.get("_parentView");return o=r.hash.view,o&&(s="view:"+o),a=o?i.lookupFactory(s):r.hash.viewClass||e.OutletView,r.data.view.set("outletSource",n),r.hash.currentViewBinding="_view.outletSource._outlets."+t,e.helpers.view.call(this,a,r)})})}(),function(){Ember.get,Ember.set;Ember.onLoad("Ember.Handlebars",function(){Ember.Handlebars.registerHelper("render",function(e,t,r){var n,i,o,a,s,u=arguments.length;if(n=(r||t).data.keywords.controller.container,i=n.lookup("router:main"),2===u)r=t,t=void 0;else{if(3!==u)throw Ember.Error("You must pass a templateName to render");s=Ember.Handlebars.get(r.contexts[1],t,r)}e=e.replace(/\//g,"."),a=n.lookup("view:"+e)||n.lookup("view:default");var l=r.hash.controller||e,c="controller:"+l;r.hash.controller;var h=r.data.keywords.controller;if(u>2){var m=n.lookupFactory(c)||Ember.generateControllerFactory(n,l,s);o=m.create({model:s,parentController:h,target:h})}else o=n.lookup(c)||Ember.generateController(n,l),o.setProperties({target:h,parentController:h});var p=r.contexts[1];p&&a.registerObserver(p,t,function(){o.set("model",Ember.Handlebars.get(p,t,r))}),r.hash.viewName=Ember.String.camelize(e);var f="template:"+e;r.hash.template=n.lookup(f),r.hash.controller=o,i&&!s&&i._connectActiveView(e,a),Ember.Handlebars.helpers.view.call(this,a,r)})})}(),function(){Ember.onLoad("Ember.Handlebars",function(){function e(e,r){var n=[];r&&n.push(r);var i=e.options.types.slice(1),o=e.options.data;return n.concat(t(e.context,e.params,{types:i,data:o}))}var t=Ember.Router.resolveParams,r=Ember.ViewUtils.isSimpleClick,n=Ember.Handlebars,i=n.get,o=n.SafeString,a=Ember.ArrayPolyfills.forEach,s=(Ember.get,Array.prototype.slice),u=n.ActionHelper={registeredActions:{}},l=["alt","shift","meta","ctrl"],c=/^click|mouse|touch/,h=function(e,t){if("undefined"==typeof t){if(c.test(e.type))return r(e);t=""}if(t.indexOf("any")>=0)return!0;var n=!0;return a.call(l,function(r){e[r+"Key"]&&-1===t.indexOf(r)&&(n=!1)}),n};u.registerAction=function(t,r,n){var o=++Ember.uuid;return u.registeredActions[o]={eventName:r.eventName,handler:function(o){if(!h(o,n))return!0;r.preventDefault!==!1&&o.preventDefault(),r.bubbles===!1&&o.stopPropagation();var a,s=r.target;s=s.target?i(s.root,s.target,s.options):s.root,r.boundProperty&&(a=i(s,t,r.options),("undefined"==typeof a||"function"==typeof a)&&(a=t)),a||(a=t),Ember.run(function(){s.send?s.send.apply(s,e(r.parameters,a)):s[a].apply(s,e(r.parameters))})}},r.view.on("willClearRender",function(){delete u.registeredActions[o]}),o},n.registerHelper("action",function(e){var t=arguments[arguments.length-1],r=s.call(arguments,1,-1),n=t.hash,i=t.data.keywords.controller,a={eventName:n.on||"click",parameters:{context:this,options:t,params:r},view:t.data.view,bubbles:n.bubbles,preventDefault:n.preventDefault,target:{options:t},boundProperty:"ID"===t.types[0]};n.target?(a.target.root=this,a.target.target=n.target):i&&(a.target.root=i);var l=u.registerAction(e,a,n.allowedKeys);return new o('data-ember-action="'+l+'"')})})}(),function(){{var e=Ember.get;Ember.set,Ember.EnumerableUtils.map}Ember.ControllerMixin.reopen({transitionToRoute:function(){var t=e(this,"target"),r=t.transitionToRoute||t.transitionTo;return r.apply(t,arguments)},transitionTo:function(){return this.transitionToRoute.apply(this,arguments)},replaceRoute:function(){var t=e(this,"target"),r=t.replaceRoute||t.replaceWith;return r.apply(t,arguments)},replaceWith:function(){return this.replaceRoute.apply(this,arguments)}})}(),function(){var e=Ember.get,t=Ember.set;Ember.View.reopen({init:function(){t(this,"_outlets",{}),this._super()},connectOutlet:function(r,n){if(this._pendingDisconnections&&delete this._pendingDisconnections[r],this._hasEquivalentView(r,n))return n.destroy(),void 0;var i=e(this,"_outlets"),o=e(this,"container"),a=o&&o.lookup("router:main"),s=e(n,"renderedName");t(i,r,n),a&&s&&a._connectActiveView(s,n)},_hasEquivalentView:function(t,r){var n=e(this,"_outlets."+t);return n&&n.constructor===r.constructor&&n.get("template")===r.get("template")&&n.get("context")===r.get("context")},disconnectOutlet:function(e){this._pendingDisconnections||(this._pendingDisconnections={}),this._pendingDisconnections[e]=!0,Ember.run.once(this,"_finishDisconnections")},_finishDisconnections:function(){if(!this.isDestroyed){var r=e(this,"_outlets"),n=this._pendingDisconnections;this._pendingDisconnections=null;for(var i in n)t(r,i,null)}}})}(),function(){var e=Ember.run.queues,t=Ember.ArrayPolyfills.indexOf;e.splice(t.call(e,"actions")+1,0,"routerTransitions")}(),function(){Ember.get,Ember.set;Ember.Location={create:function(e){var t=e&&e.implementation,r=this.implementations[t];return r.create.apply(r,arguments)},registerImplementation:function(e,t){this.implementations[e]=t},implementations:{},_location:window.location,_getHash:function(){var e=(this._location||this.location).href,t=e.indexOf("#");return-1===t?"":e.substr(t)}}}(),function(){var e=Ember.get,t=Ember.set;Ember.NoneLocation=Ember.Object.extend({implementation:"none",path:"",getURL:function(){return e(this,"path")},setURL:function(e){t(this,"path",e)},onUpdateURL:function(e){this.updateCallback=e},handleURL:function(e){t(this,"path",e),this.updateCallback(e)},formatURL:function(e){return e}})}(),function(){var e=Ember.get,t=Ember.set;Ember.HashLocation=Ember.Object.extend({implementation:"hash",init:function(){t(this,"location",e(this,"_location")||window.location)},getHash:Ember.Location._getHash,getURL:function(){return this.getHash().substr(1)},setURL:function(r){e(this,"location").hash=r,t(this,"lastSetURL",r)},replaceURL:function(r){e(this,"location").replace("#"+r),t(this,"lastSetURL",r)},onUpdateURL:function(r){var n=this,i=Ember.guidFor(this);Ember.$(window).on("hashchange.ember-location-"+i,function(){Ember.run(function(){var i=n.getURL();e(n,"lastSetURL")!==i&&(t(n,"lastSetURL",null),r(i))})})},formatURL:function(e){return"#"+e},willDestroy:function(){var e=Ember.guidFor(this);Ember.$(window).off("hashchange.ember-location-"+e)}})}(),function(){var e=Ember.get,t=Ember.set,r=!1,n=window.history&&"state"in window.history;Ember.HistoryLocation=Ember.Object.extend({implementation:"history",init:function(){t(this,"location",e(this,"location")||window.location),t(this,"baseURL",Ember.$("base").attr("href")||"")},initState:function(){t(this,"history",e(this,"history")||window.history),this.replaceState(this.formatURL(this.getURL()))},rootURL:"/",getURL:function(){var t=e(this,"rootURL"),r=e(this,"location"),n=r.pathname,i=e(this,"baseURL");t=t.replace(/\/$/,""),i=i.replace(/\/$/,"");var o=n.replace(i,"").replace(t,"");return o},setURL:function(e){var t=this.getState();e=this.formatURL(e),t&&t.path===e||this.pushState(e)},replaceURL:function(e){var t=this.getState();e=this.formatURL(e),t&&t.path===e||this.replaceState(e)},getState:function(){return n?e(this,"history").state:this._historyState},pushState:function(t){var r={path:t};e(this,"history").pushState(r,null,t),n||(this._historyState=r),this._previousURL=this.getURL()},replaceState:function(t){var r={path:t};e(this,"history").replaceState(r,null,t),n||(this._historyState=r),this._previousURL=this.getURL()},onUpdateURL:function(e){var t=Ember.guidFor(this),n=this;Ember.$(window).on("popstate.ember-location-"+t,function(){(r||(r=!0,n.getURL()!==n._previousURL))&&e(n.getURL())})},formatURL:function(t){var r=e(this,"rootURL"),n=e(this,"baseURL");return""!==t?(r=r.replace(/\/$/,""),n=n.replace(/\/$/,"")):n.match(/^\//)&&r.match(/^\//)&&(n=n.replace(/\/$/,"")),n+r+t},willDestroy:function(){var e=Ember.guidFor(this);Ember.$(window).off("popstate.ember-location-"+e)}})}(),function(){{var e=(Ember.get,Ember.set),t=Ember.HistoryLocation,r=Ember.HashLocation,n=Ember.NoneLocation,i=Ember.Location;Ember.AutoLocation={cancelRouterSetup:!1,rootURL:"/",_window:window,_location:window.location,_history:window.history,_HistoryLocation:t,_HashLocation:r,_NoneLocation:n,_getOrigin:function(){var e=this._location,t=e.origin;return t||(t=e.protocol+"//"+e.hostname,e.port&&(t+=":"+e.port)),t},_getSupportsHistory:function(){var e=this._window.navigator.userAgent;return-1!==e.indexOf("Android 2")&&-1!==e.indexOf("Mobile Safari")&&-1===e.indexOf("Chrome")?!1:!!(this._history&&"pushState"in this._history)},_getSupportsHashChange:function(){var e=this._window,t=e.document.documentMode;return"onhashchange"in e&&(void 0===t||t>7)},_replacePath:function(e){this._location.replace(this._getOrigin()+e)},_getRootURL:function(){return this.rootURL},_getPath:function(){var e=this._location.pathname;return"/"!==e.charAt(0)&&(e="/"+e),e},_getHash:i._getHash,_getQuery:function(){return this._location.search},_getFullPath:function(){return this._getPath()+this._getQuery()+this._getHash()},_getHistoryPath:function(){{var e,t,r=this._getRootURL(),n=this._getPath(),i=this._getHash(),o=this._getQuery();n.indexOf(r)}return"#/"===i.substr(0,2)?(t=i.substr(1).split("#"),e=t.shift(),"/"===n.slice(-1)&&(e=e.substr(1)),n+=e,n+=o,t.length&&(n+="#"+t.join("#"))):(n+=o,n+=i),n},_getHashPath:function(){var e=this._getRootURL(),t=e,r=this._getHistoryPath(),n=r.substr(e.length);return""!==n&&("/"!==n.charAt(0)&&(n="/"+n),t+="#"+n),t},create:function(t){t&&t.rootURL&&(this.rootURL=t.rootURL);var r,n,i=!1,o=this._NoneLocation,a=this._getFullPath();this._getSupportsHistory()?(r=this._getHistoryPath(),a===r?o=this._HistoryLocation:(i=!0,this._replacePath(r))):this._getSupportsHashChange()&&(n=this._getHashPath(),a===n||"/"===a&&"/#/"===n?o=this._HashLocation:(i=!0,this._replacePath(n)));var s=o.create.apply(o,arguments);return i&&e(s,"cancelRouterSetup",!0),s}}}}(),function(){function e(t,r,n,i){var o,a=t.name,s=t.incoming,u=t.incomingNames,l=u.length;if(n||(n={}),i||(i=[]),!n.hasOwnProperty(a)){for(i.push(a),n[a]=!0,o=0;l>o;o++)e(s[u[o]],r,n,i);r(t,i),i.pop()}}function t(){this.names=[],this.vertices={}}t.prototype.add=function(e){if(e){if(this.vertices.hasOwnProperty(e))return this.vertices[e];var t={name:e,incoming:{},incomingNames:[],hasOutgoing:!1,value:null};return this.vertices[e]=t,this.names.push(e),t}},t.prototype.map=function(e,t){this.add(e).value=t},t.prototype.addEdge=function(t,r){function n(e,t){if(e.name===r)throw new Ember.Error("cycle detected: "+r+" <- "+t.join(" <- "))}if(t&&r&&t!==r){var i=this.add(t),o=this.add(r);o.incoming.hasOwnProperty(t)||(e(i,n),i.hasOutgoing=!0,o.incoming[t]=i,o.incomingNames.push(t))}},t.prototype.topsort=function(t){var r,n,i={},o=this.vertices,a=this.names,s=a.length;for(r=0;s>r;r++)n=o[a[r]],n.hasOutgoing||e(n,t,i)},t.prototype.addEdges=function(e,t,r,n){var i;if(this.map(e,t),r)if("string"==typeof r)this.addEdge(e,r);else for(i=0;i<r.length;i++)this.addEdge(e,r[i]);if(n)if("string"==typeof n)this.addEdge(n,e);else for(i=0;i<n.length;i++)this.addEdge(n[i],e)},Ember.DAG=t}(),function(){var e=Ember.get,t=Ember.String.classify,r=Ember.String.capitalize,n=Ember.String.decamelize;Ember.Resolver=Ember.Object.extend({namespace:null,normalize:function(){throw new Error("Invalid call to `resolver.normalize(fullName)`. Please override the 'normalize' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},resolve:function(){throw new Error("Invalid call to `resolver.resolve(parsedName)`. Please override the 'resolve' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},parseName:function(){throw new Error("Invalid call to `resolver.resolveByType(parsedName)`. Please override the 'resolveByType' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},lookupDescription:function(){throw new Error("Invalid call to `resolver.lookupDescription(fullName)`. Please override the 'lookupDescription' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")},makeToString:function(){throw new Error("Invalid call to `resolver.makeToString(factory, fullName)`. Please override the 'makeToString' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")
|
19 |
+
},resolveOther:function(){throw new Error("Invalid call to `resolver.resolveDefault(parsedName)`. Please override the 'resolveDefault' method in subclass of `Ember.AbstractResolver` to prevent falling through to this error.")}}),Ember.DefaultResolver=Ember.Object.extend({namespace:null,normalize:function(e){var t=e.split(":",2),r=t[0],n=t[1];if("template"!==r){var i=n;return i.indexOf(".")>-1&&(i=i.replace(/\.(.)/g,function(e){return e.charAt(1).toUpperCase()})),n.indexOf("_")>-1&&(i=i.replace(/_(.)/g,function(e){return e.charAt(1).toUpperCase()})),r+":"+i}return e},resolve:function(e){var t=this.parseName(e),r=t.resolveMethodName;if(!t.name||!t.type)throw new TypeError("Invalid fullName: `"+e+"`, must be of the form `type:name` ");if(this[r]){var n=this[r](t);if(n)return n}return this.resolveOther(t)},parseName:function(n){var i=n.split(":"),o=i[0],a=i[1],s=a,u=e(this,"namespace"),l=u;if("template"!==o&&-1!==s.indexOf("/")){var c=s.split("/");s=c[c.length-1];var h=r(c.slice(0,-1).join("."));l=Ember.Namespace.byName(h)}return{fullName:n,type:o,fullNameWithoutType:a,name:s,root:l,resolveMethodName:"resolve"+t(o)}},lookupDescription:function(e){var r=this.parseName(e);if("template"===r.type)return"template at "+r.fullNameWithoutType.replace(/\./g,"/");var n=r.root+"."+t(r.name);return"model"!==r.type&&(n+=t(r.type)),n},makeToString:function(e){return e.toString()},useRouterNaming:function(e){e.name=e.name.replace(/\./g,"_"),"basic"===e.name&&(e.name="")},resolveTemplate:function(e){var t=e.fullNameWithoutType.replace(/\./g,"/");return Ember.TEMPLATES[t]?Ember.TEMPLATES[t]:(t=n(t),Ember.TEMPLATES[t]?Ember.TEMPLATES[t]:void 0)},resolveView:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveController:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveRoute:function(e){return this.useRouterNaming(e),this.resolveOther(e)},resolveModel:function(r){var n=t(r.name),i=e(r.root,n);return i?i:void 0},resolveHelper:function(e){return this.resolveOther(e)||Ember.Handlebars.helpers[e.fullNameWithoutType]},resolveOther:function(r){var n=t(r.name)+t(r.type),i=e(r.root,n);return i?i:void 0}})}(),function(){function e(e){this._container=e}function t(e){function t(e){return n.resolve(e)}e.get("resolver");var r=e.get("resolver")||e.get("Resolver")||Ember.DefaultResolver,n=r.create({namespace:e});return t.describe=function(e){return n.lookupDescription(e)},t.makeToString=function(e,t){return n.makeToString(e,t)},t.normalize=function(e){return n.normalize?n.normalize(e):e},t.__resolver__=n,t}var r=Ember.get,n=Ember.set;e.deprecate=function(e){return function(){var t=this._container;return t[e].apply(t,arguments)}},e.prototype={_container:null,lookup:e.deprecate("lookup"),resolve:e.deprecate("resolve"),register:e.deprecate("register")};var i=Ember.Application=Ember.Namespace.extend(Ember.DeferredMixin,{rootElement:"body",eventDispatcher:null,customEvents:null,_readinessDeferrals:1,init:function(){if(this.$||(this.$=Ember.$),this.__container__=this.buildContainer(),this.Router=this.defaultRouter(),this._super(),this.scheduleInitialize(),Ember.libraries.registerCoreLibrary("Handlebars",Ember.Handlebars.VERSION),Ember.libraries.registerCoreLibrary("jQuery",Ember.$().jquery),Ember.LOG_VERSION){Ember.LOG_VERSION=!1;var e=Math.max.apply(this,Ember.A(Ember.libraries).mapBy("name.length"));Ember.libraries.each(function(t){new Array(e-t.length+1).join(" ")})}},buildContainer:function(){var e=this.__container__=i.buildContainer(this);return e},defaultRouter:function(){if(this.Router!==!1){var e=this.__container__;return this.Router&&(e.unregister("router:main"),e.register("router:main",this.Router)),e.lookupFactory("router:main")}},scheduleInitialize:function(){var e=this;!this.$||this.$.isReady?Ember.run.schedule("actions",e,"_initialize"):this.$().ready(function(){Ember.run(e,"_initialize")})},deferReadiness:function(){this._readinessDeferrals++},advanceReadiness:function(){this._readinessDeferrals--,0===this._readinessDeferrals&&Ember.run.once(this,this.didBecomeReady)},register:function(){var e=this.__container__;e.register.apply(e,arguments)},inject:function(){var e=this.__container__;e.injection.apply(e,arguments)},initialize:function(){},_initialize:function(){if(!this.isDestroyed){if(this.Router){var e=this.__container__;e.unregister("router:main"),e.register("router:main",this.Router)}return this.runInitializers(),Ember.runLoadHooks("application",this),this.advanceReadiness(),this}},reset:function(){function e(){var e=this.__container__.lookup("router:main");e.reset(),Ember.run(this.__container__,"destroy"),this.buildContainer(),Ember.run.schedule("actions",this,function(){this._initialize()})}this._readinessDeferrals=1,Ember.run.join(this,e)},runInitializers:function(){var e,t,n=r(this.constructor,"initializers"),i=this.__container__,o=new Ember.DAG,a=this;for(e in n)t=n[e],o.addEdges(t.name,t.initialize,t.before,t.after);o.topsort(function(e){var t=e.value;t(i,a)})},didBecomeReady:function(){this.setupEventDispatcher(),this.ready(),this.startRouting(),Ember.testing||(Ember.Namespace.processAll(),Ember.BOOTED=!0),this.resolve(this)},setupEventDispatcher:function(){var e=r(this,"customEvents"),t=r(this,"rootElement"),i=this.__container__.lookup("event_dispatcher:main");n(this,"eventDispatcher",i),i.setup(e,t)},startRouting:function(){var e=this.__container__.lookup("router:main");e&&e.startRouting()},handleURL:function(e){var t=this.__container__.lookup("router:main");t.handleURL(e)},ready:Ember.K,resolver:null,Resolver:null,willDestroy:function(){Ember.BOOTED=!1,this.__container__.lookup("router:main").reset(),this.__container__.destroy()},initializer:function(e){this.constructor.initializer(e)}});Ember.Application.reopenClass({initializers:{},initializer:function(e){void 0!==this.superclass.initializers&&this.superclass.initializers===this.initializers&&this.reopenClass({initializers:Ember.create(this.initializers)}),this.initializers[e.name]=e},buildContainer:function(r){var n=new Ember.Container;return Ember.Container.defaultContainer=new e(n),n.set=Ember.set,n.resolver=t(r),n.normalize=n.resolver.normalize,n.describe=n.resolver.describe,n.makeToString=n.resolver.makeToString,n.optionsForType("component",{singleton:!1}),n.optionsForType("view",{singleton:!1}),n.optionsForType("template",{instantiate:!1}),n.optionsForType("helper",{instantiate:!1}),n.register("application:main",r,{instantiate:!1}),n.register("controller:basic",Ember.Controller,{instantiate:!1}),n.register("controller:object",Ember.ObjectController,{instantiate:!1}),n.register("controller:array",Ember.ArrayController,{instantiate:!1}),n.register("route:basic",Ember.Route,{instantiate:!1}),n.register("event_dispatcher:main",Ember.EventDispatcher),n.register("router:main",Ember.Router),n.injection("router:main","namespace","application:main"),n.register("location:auto",Ember.AutoLocation),n.register("location:hash",Ember.HashLocation),n.register("location:history",Ember.HistoryLocation),n.register("location:none",Ember.NoneLocation),n.injection("controller","target","router:main"),n.injection("controller","namespace","application:main"),n.injection("route","router","router:main"),n.injection("location","rootURL","-location-setting:root-url"),n.register("resolver-for-debugging:main",n.resolver.__resolver__,{instantiate:!1}),n.injection("container-debug-adapter:main","resolver","resolver-for-debugging:main"),n.injection("data-adapter:main","containerDebugAdapter","container-debug-adapter:main"),n.register("container-debug-adapter:main",Ember.ContainerDebugAdapter),n}}),Ember.runLoadHooks("Ember.Application",Ember.Application)}(),function(){function e(e,t,r){var n,i,o,a=[];for(i=0,o=r.length;o>i;i++)n=r[i],-1===n.indexOf(":")&&(n="controller:"+n),t.has(n)||a.push(n);if(a.length)throw new Ember.Error(Ember.inspect(e)+" needs [ "+a.join(", ")+" ] but "+(a.length>1?"they":"it")+" could not be found")}var t=Ember.get,r=(Ember.set,Ember.computed(function(){var e=this;return{needs:t(e,"needs"),container:t(e,"container"),unknownProperty:function(t){var r,n,i,o=this.needs;for(n=0,i=o.length;i>n;n++)if(r=o[n],r===t)return this.container.lookup("controller:"+t);var a=Ember.inspect(e)+"#needs does not include `"+t+"`. To access the "+t+" controller from "+Ember.inspect(e)+", "+Ember.inspect(e)+" should have a `needs` property that is an array of the controllers it has access to.";throw new ReferenceError(a)},setUnknownProperty:function(t){throw new Error("You cannot overwrite the value of `controllers."+t+"` of "+Ember.inspect(e))}}}));Ember.ControllerMixin.reopen({concatenatedProperties:["needs"],needs:[],init:function(){var r=t(this,"needs"),n=t(r,"length");n>0&&(this.container&&e(this,this.container,r),t(this,"controllers")),this._super.apply(this,arguments)},controllerFor:function(e){return Ember.controllerFor(t(this,"container"),e)},controllers:r})}(),function(){Ember.ContainerDebugAdapter=Ember.Object.extend({container:null,resolver:null,canCatalogEntriesByType:function(e){return"model"===e||"template"===e?!1:!0},catalogEntriesByType:function(e){var t=Ember.A(Ember.Namespace.NAMESPACES),r=Ember.A(),n=new RegExp(Ember.String.classify(e)+"$");return t.forEach(function(e){if(e!==Ember)for(var t in e)if(e.hasOwnProperty(t)&&n.test(t)){var i=e[t];"class"===Ember.typeOf(i)&&r.push(Ember.String.dasherize(t.replace(n,"")))}}),r}})}(),function(){Ember.DataAdapter=Ember.Object.extend({init:function(){this._super(),this.releaseMethods=Ember.A()},container:null,containerDebugAdapter:void 0,attributeLimit:3,releaseMethods:Ember.A(),getFilters:function(){return Ember.A()},watchModelTypes:function(e,t){var r,n=this.getModelTypes(),i=this,o=Ember.A();r=n.map(function(e){var r=e.klass,n=i.wrapModelType(r,e.name);return o.push(i.observeModelType(r,t)),n}),e(r);var a=function(){o.forEach(function(e){e()}),i.releaseMethods.removeObject(a)};return this.releaseMethods.pushObject(a),a},_nameToClass:function(e){return"string"==typeof e&&(e=this.container.lookupFactory("model:"+e)),e},watchRecords:function(e,t,r,n){var i,o=this,a=Ember.A(),s=this.getRecords(e),u=function(e){r([e])},l=s.map(function(e){return a.push(o.observeRecord(e,u)),o.wrapRecord(e)}),c=function(e,r,i,s){for(var l=r;r+s>l;l++){var c=e.objectAt(l),h=o.wrapRecord(c);a.push(o.observeRecord(c,u)),t([h])}i&&n(r,i)},h={didChange:c,willChange:Ember.K};return s.addArrayObserver(o,h),i=function(){a.forEach(function(e){e()}),s.removeArrayObserver(o,h),o.releaseMethods.removeObject(i)},t(l),this.releaseMethods.pushObject(i),i},willDestroy:function(){this._super(),this.releaseMethods.forEach(function(e){e()})},detect:function(){return!1},columnsForType:function(){return Ember.A()},observeModelType:function(e,t){var r=this,n=this.getRecords(e),i=function(){t([r.wrapModelType(e)])},o={didChange:function(){Ember.run.scheduleOnce("actions",this,i)},willChange:Ember.K};n.addArrayObserver(this,o);var a=function(){n.removeArrayObserver(r,o)};return a},wrapModelType:function(e,t){var r,n=this.getRecords(e);return r={name:t||e.toString(),count:Ember.get(n,"length"),columns:this.columnsForType(e),object:e}},getModelTypes:function(){var e,t=this,r=this.get("containerDebugAdapter");return e=r.canCatalogEntriesByType("model")?r.catalogEntriesByType("model"):this._getObjectsOnNamespaces(),e.map(function(e){return{klass:t._nameToClass(e),name:e}}).filter(function(e){return t.detect(e.klass)})},_getObjectsOnNamespaces:function(){var e=Ember.A(Ember.Namespace.NAMESPACES),t=Ember.A();return e.forEach(function(e){for(var r in e)if(e.hasOwnProperty(r)){var n=Ember.String.dasherize(r);e instanceof Ember.Application||!e.toString()||(n=e+"/"+n),t.push(n)}}),t},getRecords:function(){return Ember.A()},wrapRecord:function(e){var t={object:e};return t.columnValues=this.getRecordColumnValues(e),t.searchKeywords=this.getRecordKeywords(e),t.filterValues=this.getRecordFilterValues(e),t.color=this.getRecordColor(e),t},getRecordColumnValues:function(){return{}},getRecordKeywords:function(){return Ember.A()},getRecordFilterValues:function(){return{}},getRecordColor:function(){return null},observeRecord:function(){return function(){}}})}(),e("container/container",["container/inheriting_dict","exports"],function(e,t){"use strict";function r(e){this.parent=e,this.children=[],this.resolver=e&&e.resolver||function(){},this.registry=new E(e&&e.registry),this.cache=new E(e&&e.cache),this.factoryCache=new E(e&&e.factoryCache),this.resolveCache=new E(e&&e.resolveCache),this.typeInjections=new E(e&&e.typeInjections),this.injections={},this.factoryTypeInjections=new E(e&&e.factoryTypeInjections),this.factoryInjections={},this._options=new E(e&&e._options),this._typeOptions=new E(e&&e._typeOptions)}function n(e,t){return e.cache.has(t)?!0:!!e.resolve(t)}function i(e,t,r){if(r=r||{},e.cache.has(t)&&r.singleton!==!1)return e.cache.get(t);var n=m(e,t);return void 0!==n?(a(e,t)&&r.singleton!==!1&&e.cache.set(t,n),n):void 0}function o(e){throw new Error(e+" is not currently supported on child containers")}function a(e,t){var r=u(e,t,"singleton");return r!==!1}function s(e,t){var r={};if(!t)return r;for(var n,o,a=0,s=t.length;s>a;a++){if(n=t[a],o=i(e,n.fullName),void 0===o)throw new Error("Attempting to inject an unknown injection: `"+n.fullName+"`");r[n.property]=o}return r}function u(e,t,r){var n=e._options.get(t);if(n&&void 0!==n[r])return n[r];var i=t.split(":")[0];return n=e._typeOptions.get(i),n?n[r]:void 0}function l(e,t){var r,n=t,i=e.resolve(n),o=e.factoryCache,a=t.split(":")[0];if(void 0!==i){if(o.has(t))return o.get(t);if(!i||"function"!=typeof i.extend||!Ember.MODEL_FACTORY_INJECTIONS&&"model"===a)return i;var s=c(e,t),u=h(e,t);return u._toString=e.makeToString(i,t),r=i.extend(s),r.reopenClass(u),o.set(t,r),r}}function c(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.typeInjections.get(n)||[]),i=i.concat(e.injections[t]||[]),i=s(e,i),i._debugContainerKey=t,i.container=e,i}function h(e,t){var r=t.split(":"),n=r[0],i=[];return i=i.concat(e.factoryTypeInjections.get(n)||[]),i=i.concat(e.factoryInjections[t]||[]),i=s(e,i),i._debugContainerKey=t,i}function m(e,t){var r=l(e,t);return u(e,t,"instantiate")===!1?r:r?"function"==typeof r.extend?r.create():r.create(c(e,t)):void 0}function p(e,t){e.cache.eachLocal(function(r,n){u(e,r,"instantiate")!==!1&&t(n)})}function f(e){e.cache.eachLocal(function(t,r){u(e,t,"instantiate")!==!1&&r.destroy()}),e.cache.dict={}}function d(e,t,r,n){var i=e.get(t);i||(i=[],e.set(t,i)),i.push({property:r,fullName:n})}function b(e){if(!g.test(e))throw new TypeError("Invalid Fullname, expected: `type:name` got: "+e)}function v(e,t,r,n){var i=e[t]=e[t]||[];i.push({property:r,fullName:n})}var E=e["default"];r.prototype={parent:null,children:null,resolver:null,registry:null,cache:null,typeInjections:null,injections:null,_options:null,_typeOptions:null,child:function(){var e=new r(this);return this.children.push(e),e},set:function(e,t,r){e[t]=r},register:function(e,t,r){if(b(e),void 0===t)throw new TypeError("Attempting to register an unknown factory: `"+e+"`");var n=this.normalize(e);if(this.cache.has(n))throw new Error("Cannot re-register: `"+e+"`, as it has already been looked up.");this.registry.set(n,t),this._options.set(n,r||{})},unregister:function(e){b(e);var t=this.normalize(e);this.registry.remove(t),this.cache.remove(t),this.factoryCache.remove(t),this.resolveCache.remove(t),this._options.remove(t)},resolve:function(e){b(e);var t=this.normalize(e),r=this.resolveCache.get(t);if(r)return r;var n=this.resolver(t)||this.registry.get(t);return this.resolveCache.set(t,n),n},describe:function(e){return e},normalize:function(e){return e},makeToString:function(e){return e.toString()},lookup:function(e,t){return b(e),i(this,this.normalize(e),t)},lookupFactory:function(e){return b(e),l(this,this.normalize(e))},has:function(e){return b(e),n(this,this.normalize(e))},optionsForType:function(e,t){this.parent&&o("optionsForType"),this._typeOptions.set(e,t)},options:function(e,t){this.optionsForType(e,t)},typeInjection:function(e,t,r){b(r),this.parent&&o("typeInjection");var n=r.split(":")[0];if(n===e)throw new Error("Cannot inject a `"+r+"` on other "+e+"(s). Register the `"+r+"` as a different type and perform the typeInjection.");d(this.typeInjections,e,t,r)},injection:function(e,t,r){this.parent&&o("injection"),b(r);var n=this.normalize(r);if(-1===e.indexOf(":"))return this.typeInjection(e,t,n);b(e);var i=this.normalize(e);if(this.cache.has(i))throw new Error("Attempted to register an injection for a type that has already been looked up. ('"+i+"', '"+t+"', '"+r+"')");v(this.injections,i,t,n)},factoryTypeInjection:function(e,t,r){this.parent&&o("factoryTypeInjection"),d(this.factoryTypeInjections,e,t,this.normalize(r))},factoryInjection:function(e,t,r){this.parent&&o("injection");var n=this.normalize(e),i=this.normalize(r);if(b(r),-1===e.indexOf(":"))return this.factoryTypeInjection(n,t,i);if(b(e),this.factoryCache.has(n))throw new Error("Attempted to register a factoryInjection for a type that has already been looked up. ('"+n+"', '"+t+"', '"+r+"')");v(this.factoryInjections,n,t,i)},destroy:function(){for(var e=0,t=this.children.length;t>e;e++)this.children[e].destroy();this.children=[],p(this,function(e){e.destroy()}),this.parent=void 0,this.isDestroyed=!0},reset:function(){for(var e=0,t=this.children.length;t>e;e++)f(this.children[e]);f(this)}};var g=/^[^:]+.+:[^:]+$/;t["default"]=r}),e("ember-runtime/ext/rsvp",["ember-metal/core","ember-metal/logger","exports"],function(e,r,n){"use strict";var i,o=e["default"],a=r["default"],s=t("rsvp"),u="ember-testing/test";s.onerrorDefault=function(e){if(e instanceof Error)if(o.testing){if(!i&&o.__loader.registry[u]&&(i=t(u)["default"]),!i||!i.adapter)throw e;i.adapter.exception(e)}else o.onerror?o.onerror(e):a.error(e.stack)},s.on("error",s.onerrorDefault),n["default"]=s}),e("ember-runtime/system/container",["ember-metal/property_set","exports"],function(e,r){"use strict";var n=e["default"],i=t("container")["default"];i.set=n,r["default"]=i})}(),"undefined"==typeof location||"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname||Ember.Logger.warn("You are running a production build of Ember on localhost and won't receive detailed error messages. If you want full error messages please use the non-minified build provided on the Ember website.");
|
admin/views/slider-panel/js/handlebars.min.js
CHANGED
@@ -1,14 +1,19 @@
|
|
1 |
/*!
|
|
|
2 |
handlebars v1.3.0
|
|
|
3 |
Copyright (C) 2011 by Yehuda Katz
|
|
|
4 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
of this software and associated documentation files (the "Software"), to deal
|
6 |
in the Software without restriction, including without limitation the rights
|
7 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
copies of the Software, and to permit persons to whom the Software is
|
9 |
furnished to do so, subject to the following conditions:
|
|
|
10 |
The above copyright notice and this permission notice shall be included in
|
11 |
all copies or substantial portions of the Software.
|
|
|
12 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
@@ -16,6 +21,8 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
18 |
THE SOFTWARE.
|
|
|
19 |
@license
|
20 |
*/
|
21 |
-
var Handlebars=function(){var r=function(){"use strict";function n(n){this.string=n}return n.prototype.toString=function(){return""+this.string},n}(),t=function(n){"use strict";function h(n){return e[n]||"&"}function c(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}function l(n){return n instanceof f?n.toString():!n&&n!==0?"":(n=""+n,!s.test(n))?n:n.replace(o,h)}function a(n){return n||n===0?u(n)&&n.length===0?!0:!1:!0}var t={},f=n,e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},o=/[&<>"'`]/g,s=/[&<>"'`]/,i,r,u;return t.extend=c,i=Object.prototype.toString,t.toString=i,r=function(n){return typeof n=="function"},r(/x/)&&(r=function(n){return typeof n=="function"&&i.call(n)==="[object Function]"}),t.isFunction=r,u=Array.isArray||function(n){return n&&typeof n=="object"?i.call(n)==="[object Array]":!1},t.isArray=u,t.escapeExpression=l,t.isEmpty=a,t}(r),n=function(){"use strict";function t(t,i){var u,f,r;for(i&&i.firstLine&&(u=i.firstLine,t+=" - "+u+":"+i.firstColumn),f=Error.prototype.constructor.call(this,t),r=0;r<n.length;r++)this[n[r]]=f[n[r]];u&&(this.lineNumber=u,this.column=i.firstColumn)}var n=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,t}(),i=function(n,t){"use strict";function e(n,t){this.helpers=n||{},this.partials=t||{},p(this)}function p(n){n.registerHelper("helperMissing",function(n){if(arguments.length===2)return undefined;throw new s("Missing helper: '"+n+"'");}),n.registerHelper("blockHelperMissing",function(t,i){var r=i.inverse||function(){},u=i.fn;return f(t)&&(t=t.call(this)),t===!0?u(this):t===!1||t==null?r(this):l(t)?t.length>0?n.helpers.each(t,i):r(this):u(t)}),n.registerHelper("each",function(n,t){var s=t.fn,c=t.inverse,r=0,u="",i,h,e;if(f(n)&&(n=n.call(this)),t.data&&(i=o(t.data)),n&&typeof n=="object")if(l(n))for(h=n.length;r<h;r++)i&&(i.index=r,i.first=r===0,i.last=r===n.length-1),u=u+s(n[r],{data:i});else for(e in n)n.hasOwnProperty(e)&&(i&&(i.key=e,i.index=r,i.first=r===0),u=u+s(n[e],{data:i}),r++);return r===0&&(u=c(this)),u}),n.registerHelper("if",function(n,t){return f(n)&&(n=n.call(this)),(t.hash.includeZero||n)&&!r.isEmpty(n)?t.fn(this):t.inverse(this)}),n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})}),n.registerHelper("with",function(n,t){return f(n)&&(n=n.call(this)),r.isEmpty(n)?void 0:t.fn(n)}),n.registerHelper("log",function(t,i){var r=i.data&&i.data.level!=null?parseInt(i.data.level,10):1;n.log(r,t)})}function y(n,t){u.log(n,t)}var i={},r=n,s=t,h,c,u,o;i.VERSION="1.3.0",h=4,i.COMPILER_REVISION=h,c={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"},i.REVISION_CHANGES=c;var l=r.isArray,f=r.isFunction,a=r.toString,v="[object Object]";return i.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:u,log:y,registerHelper:function(n,t,i){if(a.call(n)===v){if(i||t)throw new s("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else i&&(t.not=i),this.helpers[n]=t},registerPartial:function(n,t){a.call(n)===v?r.extend(this.partials,n):this.partials[n]=t}},u={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(n,t){if(u.level<=n){var i=u.methodMap[n];typeof console!="undefined"&&console[i]&&console[i].call(console,t)}}},i.logger=u,i.log=y,o=function(n){var t={};return r.extend(t,n),t},i.createFrame=o,i}(t,n),f=function(n,t,i){"use strict";function h(n){var t=n&&n[0]||1,i=s,r,f;if(t!==i)if(t<i){r=o[i],f=o[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+f+").");}else throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}function c(n,t){if(!t)throw new u("No environment passed to template");var r=function(n,i,r,f,e,o){var s=t.VM.invokePartial.apply(this,arguments),h;if(s!=null)return s;if(t.compile)return h={helpers:f,partials:e,data:o},e[i]=t.compile(n,{data:o!==undefined},t),e[i](r,h);throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");},i={escapeExpression:f.escapeExpression,invokePartial:r,programs:[],program:function(n,t,i){var r=this.programs[n];return i?r=e(n,t,i):r||(r=this.programs[n]=e(n,t)),r},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i={},f.extend(i,t),f.extend(i,n)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(r,u){var f,e,o,s;return u=u||{},f=u.partial?u:t,u.partial||(e=u.helpers,o=u.partials),s=n.call(i,f,r,e,o,u.data),u.partial||t.VM.checkRevision(i.compilerInfo),s}}function l(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r}function e(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r}function a(n,t,i,r,f,e){var o={partial:!0,helpers:r,partials:f,data:e};if(n===undefined)throw new u("The partial "+t+" could not be found");else if(n instanceof Function)return n(i,o)}function v(){return""}var r={},f=n,u=t,s=i.COMPILER_REVISION,o=i.REVISION_CHANGES;return r.checkRevision=h,r.template=c,r.programWithDepth=l,r.program=e,r.invokePartial=a,r.noop=v,r}(t,n,i),e=function(n,t,i,r,u){"use strict";var f=n,c=t,l=i,e=r,o=u,s=function(){var n=new f.HandlebarsEnvironment;return e.extend(n,f),n.SafeString=c,n.Exception=l,n.Utils=e,n.VM=o,n.template=function(t){return o.template(t,n)},n},h=s();return h.create=s,h}(i,r,n,t,f),u=function(n){"use strict";function t(n){n=n||{},this.firstLine=n.first_line,this.firstColumn=n.first_column,this.lastColumn=n.last_column,this.lastLine=n.last_line}var r=n,i={ProgramNode:function(n,r,u,f){var o,e;arguments.length===3?(f=u,u=null):arguments.length===2&&(f=r,r=null),t.call(this,f),this.type="program",this.statements=n,this.strip={},u?(e=u[0],e?(o={first_line:e.firstLine,last_line:e.lastLine,last_column:e.lastColumn,first_column:e.firstColumn},this.inverse=new i.ProgramNode(u,r,o)):this.inverse=new i.ProgramNode(u,r),this.strip.right=r.left):r&&(this.strip.left=r.right)},MustacheNode:function(n,r,u,f,e){if(t.call(this,e),this.type="mustache",this.strip=f,u!=null&&u.charAt){var o=u.charAt(3)||u.charAt(2);this.escaped=o!=="{"&&o!=="&"}else this.escaped=!!u;this.sexpr=n instanceof i.SexprNode?n:new i.SexprNode(n,r),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(n,i,r){t.call(this,r),this.type="sexpr",this.hash=i;var u=this.id=n[0],f=this.params=n.slice(1),e=this.eligibleHelper=u.isSimple;this.isHelper=e&&(f.length||i)},PartialNode:function(n,i,r,u){t.call(this,u),this.type="partial",this.partialName=n,this.context=i,this.strip=r},BlockNode:function(n,i,u,f,e){if(t.call(this,e),n.sexpr.id.original!==f.path.original)throw new r(n.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=n,this.program=i,this.inverse=u,this.strip={left:n.strip.left,right:f.strip.right},(i||u).strip.left=n.strip.right,(u||i).strip.right=f.strip.left,u&&!i&&(this.isInverse=!0)},ContentNode:function(n,i){t.call(this,i),this.type="content",this.string=n},HashNode:function(n,i){t.call(this,i),this.type="hash",this.pairs=n},IdNode:function(n,i){var f,h,u;t.call(this,i),this.type="ID";var o="",e=[],s=0;for(f=0,h=n.length;f<h;f++)if(u=n[f].part,o+=(n[f].separator||"")+u,u===".."||u==="."||u==="this")if(e.length>0)throw new r("Invalid path: "+o,this);else u===".."?s++:this.isScoped=!0;else e.push(u);this.original=o,this.parts=e,this.string=e.join("."),this.depth=s,this.isSimple=n.length===1&&!this.isScoped&&s===0,this.stringModeValue=this.string},PartialNameNode:function(n,i){t.call(this,i),this.type="PARTIAL_NAME",this.name=n.original},DataNode:function(n,i){t.call(this,i),this.type="DATA",this.id=n},StringNode:function(n,i){t.call(this,i),this.type="STRING",this.original=this.string=this.stringModeValue=n},IntegerNode:function(n,i){t.call(this,i),this.type="INTEGER",this.original=this.integer=n,this.stringModeValue=Number(n)},BooleanNode:function(n,i){t.call(this,i),this.type="BOOLEAN",this.bool=n,this.stringModeValue=n==="true"},CommentNode:function(n,i){t.call(this,i),this.type="comment",this.comment=n}};return i}(n),o=function(){"use strict";return function(){function n(n,t){return{left:n.charAt(2)==="~",right:t.charAt(0)==="~"||t.charAt(1)==="~"}}function i(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(t,i,r,u,f,e){var o=e.length-1;switch(f){case 1:return new u.ProgramNode(e[o-1],this._$);case 2:return new u.ProgramNode([],this._$);case 3:this.$=new u.ProgramNode([],e[o-1],e[o],this._$);break;case 4:this.$=new u.ProgramNode(e[o-2],e[o-1],e[o],this._$);break;case 5:this.$=new u.ProgramNode(e[o-1],e[o],[],this._$);break;case 6:this.$=new u.ProgramNode(e[o],this._$);break;case 7:this.$=new u.ProgramNode([],this._$);break;case 8:this.$=new u.ProgramNode([],this._$);break;case 9:this.$=[e[o]];break;case 10:e[o-1].push(e[o]),this.$=e[o-1];break;case 11:this.$=new u.BlockNode(e[o-2],e[o-1].inverse,e[o-1],e[o],this._$);break;case 12:this.$=new u.BlockNode(e[o-2],e[o-1],e[o-1].inverse,e[o],this._$);break;case 13:this.$=e[o];break;case 14:this.$=e[o];break;case 15:this.$=new u.ContentNode(e[o],this._$);break;case 16:this.$=new u.CommentNode(e[o],this._$);break;case 17:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 18:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 19:this.$={path:e[o-1],strip:n(e[o-2],e[o])};break;case 20:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 21:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 22:this.$=new u.PartialNode(e[o-2],e[o-1],n(e[o-3],e[o]),this._$);break;case 23:this.$=n(e[o-1],e[o]);break;case 24:this.$=new u.SexprNode([e[o-2]].concat(e[o-1]),e[o],this._$);break;case 25:this.$=new u.SexprNode([e[o]],null,this._$);break;case 26:this.$=e[o];break;case 27:this.$=new u.StringNode(e[o],this._$);break;case 28:this.$=new u.IntegerNode(e[o],this._$);break;case 29:this.$=new u.BooleanNode(e[o],this._$);break;case 30:this.$=e[o];break;case 31:e[o-1].isHelper=!0,this.$=e[o-1];break;case 32:this.$=new u.HashNode(e[o],this._$);break;case 33:this.$=[e[o-2],e[o]];break;case 34:this.$=new u.PartialNameNode(e[o],this._$);break;case 35:this.$=new u.PartialNameNode(new u.StringNode(e[o],this._$),this._$);break;case 36:this.$=new u.PartialNameNode(new u.IntegerNode(e[o],this._$));break;case 37:this.$=new u.DataNode(e[o],this._$);break;case 38:this.$=new u.IdNode(e[o],this._$);break;case 39:e[o-2].push({part:e[o],separator:e[o-1]}),this.$=e[o-2];break;case 40:this.$=[{part:e[o]}];break;case 43:this.$=[];break;case 44:e[o-1].push(e[o]);break;case 47:this.$=[e[o]];break;case 48:e[o-1].push(e[o])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,typeof n!="number"&&(n=k.symbols_[n]||n),n}var k=this,r=[0],f=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,s,a,e,tt,v,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError),s={};;){if(o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((i===null||typeof i=="undefined")&&(i=it()),u=h[o]&&h[o][i]),(typeof u=="undefined"||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(i==1?"end of input":"'"+(this.terminals_[i]||i)+"'"),this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i),f.push(this.lexer.yytext),t.push(this.lexer.yylloc),r.push(u[1]),i=null,p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(e=this.productions_[u[1]][1],s.$=f[f.length-e],s._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],f,t),typeof w!="undefined")return w;e&&(r=r.slice(0,-2*e),f=f.slice(0,-1*e),t=t.slice(0,-1*e)),r.push(this.productions_[u[1]][0]),f.push(s.$),t.push(s._$),tt=h[r[r.length-2]][r[r.length-1]],r.push(tt);break;case 3:return!0}}return!0}},r=function(){var n={EOF:1,parseError:function(n,t){if(this.yy.parser)this.yy.parser.parseError(n,t);else throw new Error(n);},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length;i++)if(r=this._input.match(this.rules[u[i]]),r&&(!n||r[0].length>n[0].length)&&(n=r,e=i,!this.options.flex))break;return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)?f:void 0:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return typeof n!="undefined"?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i,r){function u(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}var f=r;switch(i){case 0:if(t.yytext.slice(-2)==="\\\\"?(u(0,1),this.begin("mu")):t.yytext.slice(-1)==="\\"?(u(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return u(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState(),this.begin("com");break;case 14:return u(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return t.yytext=u(1,2).replace(/\\"/g,'"'),32;case 24:return t.yytext=u(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return t.yytext=u(1,2),40;case 31:return"INVALID";case 32:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},n}();return t.lexer=r,i.prototype=t,t.Parser=i,new i}()}(),s=function(n,t){"use strict";function f(n){return n.constructor===u.ProgramNode?n:(r.yy=u,r.parse(n))}var i={},r=n,u=t;return i.parser=r,i.parse=f,i}(o,u),h=function(n){"use strict";function r(){}function u(n,t,r){if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{},"data"in t||(t.data=!0);var u=r.parse(n),f=(new r.Compiler).compile(u,t);return(new r.JavaScriptCompiler).compile(f,t)}function f(n,t,r){function f(){var i=r.parse(n),u=(new r.Compiler).compile(i,t),f=(new r.JavaScriptCompiler).compile(u,t,undefined,!0);return r.template(f)}if(n==null||typeof n!="string"&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=t||{},"data"in t||(t.data=!0);var u;return function(n,t){return u||(u=f()),u.call(this,n,t)}}var t={},i=n;return t.Compiler=r,r.prototype={compiler:r,disassemble:function(){for(var e=this.opcodes,n,u=[],f,t,r,i=0,o=e.length;i<o;i++)if(n=e[i],n.opcode==="DECLARE")u.push("DECLARE "+n.name+"="+n.value);else{for(f=[],r=0;r<n.args.length;r++)t=n.args[r],typeof t=="string"&&(t='"'+t.replace("\n","\\n")+'"'),f.push(t);u.push(n.opcode+" "+f.join(" "))}return u.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;t<i;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;t<i;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.opcodes=[],this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.accept(n)},accept:function(n){var t=n.strip||{},i;return t.left&&this.opcode("strip"),i=this[n.type](n),t.right&&this.opcode("strip"),i},program:function(n){for(var r=n.statements,t=0,i=r.length;t<i;t++)this.accept(r[t]);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var t=(new this.compiler).compile(n,this.options),u=this.guid++,r,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;i<f;i++)if(r=t.depths.list[i],r<2)continue;else this.addDepth(r-1);return u},block:function(n){var f=n.mustache,t=n.program,i=n.inverse,r,u;t&&(t=this.compileProgram(t)),i&&(i=this.compileProgram(i)),r=f.sexpr,u=this.classifySexpr(r),u==="helper"?this.helperSexpr(r,t,i):u==="simple"?(this.simpleSexpr(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(n){var u=n.pairs,r,t,i,f;for(this.opcode("pushHash"),i=0,f=u.length;i<f;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0,n.context?this.ID(n.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.name),this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){this.sexpr(n.sexpr),n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(n,t,i){var r=n.id,u=r.parts[0],f=t!=null||i!=null;this.opcode("getContext",r.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.id;t.type==="DATA"?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,r){var f=this.setupFullMustacheParams(n,t,r),u=n.id.parts[0];if(this.options.knownHelpers[u])this.opcode("invokeKnownHelper",f.length,u);else if(this.options.knownHelpersOnly)throw new i("You specified knownHelpersOnly, but used the unknown helper "+u,n);else this.opcode("invokeHelper",f.length,u,n.isRoot)},sexpr:function(n){var t=this.classifySexpr(n);t==="simple"?this.simpleSexpr(n):t==="helper"?this.helperSexpr(n):this.ambiguousSexpr(n)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;t<r;t++)this.opcode("lookup",n.parts[t])},DATA:function(n){var r,t,u;if(this.options.data=!0,n.id.isScoped||n.id.depth)throw new i("Scoped data references are not supported: "+n.original,n);for(this.opcode("lookupData"),r=n.id.parts,t=0,u=r.length;t<u;t++)this.opcode("lookup",r[t])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){n!==0&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifySexpr:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var i=n.length,t;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),t.type==="sexpr"&&this.sexpr(t)):this[t.type](t)},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},t.precompile=u,t.compile=f,t}(n),c=function(n,t){"use strict";function r(n){this.value=n}function i(){}var c=n.COMPILER_REVISION,l=n.REVISION_CHANGES,e=n.log,o=t,f,s,u,h;for(i.prototype={nameLookup:function(n,t){var u,r;return n.indexOf("depth")===0&&(u=!0),r=/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']",u?"("+n+" && "+r+")":r},compilerInfo:function(){var n=c,t=l[n];return"this.compilerInfo = ["+n+",'"+t+"'];\n"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(n,t,i,r){var f,u,s;for(this.environment=n,this.options=t||{},e("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!i,this.context=i||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(n,t),f=n.opcodes,this.i=0,s=f.length;this.i<s;this.i++)u=f[this.i],u.opcode==="DECLARE"?this[u.name]=u.value:this[u.opcode].apply(this,u.args),u.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o("Compile completed with content left on stack");return this.createFunctionContext(r)},preamble:function(){var t=[],i,n;this.isChild?t.push(""):(i=this.namespace,n="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(n=n+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(n=n+" data = data || {};"),t.push(n)),this.environment.isSimple?t.push(""):t.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=t},createFunctionContext:function(n){var o=this.stackVars.concat(this.registers.list),r,t,u,s,i,f;if(o.length>0&&(this.source[1]=this.source[1]+", "+o.join(", ")),!this.isChild)for(r in this.context.aliases)this.context.aliases.hasOwnProperty(r)&&(this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]);for(this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.pushSource("return buffer;"),t=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],u=0,s=this.environment.depths.list.length;u<s;u++)t.push("depth"+this.environment.depths.list[u]);return i=this.mergeSource(),this.isChild||(i=this.compilerInfo()+i),n?(t.push(i),Function.apply(this,t)):(f="function "+(this.name||"")+"("+t.join(",")+") {\n "+i+"}",e("debug",f+"\n\n"),f)},mergeSource:function(){for(var r="",n,t,i=0,u=this.source.length;i<u;i++)t=this.source[i],t.appendToBuffer?n=n?n+"\n + "+t.content:t.content:(n&&(r+="buffer += "+n+";\n ",n=undefined),r+=t+"\n ");return r},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n),this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing",n=["depth0"],this.setupParams(0,n),t=this.topStack(),n.splice(1,0,t),this.pushSource("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.pendingContent&&(n=this.pendingContent+n),this.stripNext&&(n=n.replace(/^\s+/,"")),this.pendingContent=n},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,"")),this.stripNext="strip"},append:function(){this.flushInline();var n=this.popStack();this.pushSource("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext),this.pushString(t),t!=="sexpr"&&(typeof n=="string"?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(){this.pushStackLiteral("{}"),this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop(),this.options.stringParams&&(this.push("{"+n.contexts.join(",")+"}"),this.push("{"+n.types.join(",")+"}")),this.push("{\n "+n.values.join(",\n ")+"\n }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){n!=null?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t,i){this.context.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var r=this.lastHelper=this.setupHelper(n,t,!0),f=this.nameLookup("depth"+this.lastContext,t,"context"),u="helper = "+r.name+" || "+f;r.paramsInit&&(u+=","+r.paramsInit),this.push("("+u+",helper ? helper.call("+r.callParams+") : helperMissing.call("+r.helperMissingParams+"))"),i||this.flushInline()},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"',this.useRegister("helper"),this.emptyHash();var i=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),r=this.nextStack();i.paramsInit&&this.pushSource(i.paramsInit),this.pushSource("if (helper = "+u+") { "+r+" = helper.call("+i.callParams+"); }"),this.pushSource("else { helper = "+f+"; "+r+" = typeof helper === functionType ? helper.call("+i.callParams+") : helper; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data"),this.context.aliases.self="this",this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var u=this.popStack(),i,r,t;this.options.stringParams&&(r=this.popStack(),i=this.popStack()),t=this.hash,i&&t.contexts.push("'"+n+"': "+i),r&&t.types.push("'"+n+"': "+r),t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var f=n.children,r,e,i,u=0,o=f.length;u<o;u++)r=f[u],e=new this.compiler,i=this.matchExistingProgram(r),i==null?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=e.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;t<r;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){var t,e;if(this.context.aliases.self="this",n==null)return"self.noop";var i=this.environment.children[n],r=i.depths.list,u,f=[i.index,i.name,"data"];for(t=0,e=r.length;t<e;t++)u=r[t],u===1?f.push("depth0"):f.push("depth"+(u-1));return(r.length===0?"self.program(":"self.programWithDepth(")+f.join(", ")+")"},register:function(n,t){this.useRegister(n),this.pushSource(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new r(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=undefined),n&&this.source.push(n)},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.pushSource(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var u="",o=this.isInline(),t,f,s,i,h,e;return o?(i=this.popStack(!0),i instanceof r?(t=i.value,s=!0):(f=!this.stackSlot,h=f?this.incrStack():this.topStackName(),u="("+this.push(h)+" = "+i+"),",t=this.topStack())):t=this.topStack(),e=n.call(this,t),o?(s||this.popStack(),f&&this.stackSlot--,this.push("("+u+e+")")):(/^stack/.test(t)||(t=this.nextStack()),this.pushSource(t+" = ("+u+e+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,u,t;if(i.length)for(this.inlineStack=[],n=0,u=i.length;n<u;n++)t=i[n],t instanceof r?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof r)return t.value;if(!i){if(!this.stackSlot)throw new o("Invalid stack pop");this.stackSlot--}return t},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof r?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u=this.setupParams(n,r,i),f=this.nameLookup("helpers",t,"helper");return{params:r,paramsInit:u,name:f,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupOptions:function(n,t){var i=[],e=[],o=[],s,r,u,f;for(i.push("hash:"+this.popStack()),this.options.stringParams&&(i.push("hashTypes:"+this.popStack()),i.push("hashContexts:"+this.popStack())),r=this.popStack(),u=this.popStack(),(u||r)&&(u||(this.context.aliases.self="this",u="self.noop"),r||(this.context.aliases.self="this",r="self.noop"),i.push("inverse:"+r),i.push("fn:"+u)),f=0;f<n;f++)s=this.popStack(),t.push(s),this.options.stringParams&&(o.push(this.popStack()),e.push(this.popStack()));return this.options.stringParams&&(i.push("contexts:["+e.join(",")+"]"),i.push("types:["+o.join(",")+"]")),this.options.data&&i.push("data:data"),i},setupParams:function(n,t,i){var r="{"+this.setupOptions(n,t).join(",")+"}";return i?(this.useRegister("options"),t.push("options"),"options="+r):(t.push(r),"")}},f="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=i.RESERVED_WORDS={},u=0,h=f.length;u<h;u++)s[f[u]]=!0;return i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)?!0:!1},i}(i,n);return function(n,t,i,r,u){"use strict";var f=n,o=t,s=i.parser,h=i.parse,c=r.Compiler,l=r.compile,a=r.precompile,v=u,y=f.create,e=function(){var n=y();return n.compile=function(t,i){return l(t,i,n)},n.precompile=function(t,i){return a(t,i,n)},n.AST=o,n.Compiler=c,n.JavaScriptCompiler=v,n.Parser=s,n.parse=h,n};return f=e(),f.create=e,f}(e,u,s,h,c)}()
|
|
1 |
/*!
|
2 |
+
|
3 |
handlebars v1.3.0
|
4 |
+
|
5 |
Copyright (C) 2011 by Yehuda Katz
|
6 |
+
|
7 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 |
of this software and associated documentation files (the "Software"), to deal
|
9 |
in the Software without restriction, including without limitation the rights
|
10 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11 |
copies of the Software, and to permit persons to whom the Software is
|
12 |
furnished to do so, subject to the following conditions:
|
13 |
+
|
14 |
The above copyright notice and this permission notice shall be included in
|
15 |
all copies or substantial portions of the Software.
|
16 |
+
|
17 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23 |
THE SOFTWARE.
|
24 |
+
|
25 |
@license
|
26 |
*/
|
27 |
+
var Handlebars=function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return h[a]||"&"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=""+a,j.test(a)?a.replace(i,b):a):""}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},i=/[&<>"'`]/g,j=/[&<>"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return"function"==typeof a};l(/x/)&&(l=function(a){return"function"==typeof a&&"[object Function]"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(a){if(2===arguments.length)return void 0;throw new h("Missing helper: '"+a+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse||function(){},e=c.fn;return m(b)&&(b=b.call(this)),b===!0?e(this):b===!1||null==b?d(this):l(b)?b.length>0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g="";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper("if",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i="1.3.0";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o="[object Object]";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h("Arg not supported with multiple helpers");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e),g=function(a){"use strict";function b(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var c,d=a,e={ProgramNode:function(a,c,d,f){var g,h;3===arguments.length?(f=d,d=null):2===arguments.length&&(f=c,c=null),b.call(this,f),this.type="program",this.statements=a,this.strip={},d?(h=d[0],h?(g={first_line:h.firstLine,last_line:h.lastLine,last_column:h.lastColumn,first_column:h.firstColumn},this.inverse=new e.ProgramNode(d,c,g)):this.inverse=new e.ProgramNode(d,c),this.strip.right=c.left):c&&(this.strip.left=c.right)},MustacheNode:function(a,c,d,f,g){if(b.call(this,g),this.type="mustache",this.strip=f,null!=d&&d.charAt){var h=d.charAt(3)||d.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!d;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,c),this.sexpr.isRoot=!0,this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,c,d){b.call(this,d),this.type="sexpr",this.hash=c;var e=this.id=a[0],f=this.params=a.slice(1),g=this.eligibleHelper=e.isSimple;this.isHelper=g&&(f.length||c)},PartialNode:function(a,c,d,e){b.call(this,e),this.type="partial",this.partialName=a,this.context=c,this.strip=d},BlockNode:function(a,c,e,f,g){if(b.call(this,g),a.sexpr.id.original!==f.path.original)throw new d(a.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block",this.mustache=a,this.program=c,this.inverse=e,this.strip={left:a.strip.left,right:f.strip.right},(c||e).strip.left=a.strip.right,(e||c).strip.right=f.strip.left,e&&!c&&(this.isInverse=!0)},ContentNode:function(a,c){b.call(this,c),this.type="content",this.string=a},HashNode:function(a,c){b.call(this,c),this.type="hash",this.pairs=a},IdNode:function(a,c){b.call(this,c),this.type="ID";for(var e="",f=[],g=0,h=0,i=a.length;i>h;h++){var j=a[h].part;if(e+=(a[h].separator||"")+j,".."===j||"."===j||"this"===j){if(f.length>0)throw new d("Invalid path: "+e,this);".."===j?g++:this.isScoped=!0}else f.push(j)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,c){b.call(this,c),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,c){b.call(this,c),this.type="DATA",this.id=a},StringNode:function(a,c){b.call(this,c),this.type="STRING",this.original=this.string=this.stringModeValue=a},IntegerNode:function(a,c){b.call(this,c),this.type="INTEGER",this.original=this.integer=a,this.stringModeValue=Number(a)},BooleanNode:function(a,c){b.call(this,c),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,c){b.call(this,c),this.type="comment",this.comment=a}};return c=e}(c),h=function(){"use strict";var a,b=function(){function a(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(0)||"~"===b.charAt(1)}}function b(){this.yy={}}var c={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(b,c,d,e,f,g){var h=g.length-1;switch(f){case 1:return new e.ProgramNode(g[h-1],this._$);case 2:return new e.ProgramNode([],this._$);case 3:this.$=new e.ProgramNode([],g[h-1],g[h],this._$);break;case 4:this.$=new e.ProgramNode(g[h-2],g[h-1],g[h],this._$);break;case 5:this.$=new e.ProgramNode(g[h-1],g[h],[],this._$);break;case 6:this.$=new e.ProgramNode(g[h],this._$);break;case 7:this.$=new e.ProgramNode([],this._$);break;case 8:this.$=new e.ProgramNode([],this._$);break;case 9:this.$=[g[h]];break;case 10:g[h-1].push(g[h]),this.$=g[h-1];break;case 11:this.$=new e.BlockNode(g[h-2],g[h-1].inverse,g[h-1],g[h],this._$);break;case 12:this.$=new e.BlockNode(g[h-2],g[h-1],g[h-1].inverse,g[h],this._$);break;case 13:this.$=g[h];break;case 14:this.$=g[h];break;case 15:this.$=new e.ContentNode(g[h],this._$);break;case 16:this.$=new e.CommentNode(g[h],this._$);break;case 17:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 18:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 19:this.$={path:g[h-1],strip:a(g[h-2],g[h])};break;case 20:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 21:this.$=new e.MustacheNode(g[h-1],null,g[h-2],a(g[h-2],g[h]),this._$);break;case 22:this.$=new e.PartialNode(g[h-2],g[h-1],a(g[h-3],g[h]),this._$);break;case 23:this.$=a(g[h-1],g[h]);break;case 24:this.$=new e.SexprNode([g[h-2]].concat(g[h-1]),g[h],this._$);break;case 25:this.$=new e.SexprNode([g[h]],null,this._$);break;case 26:this.$=g[h];break;case 27:this.$=new e.StringNode(g[h],this._$);break;case 28:this.$=new e.IntegerNode(g[h],this._$);break;case 29:this.$=new e.BooleanNode(g[h],this._$);break;case 30:this.$=g[h];break;case 31:g[h-1].isHelper=!0,this.$=g[h-1];break;case 32:this.$=new e.HashNode(g[h],this._$);break;case 33:this.$=[g[h-2],g[h]];break;case 34:this.$=new e.PartialNameNode(g[h],this._$);break;case 35:this.$=new e.PartialNameNode(new e.StringNode(g[h],this._$),this._$);break;case 36:this.$=new e.PartialNameNode(new e.IntegerNode(g[h],this._$));break;case 37:this.$=new e.DataNode(g[h],this._$);break;case 38:this.$=new e.IdNode(g[h],this._$);break;case 39:g[h-2].push({part:g[h],separator:g[h-1]}),this.$=g[h-2];break;case 40:this.$=[{part:g[h]}];break;case 43:this.$=[];break;case 44:g[h-1].push(g[h]);break;case 47:this.$=[g[h]];break;case 48:g[h-1].push(g[h])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(a){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:((null===n||"undefined"==typeof n)&&(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},d=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return e(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState(),this.begin("com");break;case 14:return e(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 20:break;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return b.yytext=e(1,2).replace(/\\"/g,'"'),32;case 24:return b.yytext=e(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return b.yytext=e(1,2),40;case 31:return"INVALID";case 32:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},a}();return c.lexer=d,b.prototype=c,c.Parser=b,new b}();return a=b}(),i=function(a,b){"use strict";function c(a){return a.constructor===f.ProgramNode?a:(e.yy=f,e.parse(a))}var d={},e=a,f=b;return d.parser=e,d.parse=c,d}(h,g),j=function(a){"use strict";function b(){}function c(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var d=c.parse(a),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function d(a,b,c){function d(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new f("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0);var e;return function(a,b){return e||(e=d()),e.call(this,a,b)}}var e={},f=a;return e.Compiler=b,b.prototype={compiler:b,disassemble:function(){for(var a,b,c,d=this.opcodes,e=[],f=0,g=d.length;g>f;f++)if(a=d[f],"DECLARE"===a.opcode)e.push("DECLARE "+a.name+"="+a.value);else{b=[];for(var h=0;h<a.args.length;h++)c=a.args[h],"string"==typeof c&&(c='"'+c.replace("\n","\\n")+'"'),b.push(c);e.push(a.opcode+" "+b.join(" "))}return e.join("\n")},equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||d.args.length!==e.args.length)return!1;for(var f=0;f<d.args.length;f++)if(d.args[f]!==e.args[f])return!1}if(b=this.children.length,a.children.length!==b)return!1;for(c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){var b,c=a.strip||{};return c.left&&this.opcode("strip"),b=this[a.type](a),c.right&&this.opcode("strip"),b},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var b,c=(new this.compiler).compile(a,this.options),d=this.guid++;this.usePartial=this.usePartial||c.usePartial,this.children[d]=c;for(var e=0,f=c.depths.list.length;f>e;e++)b=c.depths.list[e],2>b||this.addDepth(b-1);return d},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var b,c,d=a.pairs;this.opcode("pushHash");for(var e=0,f=d.length;f>e;e++)b=d[e],c=b[1],this.options.stringParams?(c.depth&&this.addDepth(c.depth),this.opcode("getContext",c.depth||0),this.opcode("pushStringParam",c.stringModeValue,c.type),"sexpr"===c.type&&this.sexpr(c)):this.accept(c),this.opcode("assignToHash",b[0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.context?this.ID(a.context):this.opcode("push","depth0"),this.opcode("invokePartial",b.name),this.opcode("append")},content:function(a){this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.id.parts[0];if(this.options.knownHelpers[e])this.opcode("invokeKnownHelper",d.length,e);else{if(this.options.knownHelpersOnly)throw new f("You specified knownHelpersOnly, but used the unknown helper "+e,a);this.opcode("invokeHelper",d.length,e,a.isRoot)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts[0]):this.opcode("pushContext");for(var c=1,d=a.parts.length;d>c;c++)this.opcode("lookup",a.parts[c])},DATA:function(a){if(this.options.data=!0,a.id.isScoped||a.id.depth)throw new f("Scoped data references are not supported: "+a.original,a);this.opcode("lookupData");for(var b=a.id.parts,c=0,d=b.length;d>c;c++)this.opcode("lookup",b[c])},STRING:function(a){this.opcode("pushString",a.string)},INTEGER:function(a){this.opcode("pushLiteral",a.integer)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:[].slice.call(arguments,1)})},declare:function(a,b){this.opcodes.push({opcode:"DECLARE",name:a,value:b})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b,c=a.length;c--;)b=a[c],this.options.stringParams?(b.depth&&this.addDepth(b.depth),this.opcode("getContext",b.depth||0),this.opcode("pushStringParam",b.stringModeValue,b.type),"sexpr"===b.type&&this.sexpr(b)):this[b.type](b)},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},e.precompile=c,e.compile=d,e}(c),k=function(a,b){"use strict";function c(a){this.value=a}function d(){}var e,f=a.COMPILER_REVISION,g=a.REVISION_CHANGES,h=a.log,i=b;d.prototype={nameLookup:function(a,b){var c,e;return 0===a.indexOf("depth")&&(c=!0),e=/^[0-9]+$/.test(b)?a+"["+b+"]":d.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']",c?"("+a+" && "+e+")":e},compilerInfo:function(){var a=f,b=g[a];return"this.compilerInfo = ["+a+",'"+b+"'];\n"},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b||{},h("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b);
|
28 |
+
var e,f=a.opcodes;this.i=0;for(var g=f.length;this.i<g;this.i++)e=f[this.i],"DECLARE"===e.opcode?this[e.name]=e.value:this[e.opcode].apply(this,e.args),e.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i("Compile completed with content left on stack");return this.createFunctionContext(d)},preamble:function(){var a=[];if(this.isChild)a.push("");else{var b=this.namespace,c="helpers = this.merge(helpers, "+b+".helpers);";this.environment.usePartial&&(c=c+" partials = this.merge(partials, "+b+".partials);"),this.options.data&&(c+=" data = data || {};"),a.push(c)}this.environment.isSimple?a.push(""):a.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=a},createFunctionContext:function(a){var b=this.stackVars.concat(this.registers.list);if(b.length>0&&(this.source[1]=this.source[1]+", "+b.join(", ")),!this.isChild)for(var c in this.context.aliases)this.context.aliases.hasOwnProperty(c)&&(this.source[1]=this.source[1]+", "+c+"="+this.context.aliases[c]);this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.pushSource("return buffer;");for(var d=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],e=0,f=this.environment.depths.list.length;f>e;e++)d.push("depth"+this.environment.depths.list[e]);var g=this.mergeSource();if(this.isChild||(g=this.compilerInfo()+g),a)return d.push(g),Function.apply(this,d);var i="function "+(this.name||"")+"("+d.join(",")+") {\n "+g+"}";return h("debug",i+"\n\n"),i},mergeSource:function(){for(var a,b="",c=0,d=this.source.length;d>c;c++){var e=this.source[c];e.appendToBuffer?a=a?a+"\n + "+e.content:e.content:(a&&(b+="buffer += "+a+";\n ",a=void 0),b+=e+"\n ")}return b},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a),this.replaceStack(function(b){return a.splice(1,0,b),"blockHelperMissing.call("+a.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a);var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.stripNext&&(a=a.replace(/^\s+/,"")),this.pendingContent=a},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,"")),this.stripNext="strip"},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if("+a+" || "+a+" === 0) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext!==a&&(this.lastContext=a)},lookupOnContext:function(a){this.push(this.nameLookup("depth"+this.lastContext,a,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(a){return"typeof "+a+" === functionType ? "+a+".apply(depth0) : "+a})},lookup:function(a){this.replaceStack(function(b){return b+" == null || "+b+" === false ? "+b+" : "+this.nameLookup(b,a,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(a,b){this.pushStackLiteral("depth"+this.lastContext),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.options.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.context.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var d=this.lastHelper=this.setupHelper(a,b,!0),e=this.nameLookup("depth"+this.lastContext,b,"context"),f="helper = "+d.name+" || "+e;d.paramsInit&&(f+=","+d.paramsInit),this.push("("+f+",helper ? helper.call("+d.callParams+") : helperMissing.call("+d.helperMissingParams+"))"),c||this.flushInline()},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.context.aliases.functionType='"function"',this.useRegister("helper"),this.emptyHash();var c=this.setupHelper(0,a,b),d=this.lastHelper=this.nameLookup("helpers",a,"helper"),e=this.nameLookup("depth"+this.lastContext,a,"context"),f=this.nextStack();c.paramsInit&&this.pushSource(c.paramsInit),this.pushSource("if (helper = "+d+") { "+f+" = helper.call("+c.callParams+"); }"),this.pushSource("else { helper = "+e+"; "+f+" = typeof helper === functionType ? helper.call("+c.callParams+") : helper; }")},invokePartial:function(a){var b=[this.nameLookup("partials",a,"partial"),"'"+a+"'",this.popStack(),"helpers","partials"];this.options.data&&b.push("data"),this.context.aliases.self="this",this.push("self.invokePartial("+b.join(", ")+")")},assignToHash:function(a){var b,c,d=this.popStack();this.options.stringParams&&(c=this.popStack(),b=this.popStack());var e=this.hash;b&&e.contexts.push("'"+a+"': "+b),c&&e.types.push("'"+a+"': "+c),e.values.push("'"+a+"': ("+d+")")},compiler:d,compileChildren:function(a,b){for(var c,d,e=a.children,f=0,g=e.length;g>f;f++){c=e[f],d=new this.compiler;var h=this.matchExistingProgram(c);null==h?(this.context.programs.push(""),h=this.context.programs.length,c.index=h,c.name="program"+h,this.context.programs[h]=d.compile(c,b,this.context),this.context.environments[h]=c):(c.index=h,c.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){if(this.context.aliases.self="this",null==a)return"self.noop";for(var b,c=this.environment.children[a],d=c.depths.list,e=[c.index,c.name,"data"],f=0,g=d.length;g>f;f++)b=d[f],1===b?e.push("depth0"):e.push("depth"+(b-1));return(0===d.length?"self.program(":"self.programWithDepth(")+e.join(", ")+")"},register:function(a,b){this.useRegister(a),this.pushSource(a+" = "+b+";")},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new c(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return a&&this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){var b,d,e,f="",g=this.isInline();if(g){var h=this.popStack(!0);if(h instanceof c)b=h.value,e=!0;else{d=!this.stackSlot;var i=d?this.incrStack():this.topStackName();f="("+this.push(i)+" = "+h+"),",b=this.topStack()}}else b=this.topStack();var j=a.call(this,b);return g?(e||this.popStack(),d&&this.stackSlot--,this.push("("+f+j+")")):(/^stack/.test(b)||(b=this.nextStack()),this.pushSource(b+" = ("+f+j+");")),b},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,d=a.length;d>b;b++){var e=a[b];e instanceof c?this.compileStack.push(e):this.pushStack(e)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),d=(b?this.inlineStack:this.compileStack).pop();if(!a&&d instanceof c)return d.value;if(!b){if(!this.stackSlot)throw new i("Invalid stack pop");this.stackSlot--}return d},topStack:function(a){var b=this.isInline()?this.inlineStack:this.compileStack,d=b[b.length-1];return!a&&d instanceof c?d.value:d},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(a,b,c){var d=[],e=this.setupParams(a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:["depth0"].concat(d).join(", "),helperMissingParams:c&&["depth0",this.quotedString(b)].concat(d).join(", ")}},setupOptions:function(a,b){var c,d,e,f=[],g=[],h=[];f.push("hash:"+this.popStack()),this.options.stringParams&&(f.push("hashTypes:"+this.popStack()),f.push("hashContexts:"+this.popStack())),d=this.popStack(),e=this.popStack(),(e||d)&&(e||(this.context.aliases.self="this",e="self.noop"),d||(this.context.aliases.self="this",d="self.noop"),f.push("inverse:"+d),f.push("fn:"+e));for(var i=0;a>i;i++)c=this.popStack(),b.push(c),this.options.stringParams&&(h.push(this.popStack()),g.push(this.popStack()));return this.options.stringParams&&(f.push("contexts:["+g.join(",")+"]"),f.push("types:["+h.join(",")+"]")),this.options.data&&f.push("data:data"),f},setupParams:function(a,b,c){var d="{"+this.setupOptions(a,b).join(",")+"}";return c?(this.useRegister("options"),b.push("options"),"options="+d):(b.push(d),"")}};for(var j="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),k=d.RESERVED_WORDS={},l=0,m=j.length;m>l;l++)k[j[l]]=!0;return d.isValidJavaScriptVariableName=function(a){return!d.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)?!0:!1},e=d}(d,c),l=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,f=g}(f,g,i,j,k);return l}();
|
admin/views/slider-panel/js/masterslider.wp.init.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function($){window.$||(window.$=jQuery.noConflict());var errorMsgs=[],timeoutDelay=5e3,oldErrorHandler=window.onerror;window.onerror=function(message,url,line){return oldErrorHandler?oldErrorHandler(message,url,line):void errorMsgs.push({message:message,url:'<a href="'+url+'" target="_blank">'+url+"</a>",line:line})},$(document).ready(function(){var support_txt="please contact your theme author.",troubleshooting_txt="Usually it caused by a plugin conflict please disable all other plugins and refresh this page. If the problem remains change your theme to another one and check it again.<br>If you still receive this message ";__MS.is_actived&&(support_txt='you can start a thread in <a href="http://support.averta.net/envato/support/" target="_blank">Averta support forum</a>, we will check it as soon as possible.'),window._msp_init_timeout=setTimeout(function(){var content,cont=$("#panelLoading");if(cont.html(""),0===errorMsgs.length)content="<p> It seems an error occurred while initializing slider, please check the browser console for any probable error messages. </p> <hr> <h3>Troubleshooting</h3> <p>"+troubleshooting_txt+support_txt+"</p>";else{content="<p> It seems an error occurred while initializing slider, error message(s): </p> <ul>";for(var i=0,l=errorMsgs.length;i!==l;i++)content+='<li> <p><strong style="color:red;">'+errorMsgs[i].message+"</strong><br><strong>File:</strong> "+errorMsgs[i].url+" <br><strong>line:</strong> "+errorMsgs[i].line+"</p></li>";content+="<ul><hr> <h3>Troubleshooting</h3> <p>"+troubleshooting_txt+support_txt+"</p>"}cont.html(content)},timeoutDelay)})}(jQuery);
|
admin/views/slider-panel/js/masterslider.wp.js
CHANGED
@@ -1,7 +1,10 @@
|
|
1 |
-
/*!
|
2 |
-
*
|
3 |
-
*
|
4 |
-
*
|
5 |
-
*
|
|
|
|
|
6 |
*/
|
7 |
-
function WPEditorTemplate(n){var t=$(hiddenEditor);return t.find("link").remove(),t.html().replace(/msp-hidden/g,n)}var hiddenEditor,__tmc_msp_id;window.MSPanel=Ember.Application.create({rootElement:"#msp-root"}),MSPanel.version="1.0",MSPanel.SliderID=parseQueryString(window.location.search).slider_id||__MSP_SLIDER_ID||"100",String.prototype.jfmt=function(){return"".fmt.apply(this.replace(/%s|%d/,"%@"),arguments)},$=jQuery.noConflict(),jQuery.ui.dialog.prototype._focusTabbable=function(){},MSPanel.Router.map(function(){this.resource("settings"),this.resource("slides",{path:"/"}),this.resource("controls"),this.resource("callbacks"),this.resource("error")}),MSPanel.Router.reopen({location:"none"}),MSPanel.ApplicationRoute=Ember.Route.extend({model:function(){var n=MSPanel.Settings.find();n.get("length")===0&&MSPanel.Settings.create().save()}}),MSPanel.SettingsRoute=Ember.Route.extend({model:function(){return MSPanel.Settings.find(1)},setupController:function(n,t){n.set("model",t),n.setup()}}),MSPanel.SlidesRoute=Ember.Route.extend({model:function(){return MSPanel.Slide.find()},setupController:function(n,t){n.set("model",t),n.set("sliderSettings",MSPanel.Settings.find(1)),n.setup()}}),MSPanel.ControlsRoute=Ember.Route.extend({model:function(){return MSPanel.Control.find()},setupController:function(n,t){n.set("model",t),n.setup(),this.activate()},activate:function(){var n=this.get("controller");n&&n.set("controlOptions","empty-template")}}),MSPanel.CallbacksRoute=Ember.Route.extend({model:function(){return MSPanel.Callback.find()},setupController:function(n,t){n.set("model",t),n.setup()}}),function(){var n=Ember.attr,f=Ember.hasMany,r=Ember.belongsTo,u=/https\:|http\:/,t={serialize:function(n){return n==undefined?n:u.test(n)?n.replace(__MS.upload_dir,""):n},deserialize:function(n){return n==undefined?n:u.test(n)?n:__MS.upload_dir+n}},i;MSPanel.Settings=Ember.Model.extend({id:n("number"),snapping:n("boolean",{defaultValue:!0}),bgImageThumb:n(t),disableControls:n("boolean",{defaultValue:!1}),name:n("string",{defaultValue:__MSP_LAN.sm_001}),width:n("number",{defaultValue:1e3}),height:n("number",{defaultValue:500}),wrapperWidth:n("number"),wrapperWidthUnit:n("string",{defaultValue:"px"}),autoCrop:n("boolean",{defaultValue:!1}),type:n("string"),sliderId:n("string"),layout:n("string",{defaultValue:"boxed"}),autoHeight:n("boolean",{defaultValue:!1}),trView:n("string",{defaultValue:"basic"}),speed:n("number",{defaultValue:20}),space:n("number",{defaultValue:0}),start:n("number",{defaultValue:1}),grabCursor:n("boolean",{defaultValue:!0}),swipe:n("boolean",{defaultValue:!0}),mouse:n("boolean",{defaultValue:!0}),wheel:n("boolean",{defaultValue:!1}),autoplay:n("boolean",{defaultValue:!1}),loop:n("boolean",{defaultValue:!1}),shuffle:n("boolean",{defaultValue:!1}),preload:n("string",{defaultValue:"-1"}),overPause:n("boolean",{defaultValue:!0}),endPause:n("boolean",{defaultValue:!1}),hideLayers:n("boolean",{defaultValue:!1}),dir:n("string",{defaultValue:"h"}),parallaxMode:n("srting",{defaultValue:"swipe"}),centerControls:n("boolean",{defaultValue:!0}),instantShowLayers:n("boolean",{defaultValue:!1}),fullscreenMargin:n("number"),inlineStyle:n("string"),className:n("string"),bgColor:n("string"),bgImage:n(t),skin:n("string",{defaultValue:"ms-skin-default"}),msTemplate:n("string",{defaultValue:"custom"}),msTemplateClass:n("string",{defaultValue:""}),usedFonts:n("string"),apiKey:n("string"),setId:n("string"),setType:n("string"),imgCount:n("number"),thumbSize:n("srting"),imgSize:n("string"),postType:n("string"),postCats:n(Array),postTags:n(Array),postCount:n("number"),postImageType:n("string"),postOrder:n("string"),postOrderDir:n("string"),postExcerptLen:n("number"),postExcludeIds:n("string"),postOffset:n("number"),postLinkSlide:n("boolean"),postLinkTarget:n("string"),postSlideBg:n("string"),postSlideBgthumb:n("string"),wcOnlyInstock:n("boolean"),wcOnlyFeatured:n("boolean"),wcOnlyOnsale:n("boolean")}),MSPanel.Slide=Ember.Model.extend({id:n("number"),timeline_h:n("number",{defaultValue:200}),bgThumb:n(t),thumbOrginal:n(t),order:n("number"),ishide:n("boolean"),bg:n(t),duration:n("number",{defaultValue:3}),fillMode:n("string",{defaultValue:"fill"}),thumb:n(t),info:n("string"),link:n("string"),linkTarget:n("string"),video:n("string"),autoplayVideo:n("boolean"),bgColor:n("string"),bgv_mp4:n("string"),bgv_ogg:n("string"),bgv_webm:n("string"),bgv_fillmode:n("string",{defaultValue:"fill"}),bgv_loop:n("boolean",{defaultValue:!0}),bgv_mute:n("boolean",{defaultValue:!0}),bgv_autopause:n("boolean",{defaultValue:!1}),cssId:n("string"),cssClass:n("string"),bgAlt:n("string"),layers:f("MSPanel.Layer",{key:"layer_ids"})}),MSPanel.Layer=Ember.Model.extend({id:n("number"),name:n("string"),isLocked:n("boolean",{defaultValue:!1}),isHided:n("boolean",{defaultValue:!1}),isSoloed:n("boolean",{defaultValue:!1}),slide:r("MSPanel.Slide",{key:"slide"}),styleModel:r("MSPanel.Style",{key:"styleModel",embedded:!1}),showEffect:r("MSPanel.Effect",{key:"showEffect",embedded:!1}),showTransform:n("string",{defaultValue:""}),showOrigin:n("string",{defaultValue:""}),showFade:n("boolean",{defaultValue:!0}),hideEffect:r("MSPanel.Effect",{key:"hideEffect",embedded:!1}),hideTransform:n("string",{defaultValue:""}),hideOrigin:n("string",{defaultValue:""}),hideFade:n("boolean",{defaultValue:!0}),imgThumb:n(t),stageOffsetX:n("number",{defaultValue:0}),stageOffsetY:n("number",{defaultValue:0}),order:n("number"),type:n("string"),cssClass:n("string"),cssId:n("string"),title:n("string"),rel:n("string"),content:n("string",{defaultValue:"Lorem Ipsum"}),img:n(t),imgAlt:n("string"),video:n("string",{defaultValue:"http://player.vimeo.com/video/11721242"}),align:n("string",{defaultValue:"top"}),useAction:n("boolean",{defaultValue:!1}),action:n("string"),toSlide:n("number"),link:n("string"),linkTarget:n("string"),offsetX:n("number",{defaultValue:0}),offsetY:n("number",{defaultValue:0}),width:n("number"),height:n("number"),resize:n("boolean",{defaultValue:!0}),fixed:n("boolean",{defaultValue:!1}),widthlimit:n("number",{defaultValue:"0"}),origin:n("string",{defaultValue:"tl"}),stayHover:n("boolean",{defaultValue:!0}),className:n("string"),parallax:n("string"),showDuration:n("number",{defaultValue:1}),showDelay:n("number",{defaultValue:0}),showEase:n("string",{defaultValue:"easeOutQuint"}),showEffFunc:n("string"),useHide:n("boolean",{defaultValue:!1}),hideDuration:n("number",{defaultValue:1}),hideDelay:n("number",{defaultValue:1}),hideEase:n("string",{defaultValue:"easeOutQuint"}),hideEffFunc:n("string"),btnClass:n("string",{defaultValue:"ms-default-btn"})}),MSPanel.Style=Ember.Model.extend({id:n("number"),name:n("string"),type:n("string"),className:n("string"),backgroundColor:n("string"),paddingTop:n("number"),paddingRight:n("number"),paddingBottom:n("number"),paddingLeft:n("number"),borderTop:n("number"),borderRight:n("number"),borderBottom:n("number"),borderLeft:n("number"),borderColor:n("string"),borderRadius:n("number"),borderStyle:n("string"),fontFamily:n("string"),fontWeight:n("string",{defaultValue:"normal"}),fontSize:n("number"),textAlign:n("string"),letterSpacing:n("number"),lineHeight:n("string",{defaultValue:"normal"}),whiteSpace:n("string"),color:n("string"),custom:n("string")}),MSPanel.PresetStyle=MSPanel.Style.extend({}),MSPanel.Effect=Ember.Model.extend({id:n("number"),name:n("string"),type:n("string"),fade:n("boolean",{defaultValue:!0}),translateX:n("number"),translateY:n("number"),translateZ:n("number"),scaleX:n("number"),scaleY:n("number"),rotate:n("number"),rotateX:n("number"),rotateY:n("number"),rotateZ:n("number"),skewX:n("number"),skewY:n("number"),originX:n("number"),originY:n("number"),originZ:n("number")}),MSPanel.PresetEffect=MSPanel.Effect.extend({}),MSPanel.Control=Ember.Model.extend({id:n("number"),label:n("string"),name:n("string"),autoHide:n("boolean",{defaultValue:!0}),overVideo:n("boolean",{defaultValue:!0}),cssClass:n("string"),cssId:n("string"),margin:n("number"),dir:n("string"),color:n("string"),radius:n("number"),stroke:n("number"),speed:n("number"),space:n("number"),type:n("string"),width:n("number"),height:n("number"),align:n("string"),inset:n("boolean"),size:n("number"),hideUnder:n("number"),fillMode:n("string")}),MSPanel.Callback=Ember.Model.extend({id:n("number"),label:n("string"),name:n("string"),content:n("string",{defaultValue:"function(event){\n var api = event.target;\n}"})}),MSPanel.ButtonStyle=Ember.Model.extend({id:n("number"),className:n("string"),normal:n("string"),hover:n("string"),active:n("string")}),i=function(n){var t=B64.decode(n);return t.slice(0,t.lastIndexOf("}")+1)},window.__MSP_PRESET_BUTTON=null,MSPanel.data=__MSP_DATA?JSON.parse(i(__MSP_DATA)):{meta:{}},MSPanel.PSData=__MSP_PRESET_STYLE?JSON.parse(i(__MSP_PRESET_STYLE)):{meta:{}},MSPanel.PEData=__MSP_PRESET_EFFECT?JSON.parse(i(__MSP_PRESET_EFFECT)):{meta:{}},MSPanel.PBData=__MSP_PRESET_BUTTON?JSON.parse(i(__MSP_PRESET_BUTTON)):{meta:{}},MSPanel.Settings.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Slide.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Layer.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Style.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Effect.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Control.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Callback.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.PresetStyle.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.PSData}),MSPanel.PresetEffect.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.PEData}),MSPanel.ButtonStyle.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.PBData})}(),MSPanel.SliderTemplates=[{name:"Custom Template",value:"custom",className:"",img:__MSP_PATH+"images/templates/custom.gif",controls:null},{name:"3D Flow Carousel",value:"3d-flow-carousel",className:"ms-caro3d-template",img:__MSP_PATH+"images/templates/3d-flow-carousel.png",settings:{space:0,loop:!0,trView:"flow",layout:"partialview",dir:"h",wheel:!1},controls:null},{name:"3D Wave Carousel",value:"3d-wave-carousel",className:"ms-caro3d-template",img:__MSP_PATH+"images/templates/3d-wave-carousel.png",settings:{space:0,loop:!0,trView:"flow",layout:"partialview",dir:"h",wheel:!1},controls:null},{name:"Image Gallery with Thumbs",value:"image-gallery",className:"ms-gallery-template",img:__MSP_PATH+"images/templates/image-gallery.png",settings:{space:0,trView:"basic",skin:"ms-skin-black-2 round-skin"},controls:null,disableControls:!0},{name:"Slider with Bottom Aligned Thumbs",value:"slider-horizontal-thumbs",className:"ms-thumbs-template",img:__MSP_PATH+"images/templates/slider-bottom-thumbs.png",settings:{trView:"scale",space:0},controls:{arrows:{},scrollbar:{dir:"h"},thumblist:{autohide:!1,dir:"h",arrows:!1,align:"bottom",width:127,height:137,margin:5,space:5}}},{name:"Slider with Top Aligned Thumbs",value:"slider-top-thumbs",className:"ms-thumbs-template",img:__MSP_PATH+"images/templates/slider-top-thumbs.png",settings:{trView:"scale",space:0},controls:{arrows:{},scrollbar:{dir:"h"},thumblist:{autohide:!1,dir:"h",arrows:!1,align:"top",width:127,height:137,margin:5,space:5}}},{name:"Slider with Right Aligned Thumbs",value:"slider-vertical-thumbs",className:"ms-thumbs-template",img:__MSP_PATH+"images/templates/slider-right-thumbs.png",settings:null,controls:{arrows:{},scrollbar:{dir:"v"},thumblist:{autohide:!1,dir:"v",arrows:!1,align:"right",width:127,height:137,margin:5,space:5}}},{name:"Slider with Left Aligned Thumbs",value:"slider-left-thumbs",className:"ms-thumbs-template",img:__MSP_PATH+"images/templates/slider-left-thumbs.png",settings:null,controls:{arrows:{},scrollbar:{dir:"v"},thumblist:{autohide:!1,dir:"v",arrows:!1,align:"left",width:127,height:137,margin:5,space:5}}},{name:"Slider with Horizontal Tabs",value:"slider-horizontal-tabs",className:"ms-tabs-template",img:__MSP_PATH+"images/templates/slider-horizontal-tabs.png",settings:null,controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},thumblist:{autohide:!1,dir:"h",type:"tabs",width:240,height:120,align:"bottom",space:0,margin:-12,hideUnder:400}}},{name:"Slider with Vertical Tabs",value:"slider-vertical-tabs",className:"ms-tabs-template",img:__MSP_PATH+"images/templates/slider-vertical-tabs.png",settings:null,controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},thumblist:{autohide:!1,dir:"v",type:"tabs",align:"right",margin:-12,space:0,width:229,height:100,hideUnder:550}}},{name:"Partial View Slider V1",value:"partial-1",className:"ms-partialview-template",img:__MSP_PATH+"images/templates/partial-1.png",settings:{space:10,loop:!0,trView:"partialWave",layout:"partialview",dir:"h"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Partial View Slider V2",value:"partial-2",className:"ms-partialview-template",img:__MSP_PATH+"images/templates/partial-2.png",settings:{space:10,loop:!0,trView:"fadeWave",layout:"partialview",dir:"h"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Partial View Slider V3",value:"partial-3",className:"ms-partialview-template",img:__MSP_PATH+"images/templates/partial-3.png",settings:{space:10,loop:!0,trView:"fadeFlow",layout:"partialview",dir:"h"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Slider in Display",value:"display",className:"ms-display-template",img:__MSP_PATH+"images/templates/display.png",settings:{width:507,height:286,speed:20,space:2,trView:"flow",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Flat Display",value:"flat-display",className:"ms-display-template",img:__MSP_PATH+"images/templates/flat-display.png",settings:{width:507,height:286,speed:20,space:2,trView:"flow",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Laptop",value:"laptop",className:"ms-laptop-template",img:__MSP_PATH+"images/templates/laptop.png",settings:{width:492,height:309,speed:20,space:2,trView:"mask",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Flat Laptop",value:"flat-laptop",className:"ms-laptop-template",img:__MSP_PATH+"images/templates/flat-laptop.png",settings:{width:492,height:309,speed:20,space:2,trView:"mask",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Tablet",value:"tablet",className:"ms-tablet-template",img:__MSP_PATH+"images/templates/tablet.png",settings:{width:400,height:534,speed:20,space:2,trView:"wave",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Flat Tablet",value:"flat-tablet",className:"ms-tablet-template",img:__MSP_PATH+"images/templates/flat-tablet.png",settings:{width:400,height:534,speed:20,space:2,trView:"basic",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Landscape Tablet",value:"tablet-land",className:"ms-tablet-template ms-tablet-land",img:__MSP_PATH+"images/templates/tablet-land.png",settings:{width:632,height:476,speed:20,space:2,trView:"mask",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Flat Landscape Tablet",value:"flat-tablet-land",className:"ms-tablet-template ms-tablet-land",img:__MSP_PATH+"images/templates/flat-tablet-land.png",settings:{width:632,height:476,speed:20,space:2,trView:"mask",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Smart Phone",value:"phone",className:"ms-phone-template",img:__MSP_PATH+"images/templates/phone.png",settings:{width:258,height:456,speed:20,space:2,trView:"wave",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Flat Smart Phone",value:"flat-phone",className:"ms-phone-template",img:__MSP_PATH+"images/templates/flat-phone.png",settings:{width:258,height:456,speed:20,space:2,trView:"basic",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Landscape Smart Phone",value:"phone-land",className:"ms-phone-template ms-phone-land",img:__MSP_PATH+"images/templates/phone-land.png",settings:{width:456,height:258,speed:20,space:2,trView:"mask",dir:"h",layout:"boxed"},controls:{arrows:{},circletimer:{color:"#FFFFFF",stroke:9},bullets:{autohide:!1}},disableControls:!0},{name:"Slider in Flat Landscape Smart Phone",value:"flat-phone-land",className:"ms-phone-template ms-phone-land",img:__MSP_PATH+"images/templates/flat-phone-land.png",settings:{width:456,height:258,speed:20,space:2,trView:"mask",dir:"h",layout:"boxed"},controls:{arrows:{},bullets:{autohide:!1}},disableControls:!0},{name:"Vertical Slider",value:"vertical-slider",className:"ms-vertical-template",img:__MSP_PATH+"images/templates/vertical-slider.png",settings:{space:5,dir:"v"},controls:{arrows:{},scrollbar:{dir:"v"},circletimer:{color:"#FFFFFF",stroke:9},thumblist:{autohide:!1,dir:"v",space:5,margin:5,align:"right"}}},{name:"Staff Carousel V1",value:"staff-1",className:"ms-staff-carousel",img:__MSP_PATH+"images/templates/staff-1.png",settings:{loop:!0,width:240,height:240,speed:20,trView:"focus",layout:"partialview",space:0,wheel:!0,dir:"h"},controls:{arrows:{},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Staff Carousel V2",value:"staff-2",className:"ms-staff-carousel",img:__MSP_PATH+"images/templates/staff-2.png",settings:{loop:!0,width:240,height:240,speed:20,trView:"fadeBasic",layout:"partialview",space:0,dir:"h"},controls:{arrows:{},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Staff Carousel V3",value:"staff-3",className:"ms-staff-carousel ms-round",img:__MSP_PATH+"images/templates/staff-3.png",settings:{loop:!0,width:240,height:240,speed:20,trView:"focus",layout:"partialview",space:0,space:35,dir:"h"},controls:{arrows:{},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Staff Carousel V4",value:"staff-4",className:"ms-staff-carousel ms-round",img:__MSP_PATH+"images/templates/staff-4.png",settings:{loop:!0,width:240,height:240,speed:20,trView:"fadeBasic",layout:"partialview",space:0,space:45,dir:"h"},controls:{arrows:{},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Staff Carousel V5",value:"staff-5",className:"ms-staff-carousel",img:__MSP_PATH+"images/templates/staff-5.png",settings:{loop:!0,width:240,height:240,speed:20,trView:"wave",layout:"partialview",space:0,wheel:!0,dir:"h"},controls:{arrows:{},slideinfo:{autohide:!1,align:"bottom",size:160}}},{name:"Staff Carousel V6",value:"staff-6",className:"ms-staff-carousel",img:__MSP_PATH+"images/templates/staff-6.png",settings:{loop:!0,width:240,height:240,speed:20,trView:"flow",layout:"partialview",space:0,wheel:!0,dir:"h"},controls:{arrows:{},slideinfo:{autohide:!1,align:"bottom",size:160}}},],MSPanel.SlideFrame=Ember.View.extend({classNames:["msp-slideframe"],classNameBindings:["selected:active"],selected:!1,thumb_src:"",showbtnclass:"msp-ico msp-ico-whitehide",template:Ember.Handlebars.compile('<div class="msp-img-cont">{{#if view.hasImg}}<div class="msp-imgselect-preview" {{bind-attr style=view.preview}})"><\/div>{{/if}}<\/div><span class="msp-frame-slideorder">#{{view.order}}<\/span><div class="msp-framehandle"><ul><li><a title="'+__MSP_LAN.ui_001+'" href="#" {{action "hideswitch" target=view}}><span {{bind-attr class=view.showbtnclass}}><\/span><\/a><\/li><li><a title="'+__MSP_LAN.ui_002+'" href="#" {{action "duplicate" target=view}}><span class="msp-ico msp-ico-whiteduplicate"><\/span><\/a><\/li><li><a title="'+__MSP_LAN.ui_003+'" href="#" {{action "remove" target=view}}><span class="msp-ico msp-ico-whiteremove"><\/span><\/a><\/li><\/ul><\/div>'),click:function(){this.get("controller").send("select",this.get("slide"))},onValueChanged:function(){var n=!Ember.isEmpty(this.get("slide.bg"));this.beginPropertyChanges(),this.set("hasImg",n),n&&this.set("preview","background-image:url("+this.get("slide.bgThumb")+");"),this.endPropertyChanges()}.observes("slide.bg").on("didInsertElement"),onSelect:function(){var n=this.get("slide");this.set("selected",n===this.get("controller.currentSlide"))}.observes("controller.currentSlide").on("init"),hideChange:function(){this.get("slide.ishide")?this.set("showbtnclass","msp-ico msp-ico-whitehide msp-ico-whiteshow"):this.set("showbtnclass","msp-ico msp-ico-whitehide")}.observes("slide.ishide").on("init"),order:function(){return this.get("slide.order")+1}.property("slide.order"),actions:{duplicate:function(){this.get("controller").duplicateSlide(this.get("slide"))},hideswitch:function(){this.set("slide.ishide",!this.get("slide.ishide"))},remove:function(){confirm(__MSP_LAN.ui_004)&&this.get("controller").removeSlide(this.get("slide"))}}}),MSPanel.SlideList=Ember.View.extend({tagName:"ul",classNames:["msp-slides"],template:Ember.Handlebars.compile('{{#each item in controller}}<li class="msp-slideframe-item" {{bind-attr data-id=item.id}}>{{view MSPanel.SlideFrame slide=item}}<\/li>{{/each}}<li class="msp-addslide-cont"><div class="msp-addslide" {{action "newSlide"}}><span class="msp-ico msp-ico-grayaddlarge"><\/span><span class="msp-addslide-label">Add Slide<\/span><\/div><\/li>'),didInsertElement:function(){var n=this;this.$().sortable({placeholder:"msp-frames-srtplaceholder",items:">li:not(.msp-addslide-cont)",delay:100,update:function(){n.updateSort()},create:function(){n.updateSort()}})},updateSort:function(){var n={};$(".msp-slideframe-item").each(function(t){n[$(this).data("id")]=t}),this.$().sortable("cancel"),this.get("controller").updateSlidesSort(n)}}),MSPanel.ImgSelect=Ember.View.extend({classNames:["msp-imgselect"],value:"",hasImg:!1,frame:null,template:Ember.Handlebars.compile('<div class="msp-img-cont">{{#if view.hasImg}}<div class="msp-imgselect-preview" {{bind-attr style=view.preview}})"><\/div>{{/if}}<\/div>{{#if view.hasImg}}<button {{action removeImg target="view"}} class="msp-img-btn"><span class="msp-ico msp-ico-grayremove"><\/span><\/button>{{else}}<button {{action addImg target="view"}} class="msp-img-btn"><span class="msp-ico msp-ico-grayadd"><\/span><\/button>{{/if}}'),willDestroyElement:function(){var n=this.get("frame");n&&(n.detach(),n.remove(),n=null,this.set("frame",null))},onValueChanged:function(){this.beginPropertyChanges(),this.set("hasImg",!Ember.isEmpty(this.get("value"))),this.set("preview","background-image:url("+this.get("thumb")+");"),this.endPropertyChanges()}.observes("value").on("didInsertElement"),actions:{removeImg:function(){this.beginPropertyChanges(),this.set("value",undefined),this.set("thumb",undefined),this.endPropertyChanges()},addImg:function(){var t,n;if(typeof wp!="undefined"){if(t=this,n=this.get("frame"),n){n.open();return}n=wp.media.frames.frame=wp.media({title:"Select Image",multiple:!1,frame:"select",library:{type:"image"},button:{text:"Add Image"}});n.on("select",function(){var i=n.state().get("selection").first().toJSON();t.set("thumb",(i.sizes.thumbnail||i.sizes.full).url),t.set("value",i.url)});n.open(),this.set("frame",n)}}}}),MSPanel.Select=Ember.Select.extend({tagName:"div",classNames:["msp-ddlist"],layout:Ember.Handlebars.compile("<select>{{yield}}<\/select>"),value:null,width:100,didInsertElement:function(){var n=this;this.$("select").on("change",function(){var t=n.$("select option:selected");n.set("value",t.attr("value"))}).width(this.get("width")),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$("select").val(this.get("value"))}.observes("value")}),MSPanel.URLTarget=MSPanel.Select.extend({onInit:function(){var n=[{lable:__MSP_LAN.ui_005,value:"_self"},{lable:__MSP_LAN.ui_006,value:"_blank"},{lable:__MSP_LAN.ui_007,value:"_parent"},{lable:__MSP_LAN.ui_008,value:"_top"}];this.set("content",n),this.set("optionValuePath","content.value"),this.set("optionLabelPath","content.lable"),this.set("width",200)}.on("init")}),MSPanel.Fillmode=Ember.View.extend({classNames:["msp-fill-dd"],type:"slide",value:"fill",index:1,template:Ember.Handlebars.compile("<select>{{#each item in view.contents}}<option {{bind-attr value=item.value data-imagesrc=item.img}}>{{item.text}}<\/option>{{/each}}<\/select>"),didInsertElement:function(){var t=this,n=!0;this.$("select").ddslick({width:154,onSelected:function(i){n||t.set("value",i.selectedData.value),n=!1}}),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$(".dd-container").ddslick("select",{index:this.get("valuedic")[this.get("value")]})}.observes("value"),onInit:function(){var n,t;this.get("type")==="slide"?(n=[{value:"fill",text:__MSP_LAN.ui_009,img:__MSP_PATH+"images/fill.png"},{value:"fit",text:__MSP_LAN.ui_010,img:__MSP_PATH+"images/fit.png"},{value:"center",text:__MSP_LAN.ui_011,img:__MSP_PATH+"images/center.png"},{value:"stretch",text:__MSP_LAN.ui_012,img:__MSP_PATH+"images/stretch.png"},{value:"tile",text:__MSP_LAN.ui_013,img:__MSP_PATH+"images/tile.png"}],t={fill:0,fit:1,center:2,stretch:3,tile:4}):this.get("type")==="video"&&(n=[{value:"fill",text:__MSP_LAN.ui_009,img:__MSP_PATH+"images/fill.png"},{value:"fit",text:__MSP_LAN.ui_010,img:__MSP_PATH+"images/fit.png"}],t={fill:0,fit:1,none:2}),this.set("contents",n),this.set("valuedic",t)}.on("init")}),MSPanel.SimpleCodeBlock=Ember.View.extend({classNames:["msp-shortcode-box"],template:Ember.Handlebars.compile('<input type="text" readonly {{bind-attr value=view.value}}>'),width:150,didInsertElement:function(){this.$("input").on("click",function(){$(this).select()}).width(this.get("width"))}}),MSPanel.SettingsView=Ember.View.extend({didInsertElement:function(){this.set("controller.mainView",this)}}),MSPanel.SlidesView=Ember.View.extend({didInsertElement:function(){this.set("controller.mainView",this)}}),MSPanel.StageArea=Ember.View.extend({classNames:["msp-stage-area"],template:Ember.Handlebars.compile('{{view MSPanel.Stage}}{{#if noticeMsg}}<div class="msp-stage-msg"><span class="msp-ico msp-ico-notice"><\/span>{{{noticeMsg}}}<\/div>{{/if}}')}),MSPanel.Stage=Ember.View.extend({classNames:["msp-slide-stage"],attributeBindings:["style"],template:Ember.Handlebars.compile('<div id="stage-bg" class="msp-stage-bg"><\/div>'),resize:function(){var n=this.get("controller.sliderSettings.width"),t=this.get("controller.sliderSettings.height");this.set("width",n),this.set("height",t),this.$().css({width:n,height:t})}.observes("controller.sliderSettings.width","controller.sliderSettings.height").on("didInsertElement"),didInsertElement:function(){var i=this.$("#stage-bg"),n=$("<img/>"),t;n.css("visibelity","hidden").each($.jqLoadFix),t=new MSAligner(this.get("controller.currentSlide.fillMode"),i,n),this.set("bgAligner",t),this.set("bgImg",n),this.onBGChange()},onBGColorChange:function(){var n=this.get("controller.currentSlide.bgColor");Ember.isEmpty(n)?this.$("#stage-bg").css("background-color",""):this.$("#stage-bg").css("background-color",n)}.observes("controller.currentSlide.bgColor"),onBGChange:function(){var i=this.get("bgAligner"),t,n,r;i&&i.reset(),t=this.get("controller.currentSlide.bg"),n=this.get("bgImg"),Ember.isEmpty(t)?n.detach():(r=this,n.appendTo(this.$("#stage-bg")),n.preloadImg(t,function(n){r._onBGLoad(n)}),n.attr("src",t))}.observes("controller.currentSlide.bg"),_onBGLoad:function(n){var t=this.get("bgAligner");t&&(t.init(n.width,n.height),t.align(),this.get("bgImg").css("visibelity",""))},onFillModeChanged:function(){var n=this.get("bgAligner");n.changeType(this.get("controller.currentSlide.fillMode"))}.observes("controller.currentSlide.fillMode"),willDestroyElement:function(){this.set("bgAligner",null)}}),MSPanel.ControlBtn=Ember.View.extend({control:null,tagName:"div",active:!1,classNames:["msp-control-btn"],classNameBindings:["active:msp-blue-btn"],template:Ember.Handlebars.compile('<span class="msp-control-label">{{view.control.label}}<\/span><a href="#" {{action "removeControl" target=view bubbles=false}}><span class="msp-control-removes msp-ico msp-ico-whiteremove"><\/span><\/a>'),didInsertElement:function(){},onActiveChange:function(){this.set("active",this.get("controller.currentControl")===this.get("control")),this.get("active")&&this.get("controller").send("showControlOptions")}.observes("controller.currentControl").on("init"),click:function(){this.get("active")||this.set("controller.currentControl",this.get("control"))},actions:{removeControl:function(){confirm('Are you sure want to remvoe "'+this.get("control.label")+'" control?')&&this.get("controller").send("removeControl",this.get("control"))}}}),MSPanel.MetaBoxComponent=Ember.Component.extend({tagName:"div",classNames:["msp-metabox"],layout:Ember.Handlebars.compile('<div class="msp-metabox-handle"><h3 class="msp-metabox-title">{{title}}<\/h3><div class="msp-metabox-toggle"><\/div><\/div>{{yield}}<div class="clear"> <\/div>')}),Ember.TEMPLATES["components/tabs-panel"]=Ember.Handlebars.compile("{{yield}}"),MSPanel.TabsPanelComponent=Ember.Component.extend({tagName:"div",attributeBindings:["id"],classNames:["msp-metabox msp-metabox-tabs"],didInsertElement:function(){this.$().avertaLiveTabs()}}),MSPanel.SwitchBoxComponent=Ember.Component.extend({classNames:["msp-switchbox"],offlable:"OFF",onlable:"ON",value:!1,layout:Ember.Handlebars.compile('<div class="msp-switch-cont"><span class="msp-switch-off">{{view.offlable}}<\/span><div class="msp-switch-handle"><\/div><span class="msp-switch-on">{{view.onlable}}<\/span><\/div>'),click:function(){var n=this;n.set("value",!n.get("value"))},update:function(){this.get("value")?this.$().addClass("switched"):this.$().removeClass("switched")}.observes("value").on("didInsertElement")}),hiddenEditor=jQuery("#mspHiddenEditor")[0].outerHTML,__tmc_msp_id=0,MSPanel.WPEditor=Ember.View.extend({classNames:["msp-wp-editor"],_id:null,template:null,tab:null,tabs:null,onInit:function(){var n="msp-wpeditor-"+__tmc_msp_id;this.set("_id",n),this.set("template",Ember.Handlebars.compile(WPEditorTemplate(n))),__tmc_msp_id++}.on("init"),didInsertElement:function(){var n=this.get("tabs");if(Ember.isEmpty(n)){this.createEditor();return}$("#"+n).bind("avtTabChange",{that:this},this.refreshEditor)},refreshEditor:function(n,t){var i=n.data.that;i.get("tab")===t&&i.createEditor()},createEditor:function(){var t,i,n,r,u;if(this.get("inited")!==!0&&(this.set("inited",!0),t=this.get("_id"),i=this,window.tinymce&&(n=$.extend({},window.tinyMCEPreInit.mceInit["msp-hidden"]||{}),n.forced_root_block="",n.force_br_newlines=!0,n.force_p_newlines=!1,n.wpautop=!1,tinyMCE.majorVersion=="3"?(n.body_class=n.elements=t,tinymce.init(n),setTimeout(function(){i.initEditor(tinyMCE.getInstanceById(t))},50)):tinyMCE.majorVersion=="4"&&(n.body_class="content post-type-post post-status-auto-draft post-format-standard",n.selector="#"+t,tinymce.init(n),setTimeout(function(){i.initEditor(tinyMCE.get(t))},50)),n.setup=function(){}),r=$.extend({},window.tinyMCEPreInit.qtInit["msp-hidden"]||{}),r.id=t,typeof QTags=="function")){u=quicktags(r),QTags.buttonsInitDone=!1,QTags._buttonsInit(),i.set("qtags",u),switchEditors.go(t,"html");this.$("textarea#"+this.get("_id")).on("change keyup paste",function(){i.set("value",$(this).val())})}},initEditor:function(n){function t(){r.set("internalChange",!0),r.set("value",n.getContent()),r.set("internalChange",!1)}var i=this.get("_id"),u=this.get("value"),r=this;this.$(".wp-editor-wrap").on("mousedown",function(){wpActiveEditor=i});if(tinyMCE.majorVersion=="3")n.onChange.add(t),n.onKeyUp.add(t);else if(tinyMCE.majorVersion=="4"){n.on("change",t);n.on("keyup",t)}this.$().click(t),setTimeout(function(){switchEditors.go(i,"html"),switchEditors.go(i,"tmce")},100),this.set("mce",n),this.onValueChanged()},onValueChanged:function(){var n,t;if(this.get("inited")){if(n=this.get("value"),this.$("textarea#"+this.get("_id")).val(n),this.get("internalChange")){this.set("internalChange",!1);return}t=this.get("mce"),Ember.isEmpty(t)||n==null?n==null&&t.setContent(" "):t.setContent(n)}}.observes("value"),willDestroyElement:function(){var n,t;this.get("inited")&&(window.tinymce&&tinymce.remove(this.get("_id")),n=this.get("qtags"),n&&($(n.toolbar).remove(),n.toolbar=null,n=null,QTags.instances[this.get("_id")]&&delete QTags.instances[this.get("_id")],this.$("textarea#"+this.get("_id")).remove()),t=this.get("tabs"),Ember.isEmpty(t)||$("#"+t).unbind("avtTabChange",this.refreshEditor))}}),jQuery.ui&&jQuery.ui.spinner&&(jQuery.ui.spinner.prototype._events.mousewheel=function(n,t){if(t&&this.element.is(":focus")){if(!this.spinning&&!this._start(n))return!1;this._spin((t>0?1:-1)*this.options.step,n),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(n)},100),n.preventDefault()}}),MSPanel.NumberInputView=Ember.View.extend({step:1,min:0,tagName:"input",attributeBindings:["type"],lastValue:null,type:"text",didInsertElement:function(){var n=this,i=this.$(),t=function(){var t=i.spinner("value");n.set("internalChange",!0),isNaN(t)||t==null?n.set("value",undefined):n.set("value",parseFloat(t))};i.on("change",t).spinner({step:this.get("step"),numberFormat:"n",min:this.get("min"),max:this.get("max"),spin:t,stop:t}).spinner("value",this.get("value"))},onValueChanged:function(){if(this.get("internalChange")){this.set("internalChange",!1);return}this.$().spinner("value",this.get("value"))}.observes("value")}),Ember.Handlebars.helper("number-input",MSPanel.NumberInputView),MSPanel.ColorPickerComponent=Ember.Component.extend({tagName:"input",classNames:"msp-color-picker",value:null,didInsertElement:function(){var n=this;this.$().spectrum({color:this.get("value"),allowEmpty:!0,showInput:!0,showAlpha:!0,clickoutFiresChange:!0,preferredFormat:"hex6",change:function(t){t===null?n.set("value",null):n.set("value",t.toString())}})},willDestroyElement:function(){this.$().spectrum("destroy")},onValueChanged:function(){this.$().spectrum("set",this.get("value"))}.observes("value")}),MSPanel.DropdwonListComponent=Ember.Component.extend({tagName:"div",classNames:["msp-ddlist"],layout:Ember.Handlebars.compile("<select>{{yield}}<\/select>"),value:null,width:100,didInsertElement:function(){var n=this;this.$("select").on("change",function(){var t=n.$("select option:selected");n.set("value",t.attr("value"))}).width(this.get("width")),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$("select").val(this.get("value"))}.observes("value")}),MSPanel.CodeMirrorComponent=Ember.Component.extend({classNames:["msp-codemirror"],width:250,height:200,mode:"css",tab:null,tabs:null,layout:Ember.Handlebars.compile("<textarea>{{yield}}<\/textarea>"),didInsertElement:function(){var t,n,i,r;this.$().width(this.get("width")).height(this.get("height")),t=this,n=CodeMirror.fromTextArea(this.$(">textarea")[0],{lineNumbers:!0,mode:this.get("mode")});n.on("change",function(){t.set("internalChange",!0),t.set("value",n.getValue())});this.set("editor",n),i=this.get("value"),Ember.isEmpty(i)||n.setValue(i),r=this.get("tabs"),Ember.isEmpty(r)||$("#"+r).bind("avtTabChange",{that:this},this.refreshEditor)},onValueChanged:function(){if(this.get("internalChange")===!0){this.set("internalChange",!1);return}this.get("editor").setValue(this.get("value")),this.set("internalChange",!1)}.observes("value"),refreshEditor:function(n,t){var i=n.data.that;i.get("tab")===t&&i.get("editor").refresh()},willDestroyElement:function(){var t=this.get("tabs"),n;Ember.isEmpty(t)||$("#"+t).unbind("avtTabChange",this.refreshEditor),n=this.get("editor"),n.toTextArea(),n=null,this.set("editor",null)}}),MSPanel.pushData=null,MSPanel.ApplicationController=Ember.Controller.extend({sliderId:MSPanel.SliderID,isSending:!1,statusMsg:"",hasError:!1,onInit:function(){window.$||(window.$=jQuery.noConflict()),MSPanel.Settings.find(),MSPanel.Slide.find(),MSPanel.Control.find(),MSPanel.Callback.find(),this.set("disableControls",MSPanel.Settings.find(0).get("disableControls"));var n=this;MSPanel.pushData=function(){n.prepareData()},__MSP_TYPE==="wc-product"&&__MSP_POST==null&&__WC_INSTALL_URL!=null&&(this.set("hasError",!0),this.set("errorTemplate","wooc-error"),this.set("wooLink",__WC_INSTALL_URL)),this.generateButtonStyles(),this.set("shortCode","[masterslider id="+this.get("sliderId")+"]"),this.set("phpFunction","<?php masterslider("+this.get("sliderId")+"); ?>"),jQuery("#panelLoading").remove()}.on("init"),prepareData:function(){var n={},i="",t;MSPanel.Style.find().forEach(function(t){var i=t.get("fontFamily"),r=t.get("fontWeight");Ember.isEmpty(i)||(n[i]||(n[i]=[]),r==="normal"&&(r="regular"),Ember.isEmpty(r)||n[i].indexOf(r)!==-1||n[i].push(r))});for(t in n)i+=t.replace(/\s/,"+")+":"+n[t].join(",")+"|";MSPanel.Settings.find(1).set("usedFonts",i.slice(0,-1)),this.saveRecords(MSPanel.Settings.find()),this.saveRecords(MSPanel.Slide.find()),this.saveRecords(MSPanel.Control.find()),this.saveRecords(MSPanel.Callback.find())},generateButtonStyles:function(){var i=MSPanel.ButtonStyle.find(),n="",t=$("#msp-buttons");i.forEach(function(t){n+="."+t.get("className")+" {"+t.get("normal")+"}\n."+t.get("className")+":hover {"+t.get("hover")+"}\n."+t.get("className")+":active {"+t.get("active")+"}\n"}),t.length===0?t=$('<style id="msp-buttons"><\/style>').text(n).appendTo($("head")):t.text(n)},actions:{saveAll:function(){this.prepareData(),this.sendData()},showPreview:function(n){window.lunchMastersliderPreview&&lunchMastersliderPreview(n)}},saveRecords:function(n){n.forEach(function(n){n.save()})},sendData:function(){this.set("statusMsg",__MSP_LAN.ap_001),this.set("isSending",!0);var n=this;jQuery.post(__MS.ajax_url,{action:"msp_panel_handler",nonce:jQuery("#msp-main-wrapper").data("nonce"),msp_data:B64.encode(JSON.stringify(MSPanel.data)),preset_style:B64.encode(JSON.stringify(MSPanel.PSData)),preset_effect:B64.encode(JSON.stringify(MSPanel.PEData)),buttons:B64.encode(JSON.stringify(MSPanel.PBData)),slider_id:MSPanel.SliderID},function(t){n.set("statusMsg",t.message),n.set("isSending",!1)})}}),MSPanel.SettingsController=Ember.ObjectController.extend({customSlider:window.__MSP_TYPE&&window.__MSP_TYPE==="custom",templateSlider:window.__MSP_TYPE&&(window.__MSP_TYPE==="flickr"||window.__MSP_TYPE==="post"||window.__MSP_TYPE==="wc-product"||window.__MSP_TYPE==="facebook"),sliderSkins:__MSP_SKINS,needs:["application","controls"],msTemplateName:null,msTemplateImg:null,draftMSTemplate:null,templates:MSPanel.SliderTemplates,showAutoHeight:!1,showNearbyNum:!1,showWrapperWidth:!1,preloadMethod:null,setup:function(){var n=this.get("preload");n==="all"||n==="-1"?this.set("preloadMethod",n):this.set("preloadMethod","nearby"),this.set("draftMSTemplate",this.get("msTemplate")),this.updateTemplate(!0)},sliderLayoutChanged:function(){var n=this.get("layout");n==="fullscreen"||n==="autofill"?(this.set("showAutoHeight",!1),this.set("autoHeight",!1)):this.set("showAutoHeight",!0),this.set("showWrapperWidth",n==="boxed"||n==="partialview"),this.set("showFSMargin",n==="fullscreen")}.observes("layout").on("setup"),preloadSetup:function(){var t=this.get("preloadMethod"),n;t==="nearby"?(this.set("showNearbyNum",!0),n=this.get("preload"),(n==="all"||n==="-1")&&this.set("preload","0")):(this.set("showNearbyNum",!1),this.set("preload",t))}.observes("preloadMethod").on("setup"),updateTemplate:function(n){var t,s=this.get("msTemplate"),r,f,e,i,u,o;if(this.get("templates").forEach(function(n){if(n.value===s){t=n;return}}),t){if(this.set("msTemplateName",t.name),this.set("msTemplateImg",t.img),this.set("msTemplateClass",t.className),this.set("controllers.application.disableControls",t.disableControls),this.set("disableControls",t.disableControls),!n){for(r=this.get("controllers.controls"),e=MSPanel.Control.find();e.get("firstObject");)i=e.get("firstObject"),r.findControlObj(i.get("name")).used=!1,i.deleteRecord();for(u in t.controls)f=r.findControlObj(u),i=MSPanel.Control.create($.extend(!0,r.getDefaultValues(u),t.controls[u])),i.set("label",f.label),f.used=!0,i.save();for(o in t.settings)this.set(o,t.settings[o])}}else this.set("draftMSTemplate","custom"),this.updateTemplate()},actions:{openTemplates:function(){var n=MSPanel.TemplatesView.create({controller:this});this.get("mainView").createChildView(n),this.set("templatesView",n),n.appendTo(MSPanel.rootElement)},closeTemplates:function(){this.get("templatesView").destroy(),this.set("draftMSTemplate",this.get("msTemplate"))},saveTemplate:function(){if(this.get("draftMSTemplate")===this.get("msTemplate")){this.send("closeTemplates");return}confirm(__MSP_LAN.tv_002)&&(this.set("msTemplate",this.get("draftMSTemplate")),this.send("closeTemplates"),this.updateTemplate())}}}),MSPanel.SlidesController=Ember.ArrayController.extend({customSlider:window.__MSP_TYPE&&window.__MSP_TYPE==="custom",_order:-1,sortProperties:["order"],mainView:null,currentSlide:null,setup:function(){if(this.get("length")===0)this.send("newSlide");else{var n=this.get("firstObject");this.set("currentSlide",n)}Ember.isEmpty(this.get("sliderSettings.type"))&&this.set("sliderSettings.type",__MSP_TYPE),this.set("sliderSettings.sliderId",MSPanel.SliderID),this.updateOrder()},duplicateSlide:function(n){var i=n.toJSON(),t;delete i.id,delete i.layers,t=MSPanel.Slide.create(i),t.set("order",n.get("order")+1),this.forEach(function(n){var i=n.get("order"),r=t.get("order");i>=r&&n!==t&&n.set("order",i+1)}),t.save(),this.updateOrder()},updateSlidesSort:function(n){this.beginPropertyChanges(),this.forEach(function(t){t.set("order",n[t.get("id")])},this),this.endPropertyChanges(),this.set("_order",this.get("lastObject.order"))},updateOrder:function(){var n=0;this.forEach(function(t){t.set("order",n++)}),this.set("_order",n-1)},removeSlide:function(n){n.deleteRecord(),this.get("length")===0?this.send("newSlide"):this.send("select",this.get("firstObject")),this.updateOrder()},actions:{newSlide:function(){var n=MSPanel.Slide.create({order:this.get("_order")+1});this.set("currentSlide",n),this.set("_order",this.get("_order")+1),n.save()},select:function(n){n!==this.get("currentSlide")&&this.set("currentSlide",n)}}}),MSPanel.ControlsController=Ember.ArrayController.extend({needs:"application",controls:[{used:!1,label:__MSP_LAN.cc_001,value:"arrows"},{used:!1,label:__MSP_LAN.cc_002,value:"timebar"},{used:!1,label:__MSP_LAN.cc_003,value:"bullets"},{used:!1,label:__MSP_LAN.cc_004,value:"circletimer"},{used:!1,label:__MSP_LAN.cc_005,value:"scrollbar"},{used:!1,label:__MSP_LAN.cc_006,value:"slideinfo"},{used:!1,label:__MSP_LAN.cc_007,value:"thumblist"}],selectedControl:null,availableControls:[],noMore:!1,currentControl:null,setup:function(){var n=this;this.forEach(function(t){n.findControlObj(t.get("name")).used=!0}),this.set("availableControls",this.findAvailableControls())},actions:{addControl:function(){var t=this.get("selectedControl"),i=this.findControlObj(t),n;n=MSPanel.Control.create(this.getDefaultValues(t)),n.set("label",i.label),i.used=!0,this.set("availableControls",this.findAvailableControls()),n.save(),this.set("currentControl",n)},removeControl:function(n){this.findControlObj(n.get("name")).used=!1,this.set("availableControls",this.findAvailableControls()),n.deleteRecord(),this.set("currentControl",this.get("firstObject")),this.send("showControlOptions")},showControlOptions:function(){var n=this.get("currentControl");Ember.isEmpty(n)?this.set("controlOptions","empty-template"):this.set("controlOptions",n.get("name")+"-options")}},findControlObj:function(n){for(var i=this.get("controls"),t=0,r=i.length;t!==r;t++)if(i[t].value===n)return i[t];return null},findAvailableControls:function(){for(var n=[],i=this.get("controls"),t=0,r=i.length;t!==r;t++)i[t].used||n.push(i[t]);return this.set("noMore",n.length===0),this.set("selectedControl",n[0]?n[0].value:null),n},getDefaultValues:function(n){var t={name:n};t.inset=!(n==="slideinfo"||n==="thumblist");switch(n){case"timebar":t.align="bottom",t.color="#FFFFFF",t.autoHide=!1,t.width=4;break;case"bullets":t.align="bottom",t.dir="h",t.margin=10,t.space=6;break;case"circletimer":t.color="#A2A2A2",t.stroke=10,t.radius=4,t.autoHide=!1;break;case"scrollbar":t.align="top",t.dir="h",t.color="#3D3D3D",t.margin=10,t.autoHide=!1,t.width=4;break;case"slideinfo":t.align="bottom",t.margin=10,t.autoHide=!1;break;case"thumblist":t.align="bottom",t.space=5,t.width=100,t.height=80,t.margin=10,t.fillMode="fill",t.autoHide=!1}return t}}),MSPanel.CallbacksController=Ember.ArrayController.extend({callbacks:[{used:!1,label:__MSP_LAN.cb_011,value:"INIT"},{used:!1,label:__MSP_LAN.cb_001,value:"CHANGE_START"},{used:!1,label:__MSP_LAN.cb_002,value:"CHANGE_END"},{used:!1,label:__MSP_LAN.cb_003,value:"WAITING"},{used:!1,label:__MSP_LAN.cb_004,value:"RESIZE"},{used:!1,label:__MSP_LAN.cb_005,value:"VIDEO_PLAY"},{used:!1,label:__MSP_LAN.cb_006,value:"VIDEO_CLOSE"},{used:!1,label:__MSP_LAN.cb_007,value:"SWIPE_START"},{used:!1,label:__MSP_LAN.cb_008,value:"SWIPE_MOVE"},{used:!1,label:__MSP_LAN.cb_009,value:"SWIPE_END"}],availableCallbacks:[],noMore:!1,selectedCallback:null,setup:function(){var n=this;this.forEach(function(t){n.findCallbackObj(t.get("name")).used=!0}),this.set("availableCallbacks",this.findAvailableCallbacks())},actions:{addCallback:function(){var i=this.get("selectedCallback"),n=this.findCallbackObj(i),t;t=MSPanel.Callback.create({name:n.value,label:n.label}),n.used=!0,this.set("availableCallbacks",this.findAvailableCallbacks()),t.save()},removeCallback:function(n){confirm(__MSP_LAN.cb_010.jfmt(n.get("label")))&&(this.findCallbackObj(n.get("name")).used=!1,this.set("availableCallbacks",this.findAvailableCallbacks()),n.deleteRecord())}},findCallbackObj:function(n){for(var i=this.get("callbacks"),t=0,r=i.length;t!==r;t++)if(i[t].value===n)return i[t];return null},findAvailableCallbacks:function(){for(var n=[],i=this.get("callbacks"),t=0,r=i.length;t!==r;t++)i[t].used||n.push(i[t]);return this.set("noMore",n.length===0),this.set("selectedCallback",n[0]?n[0].value:null),n}})
|
|
1 |
+
/*!
|
2 |
+
* Master Slider WordPress Lite Panel
|
3 |
+
* Copyright © 2015 All Rights Reserved.
|
4 |
+
*
|
5 |
+
* @author Averta [www.averta.net]
|
6 |
+
* @version 2.0.0
|
7 |
+
* @date Jan 2015
|
8 |
*/
|
9 |
+
window.MSPanel=Ember.Application.create({rootElement:"#msp-root"}),MSPanel.version="2.0.0",MSPanel.SliderID=parseQueryString(window.location.search).slider_id||__MSP_SLIDER_ID||"100",MSPanel.dependedControllers=[],String.prototype.jfmt=function(){return"".fmt.apply(this.replace(/%s|%d/,"%@"),arguments)},window.$=jQuery.noConflict(),jQuery.ui.dialog.prototype._focusTabbable=function(){},MSPanel.Router.map(function(){this.resource("settings"),this.resource("slides",{path:"/"}),this.resource("controls"),this.resource("callbacks"),this.resource("error")}),MSPanel.Router.reopen({location:"none"}),MSPanel.ApplicationRoute=Ember.Route.extend({model:function(){var setting=MSPanel.Settings.find();0===setting.get("length")&&MSPanel.Settings.create().save()}}),MSPanel.SettingsRoute=Ember.Route.extend({model:function(){return MSPanel.Settings.find(1)},setupController:function(controller,model){controller.set("model",model),controller.setup()}}),MSPanel.SlidesRoute=Ember.Route.extend({model:function(){return MSPanel.Slide.find()},setupController:function(controller,model){controller.set("model",model),controller.set("sliderSettings",MSPanel.Settings.find(1)),controller.setup()}}),MSPanel.ControlsRoute=Ember.Route.extend({model:function(){return MSPanel.Control.find()},setupController:function(controller,model){controller.set("model",model),controller.setup(),this.activate()},activate:function(){var controller=this.get("controller");controller&&controller.set("controlOptions","empty-template")}}),MSPanel.CallbacksRoute=Ember.Route.extend({model:function(){return MSPanel.Callback.find()},setupController:function(controller,model){controller.set("model",model),controller.setup()}}),function(){var attr=Ember.attr,hasMany=Ember.hasMany,belongsTo=Ember.belongsTo,regp=/https\:|http\:/,WPPath={serialize:function(path){return void 0==path?path:regp.test(path)?path.replace(__MS.upload_dir,""):path},deserialize:function(path){return void 0==path?path:regp.test(path)?path:__MS.upload_dir+path}},defaults=window.__MSP_DEF_OPTIONS||{};MSPanel.Settings=Ember.Model.extend({id:attr("number"),snapping:attr("boolean",{defaultValue:!0}),bgImageThumb:attr(WPPath),disableControls:attr("boolean",{defaultValue:!1}),name:attr("string",{defaultValue:__MSP_LAN.sm_001}),width:attr("number",{defaultValue:defaults.width||1e3}),height:attr("number",{defaultValue:defaults.height||500}),wrapperWidth:attr("number"),wrapperWidthUnit:attr("string",{defaultValue:"px"}),autoCrop:attr("boolean",{defaultValue:defaults.autoCrop||!1}),type:attr("string"),sliderId:attr("string"),layout:attr("string",{defaultValue:defaults.layout||"boxed"}),autoHeight:attr("boolean",{defaultValue:defaults.autoHeight||!1}),trView:attr("string",{defaultValue:defaults.transition||"basic"}),speed:attr("number",{defaultValue:defaults.speed||20}),space:attr("number",{defaultValue:defaults.space||0}),start:attr("number",{defaultValue:defaults.start}),grabCursor:attr("boolean",{defaultValue:defaults.grabCursor}),swipe:attr("boolean",{defaultValue:defaults.swipe}),mouse:attr("boolean",{defaultValue:defaults.mouse}),wheel:attr("boolean",{defaultValue:defaults.wheel}),autoplay:attr("boolean",{defaultValue:defaults.autoplay}),loop:attr("boolean",{defaultValue:defaults.loop}),shuffle:attr("boolean",{defaultValue:defaults.shuffle}),preload:attr("string",{defaultValue:defaults.preload}),overPause:attr("boolean",{defaultValue:defaults.overPause}),endPause:attr("boolean",{defaultValue:defaults.endPause}),hideLayers:attr("boolean",{defaultValue:defaults.hideLayers}),dir:attr("string",{defaultValue:defaults.dir}),parallaxMode:attr("srting",{defaultValue:defaults.parallaxMode}),useDeepLink:attr("string",{defaultValue:!1}),deepLink:attr("string"),deepLinkType:attr("string",{defaultValue:"path"}),scrollParallax:attr("boolean"),scrollParallaxMove:attr("number",{defaultValue:30}),scrollParallaxBGMove:attr("number",{defaultValue:50}),scrollParallaxFade:attr("boolean",{defaultValue:!0}),centerControls:attr("boolean",{defaultValue:defaults.centerControls}),instantShowLayers:attr("boolean",{defaultValue:defaults.instantShowLayers}),fullscreenMargin:attr("number"),inlineStyle:attr("string"),className:attr("string",{defaultValue:defaults.className}),bgColor:attr("string"),bgImage:attr(WPPath),customStyle:attr("string"),skin:attr("string",{defaultValue:defaults.skin}),msTemplate:attr("string",{defaultValue:"custom"}),msTemplateClass:attr("string",{defaultValue:""}),usedFonts:attr("string"),apiKey:attr("string"),setId:attr("string"),setType:attr("string"),imgCount:attr("number"),thumbSize:attr("srting"),imgSize:attr("string"),postType:attr("string"),postCats:attr(Array),postTags:attr(Array),postCount:attr("number"),postImageType:attr("string"),postOrder:attr("string"),postOrderDir:attr("string"),postExcerptLen:attr("number"),postExcludeIds:attr("string"),postIncludeIds:attr("string"),postOffset:attr("number"),postLinkSlide:attr("boolean"),postLinkTarget:attr("string"),postSlideBg:attr("string"),postSlideBgthumb:attr("string"),wcOnlyInstock:attr("boolean"),wcOnlyFeatured:attr("boolean"),wcOnlyOnsale:attr("boolean")}),MSPanel.Slide=Ember.Model.extend({id:attr("number"),timeline_h:attr("number",{defaultValue:200}),bgThumb:attr(WPPath),thumbOrginal:attr(WPPath),order:attr("number"),ishide:attr("boolean"),bg:attr(WPPath),duration:attr("number",{defaultValue:defaults.duration||3}),fillMode:attr("string",{defaultValue:defaults.slideFillMode||"fill"}),thumb:attr(WPPath),info:attr("string"),link:attr("string"),linkTarget:attr("string"),linkTitle:attr("string"),linkRel:attr("string"),linkClass:attr("string"),linkId:attr("string"),video:attr("string"),bgColor:attr("string"),autoplayVideo:attr("boolean"),pattern:attr("string"),colorOverlay:attr("string"),bgv_mp4:attr("string"),bgv_ogg:attr("string"),bgv_webm:attr("string"),bgv_fillmode:attr("string",{defaultValue:defaults.sliderVideoFillMode||"fill"}),bgv_loop:attr("boolean",{defaultValue:defaults.slideVideoLoop}),bgv_mute:attr("boolean",{defaultValue:defaults.slideVideoMute}),bgv_autopause:attr("boolean",{defaultValue:defaults.slideVideoAutopause}),cssId:attr("string"),cssClass:attr("string"),bgAlt:attr("string"),layers:hasMany("MSPanel.Layer",{key:"layer_ids"})}),MSPanel.Layer=Ember.Model.extend({id:attr("number"),name:attr("string"),isLocked:attr("boolean",{defaultValue:!1}),isHided:attr("boolean",{defaultValue:!1}),isSoloed:attr("boolean",{defaultValue:!1}),slide:belongsTo("MSPanel.Slide",{key:"slide"}),styleModel:belongsTo("MSPanel.Style",{key:"styleModel",embedded:!1}),showEffect:belongsTo("MSPanel.Effect",{key:"showEffect",embedded:!1}),showTransform:attr("string",{defaultValue:""}),showOrigin:attr("string",{defaultValue:""}),showFade:attr("boolean",{defaultValue:!0}),hideEffect:belongsTo("MSPanel.Effect",{key:"hideEffect",embedded:!1}),hideTransform:attr("string",{defaultValue:""}),hideOrigin:attr("string",{defaultValue:""}),hideFade:attr("boolean",{defaultValue:!0}),imgThumb:attr(WPPath),stageOffsetX:attr("number",{defaultValue:0}),stageOffsetY:attr("number",{defaultValue:0}),order:attr("number"),type:attr("string"),cssClass:attr("string"),cssId:attr("string"),title:attr("string"),rel:attr("string"),noSwipe:attr("string",{defaultValue:!1}),content:attr("string",{defaultValue:defaults.layerContent||"Lorem Ipsum"}),img:attr(WPPath),imgAlt:attr("string"),video:attr("string",{defaultValue:"http://player.vimeo.com/video/11721242"}),align:attr("string",{defaultValue:"top"}),useAction:attr("boolean",{defaultValue:!1}),action:attr("string"),toSlide:attr("number"),link:attr("string"),linkTarget:attr("string"),scrollDuration:attr("number",{defaultValue:2}),offsetX:attr("number",{defaultValue:0}),offsetY:attr("number",{defaultValue:0}),width:attr("number"),height:attr("number"),resize:attr("boolean",{defaultValue:!0}),fixed:attr("boolean",{defaultValue:!1}),widthlimit:attr("number",{defaultValue:"0"}),origin:attr("string",{defaultValue:"tl"}),stayHover:attr("boolean",{defaultValue:!0}),className:attr("string"),parallax:attr("string"),showDuration:attr("number",{defaultValue:1}),showDelay:attr("number",{defaultValue:0}),showEase:attr("string",{defaultValue:"easeOutQuint"}),showEffFunc:attr("string"),useHide:attr("boolean",{defaultValue:!1}),hideDuration:attr("number",{defaultValue:1}),hideDelay:attr("number",{defaultValue:1}),hideEase:attr("string",{defaultValue:"easeOutQuint"}),hideEffFunc:attr("string"),btnClass:attr("string",{defaultValue:"ms-btn ms-default-btn"}),autoplayVideo:attr("boolean")}),MSPanel.Style=Ember.Model.extend({id:attr("number"),name:attr("string"),type:attr("string"),className:attr("string"),backgroundColor:attr("string"),paddingTop:attr("number"),paddingRight:attr("number"),paddingBottom:attr("number"),paddingLeft:attr("number"),borderTop:attr("number"),borderRight:attr("number"),borderBottom:attr("number"),borderLeft:attr("number"),borderColor:attr("string"),borderRadius:attr("number"),borderStyle:attr("string"),fontFamily:attr("string"),fontWeight:attr("string",{defaultValue:"normal"}),fontSize:attr("number"),textAlign:attr("string"),letterSpacing:attr("number"),lineHeight:attr("string",{defaultValue:"normal"}),whiteSpace:attr("string"),color:attr("string"),custom:attr("string")}),MSPanel.PresetStyle=MSPanel.Style.extend({}),MSPanel.Effect=Ember.Model.extend({id:attr("number"),name:attr("string"),type:attr("string"),fade:attr("boolean",{defaultValue:!0}),translateX:attr("number"),translateY:attr("number"),translateZ:attr("number"),scaleX:attr("number"),scaleY:attr("number"),rotate:attr("number"),rotateX:attr("number"),rotateY:attr("number"),rotateZ:attr("number"),skewX:attr("number"),skewY:attr("number"),originX:attr("number"),originY:attr("number"),originZ:attr("number")}),MSPanel.PresetEffect=MSPanel.Effect.extend({}),MSPanel.Control=Ember.Model.extend({id:attr("number"),label:attr("string"),name:attr("string"),autoHide:attr("boolean",{defaultValue:!0}),overVideo:attr("boolean",{defaultValue:!0}),cssClass:attr("string"),cssId:attr("string"),margin:attr("number"),dir:attr("string"),color:attr("string"),radius:attr("number"),stroke:attr("number"),speed:attr("number"),space:attr("number"),type:attr("string"),width:attr("number"),height:attr("number"),align:attr("string"),inset:attr("boolean"),size:attr("number"),hideUnder:attr("number"),fillMode:attr("string")}),MSPanel.Callback=Ember.Model.extend({id:attr("number"),label:attr("string"),name:attr("string"),content:attr("string",{defaultValue:"function(event){\n var api = event.target;\n}"})}),MSPanel.ButtonStyle=Ember.Model.extend({id:attr("number"),className:attr("string"),normal:attr("string"),hover:attr("string"),active:attr("string"),style:attr("string",{defaultValue:"ms-btn-box"}),size:attr("string",{defaultValue:"ms-btn-n"})});var decodeFix=function(str){var decoded=B64.decode(str);return decoded.slice(0,decoded.lastIndexOf("}")+1)};MSPanel.data=__MSP_DATA?JSON.parse(decodeFix(__MSP_DATA)):{meta:{}},MSPanel.PSData=__MSP_PRESET_STYLE?JSON.parse(decodeFix(__MSP_PRESET_STYLE)):{meta:{}},MSPanel.PEData=__MSP_PRESET_EFFECT?JSON.parse(decodeFix(__MSP_PRESET_EFFECT)):{meta:{}},MSPanel.PBData=__MSP_PRESET_BUTTON?JSON.parse(decodeFix(__MSP_PRESET_BUTTON)):{meta:{}},MSPanel.Settings.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Slide.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Layer.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Style.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Effect.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Control.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.Callback.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.data}),MSPanel.PresetStyle.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.PSData}),MSPanel.PresetEffect.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.PEData}),MSPanel.ButtonStyle.adapter=Ember.OfflineAdapter.create({applicationData:MSPanel.PBData})}(),MSPanel.SlideFrame=Ember.View.extend({classNames:["msp-slideframe"],classNameBindings:["selected:active"],selected:!1,thumb_src:"",showbtnclass:"msp-ico msp-ico-whitehide",template:Ember.Handlebars.compile('<div class="msp-img-cont">{{#if view.hasImg}}<div class="msp-imgselect-preview" {{bind-attr style=view.preview}})"></div>{{/if}}</div><span class="msp-frame-slideorder">#{{view.order}}</span><div class="msp-framehandle"><ul><li><a title="'+__MSP_LAN.ui_001+'" href="#" {{action "hideswitch" target=view}}><span {{bind-attr class=view.showbtnclass}}></span></a></li><li><a title="'+__MSP_LAN.ui_002+'" href="#" {{action "duplicate" target=view}}><span class="msp-ico msp-ico-whiteduplicate"></span></a></li><li><a title="'+__MSP_LAN.ui_003+'" href="#" {{action "remove" target=view}}><span class="msp-ico msp-ico-whiteremove"></span></a></li></ul></div>'),click:function(){this.get("controller").send("select",this.get("slide"))},onValueChanged:function(){var hasImg=!Ember.isEmpty(this.get("slide.bg")),hasThumb=!Ember.isEmpty(this.get("slide.thumb"));this.beginPropertyChanges(),this.set("hasImg",hasImg||hasThumb),hasImg?this.set("preview","background-image:url("+this.get("slide.bgThumb")+");"):hasThumb&&this.set("preview","background-image:url("+this.get("slide.thumb")+");"),this.endPropertyChanges()}.observes("slide.bg","slide.thumb").on("didInsertElement"),onSelect:function(){var slide=this.get("slide");this.set("selected",slide===this.get("controller.currentSlide"))}.observes("controller.currentSlide").on("init"),hideChange:function(){this.get("slide.ishide")?this.set("showbtnclass","msp-ico msp-ico-whitehide msp-ico-whiteshow"):this.set("showbtnclass","msp-ico msp-ico-whitehide")}.observes("slide.ishide").on("init"),order:function(){return this.get("slide.order")+1}.property("slide.order"),actions:{duplicate:function(){this.get("controller").duplicateSlide(this.get("slide"))},hideswitch:function(){this.set("slide.ishide",!this.get("slide.ishide"))},remove:function(){confirm(__MSP_LAN.ui_004)&&this.get("controller").removeSlide(this.get("slide"))}}}),MSPanel.SlideList=Ember.View.extend({tagName:"ul",classNames:["msp-slides"],template:Ember.Handlebars.compile('{{#each item in controller}}<li class="msp-slideframe-item" {{bind-attr data-id=item.id}}>{{view MSPanel.SlideFrame slide=item}}</li>{{/each}}<li class="msp-addslide-cont"><div class="msp-addslide" {{action "addSlides"}}><span class="msp-ico msp-ico-grayaddlarge"></span><span class="msp-addslide-label">Add Slide</span></div></li>'),didInsertElement:function(){var that=this;this.$().sortable({placeholder:"msp-frames-srtplaceholder",items:">li:not(.msp-addslide-cont)",delay:100,update:function(){that.updateSort()},create:function(){that.updateSort()}})},updateSort:function(){var indexes={};$(".msp-slideframe-item").each(function(index){indexes[$(this).data("id")]=index}),this.$().sortable("cancel"),this.get("controller").updateSlidesSort(indexes)}}),MSPanel.ImgSelect=Ember.View.extend({classNames:["msp-imgselect"],value:"",hasImg:!1,frame:null,slideBg:!1,template:Ember.Handlebars.compile('<div class="msp-img-cont">{{#if view.hasImg}}<div class="msp-imgselect-preview" {{bind-attr style=view.preview}})"></div>{{/if}}</div>{{#if view.hasImg}}<button {{action removeImg target="view"}} class="msp-img-btn"><span class="msp-ico msp-ico-grayremove"></span></button>{{else}}<button {{action addImg target="view"}} class="msp-img-btn"><span class="msp-ico msp-ico-grayadd"></span></button>{{/if}}'),willDestroyElement:function(){var frame=this.get("frame");frame&&(frame.detach(),frame.remove(),frame=null,this.set("frame",null))},onValueChanged:function(){this.beginPropertyChanges(),this.set("hasImg",!Ember.isEmpty(this.get("value"))),this.set("preview","background-image:url("+this.get("thumb")+");"),this.endPropertyChanges()}.observes("value").on("didInsertElement"),actions:{removeImg:function(){this.beginPropertyChanges(),this.set("value",void 0),this.set("thumb",void 0),this.endPropertyChanges()},addImg:function(){if("undefined"!=typeof wp){var that=this,frame=this.get("frame");if(frame)return void frame.open();var frame=wp.media.frames.frame=wp.media({title:"Select Image",multiple:!1,frame:"select",library:{type:"image"},button:{text:"Add Image"}});frame.on("select",function(){var attachment=frame.state().get("selection").first().toJSON();that.set("thumb",(attachment.sizes.thumbnail||attachment.sizes.full).url),that.set("value",attachment.url)}),frame.open(),this.set("frame",frame)}}}}),MSPanel.Select=Ember.Select.extend({tagName:"div",classNames:["msp-ddlist"],layout:Ember.Handlebars.compile("<select>{{yield}}</select>"),value:null,width:100,didInsertElement:function(){var that=this;this.$("select").on("change",function(){var option=that.$("select option:selected");that.set("value",option.attr("value"))}).width(this.get("width")),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$("select").val(this.get("value"))}.observes("value")}),MSPanel.URLTarget=MSPanel.Select.extend({onInit:function(){var contents=[{lable:__MSP_LAN.ui_005,value:"_self"},{lable:__MSP_LAN.ui_006,value:"_blank"},{lable:__MSP_LAN.ui_007,value:"_parent"},{lable:__MSP_LAN.ui_008,value:"_top"}];this.set("content",contents),this.set("optionValuePath","content.value"),this.set("optionLabelPath","content.lable"),this.set("width",200)}.on("init")}),MSPanel.Fillmode=Ember.View.extend({classNames:["msp-fill-dd"],type:"slide",value:"fill",index:1,template:Ember.Handlebars.compile("<select>{{#each item in view.contents}}<option {{bind-attr value=item.value data-imagesrc=item.img}}>{{item.text}}</option>{{/each}}</select>"),didInsertElement:function(){var that=this,isFirst=!0;this.$("select").ddslick({width:154,onSelected:function(selected){!isFirst&&that.set("value",selected.selectedData.value),isFirst=!1}}),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$(".dd-container").ddslick("select",{index:this.get("valuedic")[this.get("value")]})}.observes("value"),onInit:function(){var contents,valuedic;"slide"===this.get("type")?(contents=[{value:"fill",text:__MSP_LAN.ui_009,img:__MSP_PATH+"images/fill.png"},{value:"fit",text:__MSP_LAN.ui_010,img:__MSP_PATH+"images/fit.png"},{value:"center",text:__MSP_LAN.ui_011,img:__MSP_PATH+"images/center.png"},{value:"stretch",text:__MSP_LAN.ui_012,img:__MSP_PATH+"images/stretch.png"},{value:"tile",text:__MSP_LAN.ui_013,img:__MSP_PATH+"images/tile.png"}],valuedic={fill:0,fit:1,center:2,stretch:3,tile:4}):"video"===this.get("type")&&(contents=[{value:"fill",text:__MSP_LAN.ui_009,img:__MSP_PATH+"images/fill.png"},{value:"fit",text:__MSP_LAN.ui_010,img:__MSP_PATH+"images/fit.png"}],valuedic={fill:0,fit:1,none:2}),this.set("contents",contents),this.set("valuedic",valuedic)}.on("init")}),MSPanel.AddLayer=Ember.View.extend({classNames:["msp-addlayer"],template:Ember.Handlebars.compile('<button {{action newLayer view.value}} class="msp-add-btn msp-addlayer-btn"><span class="msp-ico msp-ico-whiteadd"></span></button><div class="msp-addlayer-dd"><select>{{#each item in view.layertypes}}<option {{bind-attr value=item.value data-imagesrc=item.img}}>{{item.lable}}</option>{{/each}}</select></div>'),didInsertElement:function(){var that=this;this.$().find("select").ddslick({width:154,onSelected:function(selected){that.set("value",selected.selectedData.value)}})},onInit:function(){for(var layertypes=[],clt=this.get("controller.layertypes"),i=0,l=clt.length;i!==l;i++)layertypes.push({value:clt[i].value,lable:clt[i].lable,img:__MSP_PATH+"images/layertypes/"+clt[i].value+".png"});this.set("layertypes",layertypes)}.on("init")}),MSPanel.AlignBtns=Ember.View.extend({classNames:["msp-align-btns"],target:null,template:Ember.Handlebars.compile('<button title="'+__MSP_LAN.ui_015+'" {{action "alignLayer" "top" target=view.target}} class="msp-align-btn"><span class="msp-ico msp-ico-altop"></span></button><button title="'+__MSP_LAN.ui_016+'" {{action "alignLayer" "mid" target=view.target}} class="msp-align-btn"><span class="msp-ico msp-ico-almid"></span></button><button title="'+__MSP_LAN.ui_017+'" {{action "alignLayer" "bot" target=view.target}} class="msp-align-btn"><span class="msp-ico msp-ico-albot"></span></button><div class="msp-btn-space"></div><button title="'+__MSP_LAN.ui_018+'" {{action "alignLayer" "left" target=view.target}} class="msp-align-btn"><span class="msp-ico msp-ico-alleft"></span></button><button title="'+__MSP_LAN.ui_019+'" {{action "alignLayer" "center" target=view.target}} class="msp-align-btn"><span class="msp-ico msp-ico-alcenter"></span></button><button title="'+__MSP_LAN.ui_020+'" {{action "alignLayer" "right" target=view.target}} class="msp-align-btn"><span class="msp-ico msp-ico-alright"></span></button>')}),MSPanel.PositionOrigin=Ember.View.extend({classNames:["msp-origin-control"],layer:null,selectedNode:null,template:Ember.Handlebars.compile('<table><tbody><tr><td title="Top left" class="msp-origin-btn msp-origin-tl" data-origin="tl"></td><td title="Top center" class="msp-origin-btn msp-origin-tc" data-origin="tc"></td><td title="Top right" class="msp-origin-btn msp-origin-tr" data-origin="tr"></td></tr><tr><td title="Middle left" class="msp-origin-btn msp-origin-ml" data-origin="ml"></td><td title="Middle center" class="msp-origin-btn msp-origin-mc" data-origin="mc"></td><td title="Middle right" class="msp-origin-btn msp-origin-mr" data-origin="mr"></td></tr><tr><td title="Bottom left" class="msp-origin-btn msp-origin-bl" data-origin="bl"></td><td title="Bottom center" class="msp-origin-btn msp-origin-bc" data-origin="bc"></td><td title="Bottom right" class="msp-origin-btn msp-origin-br" data-origin="br"></td></tr></tbody></table>'),didInsertElement:function(){var that=this;this.$(".msp-origin-btn").click(function(){Ember.isEmpty(that.get("layer"))||that.set("layer.origin",$(this).data("origin"))}),this.onValueChanged()},onValueChanged:function(){var selectedNode=this.get("selectedNode");if(Ember.isEmpty(selectedNode)||selectedNode.removeClass("msp-origin-btn-selected"),Ember.isEmpty(this.get("layer")))return void this.$().addClass("msp-origin-control-disabled");this.$().removeClass("msp-origin-control-disabled");var value=this.get("layer.origin"),newNode=this.$(".msp-origin-"+value).addClass("msp-origin-btn-selected");this.set("selectedNode",newNode)}.observes("layer","layer.origin")}),MSPanel.ButtonsList=Ember.View.extend({classNames:["msp-buttons-container"],layer:null,template:Ember.Handlebars.compile('{{#each button in controller.buttonClasses}}<div class="msp-button-container" {{action "selectButton" button target=view}}><div class="msp-button-cell"><span {{bind-attr class=":ms-btn button.style button.size button.className"}}>Button</span></div></div>{{/each}}'),didInsertElement:function(){this.onValueChanged()},onValueChanged:function(){var className=this.get("layer.btnClass"),lastSelected=this.get("lastSelected");Ember.isEmpty(className)||(className=className.split(" ").pop(),Ember.isEmpty(lastSelected)||this.$("."+lastSelected).parent().removeClass("active"),this.$("."+className).parent().addClass("active"),this.set("lastSelected",className))}.observes("layer","layer.btnClass"),actions:{selectButton:function(button){this.set("layer.btnClass","ms-btn "+button.get("style")+" "+button.get("size")+" "+button.get("className"))}}}),MSPanel.ActionList=Ember.View.extend({classNames:["msp-action-list"],layer:null,showSlideNum:null,showDuration:null,template:Ember.Handlebars.compile('{{#dropdwon-List value=view.layer.action width=180}}<option value="next">'+(__MSP_LAN.ui_021||"Goto next slide")+'</option><option value="previous">'+(__MSP_LAN.ui_022||"Goto previous slide")+'</option><option value="gotoSlide">'+(__MSP_LAN.ui_025||"Goto slide")+'</option><option value="pause">'+(__MSP_LAN.ui_023||"Pause timer")+'</option><option value="resume">'+(__MSP_LAN.ui_024||"Resume timer")+'</option><option value="scrollToEnd">'+(__MSP_LAN.ui_028||"Scroll to bottom of slider")+'</option>{{/dropdwon-List}}{{#if view.showSlideNum}}<div class="msp-form-space-med"></div>'+(__MSP_LAN.ui_026||"Slide number : ")+' {{number-input value=view.layer.toSlide}}{{/if}}{{#if view.showDuration}}<div class="msp-form-space-med"></div>'+(__MSP_LAN.ui_029||"Scroll animation duration : ")+" {{number-input value=view.layer.scrollDuration}} s{{/if}}"),onValueChanged:function(){var value=this.get("layer.action");this.set("showSlideNum","gotoSlide"===value),this.set("showDuration","scrollToEnd"===value)}.observes("layer","layer.action").on("init")}),MSPanel.SimpleCodeBlock=Ember.View.extend({classNames:["msp-shortcode-box"],template:Ember.Handlebars.compile('<input type="text" readonly {{bind-attr value=view.value}}>'),width:150,didInsertElement:function(){this.$("input").on("click",function(){$(this).select()}).width(this.get("width"))}}),MSPanel.SettingsView=Ember.View.extend({didInsertElement:function(){this.set("controller.mainView",this)}}),MSPanel.SlidesView=Ember.View.extend({didInsertElement:function(){this.set("controller.mainView",this)}}),MSPanel.StageArea=Ember.View.extend({classNames:["msp-stage-area"],template:Ember.Handlebars.compile('{{view MSPanel.Stage}}{{#if noticeMsg}}<div class="msp-stage-msg"><span class="msp-ico msp-ico-notice"></span>{{{noticeMsg}}}</div>{{/if}}')}),MSPanel.Stage=Ember.View.extend({classNames:["msp-slide-stage"],attributeBindings:["style"],template:Ember.Handlebars.compile('<div id="stage-bg" class="msp-stage-bg"></div><div id="overlaybox" {{bind-attr class=":msp-stage-pattern :ms-pattern controller.slide.pattern"}}></div>'),resize:function(){var w=this.get("controller.sliderSettings.width"),h=this.get("controller.sliderSettings.height");this.set("width",w),this.set("height",h),this.$().css({width:w,height:h})}.observes("controller.sliderSettings.width","controller.sliderSettings.height","parentView.zoom").on("didInsertElement"),didInsertElement:function(){var BG=this.$("#stage-bg"),BGImage=$("<img/>");BGImage.css("visibelity","hidden").each($.jqLoadFix);var aligner=new MSAligner(this.get("controller.slide.fillMode"),BG,BGImage);this.set("bgAligner",aligner),this.set("bgImg",BGImage),this.onBGChange()},onBGColorChange:function(){var color=this.get("controller.slide.bgColor");Ember.isEmpty(color)?this.$("#stage-bg").css("background-color",""):this.$("#stage-bg").css("background-color",color)}.observes("controller.slide.bgColor").on("didInsertElement"),onColorOverlayChange:function(){var color=this.get("controller.slide.colorOverlay");Ember.isEmpty(color)?this.$("#overlaybox").css("background-color",""):this.$("#overlaybox").css("background-color",color)}.observes("controller.slide.colorOverlay").on("didInsertElement"),onBGChange:function(){var alinger=this.get("bgAligner");alinger&&alinger.reset();var bg=this.get("controller.slide.bg"),bgImg=this.get("bgImg");if(Ember.isEmpty(bg))bgImg.detach();else{var that=this;bgImg.appendTo(this.$("#stage-bg")),bgImg.preloadImg(bg,function(event){that._onBGLoad(event)}),bgImg.attr("src",bg)}}.observes("controller.slide.bg"),_onBGLoad:function(event){var aligner=this.get("bgAligner");aligner&&(aligner.init(event.width,event.height),aligner.align(),this.get("bgImg").css("visibelity",""))},onFillModeChanged:function(){var aligner=this.get("bgAligner");aligner.changeType(this.get("controller.slide.fillMode"))}.observes("controller.slide.fillMode"),willDestroyElement:function(){$(document).off("keydown",this.moveLayer),this.set("bgAligner",null)}}),MSPanel.ControlBtn=Ember.View.extend({control:null,tagName:"div",active:!1,classNames:["msp-control-btn"],classNameBindings:["active:msp-blue-btn"],template:Ember.Handlebars.compile('<span class="msp-control-label">{{view.control.label}}</span><a href="#" {{action "removeControl" target=view bubbles=false}}><span class="msp-control-removes msp-ico msp-ico-whiteremove"></span></a>'),didInsertElement:function(){},onActiveChange:function(){this.set("active",this.get("controller.currentControl")===this.get("control")),this.get("active")&&this.get("controller").send("showControlOptions")}.observes("controller.currentControl").on("init"),click:function(){this.get("active")||this.set("controller.currentControl",this.get("control"))},actions:{removeControl:function(){confirm('Are you sure want to remvoe "'+this.get("control.label")+'" control?')&&this.get("controller").send("removeControl",this.get("control"))}}}),function($){function WPEditorTemplate(id){var newEditor=$(hiddenEditor);return newEditor.find("link").remove(),newEditor.html().replace(/msp-hidden/g,id)}MSPanel.MetaBoxComponent=Ember.Component.extend({tagName:"div",classNames:["msp-metabox"],layout:Ember.Handlebars.compile('<div class="msp-metabox-handle"><h3 class="msp-metabox-title">{{title}}</h3><div class="msp-metabox-toggle"></div></div>{{yield}}<div class="clear"> </div>')}),Ember.TEMPLATES["components/tabs-panel"]=Ember.Handlebars.compile("{{yield}}"),MSPanel.TabsPanelComponent=Ember.Component.extend({tagName:"div",attributeBindings:["id"],classNames:["msp-metabox msp-metabox-tabs"],didInsertElement:function(){this.$().avertaLiveTabs()}}),MSPanel.SwitchBoxComponent=Ember.Component.extend({classNames:["msp-switchbox"],offlable:"OFF",onlable:"ON",value:!1,layout:Ember.Handlebars.compile('<div class="msp-switch-cont"><span class="msp-switch-off">{{view.offlable}}</span><div class="msp-switch-handle"></div><span class="msp-switch-on">{{view.onlable}}</span></div>'),click:function(){var that=this;that.set("value",!that.get("value"))},update:function(){this.get("value")?this.$().addClass("switched"):this.$().removeClass("switched")}.observes("value").on("didInsertElement")}),MSPanel.AddDynamicTag=Ember.View.extend({classNames:["msp-add-dynamic-tags"],editorId:null,template:Ember.Handlebars.compile('<button {{action "addTag" target=view}} class="msp-add-btn"><span class="msp-ico msp-ico-whiteadd"></span></button><div class="msp-ddlist"></div>'),didInsertElement:function(){for(var select=$("<select></select>").appendTo(this.$(".msp-ddlist")).width(220),i=0,l=MSPanel.dynamicTags.length;i!==l;i++)select.append('<option value="'+MSPanel.dynamicTags[i].tag+'">'+MSPanel.dynamicTags[i].name+"</option>");this.set("select",select)},actions:{addTag:function(){var id=this.get("editorId");tinymce&&$("#wp-"+id+"-wrap").hasClass("tmce-active")?tinymce.get(id).execCommand("insertHTML",!1,this.get("select").val()):$("#"+id).insertAtCaret(this.get("select").val())}}});var hiddenEditor=jQuery("#mspHiddenEditor")[0].outerHTML,__tmc_msp_id=0;MSPanel.WPEditor=Ember.View.extend({classNames:["msp-wp-editor"],_id:null,template:null,tab:null,tabs:null,onInit:function(){var id="msp-wpeditor-"+__tmc_msp_id;this.set("_id",id),this.set("template",Ember.Handlebars.compile(WPEditorTemplate(id))),__tmc_msp_id++}.on("init"),didInsertElement:function(){var tabs=this.get("tabs");return Ember.isEmpty(tabs)?void this.createEditor():void $("#"+tabs).bind("avtTabChange",{that:this},this.refreshEditor)},refreshEditor:function(event,tab){var that=event.data.that;that.get("tab")===tab&&that.createEditor()},createEditor:function(){if(this.get("inited")!==!0){this.set("inited",!0);var id=this.get("_id"),that=this;if(window.tinymce){var settings=$.extend({},window.tinyMCEPreInit.mceInit["msp-hidden"]||{});settings.forced_root_block="",settings.force_br_newlines=!0,settings.force_p_newlines=!1,settings.wpautop=!1,"3"==tinyMCE.majorVersion?(settings.body_class=settings.elements=id,settings.setup=function(ed){ed.onInit.add(function(){that.initEditor(tinyMCE.getInstanceById(id))})},tinymce.init(settings)):"4"==tinyMCE.majorVersion&&(settings.body_class="content post-type-post post-status-auto-draft post-format-standard",settings.selector="#"+id,settings.setup=function(ed){ed.on("init",function(){that.initEditor(tinyMCE.get(id))})},tinymce.init(settings))}var qtags,qtagSettings=$.extend({},window.tinyMCEPreInit.qtInit["msp-hidden"]||{});qtagSettings.id=id,"function"==typeof QTags&&(qtags=quicktags(qtagSettings),QTags.buttonsInitDone=!1,QTags._buttonsInit(),that.set("qtags",qtags),switchEditors.go(id,"html"),this.$("textarea#"+this.get("_id")).on("change keyup paste",function(){that.set("value",$(this).val())
|
10 |
+
}))}},initEditor:function(mce){function internalUpdate(){that.set("internalChange",!0),that.set("value",mce.getContent()),that.set("internalChange",!1)}var id=this.get("_id"),that=(this.get("value"),this);this.$(".wp-editor-wrap").on("mousedown",function(){wpActiveEditor=id}),"3"==tinyMCE.majorVersion?(mce.onChange.add(internalUpdate),mce.onKeyUp.add(internalUpdate)):"4"==tinyMCE.majorVersion&&(mce.on("change",internalUpdate),mce.on("keyup",internalUpdate)),this.$().click(internalUpdate),setTimeout(function(){switchEditors.go(id,"html"),switchEditors.go(id,"tmce")},100),this.set("mce",mce),this.onValueChanged()},onValueChanged:function(){if(this.get("inited")){var value=this.get("value");if(this.$("textarea#"+this.get("_id")).val(value),this.get("internalChange"))return void this.set("internalChange",!1);var mce=this.get("mce");Ember.isEmpty(mce)||null==value?null==value&&mce.setContent(" "):mce.setContent(value)}}.observes("value"),willDestroyElement:function(){if(this.get("inited")){window.tinymce&&tinymce.remove(this.get("_id"));var qtags=this.get("qtags");qtags&&($(qtags.toolbar).remove(),qtags.toolbar=null,qtags=null,QTags.instances[this.get("_id")]&&delete QTags.instances[this.get("_id")],this.$("textarea#"+this.get("_id")).remove());var tabs=this.get("tabs");Ember.isEmpty(tabs)||$("#"+tabs).unbind("avtTabChange",this.refreshEditor)}}}),jQuery.ui&&jQuery.ui.spinner&&(jQuery.ui.spinner.prototype._events.mousewheel=function(event,delta){if(delta&&this.element.is(":focus")){if(!this.spinning&&!this._start(event))return!1;this._spin((delta>0?1:-1)*this.options.step,event),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(event)},100),event.preventDefault()}}),MSPanel.NumberInputView=Ember.View.extend({step:1,min:0,tagName:"input",attributeBindings:["type"],lastValue:null,type:"text",didInsertElement:function(){var that=this,input=this.$(),updateValue=function(){var value=input.spinner("value");that.set("internalChange",!0),isNaN(value)||null==value?that.set("value",void 0):that.set("value",parseFloat(value))};input.on("change",updateValue).spinner({step:this.get("step"),numberFormat:"n",min:this.get("min"),max:this.get("max"),spin:updateValue,stop:updateValue}).spinner("value",this.get("value"))},onValueChanged:function(){return this.get("internalChange")?void this.set("internalChange",!1):void this.$().spinner("value",this.get("value"))}.observes("value")}),Ember.Handlebars.helper("number-input",MSPanel.NumberInputView),MSPanel.ColorPickerComponent=Ember.Component.extend({tagName:"input",classNames:"msp-color-picker",value:null,didInsertElement:function(){var that=this;this.$().spectrum({color:this.get("value"),allowEmpty:!0,showInput:!0,showAlpha:!0,clickoutFiresChange:!0,preferredFormat:"hex6",change:function(color){null===color?that.set("value",null):that.set("value",color.toString())}})},willDestroyElement:function(){this.$().spectrum("destroy")},onValueChanged:function(){this.$().spectrum("set",this.get("value"))}.observes("value")}),MSPanel.DropdwonListComponent=Ember.Component.extend({tagName:"div",classNames:["msp-ddlist"],layout:Ember.Handlebars.compile("<select>{{yield}}</select>"),value:null,width:100,didInsertElement:function(){var that=this;this.$("select").on("change",function(){var option=that.$("select option:selected");that.set("value",option.attr("value"))}).width(this.get("width")),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$("select").val(this.get("value"))}.observes("value")}),MSPanel.MultiDropdwonListComponent=Ember.Component.extend({tagName:"div",classNames:["msp-ddlist","msp-ddlist-multiselect"],layout:Ember.Handlebars.compile("<select {{bind-attr size=view.size}} multiple>{{yield}}</select>"),value:null,width:100,size:7,didInsertElement:function(){var that=this;this.$("select").on("change",function(){that.set("value",$(this).val())}).width(this.get("width")),this.onValueChanged()},onValueChanged:function(){Ember.isEmpty(this.get("value"))||this.$("select").val(this.get("value"))}.observes("value")}),MSPanel.GoogleFontsComponent=Ember.Component.extend({tagName:"div",classNames:["msp-ddlist","msp-gfonts-select"],defaultTemplate:Ember.Handlebars.compile('<select><option value="--" selected>Loading fonts..</option></select>'),value:null,variants:null,width:210,didInsertElement:function(){var that=this;GFonts.getList(function(){that.$("select").html('<option value="--" selected>-- select --</option>'+GFonts.generateSelectList()),that.onValueChanged(),that.$("select").trigger("change")}),this.$("select").on("change",function(){var option=that.$("select option:selected");"--"===option.val()?(that.set("value",void 0),that.set("variants",void 0)):(that.set("value",option.attr("value")),that.set("variants",option.attr("data-variants")))}).width(this.get("width")),that.onValueChanged()},onValueChanged:function(){this.$("select").val(Ember.isEmpty(this.get("value"))?"--":this.get("value"))}.observes("value")}),MSPanel.GoogleFontWeightsComponent=Ember.Component.extend({tagName:"div",classNames:["msp-ddlist","msp-gfonts-select msp-gfonts-weight"],defaultTemplate:Ember.Handlebars.compile("<select></select>"),variants:null,value:null,width:120,didInsertElement:function(){var that=this;this.$("select").on("change",function(){var option=that.$("select option:selected");return 0===option.length?void that.$("select").val("normal"):void("--"===option.val()?that.set("value",null):that.set("value",option.attr("value")))}).width(this.get("width")),that.updateVariants()},updateVariants:function(){var variants=this.get("variants");if(Ember.isEmpty(variants))this.$("select").html("<option>Select font</option>");else{var options="",value=this.get("value");variants=variants.split(",");for(var i=0,l=variants.length;i!==l;i++)-1===variants[i].indexOf("italic")&&(options+="regular"===variants[i]?'<option value="normal"'+("normal"===value?"selected":"")+">Normal</option>":'<option value="'+variants[i]+'"'+(value===variants[i]?"selected":"")+">"+variants[i]+"</option>");this.$("select").html(options).trigger("change")}}.observes("variants")}),MSPanel.CodeMirrorComponent=Ember.Component.extend({classNames:["msp-codemirror"],width:250,height:200,mode:"css",tab:null,tabs:null,layout:Ember.Handlebars.compile("<textarea>{{yield}}</textarea>"),didInsertElement:function(){this.$().width(this.get("width")).height(this.get("height"));var that=this,editor=CodeMirror.fromTextArea(this.$(">textarea")[0],{lineNumbers:!0,mode:this.get("mode")});editor.on("change",function(){that.set("internalChange",!0),that.set("value",editor.getValue())}),this.set("editor",editor);var value=this.get("value");Ember.isEmpty(value)||editor.setValue(value);var tabs=this.get("tabs");Ember.isEmpty(tabs)||$("#"+tabs).bind("avtTabChange",{that:this},this.refreshEditor)},onValueChanged:function(){return this.get("internalChange")===!0?void this.set("internalChange",!1):(this.get("editor").setValue(this.get("value")),void this.set("internalChange",!1))}.observes("value"),refreshEditor:function(event,tab){var that=event.data.that;that.get("tab")===tab&&that.get("editor").refresh()},willDestroyElement:function(){var tabs=this.get("tabs");Ember.isEmpty(tabs)||$("#"+tabs).unbind("avtTabChange",this.refreshEditor);var editor=this.get("editor");editor.toTextArea(),editor=null,this.set("editor",null)}});for(var patterns='<div class="msp-pattern-prev ms-pattern"></div>',i=1;30>=i;i++)patterns+='<div class="msp-pattern-prev ms-pattern ms-patt-'+i+'" data-pattern="ms-patt-'+i+'" style="'+(i>15?"background-color:black;":"")+'"></div>';MSPanel.PatternPickerComponent=Ember.Component.extend({tagName:"div",classNames:["msp-pattern-picker"],value:null,patternBoxIsOpen:!1,layout:Ember.Handlebars.compile('<div class="msp-pattern-control sp-replacer sp-light"><div {{bind-attr class=":ms-pattern-preview :ms-pattern view.value"}}></div><div class="sp-dd">▼</div></div><div class="msp-patterns-box">'+patterns+"</div>"),didInsertElement:function(){this.$(".msp-pattern-control").on("click",{that:this},this.togglePatternbox),$(document).on("click",{that:this},this.closePatternbox),this.$(".msp-patterns-box").css("display","none").on("click",function(e){e.stopPropagation()}).find(".ms-pattern").on("click",{that:this},this.selectPattern)},togglePatternbox:function(e){var that=e.data.that;e.stopPropagation(),that.get("patternBoxIsOpen")&&that.closePatternbox(e),that.$(".msp-patterns-box").css("display",""),that.set("patternBoxIsOpen",!0)},closePatternbox:function(e){var that=e.data.that;that.get("patternBoxIsOpen")&&(that.$(".msp-patterns-box").css("display","none"),that.set("patternBoxIsOpen",!1))},selectPattern:function(e){e.stopPropagation();var that=e.data.that;that.set("value",$(this).data("pattern"))},willDestroyElement:function(){this.$(".msp-patterns-box").off("click",this.togglePatternbox).find(".ms-pattern").off("click"),$(document).off("click",this.closePatternbox)}})}(jQuery),MSPanel.pushData=null,MSPanel.ApplicationController=Ember.Controller.extend({isFlickr:"flickr"===__MSP_TYPE,isFacebook:"facebook"===__MSP_TYPE,isPost:"post"===__MSP_TYPE,isWcproduct:"wc-product"===__MSP_TYPE,sliderId:MSPanel.SliderID,isSending:!1,statusMsg:"",hasError:!1,onInit:function(){window.$||(window.$=jQuery.noConflict()),MSPanel.Settings.find(),MSPanel.Slide.find(),MSPanel.Layer.find(),MSPanel.Style.find(),MSPanel.Effect.find(),MSPanel.PresetStyle.find(),MSPanel.PresetEffect.find(),MSPanel.Control.find(),MSPanel.Callback.find(),MSPanel.ButtonStyle.find(),this.set("disableControls",MSPanel.Settings.find(0).get("disableControls"));var that=this;MSPanel.pushData=function(){that.prepareData()},MSPanel.createButton=this.createButton,"wc-product"===__MSP_TYPE&&null==__MSP_POST&&null!=__WC_INSTALL_URL&&(this.set("hasError",!0),this.set("errorTemplate","wooc-error"),this.set("wooLink",__WC_INSTALL_URL)),this.generateButtonStyles(),this.set("shortCode",'[masterslider id="'+this.get("sliderId")+'"]'),this.set("phpFunction","<?php masterslider("+this.get("sliderId")+"); ?>"),jQuery("#panelLoading").remove(),window._msp_init_timeout&&(å,clearTimeout(window._msp_init_timeout))}.on("init"),prepareData:function(){var fonts={},font_str="";MSPanel.Style.find().forEach(function(record){var font=record.get("fontFamily"),weight=record.get("fontWeight");Ember.isEmpty(font)||(fonts[font]||(fonts[font]=[]),"normal"===weight&&(weight="regular"),Ember.isEmpty(weight)||-1!==fonts[font].indexOf(weight)||fonts[font].push(weight))});for(var font in fonts)font_str+=font.replace(/\s/,"+")+":"+fonts[font].join(",")+"|";MSPanel.Settings.find(1).set("usedFonts",font_str.slice(0,-1)),this.saveRecords(MSPanel.Settings.find()),this.saveRecords(MSPanel.Slide.find()),this.saveRecords(MSPanel.Layer.find()),this.saveRecords(MSPanel.Style.find()),this.saveRecords(MSPanel.Effect.find()),this.saveRecords(MSPanel.PresetStyle.find()),this.saveRecords(MSPanel.PresetEffect.find()),this.saveRecords(MSPanel.Control.find()),this.saveRecords(MSPanel.Callback.find()),this.saveRecords(MSPanel.ButtonStyle.find())},generateButtonStyles:function(){var styles=MSPanel.ButtonStyle.find(),css="",$styleElement=$("#msp-buttons");styles.forEach(function(style){css+="."+style.get("className")+" {"+style.get("normal")+"}\n."+style.get("className")+":hover {"+style.get("hover")+"}\n."+style.get("className")+":active {"+style.get("active")+"}\n"}),0===$styleElement.length?$styleElement=$('<style id="msp-buttons"></style>').text(css).appendTo($("head")):$styleElement.text(css)},actions:{saveAll:function(){this.prepareData(),this.sendData()},showPreview:function(event){window.lunchMastersliderPreview&&lunchMastersliderPreview(event)}},saveRecords:function(records){records.forEach(function(record){record.save()})},sendData:function(){this.set("statusMsg",__MSP_LAN.ap_001),this.set("isSending",!0);var that=this;jQuery.post(__MS.ajax_url,{action:"msp_panel_handler",nonce:jQuery("#msp-main-wrapper").data("nonce"),msp_data:B64.encode(JSON.stringify(MSPanel.data)),preset_style:B64.encode(JSON.stringify(MSPanel.PSData)),preset_effect:B64.encode(JSON.stringify(MSPanel.PEData)),buttons:B64.encode(JSON.stringify(MSPanel.PBData)),slider_id:MSPanel.SliderID},function(res){that.set("statusMsg",res.message),that.set("isSending",!1)})},createButton:function(normal,hover,active,style,size){var newPreset=MSPanel.ButtonStyle.create({normal:normal,hover:hover,active:active,size:size,style:style});newPreset.save(),newPreset.set("className","msp-preset-btn-"+newPreset.get("id")),newPreset.save()}}),MSPanel.SettingsController=Ember.ObjectController.extend({customSlider:window.__MSP_TYPE&&"custom"===window.__MSP_TYPE,sliderSkins:__MSP_SKINS,needs:["application","controls"],showAutoHeight:!1,showNearbyNum:!1,showWrapperWidth:!1,preloadMethod:null,setup:function(){var preload=this.get("preload");"all"===preload||"-1"===preload?this.set("preloadMethod",preload):this.set("preloadMethod","nearby"),this.set("draftMSTemplate",this.get("msTemplate"))},sliderLayoutChanged:function(){var layout=this.get("layout");"fullscreen"===layout||"autofill"===layout?(this.set("showAutoHeight",!1),this.set("autoHeight",!1)):this.set("showAutoHeight",!0),this.set("showWrapperWidth","boxed"===layout||"partialview"===layout),this.set("showFSMargin","fullscreen"===layout)}.observes("layout").on("setup"),preloadSetup:function(){var preloadMethod=this.get("preloadMethod");if("nearby"===preloadMethod){this.set("showNearbyNum",!0);var preload=this.get("preload");("all"===preload||"-1"===preload)&&this.set("preload","0")}else this.set("showNearbyNum",!1),this.set("preload",preloadMethod)}.observes("preloadMethod").on("setup")}),MSPanel.SlidesController=Ember.ArrayController.extend({customSlider:window.__MSP_TYPE&&"custom"===window.__MSP_TYPE,_order:-1,bgImgSelector:null,sortProperties:["order"],stylesController:null,effectsController:null,buttonsController:null,layersList:[],layersController:null,mainView:null,isFirst:!0,currentSlide:null,setup:function(){if(Ember.isEmpty(this.get("sliderSettings.type"))&&this.set("sliderSettings.type",__MSP_TYPE),this.set("sliderSettings.sliderId",MSPanel.SliderID),0!==this.get("length")){var slide=this.get("firstObject");this.set("currentSlide",slide),this.updateOrder()}},slide:function(){return this.get("currentSlide")}.property("currentSlide"),duplicateSlide:function(slide){var slideProp=slide.toJSON();delete slideProp.id;var newSlide=MSPanel.Slide.create(slideProp);newSlide.set("order",slide.get("order")+1),this.forEach(function(_slide){var slide_order=_slide.get("order"),nslide_order=newSlide.get("order");slide_order>=nslide_order&&_slide!==newSlide&&_slide.set("order",slide_order+1)}),newSlide.save(),this.updateOrder()},updateSlidesSort:function(indexes){this.beginPropertyChanges(),this.forEach(function(slide){slide.set("order",indexes[slide.get("id")])},this),this.endPropertyChanges(),this.set("_order",this.get("lastObject.order"))},updateOrder:function(){var i=0;this.forEach(function(slide){slide.set("order",i++)}),this.set("_order",i-1)},removeSlide:function(slide){slide.deleteRecord(),0!==this.get("length")&&(this.send("select",this.get("firstObject")),this.updateOrder())},onImageSelect:function(){var uploaderFrame=this.get("uploaderFrame"),selection=uploaderFrame.state().get("selection"),self=this;selection.map(function(attachment){attachment=attachment.toJSON(),self.generateSlide(attachment,attachment.url,(attachment.sizes.thumbnail||attachment.sizes.full).url)}),this.send("select",this.get("lastObject"))},generateSlide:function(attachment,bg,thumb){var slide=MSPanel.Slide.create({order:this.get("_order")+1,bg:bg,bgThumb:thumb,bgAlt:attachment.alt});this.set("_order",this.get("_order")+1),slide.save(),this.updateOrder()},actions:{addSlides:function(){var uploaderFrame=this.get("uploaderFrame");Ember.isEmpty(uploaderFrame)&&(uploaderFrame=wp.media.frames.frame=wp.media({title:__MSP_LAN.slc_001||"Select background image for new slide. (Multiple selection is available)",multiple:!0,frame:"select",library:{type:"image"},button:{text:__MSP_LAN.slc_002||"Create Slide(s)"}}),uploaderFrame.on("select",$.proxy(this.onImageSelect,this)),this.set("uploaderFrame",uploaderFrame)),uploaderFrame.open()},newSlide:function(){var slide=MSPanel.Slide.create({order:this.get("_order")+1});this.set("currentSlide",slide),this.set("_order",this.get("_order")+1),slide.save(),this.updateOrder()},select:function(slide){slide!==this.get("currentSlide")&&this.set("currentSlide",slide)}}}),MSPanel.ControlsController=Ember.ArrayController.extend({needs:"application",controls:[{used:!1,label:__MSP_LAN.cc_001,value:"arrows"},{used:!1,label:__MSP_LAN.cc_002,value:"timebar"},{used:!1,label:__MSP_LAN.cc_003,value:"bullets"},{used:!1,label:__MSP_LAN.cc_004,value:"circletimer"},{used:!1,label:__MSP_LAN.cc_005,value:"scrollbar"},{used:!1,label:__MSP_LAN.cc_006,value:"slideinfo"},{used:!1,label:__MSP_LAN.cc_007,value:"thumblist"}],selectedControl:null,availableControls:[],noMore:!1,currentControl:null,setup:function(){var that=this;this.forEach(function(control){that.findControlObj(control.get("name")).used=!0}),this.set("availableControls",this.findAvailableControls())},actions:{addControl:function(){var control,controlName=this.get("selectedControl"),controlObj=this.findControlObj(controlName);control=MSPanel.Control.create(this.getDefaultValues(controlName)),control.set("label",controlObj.label),controlObj.used=!0,this.set("availableControls",this.findAvailableControls()),control.save(),this.set("currentControl",control)},removeControl:function(control){this.findControlObj(control.get("name")).used=!1,this.set("availableControls",this.findAvailableControls()),control.deleteRecord(),this.set("currentControl",this.get("firstObject")),this.send("showControlOptions")},showControlOptions:function(){var currentControl=this.get("currentControl");Ember.isEmpty(currentControl)?this.set("controlOptions","empty-template"):this.set("controlOptions",currentControl.get("name")+"-options")}},findControlObj:function(control){for(var controls=this.get("controls"),i=0,l=controls.length;i!==l;i++)if(controls[i].value===control)return controls[i];return null},findAvailableControls:function(){for(var avc=[],controls=this.get("controls"),i=0,l=controls.length;i!==l;i++)controls[i].used||avc.push(controls[i]);return this.set("noMore",0===avc.length),this.set("selectedControl",avc[0]?avc[0].value:null),avc},getDefaultValues:function(control){var values={name:control};switch(values.inset=!("slideinfo"===control||"thumblist"===control),control){case"timebar":values.align="bottom",values.color="#FFFFFF",values.autoHide=!1,values.width=4;break;case"bullets":values.align="bottom",values.dir="h",values.margin=10,values.space=6;break;case"circletimer":values.color="#A2A2A2",values.stroke=10,values.radius=4,values.autoHide=!1;break;case"scrollbar":values.align="top",values.dir="h",values.color="#3D3D3D",values.margin=10,values.autoHide=!1,values.width=4;break;case"slideinfo":values.align="bottom",values.margin=10,values.autoHide=!1;break;case"thumblist":values.align="bottom",values.space=5,values.width=100,values.height=80,values.margin=10,values.fillMode="fill",values.autoHide=!1}return values}}),MSPanel.CallbacksController=Ember.ArrayController.extend({callbacks:[{used:!1,label:__MSP_LAN.cb_011,value:"INIT"},{used:!1,label:__MSP_LAN.cb_001,value:"CHANGE_START"},{used:!1,label:__MSP_LAN.cb_002,value:"CHANGE_END"},{used:!1,label:__MSP_LAN.cb_003,value:"WAITING"},{used:!1,label:__MSP_LAN.cb_004,value:"RESIZE"},{used:!1,label:__MSP_LAN.cb_005,value:"VIDEO_PLAY"},{used:!1,label:__MSP_LAN.cb_006,value:"VIDEO_CLOSE"},{used:!1,label:__MSP_LAN.cb_007,value:"SWIPE_START"},{used:!1,label:__MSP_LAN.cb_008,value:"SWIPE_MOVE"},{used:!1,label:__MSP_LAN.cb_009,value:"SWIPE_END"}],availableCallbacks:[],noMore:!1,selectedCallback:null,setup:function(){var that=this;this.forEach(function(callback){that.findCallbackObj(callback.get("name")).used=!0}),this.set("availableCallbacks",this.findAvailableCallbacks())},actions:{addCallback:function(){var callback,callbackName=this.get("selectedCallback"),callbackObj=this.findCallbackObj(callbackName);callback=MSPanel.Callback.create({name:callbackObj.value,label:callbackObj.label}),callbackObj.used=!0,this.set("availableCallbacks",this.findAvailableCallbacks()),callback.save()},removeCallback:function(callback){confirm(__MSP_LAN.cb_010.jfmt(callback.get("label")))&&(this.findCallbackObj(callback.get("name")).used=!1,this.set("availableCallbacks",this.findAvailableCallbacks()),callback.deleteRecord())}},findCallbackObj:function(callback){for(var callbacks=this.get("callbacks"),i=0,l=callbacks.length;i!==l;i++)if(callbacks[i].value===callback)return callbacks[i];return null},findAvailableCallbacks:function(){for(var avc=[],callbacks=this.get("callbacks"),i=0,l=callbacks.length;i!==l;i++)callbacks[i].used||avc.push(callbacks[i]);return this.set("noMore",0===avc.length),this.set("selectedCallback",avc[0]?avc[0].value:null),avc}});
|
admin/views/slider-panel/js/msp.required.js
CHANGED
@@ -1,45 +1,38 @@
|
|
|
|
|
|
|
|
|
|
1 |
/*!
|
2 |
* @overview Averta JavaScript Libraries
|
3 |
* @copyright Copyright 2014 Averta Ltd.
|
4 |
* http://www.averta.net
|
5 |
*/
|
6 |
-
window.averta={},function(n){function f(){var t,n,i;if("result"in arguments.callee)return arguments.callee.result;t=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,n=document.getElementsByTagName("script")[0];for(i in n.style)if(t.test(i))return arguments.callee.result=i.match(t)[0];return arguments.callee.result="WebkitOpacity"in n.style?"Webkit":"KhtmlOpacity"in n.style?"Khtml":""}function i(n){var u=document.body||document.documentElement,r=u.style,t=n,i;if(typeof r[t]=="string")return!0;for(v=["Moz","Webkit","Khtml","O","ms"],t=t.charAt(0).toUpperCase()+t.substr(1),i=0;i<v.length;i++)if(typeof r[v[i]+t]=="string")return!0;return!1}function e(){return i("transition")}function r(){return i("transform")}function o(){var n,t,u,i;if(!r())return!1;n=document.createElement("p"),u={WebkitTransform:"-webkit-transform",OTransform:"-o-transform",MSTransform:"-ms-transform",MozTransform:"-moz-transform",Transform:"transform"},document.body.insertBefore(n,null);for(i in u)n.style[i]!==undefined&&(n.style[i]="translate3d(1px,1px,1px)",t=window.getComputedStyle(n).getPropertyValue(u[i]));return document.body.removeChild(n),t!=null&&t.length>0&&t!=="none"}var t,u;window.package=function(n){window[n]||(window[n]={})},t={Moz:"-moz-",Webkit:"-webkit-",Khtml:"-khtml-",O:"-o-",ms:"-ms-",Icab:"-icab-"},n(document).ready(function(){window._jcsspfx=f(),window._csspfx=t[window._jcsspfx],window._cssanim=e(),window._css3d=o(),window._css2d=r(),window._mobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),window._touch="ontouchstart"in document}),window.parseQueryString=function(n){var t={};return n.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(n,i,r,u){t[i]=u}),t},u=50/3,window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,u)}}()),window.getComputedStyle||(window.getComputedStyle=function(n){return this.el=n,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(){return arguments[2].toUpperCase()})),n.currentStyle[t]?n.currentStyle[t]:null},n.currentStyle}),jQuery&&(n.jqLoadFix=function(){if(this.complete){var t=this;setTimeout(function(){n(t).load()},1)}},jQuery.uaMatch=jQuery.uaMatch||function(n){n=n.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:t[1]||"",version:t[2]||"0"}},jQuery.browser||(matched=jQuery.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser),n.fn.preloadImg=function(t,i){return this.each(function(){var u=n(this),f=this,r=new Image;r.onload=function(n){u.attr("src",t),n.width=r.width,n.height=r.height,setTimeout(function(){i.call(f,n)},50),r=null},r.src=t}),this}),window.parseTransform=function(n){var i,u,r,f,t;if(n===null)return{};for(n=n.replace(/\s+/g,""),i=n.split(")"),i.pop(),u={},r=0,f=i.length;r<f;++r)t=i[r],u[t.slice(0,t.indexOf("("))]=t.slice(t.indexOf("(")+1).split(",");return u},window.convertEaseName=function(n){if(n==="linear")return Linear.easeNone;var t=n.indexOf("InOut")!==-1,i=n.indexOf("In")!==-1;return t?window[n.slice(9)].easeInOut:i?window[n.slice(6)].easeIn:window[n.slice(7)].easeOut},jQuery.fn.extend({insertAtCaret:function(n){return this.each(function(){var i;if(document.selection)this.focus(),i=document.selection.createRange(),i.text=n,this.focus();else if(this.selectionStart||this.selectionStart=="0"){var t=this.selectionStart,r=this.selectionEnd,u=this.scrollTop;this.value=this.value.substring(0,t)+n+this.value.substring(r,this.value.length),this.focus(),this.selectionStart=t+n.length,this.selectionEnd=t+n.length,this.scrollTop=u}else this.value+=n,this.focus()})}})}(jQuery),typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t}),function(n){var t={init:function(t,i){var r=this;r.options=n.extend({},n.fn.avertaLiveTabs.defaultOptions,i||{}),r.$el=n(t),r.el=t,r.$tabs=r.$el.find(r.options.tabs),r.$contents=r.$el.find(r.options.contents),r.setup()},setup:function(){var n=this,t,i;n.$tabs.on("click",{self:n},n.onTabClicked);n.options.enableHash&&window.location.hash!==""?(i=window.location.hash.substring(1),t=n.getTabById(i)):t=n.$tabs.filter("."+n.options.tabsActiveClass),t=t.length?t:n.$tabs.first(),t.trigger("click",!0)},onTabClicked:function(t,i){t.preventDefault();var r=t.data.self,f=n(this),e,u;(i||!f.hasClass("active"))&&(r.$tabs.removeClass(r.options.tabsActiveClass),f.addClass(r.options.tabsActiveClass),r.$contents.hide(),r.options.connectType=="id"?(u=r.getIdByTab(f),e=r.getContentById(u)):e=r.$contents.eq(f.index()),e.fadeIn(r.options.duration),r.options.updateHash&&(u=r.getIdByTab(f),u=u?u+r.options.hashSuffix:"",window.history&&window.history.pushState?window.history.pushState(null,null,window.location.href.split("#")[0]+"#"+u):window.location.hash=u),r.$el.trigger("avtTabChange",e.attr("id")))},getTabById:function(n){n=n.split(this.options.hashSuffix)[0];var t=this.$tabs.find('[href="#'+n+'"]').eq(0);return t.length||(t=this.$tabs.find('[href="'+n+'"]').eq(0)),t.length?t.parent():t},getContentById:function(n){return this.$contents.filter("#"+n)},getIdByTab:function(n){var t=n.find("[href]").eq(0);return t.length?t.attr("href"):!1}};n.fn.avertaLiveTabs=function(n){return this.each(function(){var i=Object.create(t);i.init(this,n)})},n.fn.avertaLiveTabs.defaultOptions={tabs:"ul.tabs > li",tabsActiveClass:"active",contents:"ul.tabs-content > li",contentsActiveClass:"active",transition:"fade",duration:"500",connectType:"index",enableHash:!1,updateHash:!1,hashSuffix:"-tab"}}(jQuery),function(){"use strict";window.MSAligner=function(n,t,i){this.$container=t,this.$img=i,this.type=n||"stretch",this.widthOnly=!1,this.heightOnly=!1};var n=MSAligner.prototype;n.init=function(n,t){this.baseWidth=n,this.baseHeight=t,this.imgRatio=n/t,this.imgRatio2=t/n;switch(this.type){case"tile":this.$container.css("background-image","url("+this.$img.attr("src")+")"),this.$img.detach();break;case"center":this.$container.css("background-image","url("+this.$img.attr("src")+")"),this.$container.css({backgroundPosition:"center center",backgroundRepeat:"no-repeat"}),this.$img.detach();break;case"stretch":this.$img.css({width:"100%",height:"100%"});break;case"fill":case"fit":this.needAlign=!0,this.align()}},n.align=function(){if(this.needAlign){var n=this.$container.width(),t=this.$container.height(),i=n/t;this.type=="fill"?this.imgRatio<i?(this.$img.width(n),this.$img.height(n*this.imgRatio2)):(this.$img.height(t),this.$img.width(t*this.imgRatio)):this.type=="fit"&&(this.imgRatio<i?(this.$img.height(t),this.$img.width(t*this.imgRatio)):(this.$img.width(n),this.$img.height(n*this.imgRatio2))),this.setMargin()}},n.changeType=function(n){this.reset(),this.type=n,this.reinit()},n.reinit=function(){this.init(this.baseWidth,this.baseHeight)},n.reset=function(){this.type==="center"||this.type==="tile"?(this.$container.css({"background-image":"",backgroundPosition:"",backgroundRepeat:""}),this.$img.appendTo(this.$container)):this.$img.css({width:"",height:"","margin-top":"","margin-left":""})},n.setMargin=function(){var n=this.$container.width(),t=this.$container.height();this.$img.css("margin-top",(t-this.$img[0].offsetHeight)/2+"px"),this.$img.css("margin-left",(n-this.$img[0].offsetWidth)/2+"px")}}();
|
7 |
-
/*!
|
8 |
* Custom DropDown plugin by PC
|
9 |
* http://designwithpc.com/Plugins/ddslick
|
10 |
* Author: PC
|
11 |
*/
|
12 |
-
(function(n){function i(n,t){var r=n.data("ddslick"),e=n.find(".dd-selected"),h=e.siblings(".dd-selected-value"),l=n.find(".dd-options"),a=e.siblings(".dd-pointer"),o=n.find(".dd-option").eq(t),c=o.closest("li"),f=r.settings,i=r.settings.data[t];n.find(".dd-option").removeClass("dd-option-selected"),o.addClass("dd-option-selected"),r.selectedIndex=t,r.selectedItem=c,r.selectedData=i,f.showSelectedHTML?e.html((i.imageSrc?'<img class="dd-selected-image'+(f.imagePosition=="right"?" dd-image-right":"")+'" src="'+i.imageSrc+'" />':"")+(i.text?'<label class="dd-selected-text">'+i.text+"<\/label>":"")+(i.description?'<small class="dd-selected-description dd-desc'+(f.truncateDescription?" dd-selected-description-truncated":"")+'" >'+i.description+"<\/small>":"")):e.html(i.text),h.val(i.value),r.original.val(i.value),n.data("ddslick",r),u(n),s(n),typeof f.onSelected=="function"&&f.onSelected.call(this,r)}function r(t){var r=t.find(".dd-select"),i=r.siblings(".dd-options"),u=r.find(".dd-pointer"),f=i.is(":visible");n(".dd-click-off-close").not(i).slideUp(50),n(".dd-pointer").removeClass("dd-pointer-up"),f?(i.slideUp("fast"),u.removeClass("dd-pointer-up")):(i.slideDown("fast"),u.addClass("dd-pointer-up")),h(t)}function u(n){n.find(".dd-options").slideUp(50),n.find(".dd-pointer").removeClass("dd-pointer-up").removeClass("dd-pointer-up")}function s(n){var t=n.find(".dd-select").css("height"),i=n.find(".dd-selected-description"),r=n.find(".dd-selected-image");i.length<=0&&r.length>0&&n.find(".dd-selected-text").css("lineHeight",t)}function h(t){t.find(".dd-option").each(function(){var i=n(this),r=i.css("height"),u=i.find(".dd-option-description"),f=t.find(".dd-option-image");u.length<=0&&f.length>0&&i.find(".dd-option-text").css("lineHeight",r)})}n.fn.ddslick=function(i){if(t[i])return t[i].apply(this,Array.prototype.slice.call(arguments,1));if(typeof i!="object"&&i)n.error("Method "+i+" does not exists.");else return t.init.apply(this,arguments)};var t={},f={data:[],keepJSONItemsOnTop:!1,width:260,height:null,background:"#eee",selectText:"",defaultSelectedIndex:null,truncateDescription:!0,imagePosition:"left",showSelectedHTML:!0,clickOffToClose:!0,onSelected:function(){}},e='<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"><\/a><span class="dd-pointer dd-pointer-down"><\/span><\/div>',o='<ul class="dd-options"><\/ul>';t.init=function(t){var t=n.extend({},f,t);return this.each(function(){var u=n(this),v=u.data("ddslick"),y,c,h,f,s,l,a;if(!v){f=[],y=t.data,u.find("option").each(function(){var t=n(this),i=t.data();f.push({text:n.trim(t.text()),value:t.val(),selected:t.is(":selected"),description:i.description,imageSrc:i.imagesrc})}),t.keepJSONItemsOnTop?n.merge(t.data,f):t.data=n.merge(f,t.data),c=u,h=n('<div id="'+u.attr("id")+'"><\/div>'),u.replaceWith(h),u=h,u.addClass("dd-container").append(e).append(o),f=u.find(".dd-select"),s=u.find(".dd-options"),s.css({width:t.width}),f.css({width:t.width,background:t.background}),u.css({width:t.width}),t.height!=null&&s.css({height:t.height,overflow:"auto"}),n.each(t.data,function(n,i){i.selected&&(t.defaultSelectedIndex=n),s.append('<li><a class="dd-option">'+(i.value?' <input class="dd-option-value" type="hidden" value="'+i.value+'" />':"")+(i.imageSrc?' <img class="dd-option-image'+(t.imagePosition=="right"?" dd-image-right":"")+'" src="'+i.imageSrc+'" />':"")+(i.text?' <label class="dd-option-text">'+i.text+"<\/label>":"")+(i.description?' <small class="dd-option-description dd-desc">'+i.description+"<\/small>":"")+"<\/a><\/li>")}),l={settings:t,original:c,selectedIndex:-1,selectedItem:null,selectedData:null},u.data("ddslick",l),t.selectText.length>0&&t.defaultSelectedIndex==null?u.find(".dd-selected").html(t.selectText):(a=t.defaultSelectedIndex!=null&&t.defaultSelectedIndex>=0&&t.defaultSelectedIndex<t.data.length?t.defaultSelectedIndex:0,i(u,a));u.find(".dd-select").on("click.ddslick",function(){r(u)});u.find(".dd-option").on("click.ddslick",function(){i(u,n(this).closest("li").index())});if(t.clickOffToClose){s.addClass("dd-click-off-close");u.on("click.ddslick",function(n){n.stopPropagation()});n("body").on("click",function(){n(".dd-click-off-close").slideUp(50).siblings(".dd-select").find(".dd-pointer").removeClass("dd-pointer-up")})}}})},t.select=function(t){return this.each(function(){t.index!==null&&i(n(this),t.index)})},t.open=function(){return this.each(function(){var t=n(this),i=t.data("ddslick");i&&r(t)})},t.close=function(){return this.each(function(){var t=n(this),i=t.data("ddslick");i&&u(t)})},t.destroy=function(){return this.each(function(){var t=n(this),i=t.data("ddslick"),r;i&&(r=i.original,t.removeData("ddslick").unbind(".ddslick").replaceWith(r))})}})(jQuery);
|
13 |
-
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
14 |
-
* Licensed under the MIT License (LICENSE.txt).
|
15 |
-
*
|
16 |
-
|
17 |
-
*
|
18 |
-
* Requires: jQuery 1.2.2+
|
19 |
-
*/
|
20 |
-
(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?module.exports=n:n(jQuery)})(function(n){function e(i){var r=i||window.event,y=h.call(arguments,1),o=0,e=0,f=0,l=0,a,v;if(i=n.event.fix(r),i.type="mousewheel","detail"in r&&(f=r.detail*-1),"wheelDelta"in r&&(f=r.wheelDelta),"wheelDeltaY"in r&&(f=r.wheelDeltaY),"wheelDeltaX"in r&&(e=r.wheelDeltaX*-1),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(e=f*-1,f=0),o=f===0?e:f,"deltaY"in r&&(f=r.deltaY*-1,o=f),"deltaX"in r&&(e=r.deltaX,f===0&&(o=e*-1)),f!==0||e!==0)return r.deltaMode===1?(a=n.data(this,"mousewheel-line-height"),o*=a,f*=a,e*=a):r.deltaMode===2&&(v=n.data(this,"mousewheel-page-height"),o*=v,f*=v,e*=v),l=Math.max(Math.abs(f),Math.abs(e)),(!t||l<t)&&(t=l,s(r,l)&&(t/=40)),s(r,l)&&(o/=40,e/=40,f/=40),o=Math[o>=1?"floor":"ceil"](o/t),e=Math[e>=1?"floor":"ceil"](e/t),f=Math[f>=1?"floor":"ceil"](f/t),i.deltaX=e,i.deltaY=f,i.deltaFactor=t,i.deltaMode=0,y.unshift(i,o,e,f),u&&clearTimeout(u),u=setTimeout(c,200),(n.event.dispatch||n.event.handle).apply(this,y)}function c(){t=null}function s(n,t){return r.settings.adjustOldDeltas&&n.type==="mousewheel"&&t%120==0}var o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],h=Array.prototype.slice,u,t,f,r;if(n.event.fixHooks)for(f=o.length;f;)n.event.fixHooks[o[--f]]=n.event.mouseHooks;r=n.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],e,!1);else this.onmousewheel=e;n.data(this,"mousewheel-line-height",r.getLineHeight(this)),n.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=i.length;n;)this.removeEventListener(i[--n],e,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(n(t)["offsetParent"in n.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0}},n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})});
|
21 |
-
/*! Spectrum Colorpicker v1.3.2
|
22 |
-
* License: MIT
|
23 |
-
* Author: Brian Grinstead
|
24 |
-
* https://github.com/bgrins/spectrum
|
25 |
-
* Requires: jQuery
|
26 |
-
*/
|
27 |
-
(function(n,t,r){function h(n,t,i){for(var e=[],f,r,o,s,h,u=0;u<n.length;u++)f=n[u],f?(r=tinycolor(f),o=r.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light",o+=tinycolor.equals(t,f)?" sp-thumb-active":"",s=v?"background-color:"+r.toRgbString():"filter:"+r.toFilter(),e.push('<span title="'+r.toRgbString()+'" data-color="'+r.toRgbString()+'" class="'+o+'"><span class="sp-thumb-inner" style="'+s+';" /><\/span>')):(h="sp-clear-display",e.push('<span title="No Color Selected" data-color="" style="background-color:transparent;" class="'+h+'"><\/span>'));return"<div class='sp-cf "+i+"'>"+e.join("")+"<\/div>"}function b(){for(var n=0;n<u.length;n++)u[n]&&u[n].hide()}function k(n,i){var r=t.extend({},a,n);return r.callbacks={move:o(r.move,i),change:o(r.change,i),show:o(r.show,i),hide:o(r.hide,i),beforeShow:o(r.beforeShow,i)},r}function d(e,o){function nu(){var n,i,r;if(c.showPaletteOnly&&(c.showPalette=!0),c.palette)for(vi=c.palette.slice(0),ei=t.isArray(vi[0])?vi:[vi],yi={},n=0;n<ei.length;n++)for(i=0;i<ei[n].length;i++)r=tinycolor(ei[n][i]).toRgbString(),yi[r]=!0;l.toggleClass("sp-flat",ct),l.toggleClass("sp-input-disabled",!c.showInput),l.toggleClass("sp-alpha-enabled",c.showAlpha),l.toggleClass("sp-clear-enabled",at),l.toggleClass("sp-buttons-disabled",!c.showButtons),l.toggleClass("sp-palette-disabled",!c.showPalette),l.toggleClass("sp-palette-only",c.showPaletteOnly),l.toggleClass("sp-initial-disabled",!c.showInitial),l.addClass(c.className),ni()}function au(){function r(n){return n.data&&n.data.ignore?(vt(t(this).data("color")),dt()):(vt(t(this).data("color")),dt(),yt(!0),ht()),!1}var n,i;f&&l.find("*:not(input)").attr("unselectable","on"),nu(),ur&&a.after(bt).hide(),at||rr.hide(),ct?a.after(l).hide():(n=c.appendTo==="parent"?a.parent():t(c.appendTo),n.length!==1&&(n=t("body")),n.append(l)),tu(),si.bind("click.spectrum touchstart.spectrum",function(n){tr||uu(),n.stopPropagation(),t(n.target).is("input")||n.preventDefault()}),(a.is(":disabled")||c.disabled===!0)&&eu(),l.click(nt),et.change(hr),et.bind("paste",function(){setTimeout(hr,1)}),et.keydown(function(n){n.keyCode==13&&hr()}),dr.text(c.cancelText),dr.bind("click.spectrum",function(n){n.stopPropagation(),n.preventDefault(),ht("cancel")}),rr.attr("title",c.clearText),rr.bind("click.spectrum",function(n){n.stopPropagation(),n.preventDefault(),st=!0,dt(),ct&&yt(!0)}),gr.text(c.chooseText),gr.bind("click.spectrum",function(n){n.stopPropagation(),n.preventDefault(),pu()&&(yt(!0),ht())}),s(wr,function(n,t,i){it=n/nr,st=!1,i.shiftKey&&(it=Math.round(it*10)/10),dt()},or,sr),s(ir,function(n,t){ri=parseFloat(t/ai),st=!1,c.showAlpha||(it=1),dt()},or,sr),s(wi,function(n,t,i){var r,u;if(i.shiftKey){if(!ft){var f=ui*wt,e=ut-fi*ut,o=Math.abs(n-f)>Math.abs(t-e);ft=o?"x":"y"}}else ft=null;r=!ft||ft==="x",u=!ft||ft==="y",r&&(ui=parseFloat(n/wt)),u&&(fi=parseFloat((ut-t)/ut)),st=!1,c.showAlpha||(it=1),dt()},or,sr),hi?(vt(hi),gt(),ci=fr||tinycolor(hi).format,er(hi)):gt(),ct&&cr(),i=f?"mousedown.spectrum":"click.spectrum touchstart.spectrum",br.delegate(".sp-thumb-el",i,r),kr.delegate(".sp-thumb-el:nth-child(1)",i,{ignore:!0},r)}function tu(){if(pt&&n.localStorage){try{var i=n.localStorage[pt].split(",#");i.length>1&&(delete n.localStorage[pt],t.each(i,function(n,t){er(t)}))}catch(r){}try{rt=n.localStorage[pt].split(";")}catch(r){}}}function er(t){if(ou){var i=tinycolor(t).toRgbString();if(!yi[i]&&rt.indexOf(i)===-1)for(rt.push(i);rt.length>hu;)rt.shift();if(pt&&n.localStorage)try{n.localStorage[pt]=rt.join(";")}catch(r){}}}function vu(){var n=[],t;if(c.showPalette)for(i=0;i<rt.length;i++)t=tinycolor(rt[i]).toRgbString(),yi[t]||n.push(rt[i]);return n.reverse().slice(0,c.maxSelectionSize)}function iu(){var n=d(),i=t.map(ei,function(t,i){return h(t,n,"sp-palette-row sp-palette-row-"+i)});tu(),rt&&i.push(h(vu(),n,"sp-palette-row sp-palette-row-selection")),br.html(i.join(""))}function ru(){if(c.showInitial){var t=ot,n=d();kr.html(h([t,n],n,"sp-palette-row-initial"))}}function or(){(ut<=0||wt<=0||ai<=0)&&ni(),l.addClass(pr),ft=null,a.trigger("dragstart.spectrum",[d()])}function sr(){l.removeClass(pr),a.trigger("dragstop.spectrum",[d()])}function hr(){var n=et.val(),t;(n===null||n==="")&&at?(vt(null),yt(!0)):(t=tinycolor(n),t.ok?(vt(t),yt(!0)):et.addClass("sp-validation-error"))}function uu(){ii?ht():cr()}function cr(){var i=t.Event("beforeShow.spectrum");if(ii){ni();return}(a.trigger(i,[d()]),ti.beforeShow(d())===!1||i.isDefaultPrevented())||(b(),ii=!0,t(pi).bind("click.spectrum",ht),t(n).bind("resize.spectrum",ar),bt.addClass("sp-active"),l.removeClass("sp-hidden"),ni(),gt(),ot=d(),ru(),ti.show(ot),a.trigger("show.spectrum",[ot]))}function ht(i){if((!i||i.type!="click"||i.button!=2)&&ii&&!ct){ii=!1,t(pi).unbind("click.spectrum",ht),t(n).unbind("resize.spectrum",ar),bt.removeClass("sp-active"),l.addClass("sp-hidden");var r=!tinycolor.equals(d(),ot);r&&(lu&&i!=="cancel"?yt(!0):yu()),ti.hide(d()),a.trigger("hide.spectrum",[d()])}}function yu(){vt(ot,!0)}function vt(n,t){if(tinycolor.equals(n,d())){gt();return}var i,r;!n&&at?st=!0:(st=!1,i=tinycolor(n),r=i.toHsv(),ri=r.h%360/360,ui=r.s,fi=r.v,it=r.a),gt(),i&&i.ok&&!t&&(ci=fr||i.format)}function d(n){return(n=n||{},at&&st)?null:tinycolor.fromRatio({h:ri,s:ui,v:fi,a:Math.round(it*100)/100},{format:n.format||ci})}function pu(){return!et.hasClass("sp-validation-error")}function dt(){gt(),ti.move(d()),a.trigger("move.spectrum",[d()])}function gt(){var s,n,t,e,i,h,o,r,u;et.removeClass("sp-validation-error"),fu(),s=tinycolor.fromRatio({h:ri,s:1,v:1}),wi.css("background-color",s.toHexString()),n=ci,it<1&&!(it===0&&n==="name")&&(n==="hex"||n==="hex3"||n==="hex6"||n==="name")&&(n="rgb"),t=d({format:n}),e="",kt.removeClass("sp-clear-display"),kt.css("background-color","transparent"),!t&&at?kt.addClass("sp-clear-display"):(i=t.toHexString(),h=t.toRgbString(),v||t.alpha===1?kt.css("background-color",h):(kt.css("background-color","transparent"),kt.css("filter",t.toFilter())),c.showAlpha&&(o=t.toRgb(),o.a=0,r=tinycolor(o).toRgbString(),u="linear-gradient(left, "+r+", "+i+")",f?oi.css("filter",tinycolor(r).toFilter({gradientType:1},i)):(oi.css("background","-webkit-"+u),oi.css("background","-moz-"+u),oi.css("background","-ms-"+u),oi.css("background","linear-gradient(to right, "+r+", "+i+")"))),e=t.toString(n)),c.showInput&&et.val(e),c.showPalette&&iu(),ru()}function fu(){var u=ui,f=fi,n,t,i,r;at&&st?(di.hide(),ki.hide(),bi.hide()):(di.show(),ki.show(),bi.show(),n=u*wt,t=ut-f*ut,n=Math.max(-lt,Math.min(wt-lt,n-lt)),t=Math.max(-lt,Math.min(ut-lt,t-lt)),bi.css({top:t+"px",left:n+"px"}),i=it*nr,di.css({left:i-vr/2+"px"}),r=ri*ai,ki.css({top:r-yr+"px"}))}function yt(n){var t=d(),i="",r=!tinycolor.equals(t,ot);t&&(i=t.toString(ci),er(t)),gi&&a.val(i),ot=t,n&&r&&(ti.change(t),a.trigger("change",[t]))}function ni(){wt=wi.width(),ut=wi.height(),lt=bi.height(),su=ir.width(),ai=ir.height(),yr=ki.height(),nr=wr.width(),vr=di.width(),ct||(l.css("position","absolute"),l.offset(g(l,si))),fu(),c.showPalette&&iu(),a.trigger("reflow.spectrum")}function wu(){a.show(),si.unbind("click.spectrum touchstart.spectrum"),l.remove(),bt.remove(),u[li.id]=null}function bu(n,i){if(n===r)return t.extend({},c);if(i===r)return c[n];c[n]=i,nu()}function ku(){tr=!1,a.attr("disabled",!1),si.removeClass("sp-disabled")}function eu(){ht(),tr=!0,a.attr("disabled",!0),si.addClass("sp-disabled")}var c=k(o,e),ct=c.flat,ou=c.showSelectionPalette,pt=c.localStorageKey,lr=c.theme,ti=c.callbacks,ar=tt(ni,10),ii=!1,wt=0,ut=0,lt=0,ai=0,su=0,nr=0,vr=0,yr=0,ri=0,ui=0,fi=0,it=1,vi=[],ei=[],yi={},rt=c.selectionPalette.slice(0),hu=c.maxSelectionSize,pr="sp-dragging",ft=null,pi=e.ownerDocument,du=pi.body,a=t(e),tr=!1,l=t(w,pi).addClass(lr),wi=l.find(".sp-color"),bi=l.find(".sp-dragger"),ir=l.find(".sp-hue"),ki=l.find(".sp-slider"),oi=l.find(".sp-alpha-inner"),wr=l.find(".sp-alpha"),di=l.find(".sp-alpha-handle"),et=l.find(".sp-input"),br=l.find(".sp-palette"),kr=l.find(".sp-initial"),dr=l.find(".sp-cancel"),rr=l.find(".sp-clear"),gr=l.find(".sp-choose"),gi=a.is("input"),cu=gi&&y&&a.attr("type")==="color",ur=gi&&!ct,bt=ur?t(p).addClass(lr).addClass(c.className):t([]),si=ur?bt:a,kt=bt.find(".sp-preview-inner"),hi=c.color||gi&&a.val(),ot=!1,fr=c.preferredFormat,ci=fr,lu=!c.showButtons||c.clickoutFiresChange,st=!hi,at=c.allowEmpty&&!cu,li;return au(),li={show:cr,hide:ht,toggle:uu,reflow:ni,option:bu,enable:ku,disable:eu,set:function(n){vt(n),yt()},get:d,destroy:wu,container:l},li.id=u.push(li)-1,li}function g(n,i){var s=0,u=n.outerWidth(),f=n.outerHeight(),h=i.outerHeight(),e=n[0].ownerDocument,c=e.documentElement,o=c.clientWidth+t(e).scrollLeft(),l=c.clientHeight+t(e).scrollTop(),r=i.offset();return r.top+=h,r.left-=Math.min(r.left,r.left+u>o&&o>u?Math.abs(r.left+u-o):0),r.top-=Math.min(r.top,r.top+f>l&&l>f?Math.abs(f+h-s):s),r}function e(){}function nt(n){n.stopPropagation()}function o(n,t){var i=Array.prototype.slice,r=i.call(arguments,2);return function(){return n.apply(t,r.concat(i.call(arguments)))}}function s(i,r,u,e){function c(n){n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),n.returnValue=!1}function p(n){if(s){if(f&&document.documentMode<9&&!n.button)return w();var t=n.originalEvent.touches,u=t?t[0].pageX:n.pageX,e=t?t[0].pageY:n.pageY,o=Math.max(0,Math.min(u-l.left,v)),h=Math.max(0,Math.min(e-l.top,a));y&&c(n),r.apply(i,[o,h,n])}}function b(n){var r=n.which?n.which==3:n.button==2,f=n.originalEvent.touches;r||s||u.apply(i,arguments)!==!1&&(s=!0,a=t(i).height(),v=t(i).width(),l=t(i).offset(),t(h).bind(o),t(h.body).addClass("sp-dragging"),y||p(n),c(n))}function w(){s&&(t(h).unbind(o),t(h.body).removeClass("sp-dragging"),e.apply(i,arguments)),s=!1}r=r||function(){},u=u||function(){},e=e||function(){};var h=i.ownerDocument||document,s=!1,l={},a=0,v=0,y="ontouchstart"in n,o={};o.selectstart=c,o.dragstart=c,o["touchmove mousemove"]=p,o["touchend mouseup"]=w,t(i).bind("touchstart mousedown",b)}function tt(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null,n.apply(u,f)};i&&clearTimeout(r),(i||!r)&&(r=setTimeout(e,t))}}function c(){n.console&&(c=Function.prototype.bind?Function.prototype.bind.call(console.log,console):function(){Function.prototype.apply.call(console.log,console,arguments)},c.apply(this,arguments))}var a={beforeShow:e,move:e,change:e,show:e,hide:e,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!1,showInitial:!1,showPalette:!1,showPaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",clearText:"Clear Color Selection",preferredFormat:!1,className:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1},u=[],f=!!/msie/i.exec(n.navigator.userAgent),v=function(){function t(n,t){return!!~(""+n).indexOf(t)}var i=document.createElement("div"),n=i.style;return n.cssText="background-color:rgba(0,0,0,.5)",t(n.backgroundColor,"rgba")||t(n.backgroundColor,"hsla")}(),y=function(){var n=t("<input type='color' value='!' />")[0];return n.type==="color"&&n.value!=="!"}(),p="<div class='sp-replacer'><div class='sp-preview'><div class='sp-preview-inner'><\/div><\/div><div class='sp-dd'>▼<\/div><\/div>",w=function(){var t="",n;if(f)for(n=1;n<=6;n++)t+="<div class='sp-"+n+"'><\/div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'><\/div>","<\/div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'><\/div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'><\/div>","<\/div>","<\/div>","<\/div>","<div class='sp-clear sp-clear-display'>","<\/div>","<div class='sp-hue'>","<div class='sp-slider'><\/div>",t,"<\/div>","<\/div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'><\/div><\/div><\/div>","<\/div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","<\/div>","<div class='sp-initial sp-thumb sp-cf'><\/div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'><\/a>","<button class='sp-choose'><\/button>","<\/div>","<\/div>","<\/div>"].join("")}(),l="spectrum.id";t.fn.spectrum=function(n){if(typeof n=="string"){var i=this,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var f=u[t(this).data(l)],e;if(f){if(e=f[n],!e)throw new Error("Spectrum: no such method: '"+n+"'");n=="get"?i=f.get():n=="container"?i=f.container:n=="option"?i=f.option.apply(f,r):n=="destroy"?(f.destroy(),t(this).removeData(l)):e.apply(f,r)}}),i}return this.spectrum("destroy").each(function(){var i=t.extend({},n,t(this).data()),r=d(this,i);t(this).data(l,r.id)})},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=s,t.fn.spectrum.defaults=a,t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){y||t("input[type=color]").spectrum({preferredFormat:"hex6"})},function(){function t(n,u){if(n=n?n:"",u=u||{},typeof n=="object"&&n.hasOwnProperty("_tc_id"))return n;var h=it(n),e=h.r,o=h.g,s=h.b,f=h.a,c=i(100*f)/100,l=u.format||h.format;return e<1&&(e=i(e)),o<1&&(o=i(o)),s<1&&(s=i(s)),{ok:h.ok,format:l,_tc_id:tt++,alpha:f,getAlpha:function(){return f},setAlpha:function(n){f=d(n),c=i(100*f)/100},toHsv:function(){var n=p(e,o,s);return{h:n.h*360,s:n.s,v:n.v,a:f}},toHsvString:function(){var n=p(e,o,s),t=i(n.h*360),r=i(n.s*100),u=i(n.v*100);return f==1?"hsv("+t+", "+r+"%, "+u+"%)":"hsva("+t+", "+r+"%, "+u+"%, "+c+")"},toHsl:function(){var n=y(e,o,s);return{h:n.h*360,s:n.s,l:n.l,a:f}},toHslString:function(){var n=y(e,o,s),t=i(n.h*360),r=i(n.s*100),u=i(n.l*100);return f==1?"hsl("+t+", "+r+"%, "+u+"%)":"hsla("+t+", "+r+"%, "+u+"%, "+c+")"},toHex:function(n){return w(e,o,s,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(){return b(e,o,s,f)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:i(e),g:i(o),b:i(s),a:f}},toRgbString:function(){return f==1?"rgb("+i(e)+", "+i(o)+", "+i(s)+")":"rgba("+i(e)+", "+i(o)+", "+i(s)+", "+c+")"},toPercentageRgb:function(){return{r:i(r(e,255)*100)+"%",g:i(r(o,255)*100)+"%",b:i(r(s,255)*100)+"%",a:f}},toPercentageRgbString:function(){return f==1?"rgb("+i(r(e,255)*100)+"%, "+i(r(o,255)*100)+"%, "+i(r(s,255)*100)+"%)":"rgba("+i(r(e,255)*100)+"%, "+i(r(o,255)*100)+"%, "+i(r(s,255)*100)+"%, "+c+")"},toName:function(){return f===0?"transparent":k[w(e,o,s,!0)]||!1},toFilter:function(n){var i="#"+b(e,o,s,f),r=i,c=u&&u.gradientType?"GradientType = 1, ":"",h;return n&&(h=t(n),r=h.toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+c+"startColorstr="+i+",endColorstr="+r+")"},toString:function(n){var i=!!n;n=n||this.format;var t=!1,r=!i&&f<1&&f>0,u=r&&(n==="hex"||n==="hex6"||n==="hex3"||n==="name");return(n==="rgb"&&(t=this.toRgbString()),n==="prgb"&&(t=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(t=this.toHexString()),n==="hex3"&&(t=this.toHexString(!0)),n==="hex8"&&(t=this.toHex8String()),n==="name"&&(t=this.toName()),n==="hsl"&&(t=this.toHslString()),n==="hsv"&&(t=this.toHsvString()),u)?this.toRgbString():t||this.toHexString()}}}function it(n){var t={r:0,g:0,b:0},i=1,r=!1,u=!1;return typeof n=="string"&&(n=lt(n)),typeof n=="object"&&(n.hasOwnProperty("r")&&n.hasOwnProperty("g")&&n.hasOwnProperty("b")?(t=rt(n.r,n.g,n.b),r=!0,u=String(n.r).substr(-1)==="%"?"prgb":"rgb"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("v")?(n.s=c(n.s),n.v=c(n.v),t=ft(n.h,n.s,n.v),r=!0,u="hsv"):n.hasOwnProperty("h")&&n.hasOwnProperty("s")&&n.hasOwnProperty("l")&&(n.s=c(n.s),n.l=c(n.l),t=ut(n.h,n.s,n.l),r=!0,u="hsl"),n.hasOwnProperty("a")&&(i=n.a)),i=d(i),{ok:r,format:n.format||u,r:e(255,o(t.r,0)),g:e(255,o(t.g,0)),b:e(255,o(t.b,0)),a:i}}function rt(n,t,i){return{r:r(n,255)*255,g:r(t,255)*255,b:r(i,255)*255}}function y(n,t,i){var s;n=r(n,255),t=r(t,255),i=r(i,255);var u=o(n,t,i),h=e(n,t,i),f,c,l=(u+h)/2;if(u==h)f=c=0;else{s=u-h,c=l>.5?s/(2-u-h):s/(u+h);switch(u){case n:f=(t-i)/s+(t<i?6:0);break;case t:f=(i-n)/s+2;break;case i:f=(n-t)/s+4}f/=6}return{h:f,s:c,l:l}}function ut(n,t,i){function h(n,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?n+(t-n)*6*i:i<1/2?t:i<2/3?n+(t-n)*(2/3-i)*6:n}var e,o,s,u,f;return n=r(n,360),t=r(t,100),i=r(i,100),t===0?e=o=s=i:(u=i<.5?i*(1+t):i+t-i*t,f=2*i-u,e=h(f,u,n+1/3),o=h(f,u,n),s=h(f,u,n-1/3)),{r:e*255,g:o*255,b:s*255}}function p(n,t,i){n=r(n,255),t=r(t,255),i=r(i,255);var u=o(n,t,i),h=e(n,t,i),f,c,l=u,s=u-h;if(c=u===0?0:s/u,u==h)f=0;else{switch(u){case n:f=(t-i)/s+(t<i?6:0);break;case t:f=(i-n)/s+2;break;case i:f=(n-t)/s+4}f/=6}return{h:f,s:c,v:l}}function ft(n,t,i){n=r(n,360)*6,t=r(t,100),i=r(i,100);var s=h.floor(n),c=n-s,u=i*(1-t),f=i*(1-c*t),e=i*(1-(1-c)*t),o=s%6,l=[i,f,u,u,e,i][o],a=[e,i,i,f,u,u][o],v=[u,u,e,i,i,f][o];return{r:l*255,g:a*255,b:v*255}}function w(n,t,r,u){var f=[s(i(n).toString(16)),s(i(t).toString(16)),s(i(r).toString(16))];return u&&f[0].charAt(0)==f[0].charAt(1)&&f[1].charAt(0)==f[1].charAt(1)&&f[2].charAt(0)==f[2].charAt(1)?f[0].charAt(0)+f[1].charAt(0)+f[2].charAt(0):f.join("")}function b(n,t,r,u){var f=[s(ht(u)),s(i(n).toString(16)),s(i(t).toString(16)),s(i(r).toString(16))];return f.join("")}function et(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[n[t]]=t);return i}function d(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function r(n,t){ot(n)&&(n="100%");var i=st(n);return(n=e(t,o(0,parseFloat(n))),i&&(n=parseInt(n*t,10)/100),h.abs(n-t)<1e-6)?1:n%t/parseFloat(t)}function a(n){return e(1,o(0,n))}function u(n){return parseInt(n,16)}function ot(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function st(n){return typeof n=="string"&&n.indexOf("%")!=-1}function s(n){return n.length==1?"0"+n:""+n}function c(n){return n<=1&&(n=n*100+"%"),n}function ht(n){return Math.round(parseFloat(n)*255).toString(16)}function ct(n){return u(n)/255}function lt(n){var i,t;if(n=n.replace(g,"").replace(nt,"").toLowerCase(),i=!1,l[n])n=l[n],i=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(t=f.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=f.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=f.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=f.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=f.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=f.hex8.exec(n))?{a:ct(t[1]),r:u(t[2]),g:u(t[3]),b:u(t[4]),format:i?"name":"hex8"}:(t=f.hex6.exec(n))?{r:u(t[1]),g:u(t[2]),b:u(t[3]),format:i?"name":"hex"}:(t=f.hex3.exec(n))?{r:u(t[1]+""+t[1]),g:u(t[2]+""+t[2]),b:u(t[3]+""+t[3]),format:i?"name":"hex"}:!1}var g=/^[\s,#]+/,nt=/\s+$/,tt=0,h=Math,i=h.round,e=h.min,o=h.max,v=h.random,l,k,f;t.fromRatio=function(n,i){var u,r;if(typeof n=="object"){u={};for(r in n)n.hasOwnProperty(r)&&(u[r]=r==="a"?n[r]:c(n[r]));n=u}return t(n,i)},t.equals=function(n,i){return!n||!i?!1:t(n).toRgbString()==t(i).toRgbString()},t.random=function(){return t.fromRatio({r:v(),g:v(),b:v()})},t.desaturate=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.s-=i/100,r.s=a(r.s),t(r)},t.saturate=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.s+=i/100,r.s=a(r.s),t(r)},t.greyscale=function(n){return t.desaturate(n,100)},t.lighten=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.l+=i/100,r.l=a(r.l),t(r)},t.darken=function(n,i){i=i===0?0:i||10;var r=t(n).toHsl();return r.l-=i/100,r.l=a(r.l),t(r)},t.complement=function(n){var i=t(n).toHsl();return i.h=(i.h+180)%360,t(i)},t.triad=function(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+120)%360,s:i.s,l:i.l}),t({h:(r+240)%360,s:i.s,l:i.l})]},t.tetrad=function(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+90)%360,s:i.s,l:i.l}),t({h:(r+180)%360,s:i.s,l:i.l}),t({h:(r+270)%360,s:i.s,l:i.l})]},t.splitcomplement=function(n){var i=t(n).toHsl(),r=i.h;return[t(n),t({h:(r+72)%360,s:i.s,l:i.l}),t({h:(r+216)%360,s:i.s,l:i.l})]},t.analogous=function(n,i,r){i=i||6,r=r||30;var u=t(n).toHsl(),f=360/r,e=[t(n)];for(u.h=(u.h-(f*i>>1)+720)%360;--i;)u.h=(u.h+f)%360,e.push(t(u));return e},t.monochromatic=function(n,i){i=i||6;for(var r=t(n).toHsv(),e=r.h,o=r.s,u=r.v,f=[],s=1/i;i--;)f.push(t({h:e,s:o,v:u})),u=(u+s)%1;return f},t.readability=function(n,i){var r=t(n).toRgb(),u=t(i).toRgb(),f=(r.r*299+r.g*587+r.b*114)/1e3,e=(u.r*299+u.g*587+u.b*114)/1e3,o=Math.max(r.r,u.r)-Math.min(r.r,u.r)+Math.max(r.g,u.g)-Math.min(r.g,u.g)+Math.max(r.b,u.b)-Math.min(r.b,u.b);return{brightness:Math.abs(f-e),color:o}},t.readable=function(n,i){var r=t.readability(n,i);return r.brightness>125&&r.color>500},t.mostReadable=function(n,i){for(var h=null,o=0,u=!1,r=0;r<i.length;r++){var f=t.readability(n,i[r]),e=f.brightness>125&&f.color>500,s=3*(f.brightness/125)+f.color/500;(e&&!u||e&&u&&s>o||!e&&!u&&s>o)&&(u=e,o=s,h=t(i[r]))}return h},l=t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=t.hexNames=et(l),f=function(){var n="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+t),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}(),n.tinycolor=t}(),t(function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()})})(window,jQuery);
|
28 |
-
/*!
|
29 |
-
* @overview CodeMirror version 3.22
|
30 |
-
* http://codemirror.net/
|
31 |
-
*/
|
32 |
-
window.CodeMirror=function(){"use strict";function n(t,i){var r,o,f,u,s;if(!(this instanceof n))return new n(t,i);this.options=i=i||{};for(r in gf)!i.hasOwnProperty(r)&&gf.hasOwnProperty(r)&&(i[r]=gf[r]);ke(i),o=typeof i.value=="string"?0:i.value.first,f=this.display=iv(t,o),f.wrapper.CodeMirror=this,sh(this),i.autofocus&&!ve&&d(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new bs},oh(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),u=i.value,typeof u=="string"&&(u=new w(i.value,i.mode)),e(this,wl)(this,u),st&&setTimeout(ut(ht,this,!0),20),gv(this);try{s=document.activeElement==f.input}catch(h){}s||i.autofocus&&!ve?setTimeout(ut(yo,this),20):po(this),e(this,function(){var n,t;for(n in ci)ci.propertyIsEnumerable(n)&&ci[n](this,i[n],is);for(t=0;t<ne.length;++t)ne[t](this)})()}function iv(n,t){var r={},u=r.input=i("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");return y?u.style.width="1000px":u.setAttribute("wrap","off"),cr&&(u.style.border="1px solid black"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),u.setAttribute("spellcheck","false"),r.inputDiv=i("div",[u],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarH=i("div",[i("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),r.scrollbarV=i("div",[i("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),r.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),r.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),r.lineDiv=i("div",null,"CodeMirror-code"),r.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),r.cursor=i("div"," ","CodeMirror-cursor"),r.otherCursor=i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"),r.measure=i("div",null,"CodeMirror-measure"),r.lineSpace=i("div",[r.measure,r.selectionDiv,r.lineDiv,r.cursor,r.otherCursor],null,"position: relative; outline: none"),r.mover=i("div",[i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=i("div",[r.mover],"CodeMirror-sizer"),r.heightForcer=i("div",null,null,"position: absolute; height: "+ai+"px; width: 1px;"),r.gutters=i("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=i("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=i("div",[r.inputDiv,r.scrollbarH,r.scrollbarV,r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),yi&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),n.appendChild?n.appendChild(r.wrapper):n(r.wrapper),cr&&(u.style.width="0px"),y||(r.scroller.draggable=!0),ae?(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"):yi&&(r.scrollbarH.style.minWidth=r.scrollbarV.style.minWidth="18px"),r.viewOffset=r.lastSizeC=0,r.showingFrom=r.showingTo=t,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new bs,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.measureLineCache=[],r.measureLineCachePos=0,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r}function pe(t){t.doc.mode=n.getMode(t.options,t.doc.modeOption),lr(t)}function lr(n){n.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),n.doc.frontier=n.doc.first,vr(n,100),n.state.modeGen++,n.curOp&&a(n)}function rv(n){n.options.lineWrapping?(n.display.wrapper.className+=" CodeMirror-wrap",n.display.sizer.style.minWidth=""):(n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-wrap",""),be(n)),we(n),a(n),bi(n),setTimeout(function(){de(n)},100)}function fh(n){var t=oi(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/wh(n.display)-3);return function(u){return li(n.doc,u)?0:i?(Math.ceil(u.text.length/r)||1)*t:t}}function we(n){var t=n.doc,i=fh(n);t.iter(function(n){var t=i(n);t!=n.height&&et(n,t)})}function eh(n){var i=ct[n.options.keyMap],t=i.style;n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(t?" cm-keymap-"+t:"")}function oh(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-"),bi(n)}function ar(n){sh(n),a(n),setTimeout(function(){no(n)},20)}function sh(n){var r=n.display.gutters,e=n.options.gutters,t,u,f;for(bu(r),t=0;t<e.length;++t)u=e[t],f=r.appendChild(i("div",null,"CodeMirror-gutter "+u)),u=="CodeMirror-linenumbers"&&(n.display.lineGutter=f,f.style.width=(n.display.lineNumWidth||1)+"px");r.style.display=t?"":"none"}function rf(n,t){var f,e,u,i;if(t.height==0)return 0;for(f=t.text.length,u=t;e=es(u);)i=e.find(),u=r(n,i.from.line),f+=i.from.ch-i.to.ch;for(u=t;e=te(u);)i=e.find(),f-=u.text.length-i.from.ch,u=r(n,i.to.line),f+=u.text.length-i.to.ch;return f}function be(n){var t=n.display,i=n.doc;t.maxLine=r(i,i.first),t.maxLineLength=rf(i,t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=rf(i,n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}function ke(n){var t=ot(n.gutters,"CodeMirror-linenumbers");t==-1&&n.lineNumbers?n.gutters=n.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!n.lineNumbers&&(n.gutters=n.gutters.slice(0),n.gutters.splice(t,1))}function de(n){var t=n.display,e=n.doc.height,r=e+lh(t);t.sizer.style.minHeight=t.heightForcer.style.top=r+"px",t.gutters.style.height=Math.max(r,t.scroller.clientHeight-ai)+"px";var f=Math.max(r,t.scroller.scrollHeight),i=t.scroller.scrollWidth>t.scroller.clientWidth+1,u=f>t.scroller.clientHeight+1;u?(t.scrollbarV.style.display="block",t.scrollbarV.style.bottom=i?gu(t.measure)+"px":"0",t.scrollbarV.firstChild.style.height=Math.max(0,f-t.scroller.clientHeight+t.scrollbarV.clientHeight)+"px"):(t.scrollbarV.style.display="",t.scrollbarV.firstChild.style.height="0"),i?(t.scrollbarH.style.display="block",t.scrollbarH.style.right=u?gu(t.measure)+"px":"0",t.scrollbarH.firstChild.style.width=t.scroller.scrollWidth-t.scroller.clientWidth+t.scrollbarH.clientWidth+"px"):(t.scrollbarH.style.display="",t.scrollbarH.firstChild.style.width="0"),i&&u?(t.scrollbarFiller.style.display="block",t.scrollbarFiller.style.height=t.scrollbarFiller.style.width=gu(t.measure)+"px"):t.scrollbarFiller.style.display="",i&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(t.gutterFiller.style.display="block",t.gutterFiller.style.height=gu(t.measure)+"px",t.gutterFiller.style.width=t.gutters.offsetWidth+"px"):t.gutterFiller.style.display="",da&&gu(t.measure)===0&&(t.scrollbarV.style.minWidth=t.scrollbarH.style.minHeight=ga?"18px":"12px",t.scrollbarV.style.pointerEvents=t.scrollbarH.style.pointerEvents="none")}function ge(n,t,i){var r=n.scroller.scrollTop,u=n.wrapper.clientHeight,f;return typeof i=="number"?r=i:i&&(r=i.top,u=i.bottom-i.top),r=Math.floor(r-ch(n)),f=Math.ceil(r+u),{from:cu(t,r),to:cu(t,f)}}function no(n){var t=n.display,i,r,u;if(t.alignWidgets||t.gutters.firstChild&&n.options.fixedGutter){var f=io(t)-t.scroller.scrollLeft+n.doc.scrollLeft,e=t.gutters.offsetWidth,o=f+"px";for(i=t.lineDiv.firstChild;i;i=i.nextSibling)if(i.alignable)for(r=0,u=i.alignable;r<u.length;++r)u[r].style.left=o;n.options.fixedGutter&&(t.gutters.style.left=f+e+"px")}}function uv(n){if(!n.options.lineNumbers)return!1;var u=n.doc,r=to(n.options,u.first+u.size-1),t=n.display;if(r.length!=t.lineNumChars){var f=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=f.firstChild.offsetWidth,o=f.offsetWidth-e;return t.lineGutter.style.width="",t.lineNumInnerWidth=Math.max(e,t.lineGutter.offsetWidth-o),t.lineNumWidth=t.lineNumInnerWidth+o,t.lineNumChars=t.lineNumInnerWidth?r.length:-1,t.lineGutter.style.width=t.lineNumWidth+"px",!0}return!1}function to(n,t){return String(n.lineNumberFormatter(t+n.firstLineNumber))}function io(n){return c(n.scroller).left-c(n.sizer).left}function uf(n,t,i,r){for(var s=n.display.showingFrom,h=n.display.showingTo,f,u=ge(n.display,n.doc,i),o,e=!0;;e=!1){if(o=n.display.scroller.clientWidth,!fv(n,t,u,r))break;if(f=!0,t=[],uo(n),de(n),e&&n.options.lineWrapping&&o!=n.display.scroller.clientWidth){r=!0;continue}if(r=!1,i&&(i=Math.min(n.display.scroller.scrollHeight-n.display.scroller.clientHeight,typeof i=="number"?i:i.top)),u=ge(n.display,n.doc,i),u.from>=n.display.showingFrom&&u.to<=n.display.showingTo)break}return f&&(g(n,"update",n),(n.display.showingFrom!=s||n.display.showingTo!=h)&&g(n,"viewportChange",n,n.display.showingFrom,n.display.showingTo)),f}function fv(n,t,i,u){var f=n.display,o=n.doc,b,v,l,k,w,p,e,h,a,d;if(!f.wrapper.offsetWidth){f.showingFrom=f.showingTo=o.first,f.viewOffset=0;return}if(u||t.length!=0||!(i.from>f.showingFrom)||!(i.to<f.showingTo)){if(uv(n)&&(t=[{from:o.first,to:o.first+o.size}]),b=f.sizer.style.marginLeft=f.gutters.offsetWidth+"px",f.scrollbarH.style.left=n.options.fixedGutter?b:"0",v=Infinity,n.options.lineNumbers)for(e=0;e<t.length;++e)t[e].diff&&t[e].from<v&&(v=t[e].from);var y=o.first+o.size,c=Math.max(i.from-n.options.viewportMargin,o.first),s=Math.min(y,i.to+n.options.viewportMargin);if(f.showingFrom<c&&c-f.showingFrom<20&&(c=Math.max(o.first,f.showingFrom)),f.showingTo>s&&f.showingTo-s<20&&(s=Math.min(y,f.showingTo)),wi)for(c=tt(wt(o,r(o,c)));s<y&&li(o,r(o,s));)++s;if(l=[{from:Math.max(f.showingFrom,o.first),to:Math.min(f.showingTo,y)}],l=l[0].from>=l[0].to?[]:ov(l,t),wi)for(e=0;e<l.length;++e)for(h=l[e];k=te(r(o,h.to-1));)if(w=k.find().from.line,w>h.from)h.to=w;else{l.splice(e--,1);break}for(p=0,e=0;e<l.length;++e)h=l[e],h.from<c&&(h.from=c),h.to>s&&(h.to=s),h.from>=h.to?l.splice(e--,1):p+=h.to-h.from;if(!u&&p==s-c&&c==f.showingFrom&&s==f.showingTo){hh(n);return}l.sort(function(n,t){return n.from-t.from});try{a=document.activeElement}catch(g){}return p<(s-c)*.7&&(f.lineDiv.style.display="none"),hv(n,c,s,l,v),f.lineDiv.style.display="",a&&document.activeElement!=a&&a.offsetHeight&&a.focus(),d=c!=f.showingFrom||s!=f.showingTo||f.lastSizeC!=f.wrapper.clientHeight,d&&(f.lastSizeC=f.wrapper.clientHeight,vr(n,400)),f.showingFrom=c,f.showingTo=s,f.gutters.style.height="",ev(n),hh(n),!0}}function ev(n){for(var f=n.display,h=f.lineDiv.offsetTop,i,e,o,s,r,u,t=f.lineDiv.firstChild;t;t=t.nextSibling)if(t.lineObj&&(yi?(e=t.offsetTop+t.offsetHeight,i=e-h,h=e):(o=c(t),i=o.bottom-o.top),s=t.lineObj.height-i,i<2&&(i=oi(f)),(s>.001||s<-.001)&&(et(t.lineObj,i),r=t.lineObj.widgets,r)))for(u=0;u<r.length;++u)r[u].height=r[u].node.offsetHeight}function hh(n){var t=n.display.viewOffset=lu(n,r(n.doc,n.display.showingFrom));n.display.mover.style.top=t+"px"}function ov(n,t){for(var o,h,i,f=0,s=t.length||0;f<s;++f){var r=t[f],u=[],e=r.diff||0;for(o=0,h=n.length;o<h;++o)i=n[o],r.to<=i.from&&r.diff?u.push({from:i.from+e,to:i.to+e}):r.to<=i.from||r.from>=i.to?u.push(i):(r.from>i.from&&u.push({from:i.from,to:r.from}),r.to<i.to&&u.push({from:r.to+e,to:i.to+e}));n=u}return n}function sv(n){for(var i=n.display,u={},f={},t=i.gutters.firstChild,r=0;t;t=t.nextSibling,++r)u[n.options.gutters[r]]=t.offsetLeft,f[n.options.gutters[r]]=t.offsetWidth;return{fixedPos:io(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:u,gutterWidth:f,wrapperWidth:i.wrapper.clientWidth}}function hv(n,t,r,u,f){function c(t){var i=t.nextSibling;return y&&pi&&n.display.currentWheelTarget==t?(t.style.display="none",t.lineObj=null):t.parentNode.removeChild(t),i}var l=sv(n),a=n.display,v=n.options.lineNumbers,h,e,s,o;for(u.length||y&&n.display.currentWheelTarget||bu(a.lineDiv),h=a.lineDiv,e=h.firstChild,s=u.shift(),o=t,n.doc.iter(t,r,function(t){var p,y,r,w,d,g,a,b,k;if(s&&s.to==o&&(s=u.shift()),li(n.doc,t)){if(t.height!=0&&et(t,0),t.widgets&&e&&e.previousSibling)for(p=0;p<t.widgets.length;++p)y=t.widgets[p],y.showIfHidden&&(r=e.previousSibling,/pre/i.test(r.nodeName)&&(w=i("div",null,null,"position: relative"),r.parentNode.replaceChild(w,r),w.appendChild(r),r=w),d=r.appendChild(i("div",[y.node],"CodeMirror-linewidget")),y.handleMouseEvents||(d.ignoreEvents=!0),ro(y,d,r,l))}else if(s&&s.from<=o&&s.to>o){while(e.lineObj!=t)e=c(e);v&&f<=o&&e.lineNumber&&ha(e.lineNumber,to(n.options,o)),e=e.nextSibling}else{if(t.widgets)for(g=0,a=e;a&&g<20;++g,a=a.nextSibling)if(a.lineObj==t&&/div/i.test(a.nodeName)){b=a;break}if(k=cv(n,t,o,l,b),k!=b)h.insertBefore(k,e);else{while(e!=b)e=c(e);e=e.nextSibling}k.lineObj=t}++o});e;)e=c(e)}function cv(n,t,r,u,f){var w=hs(n,t),l=w.pre,c=t.gutterMarkers,ut=n.display,e,b=w.bgClass?w.bgClass+" "+(t.bgClass||""):t.bgClass,h,rt,a,p,v,d,s,nt,o,y;if(!n.options.lineNumbers&&!c&&!b&&!t.wrapClass&&!t.widgets)return l;if(f){f.alignable=null;var tt=!0,it=0,k=null;for(h=f.firstChild;h;h=rt)if(rt=h.nextSibling,/\bCodeMirror-linewidget\b/.test(h.className)){for(s=0;s<t.widgets.length;++s)if(o=t.widgets[s],o.node==h.firstChild){o.above||k||(k=h),ro(o,h,f,u),++it;break}if(s==t.widgets.length){tt=!1;break}}else f.removeChild(h);f.insertBefore(l,k),tt&&it==t.widgets.length&&(e=f,f.className=t.wrapClass||"")}if(e||(e=i("div",null,t.wrapClass,"position: relative"),e.appendChild(l)),b&&e.insertBefore(i("div",null,b+" CodeMirror-linebackground"),e.firstChild),(n.options.lineNumbers||c)&&(a=e.insertBefore(i("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),l),n.options.fixedGutter&&(e.alignable||(e.alignable=[])).push(a),!n.options.lineNumbers||c&&c["CodeMirror-linenumbers"]||(e.lineNumber=a.appendChild(i("div",to(n.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+ut.lineNumInnerWidth+"px"))),c))for(p=0;p<n.options.gutters.length;++p)v=n.options.gutters[p],d=c.hasOwnProperty(v)&&c[v],d&&a.appendChild(i("div",[d],"CodeMirror-gutter-elt","left: "+u.gutterLeft[v]+"px; width: "+u.gutterWidth[v]+"px"));if(yi&&(e.style.zIndex=2),t.widgets&&e!=f)for(s=0,nt=t.widgets;s<nt.length;++s)o=nt[s],y=i("div",[o.node],"CodeMirror-linewidget"),o.handleMouseEvents||(y.ignoreEvents=!0),ro(o,y,e,u),o.above?e.insertBefore(y,n.options.lineNumbers&&t.height!=0?a:l):e.appendChild(y),g(o,"redraw");return e}function ro(n,t,i,r){if(n.noHScroll){(i.alignable||(i.alignable=[])).push(t);var u=r.wrapperWidth;t.style.left=r.fixedPos+"px",n.coverGutter||(u-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=u+"px"}n.coverGutter&&(t.style.zIndex=5,t.style.position="relative",n.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function uo(n){var t=n.display,i=s(n.doc.sel.from,n.doc.sel.to);if(i||n.options.showCursorWhenSelecting?lv(n):t.cursor.style.display=t.otherCursor.style.display="none",i?t.selectionDiv.style.display="none":av(n),n.options.moveInputWithCursor){var r=it(n,n.doc.sel.head,"div"),u=c(t.wrapper),f=c(t.lineDiv);t.inputDiv.style.top=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top))+"px",t.inputDiv.style.left=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))+"px"}}function lv(n){var t=n.display,i=it(n,n.doc.sel.head,"div");t.cursor.style.left=i.left+"px",t.cursor.style.top=i.top+"px",t.cursor.style.height=Math.max(0,i.bottom-i.top)*n.options.cursorHeight+"px",t.cursor.style.display="",i.other?(t.otherCursor.style.display="",t.otherCursor.style.left=i.other.left+"px",t.otherCursor.style.top=i.other.top+"px",t.otherCursor.style.height=(i.other.bottom-i.other.top)*.85+"px"):t.otherCursor.style.display="none"}function av(n){function e(n,t,r,u){t<0&&(t=0),v.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px; top: "+t+"px; width: "+(r==null?p-n:r)+"px; height: "+(u-t)+"px"))}function l(i,u,f){function v(r,u){return so(n,t(i,r),"div",l,u)}var l=r(h,i),a=l.text.length,o,c;return op(lt(l),u||0,f==null?a:f,function(n,t,i){var r=v(n,"left"),h,l,y,w;n==t?(h=r,l=y=r.left):(h=v(t-1,"right"),i=="rtl"&&(w=r,r=h,h=w),l=r.left,y=h.right),u==null&&n==0&&(l=s),h.top-r.top>3&&(e(l,r.top,null,r.bottom),l=s,r.bottom<h.top&&e(l,r.bottom,null,h.top)),f==null&&t==a&&(y=p),(!o||r.top<o.top||r.top==o.top&&r.left<o.left)&&(o=r),(!c||h.bottom>c.bottom||h.bottom==c.bottom&&h.right>c.right)&&(c=h),l<s+1&&(l=s),e(l,h.top,y-l,h.bottom)}),{start:o,end:c}}var c=n.display,h=n.doc,u=n.doc.sel,v=document.createDocumentFragment(),y=pv(n.display),s=y.left,p=c.lineSpace.offsetWidth-y.right;if(u.from.line==u.to.line)l(u.from.line,u.from.ch,u.to.ch);else{var w=r(h,u.from.line),b=r(h,u.to.line),a=wt(h,w)==wt(h,b),f=l(u.from.line,u.from.ch,a?w.text.length:null).end,o=l(u.to.line,a?0:null,u.to.ch).start;a&&(f.top<o.top-2?(e(f.right,f.top,null,f.bottom),e(s,o.top,o.left,o.bottom)):e(f.right,f.top,o.left-f.right,f.bottom)),f.bottom<o.top&&e(s,f.bottom,null,o.top)}yt(c.selectionDiv,v),c.selectionDiv.style.display=""}function ff(n){var t,i;n.state.focused&&(t=n.display,clearInterval(t.blinker),i=!0,t.cursor.style.visibility=t.otherCursor.style.visibility="",n.options.cursorBlinkRate>0&&(t.blinker=setInterval(function(){t.cursor.style.visibility=t.otherCursor.style.visibility=(i=!i)?"":"hidden"},n.options.cursorBlinkRate)))}function vr(n,t){n.doc.mode.startState&&n.doc.frontier<n.display.showingTo&&n.state.highlight.set(t,ut(vv,n))}function vv(n){var t=n.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=n.display.showingTo)){var f=+new Date+n.options.workTime,r=fr(t.mode,yr(n,t.frontier)),i=[],u;t.iter(t.frontier,Math.min(t.first+t.size,n.display.showingTo+500),function(e){var o,h,s;if(t.frontier>=n.display.showingFrom){for(o=e.styles,e.styles=ol(n,e,r,!0),h=!o||o.length!=e.styles.length,s=0;!h&&s<o.length;++s)h=o[s]!=e.styles[s];h&&(u&&u.end==t.frontier?u.end++:i.push(u={start:t.frontier,end:t.frontier+1})),e.stateAfter=fr(t.mode,r)}else ss(n,e.text,r),e.stateAfter=t.frontier%5==0?fr(t.mode,r):null;return++t.frontier,+new Date>f?(vr(n,n.options.workDelay),!0):void 0}),i.length&&e(n,function(){for(var n=0;n<i.length;++n)a(this,i[n].start,i[n].end)})()}}function yv(n,t,i){for(var h,e,f=n.doc,c=i?-1:t-(n.doc.mode.innerMode?1e3:100),o,s,u=t;u>c;--u){if(u<=f.first)return f.first;if(o=r(f,u-1),o.stateAfter&&(!i||u<=f.frontier))return u;s=ii(o.text,null,n.options.tabSize),(e==null||h>s)&&(e=u-1,h=s)}return e}function yr(n,t,i){var f=n.doc,o=n.display,u,e;return f.mode.startState?(u=yv(n,t,i),e=u>f.first&&r(f,u-1).stateAfter,e=e?fr(f.mode,e):pc(f.mode),f.iter(u,t,function(i){ss(n,i.text,e);var r=u==t-1||u%5==0||u>=o.showingFrom&&u<o.showingTo;i.stateAfter=r?fr(f.mode,e):null,++u}),i&&(f.frontier=u),e):!0}function ch(n){return n.lineSpace.offsetTop}function lh(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function pv(n){if(n.cachedPaddingH)return n.cachedPaddingH;var t=yt(n.measure,i("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle;return n.cachedPaddingH={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)}}function pr(n,t,i,r,u){var o=-1,s,e,f;if(r=r||eo(n,t),r.crude)return s=r.left+i*r.width,{left:s,right:s+r.width,top:r.top,bottom:r.bottom};for(e=i;;e+=o){if(f=r[e],f)break;o<0&&e==0&&(o=1)}return u=e>i?"left":e<i?"right":u,u=="left"&&f.leftSide?f=f.leftSide:u=="right"&&f.rightSide&&(f=f.rightSide),{left:e<i?f.right:f.left,right:e>i?f.left:f.right,top:f.top,bottom:f.bottom}}function fo(n,t){for(var u=n.display.measureLineCache,i,r=0;r<u.length;++r)if(i=u[r],i.text==t.text&&i.markedSpans==t.markedSpans&&n.display.scroller.clientWidth==i.width&&i.classes==t.textClass+"|"+t.wrapClass)return i}function wv(n,t){var i=fo(n,t);i&&(i.text=i.measure=i.markedSpans=null)}function eo(n,t){var r=fo(n,t);if(r)return r.measure;var u=ah(n,t),i=n.display.measureLineCache,f={text:t.text,width:n.display.scroller.clientWidth,markedSpans:t.markedSpans,measure:u,classes:t.textClass+"|"+t.wrapClass};return i.length==16?i[++n.display.measureLineCachePos%16]=f:i.push(f),u}function ah(n,t){function v(n){var i=n.top-s.top,r=n.bottom-s.top,t,u,e;for(r>rt&&(r=rt),i<0&&(i=0),t=f.length-2;t>=0;t-=2)if((u=f[t],e=f[t+1],!(u>r)&&!(e<i))&&(u<=i&&e>=r||i<=u&&r>=e||Math.min(r,e)-Math.max(i,u)>=r-i>>1)){f[t]=Math.min(i,u),f[t+1]=Math.max(r,e);break}return t<0&&(t=f.length,f.push(i,r)),{left:n.left-s.left,right:n.right-s.left,top:t,bottom:null}}function g(n){n.bottom=f[n.top+1],n.top=f[n.top]}var it,k,d,y,o,l,u,r;if(!n.options.lineWrapping&&t.text.length>=n.options.crudeMeasuringFrom)return bv(n,t);var a=n.display,p=fa(t.text.length),e=hs(n,t,p,!0).pre;if(st&&!yi&&!n.options.lineWrapping&&e.childNodes.length>100){var nt=document.createDocumentFragment(),tt=10,w=e.childNodes.length;for(u=0,it=Math.ceil(w/tt);u<it;++u){for(k=i("div",null,null,"display: inline-block"),d=0;d<tt&&w;++d)k.appendChild(e.firstChild),--w;nt.appendChild(k)}e.appendChild(nt)}yt(a.measure,e);var s=c(a.lineDiv),f=[],h=fa(t.text.length),rt=e.offsetHeight;for(b&&a.measure.first!=e&&yt(a.measure,e),u=0;u<p.length;++u)(r=p[u])&&(y=r,o=null,/\bCodeMirror-widget\b/.test(r.className)&&r.getClientRects&&(r.firstChild.nodeType==1&&(y=r.firstChild),l=y.getClientRects(),l.length>1&&(o=h[u]=v(l[0]),o.rightSide=v(l[l.length-1]))),o||(o=h[u]=v(c(y))),r.measureRight&&(o.right=c(r.measureRight).left-s.left),r.leftSide&&(o.leftSide=v(c(r.leftSide))));for(bu(n.display.measure),u=0;u<h.length;++u)(r=h[u])&&(g(r),r.leftSide&&g(r.leftSide),r.rightSide&&g(r.rightSide));return h}function bv(n,t){var i=new bt(t.text.slice(0,100),null);t.textClass&&(i.textClass=t.textClass);var u=ah(n,i),r=pr(n,i,0,u,"left"),f=pr(n,i,99,u,"right");return{crude:!0,top:r.top,left:r.left,bottom:r.bottom,width:(f.right-r.left)/100}}function kv(n,t){var e=!1,i,r,u,f,o;if(t.markedSpans)for(i=0;i<t.markedSpans;++i)r=t.markedSpans[i],r.collapsed&&(r.to==null||r.to==t.text.length)&&(e=!0);return(u=!e&&fo(n,t),u||t.text.length>=n.options.crudeMeasuringFrom)?pr(n,t,t.text.length,u&&u.measure,"right").right:(f=hs(n,t,null,!0).pre,o=f.appendChild(nf(n.display.measure)),yt(n.display.measure,f),c(o).right-c(n.display.lineDiv).left)}function bi(n){n.display.measureLineCache.length=n.display.measureLineCachePos=0,n.display.cachedCharWidth=n.display.cachedTextHeight=n.display.cachedPaddingH=null,n.options.lineWrapping||(n.display.maxLineChanged=!0),n.display.lineNumChars=null}function vh(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function yh(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function oo(n,t,i,r){var f,e,u,o,s;if(t.widgets)for(f=0;f<t.widgets.length;++f)t.widgets[f].above&&(e=ie(t.widgets[f]),i.top+=e,i.bottom+=e);return r=="line"?i:(r||(r="local"),u=lu(n,t),r=="local"?u+=ch(n.display):u-=n.display.viewOffset,(r=="page"||r=="window")&&(o=c(n.display.lineSpace),u+=o.top+(r=="window"?0:yh()),s=o.left+(r=="window"?0:vh()),i.left+=s,i.right+=s),i.top+=u,i.bottom+=u,i)}function ph(n,t,i){var r,u,f,e;return i=="div"?t:(r=t.left,u=t.top,i=="page"?(r-=vh(),u-=yh()):i!="local"&&i||(f=c(n.display.sizer),r+=f.left,u+=f.top),e=c(n.display.lineSpace),{left:r-e.left,top:u-e.top})}function so(n,t,i,u,f){return u||(u=r(n.doc,t.line)),oo(n,u,pr(n,u,t.ch,null,f),i)}function it(n,t,i,u,f){function s(t,r){var e=pr(n,u,t,f,r?"right":"left");return r?e.left=e.right:e.right=e.left,oo(n,u,e,i)}function c(n,t){var i=e[t],r=i.level%2;return(n==ds(i)&&t&&i.level<e[t-1].level?(i=e[--t],n=gs(i)-(i.level%2?0:1),r=!0):n==gs(i)&&t<e.length-1&&i.level<e[t+1].level&&(i=e[++t],n=ds(i)-i.level%2,r=!1),r&&n==i.to&&n>i.from)?s(n-1):s(n,r)}var e,o,l,h;return(u=u||r(n.doc,t.line),f||(f=eo(n,u)),e=lt(u),o=t.ch,!e)?s(o):(l=nh(e,o),h=c(o,l),tf!=null&&(h.other=c(o,tf)),h)}function ef(n,i,r,u){var f=new t(n,i);return f.xRel=u,r&&(f.outside=!0),f}function ho(n,t,i){var u=n.doc,f,o;if(i+=n.display.viewOffset,i<0)return ef(u.first,0,!0,-1);if(f=cu(u,i),o=u.first+u.size-1,f>o)return ef(u.first+u.size-1,r(u,o).text.length,!0,1);for(t<0&&(t=0);;){var c=r(u,f),e=dv(n,c,f,t,i),s=te(c),h=s&&s.find();if(s&&(e.ch>h.from.ch||e.ch==h.from.ch&&e.xRel>0))f=h.to.line;else return e}}function dv(n,i,r,u,f){function p(u){var f=it(n,t(r,u),"line",i,ut);return(h=!0,g>f.bottom)?f.left-nt:g<f.top?f.left+nt:(h=!1,f.left)}var g=f-lu(n,i),h=!1,nt=2*n.display.wrapper.clientWidth,ut=eo(n,i),tt=lt(i),w=i.text.length,e=he(i),o=ce(i),v=p(e),rt=h,l=p(o),b=h,c,k,a,s,d,y;if(u>l)return ef(r,o,b,1);for(;;){if(tt?o==e||o==ih(i,e,1):o-e<=1){for(c=u<v||u-v<=l-u?e:o,k=u-(c==e?v:l);se(i.text.charAt(c));)++c;return ef(r,c,c==e?rt:b,k<0?-1:k?1:0)}if(a=Math.ceil(w/2),s=e+a,tt)for(s=e,d=0;d<a;++d)s=ih(i,s,1);y=p(s),y>u?(o=s,l=y,(b=h)&&(l+=1e3),w=a):(e=s,v=y,rt=h,w-=a)}}function oi(n){var r,t;if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(ei==null){for(ei=i("pre"),r=0;r<49;++r)ei.appendChild(document.createTextNode("x")),ei.appendChild(i("br"));ei.appendChild(document.createTextNode("x"))}return yt(n.measure,ei),t=ei.offsetHeight/50,t>3&&(n.cachedTextHeight=t),bu(n.measure),t||1}function wh(n){var r,u,t;return n.cachedCharWidth!=null?n.cachedCharWidth:(r=i("span","x"),u=i("pre",[r]),yt(n.measure,u),t=r.offsetWidth,t>2&&(n.cachedCharWidth=t),t||10)}function ki(n){n.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++bh},yu++||(ti=[])}function di(n){var t=n.curOp,h=n.doc,i=n.display,v,a,f,y,e,p,w,o,s,c,r;if(n.curOp=null,t.updateMaxLine&&be(n),i.maxLineChanged&&!n.options.lineWrapping&&i.maxLine&&(v=kv(n,i.maxLine),i.sizer.style.minWidth=Math.max(0,v+3)+"px",i.maxLineChanged=!1,a=Math.max(0,i.sizer.offsetLeft+i.sizer.offsetWidth-i.scroller.clientWidth),a<h.scrollLeft&&!t.updateScrollPos&&gi(n,Math.min(i.scroller.scrollLeft,a),!0)),t.updateScrollPos?f=t.updateScrollPos:t.selectionChanged&&i.scroller.clientHeight&&(e=it(n,h.sel.head),f=wf(n,e.left,e.top,e.left,e.bottom)),(t.changes.length||t.forceUpdate||f&&f.scrollTop!=null)&&(y=uf(n,t.changes,f&&f.scrollTop,t.forceUpdate),n.display.scroller.offsetHeight&&(n.doc.scrollTop=n.display.scroller.scrollTop)),!y&&t.selectionChanged&&uo(n),t.updateScrollPos?(p=Math.max(0,Math.min(i.scroller.scrollHeight-i.scroller.clientHeight,f.scrollTop)),w=Math.max(0,Math.min(i.scroller.scrollWidth-i.scroller.clientWidth,f.scrollLeft)),i.scroller.scrollTop=i.scrollbarV.scrollTop=h.scrollTop=p,i.scroller.scrollLeft=i.scrollbarH.scrollLeft=h.scrollLeft=w,no(n),t.scrollToPos&&vc(n,u(n.doc,t.scrollToPos.from),u(n.doc,t.scrollToPos.to),t.scrollToPos.margin)):f&&oy(n),t.selectionChanged&&ff(n),n.state.focused&&t.updateInput&&ht(n,t.userSelChange),o=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers,o)for(r=0;r<o.length;++r)o[r].lines.length||l(o[r],"hide");if(s)for(r=0;r<s.length;++r)s[r].lines.length&&l(s[r],"unhide");if(--yu||(c=ti,ti=null),t.textChanged&&l(n,"change",n,t.textChanged),t.cursorActivity&&l(n,"cursorActivity",n),c)for(r=0;r<c.length;++r)c[r]()}function e(n,t){return function(){var i=n||this,r=!i.curOp,u;r&&ki(i);try{u=t.apply(i,arguments)}finally{r&&di(i)}return u}}function wr(n){return function(){var t=this.cm&&!this.cm.curOp,i;t&&ki(this.cm);try{i=n.apply(this,arguments)}finally{t&&di(this.cm)}return i}}function co(n,t){var i=!n.curOp,r;i&&ki(n);try{r=t()}finally{i&&di(n)}return r}function a(n,t,i,r){t==null&&(t=n.doc.first),i==null&&(i=n.doc.first+n.doc.size),n.curOp.changes.push({from:t,to:i,diff:r})}function of(n){n.display.pollingFast||n.display.poll.set(n.options.pollInterval,function(){lo(n),n.state.focused&&of(n)})}function br(n){function i(){var r=lo(n);r||t?(n.display.pollingFast=!1,of(n)):(t=!0,n.display.poll.set(60,i))}var t=!1;n.display.pollingFast=!0,n.display.poll.set(20,i)}function lo(n){var e=n.display.input,h=n.display.prevInput,w=n.doc,u=w.sel,i,y,f,d,nt,p,a,v;if(!n.state.focused||ep(e)||sf(n)||n.options.disableInput||(n.state.pasteIncoming&&n.state.fakedLastChar&&(e.value=e.value.substring(0,e.value.length-1),n.state.fakedLastChar=!1),i=e.value,i==h&&s(u.from,u.to)))return!1;if(k&&!b&&n.display.inputHasSelection===i)return ht(n,!0),!1;for(y=!n.curOp,y&&ki(n),u.shift=!1,f=0,d=Math.min(h.length,i.length);f<d&&h.charCodeAt(f)==i.charCodeAt(f);)++f;var c=u.from,o=u.to,l=i.slice(f);if(f<h.length?c=t(c.line,c.ch-(h.length-f)):n.state.overwrite&&s(c,o)&&!n.state.pasteIncoming&&(o=t(o.line,Math.min(r(w,o.line).text.length,o.ch+l.length))),nt=n.curOp.updateInput,p={from:c,to:o,text:ri(l),origin:n.state.pasteIncoming?"paste":n.state.cutIncoming?"cut":"+input"},nr(n.doc,p,"end"),n.curOp.updateInput=nt,g(n,"inputRead",n,p),l&&!n.state.pasteIncoming&&n.options.electricChars&&n.options.smartIndent&&u.head.ch<100&&(a=n.getModeAt(u.head).electricChars,a))for(v=0;v<a.length;v++)if(l.indexOf(a.charAt(v))>-1){kf(n,u.head.line,"smart");break}return i.length>1e3||i.indexOf("\n")>-1?e.value=n.display.prevInput="":n.display.prevInput=i,y&&di(n),n.state.pasteIncoming=n.state.cutIncoming=!1,!0}function ht(n,t){var r,f,i=n.doc,u;s(i.sel.from,i.sel.to)?t&&(n.display.prevInput=n.display.input.value="",k&&!b&&(n.display.inputHasSelection=null)):(n.display.prevInput="",r=la&&(i.sel.to.line-i.sel.from.line>100||(f=n.getSelection()).length>1e3),u=r?"-":f||n.getSelection(),n.display.input.value=u,n.state.focused&&ra(n.display.input),k&&!b&&(n.display.inputHasSelection=u)),n.display.inaccurateSelection=r}function d(n){n.options.readOnly=="nocursor"||ve&&document.activeElement==n.display.input||n.display.input.focus()}function ao(n){n.state.focused||(d(n),yo(n))}function sf(n){return n.options.readOnly||n.doc.cantEdit}function gv(n){function u(){n.state.focused&&setTimeout(ut(d,n),0)}function f(){i==null&&(i=setTimeout(function(){i=null,t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=du=null,bi(n),co(n,ut(a,n))},100))}function s(){for(var n=t.wrapper.parentNode;n&&n!=document.body;n=n.parentNode);n?setTimeout(s,5e3):kt(window,"resize",f)}function h(t){at(n,t)||n.options.onDragEvent&&n.options.onDragEvent(n,au(t))||vu(t)}function c(i){t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,t.input.value=n.getSelection(),ra(t.input)),i.type=="cut"&&(n.state.cutIncoming=!0)}var t=n.display,i;o(t.scroller,"mousedown",e(n,ny)),st?o(t.scroller,"dblclick",e(n,function(t){var i,u;at(n,t)||(i=kr(n,t),!i||dh(n,t)||si(n.display,t))||(v(t),u=ts(r(n.doc,i.line).text,i),p(n.doc,u.from,u.to))})):o(t.scroller,"dblclick",function(t){at(n,t)||v(t)}),o(t.lineSpace,"selectstart",function(n){si(t,n)||v(n)}),ye||o(t.scroller,"contextmenu",function(t){ec(n,t)}),o(t.scroller,"scroll",function(){t.scroller.clientHeight&&(dr(n,t.scroller.scrollTop),gi(n,t.scroller.scrollLeft,!0),l(n,"scroll",n))}),o(t.scrollbarV,"scroll",function(){t.scroller.clientHeight&&dr(n,t.scrollbarV.scrollTop)}),o(t.scrollbarH,"scroll",function(){t.scroller.clientHeight&&gi(n,t.scrollbarH.scrollLeft)}),o(t.scroller,"mousewheel",function(t){gh(n,t)}),o(t.scroller,"DOMMouseScroll",function(t){gh(n,t)}),o(t.scrollbarH,"mousedown",u),o(t.scrollbarV,"mousedown",u),o(t.wrapper,"scroll",function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),o(window,"resize",f),setTimeout(s,5e3),o(t.input,"keyup",e(n,rc)),o(t.input,"input",function(){k&&!b&&n.display.inputHasSelection&&(n.display.inputHasSelection=null),br(n)}),o(t.input,"keydown",e(n,uc)),o(t.input,"keypress",e(n,fc)),o(t.input,"focus",ut(yo,n)),o(t.input,"blur",ut(po,n)),n.options.dragDrop&&(o(t.scroller,"dragstart",function(t){ry(n,t)}),o(t.scroller,"dragenter",h),o(t.scroller,"dragover",h),o(t.scroller,"drop",e(n,iy))),o(t.scroller,"paste",function(i){si(t,i)||(d(n),br(n))}),o(t.input,"paste",function(){if(y&&!n.state.fakedLastChar&&!(new Date-n.state.lastMiddleDown<200)){var i=t.input.selectionStart,r=t.input.selectionEnd;t.input.value+="$",t.input.selectionStart=i,t.input.selectionEnd=r,n.state.fakedLastChar=!0}n.state.pasteIncoming=!0,br(n)}),o(t.input,"cut",c),o(t.input,"copy",c),ae&&o(t.sizer,"mouseup",function(){document.activeElement==t.input&&t.input.blur(),d(n)})}function si(n,t){for(var i=ps(t);i!=n.wrapper;i=i.parentNode)if(!i||i.ignoreEvents||i.parentNode==n.sizer&&i!=n.mover)return!0}function kr(n,t,i){var r=n.display,u,e,o,f;if(!i&&(u=ps(t),u==r.scrollbarH||u==r.scrollbarH.firstChild||u==r.scrollbarV||u==r.scrollbarV.firstChild||u==r.scrollbarFiller||u==r.gutterFiller))return null;f=c(r.lineSpace);try{e=t.clientX,o=t.clientY}catch(t){return null}return ho(n,e-f.left,o-f.top)}function ny(n){function wt(n){if(!s(yt,n)){if(yt=n,w=="single"){p(i.doc,u(a,f),n);return}if(tt=u(a,tt),ft=u(a,ft),w=="double"){var e=ts(r(a,n.line).text,n);h(n,tt)?p(i.doc,e.from,ft):p(i.doc,tt,e.to)}else w=="triple"&&(h(n,tt)?p(i.doc,ft,u(a,t(n.line,0))):p(i.doc,tt,u(a,t(n.line+1,0))))}}function ct(n){var f=++rt,t=kr(i,n,!0),r,u;t&&(s(t,ot)?(u=n.clientY<ht.top?-20:n.clientY>ht.bottom?20:0,u&&setTimeout(e(i,function(){rt==f&&(l.scroller.scrollTop+=u,ct(n))}),50)):(ao(i),ot=t,wt(t),r=ge(l,a),(t.line>=r.to||t.line<r.from)&&setTimeout(e(i,function(){rt==f&&ct(n)}),150)))}function pt(n){rt=Infinity,v(n),d(i),kt(document,"mousemove",lt),kt(document,"mouseup",vt)}var f,it,w,et,ot,nt,ht,rt,lt,vt;if(!at(this,n)){var i=this,l=i.display,a=i.doc,g=a.sel;if(g.shift=n.shiftKey,si(l,n)){y||(l.scroller.draggable=!1,setTimeout(function(){l.scroller.draggable=!0},100));return}if(!dh(i,n)){f=kr(i,n),window.focus();switch(ta(n)){case 3:ye&&ec.call(i,i,n);return;case 2:y&&(i.state.lastMiddleDown=+new Date),f&&p(i.doc,f),setTimeout(ut(d,i),20),v(n);return}if(!f){ps(n)==l.scroller&&v(n);return}if(setTimeout(ut(ao,i),0),it=+new Date,w="single",cf&&cf.time>it-400&&s(cf.pos,f)?(w="triple",v(n),setTimeout(ut(d,i),20),hy(i,f.line)):hf&&hf.time>it-400&&s(hf.pos,f)?(w="double",cf={time:it,pos:f},v(n),et=ts(r(a,f.line).text,f),p(i.doc,et.from,et.to)):hf={time:it,pos:f},ot=f,i.options.dragDrop&&ca&&!sf(i)&&!s(g.from,g.to)&&!h(f,g.from)&&!h(g.to,f)&&w=="single"){nt=e(i,function(t){y&&(l.scroller.draggable=!1),i.state.draggingText=!1,kt(document,"mouseup",nt),kt(l.scroller,"drop",nt),Math.abs(n.clientX-t.clientX)+Math.abs(n.clientY-t.clientY)<10&&(v(t),p(i.doc,f),d(i),st&&!b&&setTimeout(function(){document.body.focus(),d(i)},20))}),y&&(l.scroller.draggable=!0),i.state.draggingText=nt,l.scroller.dragDrop&&l.scroller.dragDrop(),o(document,"mouseup",nt),o(l.scroller,"drop",nt);return}v(n),w=="single"&&p(i.doc,u(a,f));var tt=g.from,ft=g.to,yt=f;ht=c(l.wrapper),rt=0,lt=e(i,function(n){(k&&!pa?n.buttons:ta(n))?ct(n):pt(n)}),vt=e(i,pt),o(document,"mousemove",lt),o(document,"mouseup",vt)}}}function kh(n,t,i,r,u){var s,e,o,h,f,l,a,y;try{s=t.clientX,e=t.clientY}catch(t){return!1}if(s>=Math.floor(c(n.display.gutters).right))return!1;if(r&&v(t),o=n.display,h=c(o.lineDiv),e>h.bottom||!vt(n,i))return ys(t);for(e-=h.top-o.viewOffset,f=0;f<n.options.gutters.length;++f)if(l=o.gutters.childNodes[f],l&&c(l).right>=s)return a=cu(n.doc,e),y=n.options.gutters[f],u(n,i,n,a,y,t),ys(t)}function ty(n,t){return vt(n,"gutterContextMenu")?kh(n,t,"gutterContextMenu",!1,l):!1}function dh(n,t){return kh(n,t,"gutterClick",!0,g)}function iy(n){var t=this,i,f,e,r,s,c;if(!at(t,n)&&!si(t.display,n)&&(!t.options.onDragEvent||!t.options.onDragEvent(t,au(n)))&&(v(n),k&&(vo=+new Date),i=kr(t,n,!0),f=n.dataTransfer.files,i&&!sf(t)))if(f&&f.length&&window.FileReader&&window.File){var o=f.length,r=Array(o),l=0,a=function(n,f){var e=new FileReader;e.onload=function(){r[f]=e.result,++l==o&&(i=u(t.doc,i),nr(t.doc,{from:i,to:i,text:ri(r.join("\n")),origin:"paste"},"around"))},e.readAsText(n)};for(e=0;e<o;++e)a(f[e],e)}else{if(t.state.draggingText&&!(h(i,t.doc.sel.from)||h(t.doc.sel.to,i))){t.state.draggingText(n),setTimeout(ut(d,t),20);return}try{r=n.dataTransfer.getData("Text"),r&&(s=t.doc.sel.from,c=t.doc.sel.to,pt(t.doc,i,i),t.state.draggingText&&dt(t.doc,"",s,c,"paste"),t.replaceSelection(r,null,"paste"),d(t))}catch(n){}}}function ry(n,t){var u,r;if(k&&(!n.state.draggingText||+new Date-vo<100)){vu(t);return}at(n,t)||si(n.display,t)||(u=n.getSelection(),t.dataTransfer.setData("Text",u),t.dataTransfer.setDragImage&&!le&&(r=i("img",null,null,"position: fixed; left: 0; top: 0;"),r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ft&&(r.width=r.height=1,n.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ft&&r.parentNode.removeChild(r)))}function dr(n,t){Math.abs(n.doc.scrollTop-t)<2||(n.doc.scrollTop=t,vi||uf(n,[],t),n.display.scroller.scrollTop!=t&&(n.display.scroller.scrollTop=t),n.display.scrollbarV.scrollTop!=t&&(n.display.scrollbarV.scrollTop=t),vi&&uf(n,[]),vr(n,100))}function gi(n,t,i){(i?t==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-t)<2)||(t=Math.min(t,n.display.scroller.scrollWidth-n.display.scroller.clientWidth),n.doc.scrollLeft=t,no(n),n.display.scroller.scrollLeft!=t&&(n.display.scroller.scrollLeft=t),n.display.scrollbarH.scrollLeft!=t&&(n.display.scrollbarH.scrollLeft=t))}function gh(n,t){var f=t.wheelDeltaX,u=t.wheelDeltaY,i,r,e;if(f==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(f=t.detail),u==null&&t.detail&&t.axis==t.VERTICAL_AXIS?u=t.detail:u==null&&(u=t.wheelDelta),i=n.display,r=i.scroller,f&&r.scrollWidth>r.clientWidth||u&&r.scrollHeight>r.clientHeight){if(u&&pi&&y)for(e=t.target;e!=r;e=e.parentNode)if(e.lineObj){n.display.currentWheelTarget=e;break}if(f&&!vi&&!ft&&rt!=null){u&&dr(n,Math.max(0,Math.min(r.scrollTop+u*rt,r.scrollHeight-r.clientHeight))),gi(n,Math.max(0,Math.min(r.scrollLeft+f*rt,r.scrollWidth-r.clientWidth))),v(t),i.wheelStartX=null;return}if(u&&rt!=null){var s=u*rt,o=n.doc.scrollTop,h=o+i.wrapper.clientHeight;s<0?o=Math.max(0,o+s-50):h=Math.min(n.doc.height,h+s+50),uf(n,[],{top:o,bottom:h})}gr<20&&(i.wheelStartX==null?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=f,i.wheelDY=u,setTimeout(function(){if(i.wheelStartX!=null){var n=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,u=t&&i.wheelDY&&t/i.wheelDY||n&&i.wheelDX&&n/i.wheelDX;(i.wheelStartX=i.wheelStartY=null,u)&&(rt=(rt*gr+u)/(gr+1),++gr)}},200)):(i.wheelDX+=f,i.wheelDY+=u))}}function lf(n,t,i){if(typeof t=="string"&&(t=tu[t],!t))return!1;n.display.pollingFast&&lo(n)&&(n.display.pollingFast=!1);var r=n.doc,f=r.sel.shift,u=!1;try{sf(n)&&(n.state.suppressEdits=!0),i&&(r.sel.shift=!1),u=t(n)!=ws}finally{r.sel.shift=f,n.state.suppressEdits=!1}return u}function nc(n){var t=n.state.keyMaps.slice(0);return n.options.extraKeys&&t.push(n.options.extraKeys),t.push(n.options.keyMap),t}function ic(n,t){var e=us(n.options.keyMap),r=e.auto,i,u,f;return(clearTimeout(tc),r&&!wc(t)&&(tc=setTimeout(function(){us(n.options.keyMap)==e&&(n.options.keyMap=r.call?r.call(null,n):r,eh(n))},50)),i=bc(t,!0),u=!1,!i)?!1:(f=nc(n),u=t.shiftKey?iu("Shift-"+i,f,function(t){return lf(n,t,!0)})||iu(i,f,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion)return lf(n,t)}):iu(i,f,function(t){return lf(n,t)}),u&&(v(t),ff(n),b&&(t.oldKeyCode=t.keyCode,t.keyCode=0),g(n,"keyHandled",n,i,t)),u)}function uy(n,t,i){var r=iu("'"+i+"'",nc(n),function(t){return lf(n,t,!0)});return r&&(v(t),ff(n),g(n,"keyHandled",n,"'"+i+"'",t)),r}function rc(n){var t=this;at(t,n)||t.options.onKeyEvent&&t.options.onKeyEvent(t,au(n))||n.keyCode==16&&(t.doc.sel.shift=!1)}function uc(n){var t=this,i,r;(ao(t),at(t,n)||t.options.onKeyEvent&&t.options.onKeyEvent(t,au(n)))||(st&&n.keyCode==27&&(n.returnValue=!1),i=n.keyCode,t.doc.sel.shift=i==16||n.shiftKey,r=ic(t,n),ft&&(af=r?i:null,r||i!=88||la||!(pi?n.metaKey:n.ctrlKey)||t.replaceSelection("")))}function fc(n){var t=this,i,r,u;if(!at(t,n)&&(!t.options.onKeyEvent||!t.options.onKeyEvent(t,au(n)))){if(i=n.keyCode,r=n.charCode,ft&&i==af){af=null,v(n);return}(ft&&(!n.which||n.which<10)||ae)&&ic(t,n)||(u=String.fromCharCode(r==null?i:r),uy(t,n,u))||(k&&!b&&(t.display.inputHasSelection=null),br(t))}}function yo(n){n.options.readOnly!="nocursor"&&(n.state.focused||(l(n,"focus",n),n.state.focused=!0,n.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1&&(n.display.wrapper.className+=" CodeMirror-focused"),n.curOp||(ht(n,!0),y&&setTimeout(ut(ht,n,!0),0))),of(n),ff(n))}function po(n){n.state.focused&&(l(n,"blur",n),n.state.focused=!1,n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.doc.sel.shift=!1)},150)}function ec(n,t){function v(){if(i.input.selectionStart!=null){var n=i.input.value=""+(s(r.from,r.to)?"":i.input.value);i.prevInput="",i.input.selectionStart=1,i.input.selectionEnd=n.length}}function y(){if(i.inputDiv.style.position="relative",i.input.style.cssText=a,b&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=c),of(n),i.input.selectionStart!=null){(!k||b)&&v(),clearTimeout(wo);var r=0,t=function(){i.prevInput==""&&i.input.selectionStart==0?e(n,tu.selectAll)(n):r++<10?wo=setTimeout(t,500):ht(n)};wo=setTimeout(t,200)}}var i,r,u,c,l,a,f;at(n,t,"contextmenu")||(i=n.display,r=n.doc.sel,si(i,t)||ty(n,t))||(u=kr(n,t),c=i.scroller.scrollTop,u&&!ft)&&(l=n.options.resetSelectionOnContextMenu,l&&(s(r.from,r.to)||h(u,r.from)||!h(u,r.to))&&e(n,pt)(n.doc,u,u),a=i.input.style.cssText,i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: transparent; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",d(n),ht(n,!0),s(r.from,r.to)&&(i.input.value=i.prevInput=" "),k&&!b&&v(),ye?(vu(t),f=function(){kt(window,"mouseup",f),setTimeout(y,20)},o(window,"mouseup",f)):setTimeout(y,50))}function oc(n,i,f){var e,s,o,c;return h(i.from,f)?(e=i.text.length-1-(i.to.line-i.from.line),f.line>i.to.line+e)?(s=f.line-e,o=n.first+n.size-1,s>o)?t(o,r(n,o).text.length):yf(f,r(n,s).text.length):f.line==i.to.line+e?yf(f,nt(i.text).length+(i.text.length==1?i.from.ch:0)+r(n,i.to.line).text.length-i.to.ch):(c=f.line-i.from.line,yf(f,i.text[c].length+(c?0:i.from.ch))):u(n,f)}function bo(n,i,r){var u,f;return r&&typeof r=="object"?{anchor:oc(n,i,r.anchor),head:oc(n,i,r.head)}:r=="start"?{anchor:i.from,head:i.from}:(u=vf(i),r=="around")?{anchor:i.from,head:u}:r=="end"?{anchor:u,head:u}:(f=function(n){if(h(n,i.from))return n;if(!h(i.to,n))return u;var f=n.line+i.text.length-(i.to.line-i.from.line)-1,r=n.ch;return n.line==i.to.line&&(r+=u.ch-i.to.ch),t(f,r)},{anchor:f(n.sel.anchor),head:f(n.sel.head)})}function sc(n,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return(i&&(r.update=function(t,i,r,f){t&&(this.from=u(n,t)),i&&(this.to=u(n,i)),r&&(this.text=r),f!==undefined&&(this.origin=f)}),l(n,"beforeChange",n,r),n.cm&&l(n.cm,"beforeChange",n.cm,r),r.canceled)?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function nr(n,t,i,r){var u,f;if(n.cm){if(!n.cm.curOp)return e(n.cm,nr)(n,t,i,r);if(n.cm.state.suppressEdits)return}if(!vt(n,"beforeChange")&&(!n.cm||!vt(n.cm,"beforeChange"))||(t=sc(n,t,!0),t))if(u=uh&&!r&&py(n,t.from,t.to),u){for(f=u.length-1;f>=1;--f)ko(n,{from:u[f].from,to:u[f].to,text:[""]});u.length&&ko(n,{from:u[0].from,to:u[0].to,text:t.text},i)}else ko(n,t,i)}function ko(n,t,i){var r,u;t.text.length==1&&t.text[0]==""&&s(t.from,t.to)||(r=bo(n,t,i),kl(n,t,r,n.cm?n.cm.curOp.id:NaN),nu(n,t,r,fs(n,t)),u=[],sr(n,function(n,i){i||ot(u,n.history)!=-1||(gl(n.history,t),u.push(n.history)),nu(n,t,null,fs(n,t))}))}function hc(n,t){var r,i,e,s,f,u,h,o;if((!n.cm||!n.cm.state.suppressEdits)&&(r=n.history,i=(t=="undo"?r.done:r.undone).pop(),i))for(e={changes:[],anchorBefore:i.anchorAfter,headBefore:i.headAfter,anchorAfter:i.anchorBefore,headAfter:i.headBefore,generation:r.generation},(t=="undo"?r.undone:r.done).push(e),r.generation=i.generation||++r.maxGeneration,s=vt(n,"beforeChange")||n.cm&&vt(n.cm,"beforeChange"),f=i.changes.length-1;f>=0;--f){if(u=i.changes[f],u.origin=t,s&&!sc(n,u,!1)){(t=="undo"?r.done:r.undone).length=0;return}e.changes.push(vs(n,u)),h=f?bo(n,u,null):{anchor:i.anchorBefore,head:i.headBefore},nu(n,u,h,gc(n,u)),o=[],sr(n,function(n,t){t||ot(o,n.history)!=-1||(gl(n.history,u),o.push(n.history)),nu(n,u,null,gc(n,u))})}}function cc(n,i){function r(n){return t(n.line+i,n.ch)}n.first+=i,n.cm&&a(n.cm,n.first,n.first,i),n.sel.head=r(n.sel.head),n.sel.anchor=r(n.sel.anchor),n.sel.from=r(n.sel.from),n.sel.to=r(n.sel.to)}function nu(n,i,u,f){var s,o;if(n.cm&&!n.cm.curOp)return e(n.cm,nu)(n,i,u,f);if(i.to.line<n.first){cc(n,i.text.length-1-(i.to.line-i.from.line));return}i.from.line>n.lastLine()||(i.from.line<n.first&&(s=i.text.length-1-(n.first-i.from.line),cc(n,s),i={from:t(n.first,0),to:t(i.to.line+s,i.to.ch),text:[nt(i.text)],origin:i.origin}),o=n.lastLine(),i.to.line>o&&(i={from:i.from,to:t(o,r(n,o).text.length),text:[i.text[0]],origin:i.origin}),i.removed=ls(n,i.from,i.to),u||(u=bo(n,i,null)),n.cm?fy(n.cm,i,f,u):cs(n,i,f,u))}function fy(n,t,i,u){var f=n.doc,o=n.display,e=t.from,c=t.to,l=!1,v=e.line,p,y,s;if(n.options.lineWrapping||(v=tt(wt(f,r(f,e.line))),f.iter(v,c.line+1,function(n){if(n==o.maxLine)return l=!0,!0})),h(f.sel.head,t.from)||h(t.to,f.sel.head)||(n.curOp.cursorActivity=!0),cs(f,t,i,u,fh(n)),n.options.lineWrapping||(f.iter(v,e.line+t.text.length,function(n){var t=rf(f,n);t>o.maxLineLength&&(o.maxLine=n,o.maxLineLength=t,o.maxLineChanged=!0,l=!1)}),l&&(n.curOp.updateMaxLine=!0)),f.frontier=Math.min(f.frontier,e.line),vr(n,400),p=t.text.length-(c.line-e.line)-1,a(n,e.line,c.line+1,p),vt(n,"change"))if(y={from:e,to:c,text:t.text,removed:t.removed,origin:t.origin},n.curOp.textChanged){for(s=n.curOp.textChanged;s.next;s=s.next);s.next=y}else n.curOp.textChanged=y}function dt(n,t,i,r,u){if(r||(r=i),h(r,i)){var f=r;r=i,i=f}typeof t=="string"&&(t=ri(t)),nr(n,{from:i,to:r,text:t,origin:u},null)}function t(n,i){if(!(this instanceof t))return new t(n,i);this.line=n,this.ch=i}function s(n,t){return n.line==t.line&&n.ch==t.ch}function h(n,t){return n.line<t.line||n.line==t.line&&n.ch<t.ch}function tr(n,t){return n.line-t.line||n.ch-t.ch}function hi(n){return t(n.line,n.ch)}function lc(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function u(n,i){if(i.line<n.first)return t(n.first,0);var u=n.first+n.size-1;return i.line>u?t(u,r(n,u).text.length):yf(i,r(n,i.line).text.length)}function yf(n,i){var r=n.ch;return r==null||r>i?t(n.line,i):r<0?t(n.line,0):n}function ir(n,t){return t>=n.first&&t<n.first+n.size}function p(n,t,i,r){var u,f;n.sel.shift||n.sel.extend?(u=n.sel.anchor,i&&(f=h(t,u),f!=h(i,u)?(u=t,t=i):f!=h(t,i)&&(t=i)),pt(n,u,t,r)):pt(n,t,i||t,r),n.cm&&(n.cm.curOp.userSelChange=!0)}function ey(n,t,i){var r={anchor:t,head:i};return l(n,"beforeSelectionChange",n,r),n.cm&&l(n.cm,"beforeSelectionChange",n.cm,r),r.anchor=u(n,r.anchor),r.head=u(n,r.head),r}function pt(n,t,i,r,u){var e,f,o;((!u&&vt(n,"beforeSelectionChange")||n.cm&&vt(n.cm,"beforeSelectionChange"))&&(e=ey(n,t,i),i=e.head,t=e.anchor),f=n.sel,f.goalColumn=null,r==null&&(r=h(i,f.head)?-1:1),(u||!s(t,f.anchor))&&(t=pf(n,t,r,u!="push")),(u||!s(i,f.head))&&(i=pf(n,i,r,u!="push")),s(f.anchor,t)&&s(f.head,i))||(f.anchor=t,f.head=i,o=h(i,t),f.from=o?i:t,f.to=o?t:i,n.cm&&(n.cm.curOp.updateInput=n.cm.curOp.selectionChanged=n.cm.curOp.cursorActivity=!0),g(n,"cursorActivity",n))}function ac(n){pt(n.doc,n.doc.sel.from,n.doc.sel.to,null,"push")}function pf(n,i,f,e){var w=!1,h=i,p=f||1,v,y,c,a,o;n.cantEdit=!1;n:for(;;){if(v=r(n,h.line),v.markedSpans)for(y=0;y<v.markedSpans.length;++y)if(c=v.markedSpans[y],a=c.marker,(c.from==null||(a.inclusiveLeft?c.from<=h.ch:c.from<h.ch))&&(c.to==null||(a.inclusiveRight?c.to>=h.ch:c.to>h.ch))){if(e&&(l(a,"beforeCursorEnter"),a.explicitlyCleared))if(v.markedSpans){--y;continue}else break;if(!a.atomic)continue;if(o=a.find()[p<0?"from":"to"],s(o,h)&&(o.ch+=p,o.ch<0?o=o.line>n.first?u(n,t(o.line-1)):null:o.ch>v.text.length&&(o=o.line<n.first+n.size-1?t(o.line+1,0):null),!o)){if(w)return e?(n.cantEdit=!0,t(n.first,0)):pf(n,i,f,!0);w=!0,o=i,p=-p}h=o;continue n}return h}}function oy(n){var t=vc(n,n.doc.sel.head,null,n.options.cursorScrollMargin),u;if(n.state.focused){var f=n.display,e=c(f.sizer),r=null;t.top+e.top<0?r=!0:t.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r==null||nv||(u=i("div","",null,"position: absolute; top: "+(t.top-f.viewOffset)+"px; height: "+(t.bottom-t.top+ai)+"px; left: "+t.left+"px; width: 2px;"),n.display.lineSpace.appendChild(u),u.scrollIntoView(r),n.display.lineSpace.removeChild(u))}}function vc(n,t,i,r){for(r==null&&(r=0);;){var o=!1,u=it(n,t),f=!i||i==t?u:it(n,i),e=wf(n,Math.min(u.left,f.left),Math.min(u.top,f.top)-r,Math.max(u.left,f.left),Math.max(u.bottom,f.bottom)+r),s=n.doc.scrollTop,h=n.doc.scrollLeft;if(e.scrollTop!=null&&(dr(n,e.scrollTop),Math.abs(n.doc.scrollTop-s)>1&&(o=!0)),e.scrollLeft!=null&&(gi(n,e.scrollLeft),Math.abs(n.doc.scrollLeft-h)>1&&(o=!0)),!o)return u}}function sy(n,t,i,r,u){var f=wf(n,t,i,r,u);f.scrollTop!=null&&dr(n,f.scrollTop),f.scrollLeft!=null&&gi(n,f.scrollLeft)}function wf(n,t,i,r,u){var f=n.display,v=oi(n.display),h,c,l,o,a;i<0&&(i=0);var y=f.scroller.clientHeight-ai,s=f.scroller.scrollTop,e={},p=n.doc.height+lh(f),w=i<v,b=u>p-v;return i<s?e.scrollTop=w?0:i:u>s+y&&(h=Math.min(i,(b?p:u)-y),h!=s&&(e.scrollTop=h)),c=f.scroller.clientWidth-ai,l=f.scroller.scrollLeft,t+=f.gutters.offsetWidth,r+=f.gutters.offsetWidth,o=f.gutters.offsetWidth,a=t<o+10,t<l+o||a?(a&&(t=0),e.scrollLeft=Math.max(0,t-10-o)):r>c+l-3&&(e.scrollLeft=r+10-c),e}function bf(n,t,i){n.curOp.updateScrollPos={scrollLeft:t==null?n.doc.scrollLeft:t,scrollTop:i==null?n.doc.scrollTop:i}}function go(n,t,i){var r=n.curOp.updateScrollPos||(n.curOp.updateScrollPos={scrollLeft:n.doc.scrollLeft,scrollTop:n.doc.scrollTop}),u=n.display.scroller;r.scrollTop=Math.max(0,Math.min(u.scrollHeight-u.clientHeight,r.scrollTop+i)),r.scrollLeft=Math.max(0,Math.min(u.scrollWidth-u.clientWidth,r.scrollLeft+t))}function kf(n,i,u,f){var h=n.doc,p,s,e,c,a,y;u==null&&(u="add"),u=="smart"&&(n.doc.mode.indent?p=yr(n,i):u="prev");var l=n.options.tabSize,o=r(h,i),v=ii(o.text,null,l);if(o.stateAfter&&(o.stateAfter=null),s=o.text.match(/^\s*/)[0],f||/\S/.test(o.text)){if(u=="smart"&&(e=n.doc.mode.indent(p,o.text.slice(s.length),o.text),e==ws)){if(!f)return;u="prev"}}else e=0,u="not";if(u=="prev"?e=i>h.first?ii(r(h,i-1).text,null,l):0:u=="add"?e=v+n.options.indentUnit:u=="subtract"?e=v-n.options.indentUnit:typeof u=="number"&&(e=v+u),e=Math.max(0,e),c="",a=0,n.options.indentWithTabs)for(y=Math.floor(e/l);y;--y)a+=l,c+="\t";a<e&&(c+=ia(e-a)),c!=s?dt(n.doc,c,t(i,0),t(i,s.length),"+input"):h.sel.head.line==i&&h.sel.head.ch<s.length&&pt(h,t(i,s.length),t(i,s.length),1),o.stateAfter=null}function df(n,t,i){var u=t,f=t,e=n.doc;if(typeof t=="number"?f=r(e,lc(e,t)):u=tt(t),u==null)return null;if(i(f,u))a(n,u,u+1);else return null;return f}function ns(n,i,u,f,e){function d(){var t=a+u;return t<n.first||t>=n.first+n.size?w=!1:(a=t,h=r(n,t))}function c(n){var t=(e?ih:va)(h,o,u,!0);if(t==null)if(!n&&d())o=e?(u<0?ce:he)(h):u<0?h.text.length:0;else return w=!1;else o=t;return!0}var a=i.line,o=i.ch,k=u,h=r(n,a),w=!0,v,y,l,p,s,b;if(f=="char")c();else if(f=="column")c(!0);else if(f=="word"||f=="group")for(v=null,y=f=="group",l=!0;;l=!1){if(u<0&&!c(!l))break;if(p=h.text.charAt(o)||"\n",s=wu(p)?"w":y&&p=="\n"?"n":!y||/\s/.test(p)?null:"p",!y||l||s||(s="s"),v&&v!=s){u<0&&(u=1,c());break}if(s&&(v=s),u>0&&!c(!l))break}return b=pf(n,t(a,o),k,!0),w||(b.hitSide=!0),b}function yc(n,t,i,r){var o=n.doc,s=t.left,u,e,f;for(r=="page"?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=t.top+i*(e-(i<0?1.5:.5)*oi(n.display))):r=="line"&&(u=i>0?t.bottom+3:t.top-3);;){if(f=ho(n,s,u),!f.outside)break;if(i<0?u<=0:u>=o.height){f.hitSide=!0;break}u+=i*5}return f}function ts(n,i){var r=i.ch,u=i.ch,f,e;if(n){for((i.xRel<0||u==n.length)&&r?--r:++u,f=n.charAt(r),e=wu(f)?wu:/\s/.test(f)?function(n){return/\s/.test(n)}:function(n){return!/\s/.test(n)&&!wu(n)};r>0&&e(n.charAt(r-1));)--r;while(u<n.length&&e(n.charAt(u)))++u}return{from:t(i.line,r),to:t(i.line,u)}}function hy(n,i){p(n.doc,t(i,0),u(n.doc,t(i+1,0)))}function f(t,i,r,u){n.defaults[t]=i,r&&(ci[t]=u?function(n,t,i){i!=is&&r(n,t,i)}:r)}function fr(n,t){var r,u,i;if(t===!0)return t;if(n.copyState)return n.copyState(t);r={};for(u in t)i=t[u],i instanceof Array&&(i=i.concat([])),r[u]=i;return r}function pc(n,t,i){return n.startState?n.startState(t,i):!0}function us(n){return typeof n=="string"?ct[n]:n}function iu(n,t,i){function u(t){var f,r,e,s,o;if(t=us(t),f=t[n],f===!1)return"stop";if(f!=null&&i(f))return!0;if(t.nofallthrough)return"stop";if(r=t.fallthrough,r==null)return!1;if(Object.prototype.toString.call(r)!="[object Array]")return u(r);for(e=0,s=r.length;e<s;++e)if(o=u(r[e]),o)return o;return!1}for(var f,r=0;r<t.length;++r)if(f=u(t[r]),f)return f!="stop"}function wc(n){var t=ui[n.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function bc(n,t){if(ft&&n.keyCode==34&&n.char)return!1;var i=ui[n.keyCode];return i==null||n.altGraphKey?!1:(n.altKey&&(i="Alt-"+i),(rh?n.metaKey:n.ctrlKey)&&(i="Ctrl-"+i),(rh?n.ctrlKey:n.metaKey)&&(i="Cmd-"+i),!t&&n.shiftKey&&(i="Shift-"+i),i)}function ru(n,t){this.pos=this.start=0,this.string=n,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0}function ni(n,t){this.lines=[],this.type=t,this.doc=n}function uu(n,t,r,u,f){var c,v,l,y;if(u&&u.shared)return cy(n,t,r,u,f);if(n.cm&&!n.cm.curOp)return e(n.cm,uu)(n,t,r,u,f);if(c=new ni(n,f),u&&oe(u,c),h(r,t)||s(t,r)&&c.clearWhenEmpty!==!1)return c;if(c.replacedWith&&(c.collapsed=!0,c.replacedWith=i("span",[c.replacedWith],"CodeMirror-widget"),u.handleMouseEvents||(c.replacedWith.ignoreEvents=!0)),c.collapsed){if(il(n,t.line,t,r,c)||t.line!=r.line&&il(n,r.line,t,r,c))throw new Error("Inserting collapsed marker partially overlapping an existing one");wi=!0}return c.addToHistory&&kl(n,{from:t,to:r,origin:"markText"},{head:n.sel.head,anchor:n.sel.anchor},NaN),v=t.line,l=n.cm,n.iter(v,r.line+1,function(i){l&&c.collapsed&&!l.options.lineWrapping&&wt(n,i)==l.display.maxLine&&(y=!0);var u={from:null,to:null,marker:c};v==t.line&&(u.from=t.ch),v==r.line&&(u.to=r.ch),c.collapsed&&v!=t.line&&et(i,0),ay(i,u),++v}),c.collapsed&&n.iter(t.line,r.line+1,function(t){li(n,t)&&et(t,0)}),c.clearOnEnter&&o(c,"beforeCursorEnter",function(){c.clear()}),c.readOnly&&(uh=!0,(n.history.done.length||n.history.undone.length)&&n.clearHistory()),c.collapsed&&(c.id=++kc,c.atomic=!0),l&&(y&&(l.curOp.updateMaxLine=!0),(c.className||c.title||c.startStyle||c.endStyle||c.collapsed)&&a(l,t.line,r.line+1),c.atomic&&ac(l)),c}function fu(n,t){this.markers=n,this.primary=t;for(var i=0,r=this;i<n.length;++i)n[i].parent=this,o(n[i],"clear",function(){r.clear()})}function cy(n,t,i,r,f){r=oe(r),r.shared=!1;var e=[uu(n,t,i,r,f)],o=e[0],s=r.replacedWith;return sr(n,function(n){s&&(r.replacedWith=s.cloneNode(!0)),e.push(uu(n,u(n,t),u(n,i),r,f));for(var h=0;h<n.linked.length;++h)if(n.linked[h].isParent)return;o=nt(e)}),new fu(e,o)}function eu(n,t){var i,r;if(n)for(i=0;i<n.length;++i)if(r=n[i],r.marker==t)return r}function ly(n,t){for(var r,i=0;i<n.length;++i)n[i]!=t&&(r||(r=[])).push(n[i]);return r}function ay(n,t){n.markedSpans=n.markedSpans?n.markedSpans.concat([t]):[t],t.marker.attachLine(n)}function vy(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t);!s&&(r.from!=t||f.type!="bookmark"||i&&r.marker.insertLeft)||(o=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t),(e||(e=[])).push({from:r.from,to:o?null:r.to,marker:f}))}return e}function yy(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t);(s||r.from==t&&f.type=="bookmark"&&(!i||r.marker.insertLeft))&&(o=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t),(e||(e=[])).push({from:o?null:r.from-t,to:r.to==null?null:r.to-t,marker:f}))}return e}function fs(n,t){var p=ir(n,t.from.line)&&r(n,t.from.line).markedSpans,w=ir(n,t.to.line)&&r(n,t.to.line).markedSpans,f,o,l,v,y,i;if(!p&&!w)return null;var a=t.from.ch,k=t.to.ch,b=s(t.from,t.to),u=vy(p,a,b),e=yy(w,k,b),h=t.text.length==1,c=nt(t.text).length+(h?a:0);if(u)for(i=0;i<u.length;++i)f=u[i],f.to==null&&(o=eu(e,f.marker),o?h&&(f.to=o.to==null?null:o.to+c):f.to=a);if(e)for(i=0;i<e.length;++i)f=e[i],f.to!=null&&(f.to+=c),f.from==null?(o=eu(u,f.marker),o||(f.from=c,h&&(u||(u=[])).push(f))):(f.from+=c,h&&(u||(u=[])).push(f));if(u&&(u=dc(u)),e&&e!=u&&(e=dc(e)),l=[u],!h){if(v=t.text.length-2,v>0&&u)for(i=0;i<u.length;++i)u[i].to==null&&(y||(y=[])).push({from:null,to:null,marker:u[i].marker});for(i=0;i<v;++i)l.push(y);l.push(e)}return l}function dc(n){for(var i,t=0;t<n.length;++t)i=n[t],i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&n.splice(t--,1);return n.length?n:null}function gc(n,t){var i=rp(n,t),s=fs(n,t),r,f,u,e,h,o;if(!i)return s;if(!s)return i;for(r=0;r<i.length;++r)if(f=i[r],u=s[r],f&&u)n:for(e=0;e<u.length;++e){for(h=u[e],o=0;o<f.length;++o)if(f[o].marker==h.marker)continue n;f.push(h)}else u&&(i[r]=u);return i}function py(n,t,i){var f=null,e,l,a,r,o,u,c;if(n.iter(t.line,i.line+1,function(n){var t,i;if(n.markedSpans)for(t=0;t<n.markedSpans.length;++t)i=n.markedSpans[t].marker,i.readOnly&&(!f||ot(f,i)==-1)&&(f||(f=[])).push(i)}),!f)return null;for(e=[{from:t,to:i}],l=0;l<f.length;++l)for(a=f[l],r=a.find(),o=0;o<e.length;++o)(u=e[o],h(u.to,r.from)||h(r.to,u.from))||(c=[o,1],(h(u.from,r.from)||!a.inclusiveLeft&&s(u.from,r.from))&&c.push({from:u.from,to:r.from}),(h(r.to,u.to)||!a.inclusiveRight&&s(u.to,r.to))&&c.push({from:r.to,to:u.to}),e.splice.apply(e,c),o+=c.length-1);return e}function er(n){return n.inclusiveLeft?-1:0}function or(n){return n.inclusiveRight?1:0}function nl(n,t){var r=n.lines.length-t.lines.length,i;if(r!=0)return r;var u=n.find(),f=t.find(),e=tr(u.from,f.from)||er(n)-er(t);return e?-e:(i=tr(u.to,f.to)||or(n)-or(t),i)?i:t.id-n.id}function tl(n,t){var f=wi&&n.markedSpans,r,i,u;if(f)for(u=0;u<f.length;++u)i=f[u],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||nl(r,i.marker)<0)&&(r=i.marker);return r}function es(n){return tl(n,!0)}function te(n){return tl(n,!1)}function il(n,t,i,u,f){var a=r(n,t),c=wi&&a.markedSpans,o,e;if(c)for(o=0;o<c.length;++o)if(e=c[o],e.marker.collapsed){var s=e.marker.find(!0),h=tr(s.from,i)||er(e.marker)-er(f),l=tr(s.to,u)||or(e.marker)-or(f);if((!(h>=0)||!(l<=0))&&(!(h<=0)||!(l>=0))&&(h<=0&&(tr(s.to,i)||or(e.marker)-er(f))>0||h>=0&&(tr(s.from,u)||er(e.marker)-or(f))<0))return!0}}function wt(n,t){for(var i;i=es(t);)t=r(n,i.find().from.line);return t}function li(n,t){var u=wi&&t.markedSpans,i,r;if(u)for(r=0;r<u.length;++r)if(i=u[r],i.marker.collapsed){if(i.from==null)return!0;if(!i.marker.replacedWith&&i.from==0&&i.marker.inclusiveLeft&&os(n,t,i))return!0}}function os(n,t,i){var o,e,u,f;if(i.to==null)return o=i.marker.find().to,e=r(n,o.line),os(n,e,eu(e.markedSpans,i.marker));if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(f=0;f<t.markedSpans.length;++f)if(u=t.markedSpans[f],u.marker.collapsed&&!u.marker.replacedWith&&u.from==i.to&&(u.to==null||u.to!=i.from)&&(u.marker.inclusiveLeft||i.marker.inclusiveRight)&&os(n,t,u))return!0}function rl(n){var i=n.markedSpans,t;if(i){for(t=0;t<i.length;++t)i[t].marker.detachLine(n);n.markedSpans=null}}function ul(n,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(n);n.markedSpans=t}}function fl(n){return function(){var t=!this.cm.curOp,i;t&&ki(this.cm);try{i=n.apply(this,arguments)}finally{t&&di(this.cm)}return i}}function ie(n){return n.height!=null?n.height:(n.node.parentNode&&n.node.parentNode.nodeType==1||yt(n.cm.display.measure,i("div",[n.node],null,"position: relative")),n.height=n.node.offsetHeight)}function wy(n,t,i,r){var u=new ou(n,i,r);return u.noHScroll&&(n.display.alignWidgets=!0),df(n,t,function(t){var i=t.widgets||(t.widgets=[]),r;return u.insertAt==null?i.push(u):i.splice(Math.min(i.length-1,Math.max(0,u.insertAt)),0,u),u.line=t,(!li(n.doc,t)||u.showIfHidden)&&(r=lu(n,t)<n.doc.scrollTop,et(t,t.height+ie(u)),r&&go(n,0,u.height),n.curOp.forceUpdate=!0),!0}),u}function by(n,t,i,r){n.text=t,n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null),n.order!=null&&(n.order=null),rl(n),ul(n,i);var u=r?r(n):1;u!=n.height&&et(n,u)}function ky(n){n.parent=null,rl(n)}function el(t,i,r,u,f,e){var c=r.flattenSpans,a,v;c==null&&(c=t.options.flattenSpans);var h=0,l=null,o=new ru(i,t.options.tabSize),s;for(i==""&&r.blankLine&&r.blankLine(u);!o.eol();)o.pos>t.options.maxHighlightLength?(c=!1,e&&ss(t,i,u,o.pos),o.pos=i.length,s=null):s=r.token(o,u),t.options.addModeClass&&(a=n.innerMode(r,u).mode.name,a&&(s="m-"+(s?a+" "+s:a))),c&&l==s||(h<o.start&&f(o.start,l),h=o.start,l=s),o.start=o.pos;while(h<o.pos)v=Math.min(o.pos,h+5e4),f(v,l),h=v}function ol(n,t,i,r){var u=[n.state.modeGen],e;for(el(n,t.text,n.doc.mode,i,function(n,t){u.push(n,t)},r),e=0;e<n.state.overlays.length;++e){var o=n.state.overlays[e],f=1,s=0;el(n,t.text,o.mode,!0,function(n,t){for(var i=f,r,e;s<n;)r=u[f],r>n&&u.splice(f,1,n,u[f+1],r),f+=2,s=Math.min(n,r);if(t)if(o.opaque)u.splice(i,f-i,n,t),f=i+2;else for(;i<f;i+=2)e=u[i+1],u[i+1]=e?e+" "+t:t})}return u}function sl(n,t){return t.styles&&t.styles[0]==n.state.modeGen||(t.styles=ol(n,t,t.stateAfter=yr(n,tt(t)))),t.styles}function ss(n,t,i,r){var f=n.doc.mode,u=new ru(t,n.options.tabSize);for(u.start=u.pos=r||0,t==""&&f.blankLine&&f.blankLine(i);!u.eol()&&u.pos<=n.options.maxHighlightLength;)f.token(u,i),u.start=u.pos}function ll(n,t){var i,r,u;if(!n)return null;for(;;){if(i=n.match(/(?:^|\s+)line-(background-)?(\S+)/),!i)break;n=n.slice(0,i.index)+n.slice(i.index+i[0].length),r=i[1]?"bgClass":"textClass",t[r]==null?t[r]=i[2]:new RegExp("(?:^|s)"+i[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+i[2])}return/^\s*$/.test(n)?null:(u=t.cm.options.addModeClass?cl:hl,u[n]||(u[n]=n.replace(/\S+/g,"cm-$&")))}function hs(n,t,u,f){for(var b,o=t,d=!0,e,a,s,h,v,p,c,w;b=es(o);)o=r(n.doc,b.find().from.line);e={pre:i("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:n,copyWidgets:f};do o.text&&(d=!1),e.measure=o==t&&u,e.pos=0,e.addToken=e.measure?gy:al,(k||y)&&n.getOption("lineWrapping")&&(e.addToken=np(e.addToken)),a=tp(o,e,sl(n,o)),u&&o==t&&!e.measuredSomething&&(u[0]=e.pre.appendChild(nf(n.display.measure)),e.measuredSomething=!0),a&&(o=r(n.doc,a.to.line));while(a);return!u||e.measuredSomething||u[0]||(u[0]=e.pre.appendChild(d?i("span"," "):nf(n.display.measure))),e.pre.firstChild||li(n.doc,t)||e.pre.appendChild(document.createTextNode(" ")),u&&k&&(s=lt(o))&&(h=s.length-1,s[h].from==s[h].to&&--h,v=s[h],p=s[h-1],v.from+1==v.to&&p&&v.level<p.level&&(c=u[e.pos-1],c&&c.parentNode.insertBefore(c.measureRight=nf(n.display.measure),c.nextSibling))),w=e.textClass?e.textClass+" "+(t.textClass||""):t.textClass,w&&(e.pre.className=w),l(n,"renderLine",n,t,e.pre),e}function dy(n){var t=i("span","•","cm-invalidchar");return t.title="\\u"+n.charCodeAt(0).toString(16),t}function al(n,t,r,u,f,e){var a,o,s,h,l,y,p,v,c;if(t){if(a=n.cm.options.specialChars,a.test(t))for(o=document.createDocumentFragment(),s=0;;){if(a.lastIndex=s,h=a.exec(t),l=h?h.index-s:t.length-s,l&&(o.appendChild(document.createTextNode(t.slice(s,s+l))),n.col+=l),!h)break;s+=l+1,h[0]=="\t"?(y=n.cm.options.tabSize,p=y-n.col%y,o.appendChild(i("span",ia(p),"cm-tab")),n.col+=p):(c=n.cm.options.specialCharPlaceholder(h[0]),o.appendChild(c),n.col+=1)}else n.col+=t.length,o=document.createTextNode(t);if(r||u||f||n.measure)return v=r||"",u&&(v+=u),f&&(v+=f),c=i("span",[o],v),e&&(c.title=e),n.pre.appendChild(c);n.pre.appendChild(o)}}function gy(n,t,r,u,f){for(var l=n.cm.options.lineWrapping,a,o,s,h,c,e=0;e<t.length;++e){for(a=e==0,o=e+1;o<t.length&&se(t.charAt(o));)++o;s=t.slice(e,o),e=o-1,e&&l&&ku(t,e)&&n.pre.appendChild(i("wbr")),h=n.measure[n.pos],c=n.measure[n.pos]=al(n,s,r,a&&u,e==t.length-1&&f),h&&(c.leftSide=h.leftSide||h),st&&l&&s==" "&&e&&!/\s/.test(t.charAt(e-1))&&e<t.length-1&&!/\s/.test(t.charAt(e+1))&&(c.style.whiteSpace="normal"),n.pos+=s.length}t.length&&(n.measuredSomething=!0)}function np(n){function t(n){for(var i=" ",t=0;t<n.length-2;++t)i+=t%2?" ":" ";return i+" "}return function(i,r,u,f,e,o){return n(i,r.replace(/ {3,}/g,t),u,f,e,o)}}function vl(n,t,i,r){var u=!r&&i.replacedWith,f;if(u&&(n.copyWidgets&&(u=u.cloneNode(!0)),n.pre.appendChild(u),n.measure)){if(t)n.measure[n.pos]=u;else if(f=nf(n.cm.display.measure),i.type!="bookmark"||i.insertLeft){if(n.measure[n.pos])return;n.measure[n.pos]=n.pre.insertBefore(f,u)}else n.measure[n.pos]=n.pre.appendChild(f);n.measuredSomething=!0}n.pos+=t}function tp(n,t,i){var d=n.markedSpans,g=n.text,v=0,h,a,u,e,s,l,k,it;if(!d){for(h=1;h<i.length;h+=2)t.addToken(t,g.slice(v,v=i[h]),ll(i[h+1],t));return}for(var nt=g.length,r=0,h=1,c="",tt,o=0,y,p,w,b,f;;){if(o==r){for(y=p=w=b="",f=null,o=Infinity,a=[],s=0;s<d.length;++s)u=d[s],e=u.marker,u.from<=r&&(u.to==null||u.to>r)?(u.to!=null&&o>u.to&&(o=u.to,p=""),e.className&&(y+=" "+e.className),e.startStyle&&u.from==r&&(w+=" "+e.startStyle),e.endStyle&&u.to==o&&(p+=" "+e.endStyle),e.title&&!b&&(b=e.title),e.collapsed&&(!f||nl(f.marker,e)<0)&&(f=u)):u.from>r&&o>u.from&&(o=u.from),e.type=="bookmark"&&u.from==r&&e.replacedWith&&a.push(e);if(f&&(f.from||0)==r&&(vl(t,(f.to==null?nt:f.to)-r,f.marker,f.from==null),f.to==null))return f.marker.find();if(!f&&a.length)for(s=0;s<a.length;++s)vl(t,0,a[s])}if(r>=nt)break;for(l=Math.min(nt,o);;){if(c){if(k=r+c.length,f||(it=k>l?c.slice(0,l-r):c,t.addToken(t,it,tt?tt+y:y,w,r+it.length==o?p:"",b)),k>=l){c=c.slice(l-r),r=l;break}r=k,w=""}c=g.slice(v,v=i[h++]),tt=ll(i[h++],t)}}}function cs(n,t,i,u,f){function l(n){return i?i[n]:null}function v(n,i,r){by(n,i,r,f),g(n,"change",n,t)}var o=t.from,a=t.to,s=t.text,h=r(n,o.line),y=r(n,a.line),b=nt(s),k=l(s.length-1),p=a.line-o.line;if(o.ch==0&&a.ch==0&&b==""&&(!n.cm||n.cm.options.wholeLineUpdateBefore)){for(var e=0,w=s.length-1,c=[];e<w;++e)c.push(new bt(s[e],l(e),f));v(y,y.text,k),p&&n.remove(o.line,p),c.length&&n.insert(o.line,c)}else if(h==y)if(s.length==1)v(h,h.text.slice(0,o.ch)+b+h.text.slice(a.ch),k);else{for(var c=[],e=1,w=s.length-1;e<w;++e)c.push(new bt(s[e],l(e),f));c.push(new bt(b+h.text.slice(a.ch),k,f)),v(h,h.text.slice(0,o.ch)+s[0],l(0)),n.insert(o.line+1,c)}else if(s.length==1)v(h,h.text.slice(0,o.ch)+s[0]+y.text.slice(a.ch),l(0)),n.remove(o.line+1,p);else{v(h,h.text.slice(0,o.ch)+s[0],l(0)),v(y,b+y.text.slice(a.ch),k);for(var e=1,w=s.length-1,c=[];e<w;++e)c.push(new bt(s[e],l(e),f));p>1&&n.remove(o.line+1,p-1),n.insert(o.line+1,c)}g(n,"change",n,t),pt(n,u.anchor,u.head,null,!0)}function re(n){this.lines=n,this.parent=null;for(var t=0,r=n.length,i=0;t<r;++t)n[t].parent=this,i+=n[t].height;this.height=i}function su(n){var r,u,t,f,i;for(this.children=n,r=0,u=0,t=0,f=n.length;t<f;++t)i=n[t],r+=i.chunkSize(),u+=i.height,i.parent=this;this.size=r,this.height=u,this.parent=null}function sr(n,t,i){function r(n,u,f){var o,e,s;if(n.linked)for(o=0;o<n.linked.length;++o)(e=n.linked[o],e.doc!=u)&&(s=f&&e.sharedHist,!i||s)&&(t(e.doc,s),r(e.doc,n,s))}r(n,null,!0)}function wl(n,t){if(t.cm)throw new Error("This document is already in use.");n.doc=t,t.cm=n,we(n),pe(n),n.options.lineWrapping||be(n),n.options.mode=t.modeOption,a(n)}function r(n,t){var i,r,u;for(t-=n.first;!n.lines;)for(i=0;;++i){if(r=n.children[i],u=r.chunkSize(),t<u){n=r;break}t-=u}return n.lines[t]}function ls(n,t,i){var u=[],r=t.line;return n.iter(t.line,i.line+1,function(n){var f=n.text;r==i.line&&(f=f.slice(0,i.ch)),r==t.line&&(f=f.slice(t.ch)),u.push(f),++r}),u}function as(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function et(n,t){for(var r=t-n.height,i=n;i;i=i.parent)i.height+=r}function tt(n){var i,u,t,r;if(n.parent==null)return null;for(i=n.parent,u=ot(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;;++r){if(t.children[r]==i)break;u+=t.children[r].chunkSize()}return u+i.first}function cu(n,t){var f=n.first,u,e,i,r,s,o;n:do{for(i=0,r=n.children.length;i<r;++i){if(u=n.children[i],e=u.height,t<e){n=u;continue n}t-=e,f+=u.chunkSize()}return f}while(!n.lines);for(i=0,r=n.lines.length;i<r;++i){if(s=n.lines[i],o=s.height,t<o)break;t-=o}return f+i}function lu(n,t){var f,r,e,u,i,o;for(t=wt(n.doc,t),f=0,r=t.parent,i=0;i<r.lines.length;++i)if(e=r.lines[i],e==t)break;else f+=e.height;for(u=r.parent;u;r=u,u=r.parent)for(i=0;i<u.children.length;++i)if(o=u.children[i],o==r)break;else f+=o.height;return f}function lt(n){var t=n.order;return t==null&&(t=n.order=ya(n.text)),t}function ue(n){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,generation:n||1,maxGeneration:n||1}}function bl(n,t,i,r){var u=t["spans_"+n.id],f=0;n.iter(Math.max(n.first,i),Math.min(n.first+n.size,r),function(i){i.markedSpans&&((u||(u=t["spans_"+n.id]={}))[f]=i.markedSpans),++f})}function vs(n,t){var r={line:t.from.line,ch:t.from.ch},i={from:r,to:vf(t),text:ls(n,t.from,t.to)};return bl(n,i,t.from.line,t.to.line+1),sr(n,function(n){bl(n,i,t.from.line,t.to.line+1)},!0),i}function kl(n,t,i,r){var u=n.history,o,f,e;if(u.undone.length=0,o=+new Date,f=nt(u.done),f&&(u.lastOp==r||u.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.cm&&u.lastTime>o-n.cm.options.historyEventDelay||t.origin.charAt(0)=="*")))e=nt(f.changes),s(t.from,t.to)&&s(t.from,e.to)?e.to=vf(t):f.changes.push(vs(n,t)),f.anchorAfter=i.anchor,f.headAfter=i.head;else for(f={changes:[vs(n,t)],generation:u.generation,anchorBefore:n.sel.anchor,headBefore:n.sel.head,anchorAfter:i.anchor,headAfter:i.head},u.done.push(f);u.done.length>u.undoDepth;)u.done.shift();u.generation=++u.maxGeneration,u.lastTime=o,u.lastOp=r,u.lastOrigin=t.origin,e||l(n,"historyAdded")}function ip(n){if(!n)return null;for(var i=0,t;i<n.length;++i)n[i].marker.explicitlyCleared?t||(t=n.slice(0,i)):t&&t.push(n[i]);return t?t.length?t:null:n}function rp(n,t){var u=t["spans_"+n.id],i,r;if(!u)return null;for(i=0,r=[];i<t.text.length;++i)r.push(ip(u[i]));return r}function fe(n,t){for(var e,i,c,u,f=0,o=[];f<n.length;++f){var r=n[f],h=r.changes,s=[];for(o.push({changes:s,anchorBefore:r.anchorBefore,headBefore:r.headBefore,anchorAfter:r.anchorAfter,headAfter:r.headAfter}),e=0;e<h.length;++e)if(i=h[e],s.push({from:i.from,to:i.to,text:i.text}),t)for(u in i)(c=u.match(/^spans_(\d+)$/))&&ot(t,Number(c[1]))>-1&&(nt(s)[u]=i[u],delete i[u])}return o}function ee(n,t,i,r){i<n.line?n.line+=r:t<n.line&&(n.line=t,n.ch=0)}function dl(n,t,i,r){for(var u,s,o,f,e=0;e<n.length;++e){for(u=n[e],s=!0,o=0;o<u.changes.length;++o)if(f=u.changes[o],u.copied||(f.from=hi(f.from),f.to=hi(f.to)),i<f.from.line)f.from.line+=r,f.to.line+=r;else if(t<=f.to.line){s=!1;break}u.copied||(u.anchorBefore=hi(u.anchorBefore),u.headBefore=hi(u.headBefore),u.anchorAfter=hi(u.anchorAfter),u.readAfter=hi(u.headAfter),u.copied=!0),s?(ee(u.anchorBefore),ee(u.headBefore),ee(u.anchorAfter),ee(u.headAfter)):(n.splice(0,e+1),e=0)}}function gl(n,t){var i=t.from.line,r=t.to.line,u=t.text.length-(r-i)-1;dl(n.done,i,r,u),dl(n.undone,i,r,u)}function up(){vu(this)}function au(n){return n.stop||(n.stop=up),n}function v(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function na(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function ys(n){return n.defaultPrevented!=null?n.defaultPrevented:n.returnValue==!1}function vu(n){v(n),na(n)}function ps(n){return n.target||n.srcElement}function ta(n){var t=n.which;return t==null&&(n.button&1?t=1:n.button&2?t=3:n.button&4&&(t=2)),pi&&n.ctrlKey&&t==1&&(t=3),t}function o(n,t,i){if(n.addEventListener)n.addEventListener(t,i,!1);else if(n.attachEvent)n.attachEvent("on"+t,i);else{var r=n._handlers||(n._handlers={}),u=r[t]||(r[t]=[]);u.push(i)}}function kt(n,t,i){var r,u;if(n.removeEventListener)n.removeEventListener(t,i,!1);else if(n.detachEvent)n.detachEvent("on"+t,i);else{if(r=n._handlers&&n._handlers[t],!r)return;for(u=0;u<r.length;++u)if(r[u]==i){r.splice(u,1);break}}}function l(n,t){var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,u)}function g(n,t){function f(n){return function(){n.apply(null,u)}}var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),ti||(++yu,ti=[],setTimeout(fp,0)),i=0;i<r.length;++i)ti.push(f(r[i]))}function at(n,t,i){return l(n,i||t.type,n,t),ys(t)||t.codemirrorIgnore}function fp(){var t,n;for(--yu,t=ti,ti=null,n=0;n<t.length;++n)t[n]()}function vt(n,t){var i=n._handlers&&n._handlers[t];return i&&i.length>0}function hr(n){n.prototype.on=function(n,t){o(this,n,t)},n.prototype.off=function(n,t){kt(this,n,t)}}function bs(){this.id=null}function ii(n,t,i,r,u){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));for(var e=r||0,f=u||0;e<t;++e)n.charAt(e)=="\t"?f+=i-f%i:++f;return f}function ia(n){while(pu.length<=n)pu.push(nt(pu)+" ");return pu[n]}function nt(n){return n[n.length-1]}function ra(n){if(cr)n.selectionStart=0,n.selectionEnd=n.value.length;else try{n.select()}catch(t){}}function ot(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;++i)if(n[i]==t)return i;return-1}function ua(n,t){function i(){}i.prototype=n;var r=new i;return t&&oe(t,r),r}function oe(n,t){t||(t={});for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}function fa(n){for(var t=[],i=0;i<n;++i)t.push(undefined);return t}function ut(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t)}}function wu(n){return/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||ea.test(n))}function oa(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function se(n){return n.charCodeAt(0)>=768&&sa.test(n)}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),typeof t=="string")ha(u,t);else if(t)for(f=0;f<t.length;++f)u.appendChild(t[f]);return u}function bu(n){for(var t=n.childNodes.length;t>0;--t)n.removeChild(n.firstChild);return n}function yt(n,t){return bu(n).appendChild(t)}function ha(n,t){b?(n.innerHTML="",n.appendChild(document.createTextNode(t))):n.textContent=t}function c(n){return n.getBoundingClientRect()}function ku(){return!1}function gu(n){if(du!=null)return du;var t=i("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return yt(n,t),t.offsetWidth&&(du=t.offsetHeight-t.clientHeight),du||0}function nf(n){if(ks==null){var t=i("span","");yt(n,i("span",[t,document.createTextNode("x")])),n.firstChild.offsetHeight!=0&&(ks=t.offsetWidth<=1&&t.offsetHeight>2&&!yi)}return ks?i("span",""):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function op(n,t,i,r){var e,f,u;if(!n)return r(t,i,"ltr");for(e=!1,f=0;f<n.length;++f)u=n[f],(u.from<i&&u.to>t||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr"),e=!0);e||r(t,i,"ltr")}function ds(n){return n.level%2?n.to:n.from}function gs(n){return n.level%2?n.from:n.to}function he(n){var t=lt(n);return t?ds(t[0]):0}function ce(n){var t=lt(n);return t?gs(nt(t)):n.text.length}function aa(n,i){var e=r(n.doc,i),u=wt(n.doc,e),f,o;return u!=e&&(i=tt(u)),f=lt(u),o=f?f[0].level%2?ce(u):he(u):0,t(i,o)}function sp(n,i){for(var e,u,f,o;e=te(u=r(n.doc,i));)i=e.find().to.line;return f=lt(u),o=f?f[0].level%2?he(u):ce(u):u.text.length,t(i,o)}function hp(n,t,i){var r=n[0].level;return t==r?!0:i==r?!1:t<i}function nh(n,t){var r,u,i;for(tf=null,r=0;r<n.length;++r){if(i=n[r],i.from<t&&i.to>t)return r;if(i.from==t||i.to==t)if(u==null)u=r;else return hp(n,i.level,n[u].level)?(i.from!=i.to&&(tf=u),r):(i.from!=i.to&&(tf=r),u)}return u}function th(n,t,i,r){if(!r)return t+i;do t+=i;while(t>0&&se(n.text.charAt(t)));return t}function ih(n,t,i,r){var e=lt(n);if(!e)return va(n,t,i,r);for(var o=nh(e,t),u=e[o],f=th(n,t,u.level%2?-i:i,r);;){if(f>u.from&&f<u.to)return f;if(f==u.from||f==u.to)return nh(e,f)==o?f:(u=e[o+=i],i>0==u.level%2?u.to:u.from);if(u=e[o+=i],!u)return null;f=i>0==u.level%2?th(n,u.to,-1,r):th(n,u.from,1,r)}}function va(n,t,i,r){var u=t+i;if(r)while(u>0&&se(n.text.charAt(u)))u+=i;return u<0||u>n.text.length?null:u}var vi=/gecko\/\d/i.test(navigator.userAgent),st=/MSIE \d/.test(navigator.userAgent),yi=st&&(document.documentMode==null||document.documentMode<8),b=st&&(document.documentMode==null||document.documentMode<9),pa=st&&(document.documentMode==null||document.documentMode<10),wa=/Trident\/([7-9]|\d{2,})\./.test(navigator.userAgent),k=st||wa,y=/WebKit\//.test(navigator.userAgent),ba=y&&/Qt\/\d+\.\d+/.test(navigator.userAgent),ka=/Chrome\//.test(navigator.userAgent),ft=/Opera\//.test(navigator.userAgent),le=/Apple Computer/.test(navigator.vendor),ae=/KHTML\//.test(navigator.userAgent),da=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),ga=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),nv=/PhantomJS/.test(navigator.userAgent),cr=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),ve=cr||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),pi=cr||/Mac/.test(navigator.platform),tv=/win/i.test(navigator.platform),fi=ft&&navigator.userAgent.match(/Version\/(\d*\.\d*)/),ei,bh,hf,cf,vo,gr,rt,tc,af,wo,vf,ci,gf,is,rs,rr,ur,ne,gt,tu,ct,kc,ou,bt,hl,cl,yl,w,pl,hu,ti,yu,ai,ws,pu,ea,sa,ca,du,ks,ri,tf,ya;fi&&(fi=Number(fi[1])),fi&&fi>=15&&(ft=!1,y=!0);var rh=pi&&(ba||ft&&(fi==null||fi<12.11)),ye=vi||k&&!b,uh=!1,wi=!1;bh=0,vo=0,gr=0,rt=null,k?rt=-.53:vi?rt=15:ka?rt=-.7:le&&(rt=-1/3),af=null,vf=n.changeEnd=function(n){return n.text?t(n.from.line+n.text.length-1,nt(n.text).length+(n.text.length==1?n.from.ch:0)):n.to},n.Pos=t,n.prototype={constructor:n,focus:function(){window.focus(),d(this),br(this)},setOption:function(n,t){var i=this.options,r=i[n];(i[n]!=t||n=="mode")&&(i[n]=t,ci.hasOwnProperty(n)&&e(this,ci[n])(this,t,r))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,t){this.state.keyMaps[t?"push":"unshift"](n)},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;t<i.length;++t)if(i[t]==n||typeof i[t]!="string"&&i[t].name==n)return i.splice(t,1),!0},addOverlay:e(null,function(t,i){var r=t.token?t:n.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:i&&i.opaque}),this.state.modeGen++,a(this)}),removeOverlay:e(null,function(n){for(var i=this.state.overlays,r,t=0;t<i.length;++t)if(r=i[t].modeSpec,r==n||typeof n=="string"&&r.name==n){i.splice(t,1),this.state.modeGen++,a(this);return}}),indentLine:e(null,function(n,t,i){typeof t!="string"&&typeof t!="number"&&(t=t==null?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ir(this.doc,n)&&kf(this,n,t,i)}),indentSelection:e(null,function(n){var t=this.doc.sel,r,i;if(s(t.from,t.to))return kf(this,t.from.line,n,!0);for(r=t.to.line-(t.to.ch?0:1),i=t.from.line;i<=r;++i)kf(this,i,n)}),getTokenAt:function(n,t){var e=this.doc,f;n=u(e,n);for(var o=yr(this,n.line,t),s=this.doc.mode,h=r(e,n.line),i=new ru(h.text,this.options.tabSize);i.pos<n.ch&&!i.eol();)i.start=i.pos,f=s.token(i,o);return{start:i.start,end:i.pos,string:i.current(),className:f||null,type:f||null,state:o}},getTokenTypeAt:function(n){var t;n=u(this.doc,n);var i=sl(this,r(this.doc,n.line)),e=0,o=(i.length-1)/2,f=n.ch;if(f==0)return i[2];for(;;)if(t=e+o>>1,(t?i[t*2-1]:0)>=f)o=t;else if(i[t*2+1]<f)e=t+1;else return i[t*2+2]},getModeAt:function(t){var i=this.doc.mode;return i.innerMode?n.innerMode(i,this.getTokenAt(t).state).mode:i},getHelper:function(n,t){return this.getHelpers(n,t)[0]},getHelpers:function(n,t){var f=[],r,i,o,u,e;if(!gt.hasOwnProperty(t))return gt;if(r=gt[t],i=this.getModeAt(n),typeof i[t]=="string")r[i[t]]&&f.push(r[i[t]]);else if(i[t])for(u=0;u<i[t].length;u++)o=r[i[t][u]],o&&f.push(o);else i.helperType&&r[i.helperType]?f.push(r[i.helperType]):r[i.name]&&f.push(r[i.name]);for(u=0;u<r._global.length;u++)e=r._global[u],e.pred(i,this)&&ot(f,e.val)==-1&&f.push(e.val);return f},getStateAfter:function(n,t){var i=this.doc;return n=lc(i,n==null?i.first+i.size-1:n),yr(this,n+1,t)},cursorCoords:function(n,t){var r,i=this.doc.sel;return r=n==null?i.head:typeof n=="object"?u(this.doc,n):n?i.from:i.to,it(this,r,t||"page")},charCoords:function(n,t){return so(this,u(this.doc,n),t||"page")},coordsChar:function(n,t){return n=ph(this,n,t||"page"),ho(this,n.left,n.top)},lineAtHeight:function(n,t){return n=ph(this,{top:n,left:0},t||"page").top,cu(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,t){var i=!1,u=this.doc.first+this.doc.size-1,f;return n<this.doc.first?n=this.doc.first:n>u&&(n=u,i=!0),f=r(this.doc,n),oo(this,r(this.doc,n),{top:0,left:0},t||"page").top+(i?f.height:0)},defaultTextHeight:function(){return oi(this.display)},defaultCharWidth:function(){return wh(this.display)},setGutterMarker:e(null,function(n,t,i){return df(this,n,function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&oa(r)&&(n.gutterMarkers=null),!0})}),clearGutter:e(null,function(n){var i=this,r=i.doc,t=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[n]&&(r.gutterMarkers[n]=null,a(i,t,t+1),oa(r.gutterMarkers)&&(r.gutterMarkers=null)),++t})}),addLineClass:e(null,function(n,t,i){return df(this,n,function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass";if(n[r]){if(new RegExp("(?:^|\\s)"+i+"(?:$|\\s)").test(n[r]))return!1;n[r]+=" "+i}else n[r]=i;return!0})}),removeLineClass:e(null,function(n,t,i){return df(this,n,function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass",u=n[f],r,e;if(u)if(i==null)n[f]=null;else{if(r=u.match(new RegExp("(?:^|\\s+)"+i+"(?:$|\\s+)")),!r)return!1;e=r.index+r[0].length,n[f]=u.slice(0,r.index)+(!r.index||e==u.length?"":" ")+u.slice(e)||null}else return!1;return!0})}),addLineWidget:e(null,function(n,t,i){return wy(this,n,t,i)}),removeLineWidget:function(n){n.clear()},lineInfo:function(n){var t;if(typeof n=="number"){if(!ir(this.doc,n)||(t=n,n=r(this.doc,n),!n))return null}else if(t=tt(n),t==null)return null;return{line:t,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(n,t,i,r,f){var s=this.display,o,e,h,c;n=it(this,u(this.doc,n)),o=n.bottom,e=n.left,t.style.position="absolute",s.sizer.appendChild(t),r=="over"?o=n.top:(r=="above"||r=="near")&&(h=Math.max(s.wrapper.clientHeight,this.doc.height),c=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth),(r=="above"||n.bottom+t.offsetHeight>h)&&n.top>t.offsetHeight?o=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=h&&(o=n.bottom),e+t.offsetWidth>c&&(e=c-t.offsetWidth)),t.style.top=o+"px",t.style.left=t.style.right="",f=="right"?(e=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(f=="left"?e=0:f=="middle"&&(e=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=e+"px"),i&&sy(this,e,o,e+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:e(null,uc),triggerOnKeyPress:e(null,fc),triggerOnKeyUp:e(null,rc),execCommand:function(n){if(tu.hasOwnProperty(n))return tu[n](this)},findPosH:function(n,t,i,r){var o=1,e,f;for(t<0&&(o=-1,t=-t),e=0,f=u(this.doc,n);e<t;++e)if(f=ns(this.doc,f,o,i,r),f.hitSide)break;return f},moveH:e(null,function(n,t){var i=this.doc.sel,r;r=i.shift||i.extend||s(i.from,i.to)?ns(this.doc,i.head,n,t,this.options.rtlMoveVisually):n<0?i.from:i.to,p(this.doc,r,r,n)}),deleteH:e(null,function(n,t){var i=this.doc.sel;s(i.from,i.to)?dt(this.doc,"",i.from,ns(this.doc,i.head,n,t,!1),"+delete"):dt(this.doc,"",i.from,i.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(n,t,i,r){var h=1,o=r,s,f,e;for(t<0&&(h=-1,t=-t),s=0,f=u(this.doc,n);s<t;++s)if(e=it(this,f,"div"),o==null?o=e.left:e.left=o,f=yc(this,e,h,i),f.hitSide)break;return f},moveV:e(null,function(n,t){var i=this.doc.sel,r,f,u;i.shift||i.extend||s(i.from,i.to)?(u=it(this,i.head,"div"),i.goalColumn!=null&&(u.left=i.goalColumn),r=yc(this,u,n,t),t=="page"&&go(this,0,so(this,r,"div").top-u.top),f=u.left):r=n<0?i.from:i.to,p(this.doc,r,r,n),f!=null&&(i.goalColumn=f)}),toggleOverwrite:function(n){(n==null||n!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""),l(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return document.activeElement==this.display.input},scrollTo:e(null,function(n,t){bf(this,n,t)}),getScrollInfo:function(){var n=this.display.scroller,t=ai;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-t,width:n.scrollWidth-t,clientHeight:n.clientHeight-t,clientWidth:n.clientWidth-t}},scrollIntoView:e(null,function(n,i){var r,u;n==null?n={from:this.doc.sel.head,to:null}:typeof n=="number"?n={from:t(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),i||(i=0),r=n,n.from.line!=null&&(this.curOp.scrollToPos={from:n.from,to:n.to,margin:i},r={from:it(this,n.from),to:it(this,n.to)}),u=wf(this,Math.min(r.from.left,r.to.left),Math.min(r.from.top,r.to.top)-i,Math.max(r.from.right,r.to.right),Math.max(r.from.bottom,r.to.bottom)+i),bf(this,u.scrollLeft,u.scrollTop)}),setSize:e(null,function(n,t){function i(n){return typeof n=="number"||/^\d+$/.test(String(n))?n+"px":n}n!=null&&(this.display.wrapper.style.width=i(n)),t!=null&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0,l(this,"refresh",this)}),operation:function(n){return co(this,n)},refresh:e(null,function(){var n=this.display.cachedTextHeight;bi(this),bf(this,this.doc.scrollLeft,this.doc.scrollTop),a(this),(n==null||Math.abs(n-oi(this.display))>.5)&&we(this),l(this,"refresh",this)}),swapDoc:e(null,function(n){var t=this.doc;return t.cm=null,wl(this,n),bi(this),ht(this,!0),bf(this,n.scrollLeft,n.scrollTop),g(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},hr(n),ci=n.optionHandlers={},gf=n.defaults={},is=n.Init={toString:function(){return"CodeMirror.Init"}},f("value","",function(n,t){n.setValue(t)},!0),f("mode",null,function(n,t){n.doc.modeOption=t,pe(n)},!0),f("indentUnit",2,pe,!0),f("indentWithTabs",!1),f("smartIndent",!0),f("tabSize",4,function(n){lr(n),bi(n),a(n)},!0),f("specialChars",/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/g,function(n,t){n.options.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n.refresh()},!0),f("specialCharPlaceholder",dy,function(n){n.refresh()},!0),f("electricChars",!0),f("rtlMoveVisually",!tv),f("wholeLineUpdateBefore",!0),f("theme","default",function(n){oh(n),ar(n)},!0),f("keyMap","default",eh),f("extraKeys",null),f("onKeyEvent",null),f("onDragEvent",null),f("lineWrapping",!1,rv,!0),f("gutters",[],function(n){ke(n.options),ar(n)},!0),f("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?io(n.display)+"px":"0",n.refresh()},!0),f("coverGutterNextToScrollbar",!1,de,!0),f("lineNumbers",!1,function(n){ke(n.options),ar(n)},!0),f("firstLineNumber",1,ar,!0),f("lineNumberFormatter",function(n){return n},ar,!0),f("showCursorWhenSelecting",!1,uo,!0),f("resetSelectionOnContextMenu",!0),f("readOnly",!1,function(n,t){t=="nocursor"?(po(n),n.display.input.blur(),n.display.disabled=!0):(n.display.disabled=!1,t||ht(n,!0))}),f("disableInput",!1,function(n,t){t||ht(n,!0)},!0),f("dragDrop",!0),f("cursorBlinkRate",530),f("cursorScrollMargin",0),f("cursorHeight",1),f("workTime",100),f("workDelay",100),f("flattenSpans",!0,lr,!0),f("addModeClass",!1,lr,!0),f("pollInterval",100),f("undoDepth",40,function(n,t){n.doc.history.undoDepth=t}),f("historyEventDelay",500),f("viewportMargin",10,function(n){n.refresh()},!0),f("maxHighlightLength",1e4,lr,!0),f("crudeMeasuringFrom",1e4),f("moveInputWithCursor",!0,function(n,t){t||(n.display.inputDiv.style.top=n.display.inputDiv.style.left=0)}),f("tabindex",null,function(n,t){n.display.input.tabIndex=t||""}),f("autofocus",null),rs=n.modes={},rr=n.mimeModes={},n.defineMode=function(t,i){if(n.defaults.mode||t=="null"||(n.defaults.mode=t),arguments.length>2){i.dependencies=[];for(var r=2;r<arguments.length;++r)i.dependencies.push(arguments[r])}rs[t]=i},n.defineMIME=function(n,t){rr[n]=t},n.resolveMode=function(t){if(typeof t=="string"&&rr.hasOwnProperty(t))t=rr[t];else if(t&&typeof t.name=="string"&&rr.hasOwnProperty(t.name)){var i=rr[t.name];typeof i=="string"&&(i={name:i}),t=ua(i,t),t.name=i.name}else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return n.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},n.getMode=function(t,i){var i=n.resolveMode(i),e=rs[i.name],u,f,r;if(!e)return n.getMode(t,"text/plain");if(u=e(t,i),ur.hasOwnProperty(i.name)){f=ur[i.name];for(r in f)f.hasOwnProperty(r)&&(u.hasOwnProperty(r)&&(u["_"+r]=u[r]),u[r]=f[r])}if(u.name=i.name,i.helperType&&(u.helperType=i.helperType),i.modeProps)for(r in i.modeProps)u[r]=i.modeProps[r];return u},n.defineMode("null",function(){return{token:function(n){n.skipToEnd()}}}),n.defineMIME("text/plain","null"),ur=n.modeExtensions={},n.extendMode=function(n,t){var i=ur.hasOwnProperty(n)?ur[n]:ur[n]={};oe(t,i)},n.defineExtension=function(t,i){n.prototype[t]=i},n.defineDocExtension=function(n,t){w.prototype[n]=t},n.defineOption=f,ne=[],n.defineInitHook=function(n){ne.push(n)},gt=n.helpers={},n.registerHelper=function(t,i,r){gt.hasOwnProperty(t)||(gt[t]=n[t]={_global:[]}),gt[t][i]=r},n.registerGlobalHelper=function(t,i,r,u){n.registerHelper(t,i,u),gt[t]._global.push({pred:r,val:u})},n.isWordChar=wu,n.copyState=fr,n.startState=pc,n.innerMode=function(n,t){while(n.innerMode){var i=n.innerMode(t);if(!i||i.mode==n)break;t=i.state,n=i.mode}return i||{mode:n,state:t}},tu=n.commands={selectAll:function(n){n.setSelection(t(n.firstLine(),0),t(n.lastLine()))},killLine:function(n){var i=n.getCursor(!0),r=n.getCursor(!1),u=!s(i,r);u||n.getLine(i.line).length!=i.ch?n.replaceRange("",i,u?r:t(i.line),"+delete"):n.replaceRange("",i,t(i.line+1,0),"+delete")},deleteLine:function(n){var i=n.getCursor().line;n.replaceRange("",t(i,0),t(i+1,0),"+delete")},delLineLeft:function(n){var i=n.getCursor();n.replaceRange("",t(i.line,0),i,"+delete")},undo:function(n){n.undo()},redo:function(n){n.redo()},goDocStart:function(n){n.extendSelection(t(n.firstLine(),0))},goDocEnd:function(n){n.extendSelection(t(n.lastLine()))},goLineStart:function(n){n.extendSelection(aa(n,n.getCursor().line))},goLineStartSmart:function(n){var i=n.getCursor(),r=aa(n,i.line),f=n.getLineHandle(r.line),e=lt(f),u,o;e&&e[0].level!=0?n.extendSelection(r):(u=Math.max(0,f.text.search(/\S/)),o=i.line==r.line&&i.ch<=u&&i.ch,n.extendSelection(t(r.line,o?0:u)))},goLineEnd:function(n){n.extendSelection(sp(n,n.getCursor().line))},goLineRight:function(n){var t=n.charCoords(n.getCursor(),"div").top+5;n.extendSelection(n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div"))},goLineLeft:function(n){var t=n.charCoords(n.getCursor(),"div").top+5;n.extendSelection(n.coordsChar({left:0,top:t},"div"))},goLineUp:function(n){n.moveV(-1,"line")},goLineDown:function(n){n.moveV(1,"line")},goPageUp:function(n){n.moveV(-1,"page")},goPageDown:function(n){n.moveV(1,"page")},goCharLeft:function(n){n.moveH(-1,"char")},goCharRight:function(n){n.moveH(1,"char")},goColumnLeft:function(n){n.moveH(-1,"column")},goColumnRight:function(n){n.moveH(1,"column")},goWordLeft:function(n){n.moveH(-1,"word")},goGroupRight:function(n){n.moveH(1,"group")},goGroupLeft:function(n){n.moveH(-1,"group")},goWordRight:function(n){n.moveH(1,"word")},delCharBefore:function(n){n.deleteH(-1,"char")},delCharAfter:function(n){n.deleteH(1,"char")},delWordBefore:function(n){n.deleteH(-1,"word")},delWordAfter:function(n){n.deleteH(1,"word")},delGroupBefore:function(n){n.deleteH(-1,"group")},delGroupAfter:function(n){n.deleteH(1,"group")},indentAuto:function(n){n.indentSelection("smart")},indentMore:function(n){n.indentSelection("add")},indentLess:function(n){n.indentSelection("subtract")},insertTab:function(n){n.replaceSelection("\t","end","+input")},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.replaceSelection("\t","end","+input")},transposeChars:function(n){var i=n.getCursor(),r=n.getLine(i.line);i.ch>0&&i.ch<r.length-1&&n.replaceRange(r.charAt(i.ch)+r.charAt(i.ch-1),t(i.line,i.ch-1),t(i.line,i.ch+1))},newlineAndIndent:function(n){e(n,function(){n.replaceSelection("\n","end","+input"),n.indentLine(n.getCursor().line,null,!0)})()},toggleOverwrite:function(n){n.toggleOverwrite()}},ct=n.keyMap={},ct.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},ct.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},ct.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]},ct["default"]=pi?ct.macDefault:ct.pcDefault,ct.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},n.lookupKey=iu,n.isModifierKey=wc,n.keyName=bc,n.fromTextArea=function(t,i){function f(){t.value=r.getValue()}var e,u,s,h,r;if(i||(i={}),i.value=t.value,!i.tabindex&&t.tabindex&&(i.tabindex=t.tabindex),!i.placeholder&&t.placeholder&&(i.placeholder=t.placeholder),i.autofocus==null){e=document.body;try{e=document.activeElement}catch(c){}i.autofocus=e==t||t.getAttribute("autofocus")!=null&&e==document.body}if(t.form&&(o(t.form,"submit",f),!i.leaveSubmitMethodAlone)){u=t.form,s=u.submit;try{h=u.submit=function(){f(),u.submit=s,u.submit(),u.submit=h}}catch(c){}}return t.style.display="none",r=n(function(n){t.parentNode.insertBefore(n,t.nextSibling)},i),r.save=f,r.getTextArea=function(){return t},r.toTextArea=function(){f(),t.parentNode.removeChild(r.getWrapperElement()),t.style.display="",t.form&&(kt(t.form,"submit",f),typeof t.form.submit=="function"&&(t.form.submit=s))},r},ru.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(n){var t=this.string.charAt(this.pos),i;return i=typeof n=="string"?t==n:t&&(n.test?n.test(t):n(t)),i?(++this.pos,t):void 0},eatWhile:function(n){for(var t=this.pos;this.eat(n););return this.pos>t},eatSpace:function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},skipToEnd:function(){this.pos=this.string.length},skipTo:function(n){var t=this.string.indexOf(n,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(n){this.pos-=n},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ii(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ii(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return ii(this.string,null,this.tabSize)-(this.lineStart?ii(this.string,this.lineStart,this.tabSize):0)},match:function(n,t,i){var u,f,r;if(typeof n=="string"){if(u=function(n){return i?n.toLowerCase():n},f=this.string.substr(this.pos,n.length),u(f)==u(n))return t!==!1&&(this.pos+=n.length),!0}else return(r=this.string.slice(this.pos).match(n),r&&r.index>0)?null:(r&&t!==!1&&(this.pos+=r[0].length),r)},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(n,t){this.lineStart+=n;try{return t()}finally{this.lineStart-=n}}},n.StringStream=ru,n.TextMarker=ni,hr(ni),ni.prototype.clear=function(){var n,e,r,u,o,i,f,t,s,h;if(!this.explicitlyCleared){for(n=this.doc.cm,e=n&&!n.curOp,e&&ki(n),vt(this,"clear")&&(r=this.find(),r&&g(this,"clear",r.from,r.to)),u=null,o=null,t=0;t<this.lines.length;++t)i=this.lines[t],f=eu(i.markedSpans,this),f.to!=null&&(o=tt(i)),i.markedSpans=ly(i.markedSpans,f),f.from!=null?u=tt(i):this.collapsed&&!li(this.doc,i)&&n&&et(i,oi(n.display));if(n&&this.collapsed&&!n.options.lineWrapping)for(t=0;t<this.lines.length;++t)s=wt(n.doc,this.lines[t]),h=rf(n.doc,s),h>n.display.maxLineLength&&(n.display.maxLine=s,n.display.maxLineLength=h,n.display.maxLineChanged=!0);u!=null&&n&&a(n,u,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&ac(n)),e&&di(n)}},ni.prototype.find=function(n){for(var r,o,f,i,e,u=0;u<this.lines.length;++u)f=this.lines[u],i=eu(f.markedSpans,this),(i.from!=null||i.to!=null)&&(e=tt(f),i.from!=null&&(r=t(e,i.from)),i.to!=null&&(o=t(e,i.to)));return this.type=="bookmark"&&!n?r:r&&{from:r,to:o}},ni.prototype.changed=function(){var i=this.find(),n=this.doc.cm,u,t;if(i&&n&&(this.type!="bookmark"&&(i=i.from),u=r(this.doc,i.line),wv(n,u),i.line>=n.display.showingFrom&&i.line<n.display.showingTo)){for(t=n.display.lineDiv.firstChild;t;t=t.nextSibling)if(t.lineObj==u){t.offsetHeight!=u.height&&et(u,t.offsetHeight);break}co(n,function(){n.curOp.selectionChanged=n.curOp.forceUpdate=n.curOp.updateMaxLine=!0})}},ni.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&ot(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)},ni.prototype.detachLine=function(n){if(this.lines.splice(ot(this.lines,n),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},kc=0,n.SharedTextMarker=fu,hr(fu),fu.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();g(this,"clear")}},fu.prototype.find=function(){return this.primary.find()},ou=n.LineWidget=function(n,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.cm=n,this.node=t},hr(ou),ou.prototype.clear=fl(function(){var n=this.line.widgets,i=tt(this.line),t,r;if(i!=null&&n){for(t=0;t<n.length;++t)n[t]==this&&n.splice(t--,1);n.length||(this.line.widgets=null),r=lu(this.cm,this.line)<this.cm.doc.scrollTop,et(this.line,Math.max(0,this.line.height-ie(this))),r&&go(this.cm,0,-this.height),a(this.cm,i,i+1)}}),ou.prototype.changed=fl(function(){var i=this.height,n,t;(this.height=null,n=ie(this)-i,n)&&(et(this.line,this.line.height+n),t=tt(this.line),a(this.cm,t,t+1))}),bt=n.Line=function(n,t,i){this.text=n,ul(this,t),this.height=i?i(this):1},hr(bt),bt.prototype.lineNo=function(){return tt(this)},hl={},cl={},re.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,t){for(var r,i=n,u=n+t;i<u;++i)r=this.lines[i],this.height-=r.height,ky(r),g(r,"delete");this.lines.splice(n,t)},collapse:function(n){n.splice.apply(n,[n.length,0].concat(this.lines))},insertInner:function(n,t,i){this.height+=i,this.lines=this.lines.slice(0,n).concat(t).concat(this.lines.slice(n));for(var r=0,u=t.length;r<u;++r)t[r].parent=this},iterN:function(n,t,i){for(var r=n+t;n<r;++n)if(i(this.lines[n]))return!0}},su.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;r<this.children.length;++r)if(i=this.children[r],u=i.chunkSize(),n<u){if(f=Math.min(t,u-n),o=i.height,i.removeInner(n,f),this.height-=o-i.height,u==f&&(this.children.splice(r--,1),i.parent=null),(t-=f)==0)break;n=0}else n-=u;this.size-t<25&&(e=[],this.collapse(e),this.children=[new re(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0,i=this.children.length;t<i;++t)this.children[t].collapse(n)},insertInner:function(n,t,i){var u,o,r,e,s,f;for(this.size+=t.length,this.height+=i,u=0,o=this.children.length;u<o;++u){if(r=this.children[u],e=r.chunkSize(),n<=e){if(r.insertInner(n,t,i),r.lines&&r.lines.length>50){while(r.lines.length>50)s=r.lines.splice(r.lines.length-25,25),f=new re(s),r.height-=f.height,this.children.splice(u+1,0,f),f.parent=this;this.maybeSpill()}break}n-=e}},maybeSpill:function(){var n,r,t,i,u;if(!(this.children.length<=10)){n=this;do r=n.children.splice(n.children.length-5,5),t=new su(r),n.parent?(n.size-=t.size,n.height-=t.height,u=ot(n.parent.children,n),n.parent.children.splice(u+1,0,t)):(i=new su(n.children),i.parent=n,n.children=[i,t],n=i),t.parent=n.parent;while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var f,u,e,r=0,o=this.children.length;r<o;++r)if(f=this.children[r],u=f.chunkSize(),n<u){if(e=Math.min(t,u-n),f.iterN(n,e,i))return!0;if((t-=e)==0)break;n=0}else n-=u}},yl=0,w=n.Doc=function(n,i,r){if(!(this instanceof w))return new w(n,i,r);r==null&&(r=0),su.call(this,[new re([new bt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=ue(),this.cleanGeneration=1,this.frontier=r;var u=t(r,0);this.sel={from:u,to:u,head:u,anchor:u,shift:!1,extend:!1,goalColumn:null},this.id=++yl,this.modeOption=i,typeof n=="string"&&(n=ri(n)),cs(this,{from:u,to:u,text:n},null,{head:u,anchor:u})},w.prototype=ua(su.prototype,{constructor:w,iter:function(n,t,i){i?this.iterN(n-this.first,t-n,i):this.iterN(this.first,this.first+this.size,n)},insert:function(n,t){for(var r=0,i=0,u=t.length;i<u;++i)r+=t[i].height;this.insertInner(n-this.first,t,r)},remove:function(n,t){this.removeInner(n-this.first,t)},getValue:function(n){var t=as(this,this.first,this.first+this.size);return n===!1?t:t.join(n||"\n")},setValue:function(n){var i=t(this.first,0),u=this.first+this.size-1;nr(this,{from:i,to:t(u,r(this,u).text.length),text:ri(n),origin:"setValue"},{head:i,anchor:i},!0)},replaceRange:function(n,t,i,r){t=u(this,t),i=i?u(this,i):t,dt(this,n,t,i,r)},getRange:function(n,t,i){var r=ls(this,u(this,n),u(this,t));return i===!1?r:r.join(i||"\n")},getLine:function(n){var t=this.getLineHandle(n);return t&&t.text},setLine:function(n,i){ir(this,n)&&dt(this,i,t(n,0),u(this,t(n)))},removeLine:function(n){n?dt(this,"",u(this,t(n-1)),u(this,t(n))):dt(this,"",t(0,0),u(this,t(1,0)))},getLineHandle:function(n){if(ir(this,n))return r(this,n)},getLineNumber:function(n){return tt(n)},getLineHandleVisualStart:function(n){return typeof n=="number"&&(n=r(this,n)),wt(this,n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return u(this,n)},getCursor:function(n){var t=this.sel,i;return i=n==null||n=="head"?t.head:n=="anchor"?t.anchor:n=="end"||n===!1?t.to:t.from,hi(i)},somethingSelected:function(){return!s(this.sel.head,this.sel.anchor)},setCursor:wr(function(n,i,r){var f=u(this,typeof n=="number"?t(n,i||0):n);r?p(this,f):pt(this,f,f)}),setSelection:wr(function(n,t,i){pt(this,u(this,n),u(this,t||n),i)}),extendSelection:wr(function(n,t,i){p(this,u(this,n),t&&u(this,t),i)}),getSelection:function(n){return this.getRange(this.sel.from,this.sel.to,n)},replaceSelection:function(n,t,i){nr(this,{from:this.sel.from,to:this.sel.to,text:ri(n),origin:i},t||"around")},undo:wr(function(){hc(this,"undo")}),redo:wr(function(){hc(this,"redo")}),setExtending:function(n){this.sel.extend=n},historySize:function(){var n=this.history;return{undo:n.done.length,redo:n.undone.length}},clearHistory:function(){this.history=ue(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(n){return n&&(this.history.lastOp=this.history.lastOrigin=null),this.history.generation},isClean:function(n){return this.history.generation==(n||this.cleanGeneration)},getHistory:function(){return{done:fe(this.history.done),undone:fe(this.history.undone)}},setHistory:function(n){var t=this.history=ue(this.history.maxGeneration);t.done=n.done.slice(0),t.undone=n.undone.slice(0)},markText:function(n,t,i){return uu(this,u(this,n),u(this,t),i,"range")},setBookmark:function(n,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1};return n=u(this,n),uu(this,n,n,i,"bookmark")},findMarksAt:function(n){var e,i,f,t;if(n=u(this,n),e=[],i=r(this,n.line).markedSpans,i)for(f=0;f<i.length;++f)t=i[f],(t.from==null||t.from<=n.ch)&&(t.to==null||t.to>=n.ch)&&e.push(t.marker.parent||t.marker);return e},findMarks:function(n,t){n=u(this,n),t=u(this,t);var r=[],i=n.line;return this.iter(n.line,t.line+1,function(u){var o=u.markedSpans,e,f;if(o)for(e=0;e<o.length;e++)f=o[e],i==n.line&&n.ch>f.to||f.from==null&&i!=n.line||i==t.line&&f.from>t.ch||r.push(f.marker.parent||f.marker);++i}),r},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;i<r.length;++i)r[i].from!=null&&n.push(r[i].marker)}),n},posFromIndex:function(n){var i,r=this.first;return this.iter(function(t){var u=t.text.length+1;if(u>n)return i=n,!0;n-=u,++r}),u(this,t(r,i))},indexFromPos:function(n){n=u(this,n);var t=n.ch;return n.line<this.first||n.ch<0?0:(this.iter(this.first,n.line,function(n){t+=n.text.length+1}),t)},copy:function(n){var t=new w(as(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},n&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(n){var t,r,i;return n||(n={}),t=this.first,r=this.first+this.size,n.from!=null&&n.from>t&&(t=n.from),n.to!=null&&n.to<r&&(r=n.to),i=new w(as(this,t,r),n.mode||this.modeOption,t),n.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:n.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],i},unlinkDoc:function(t){var i,u,r;if(t instanceof n&&(t=t.doc),this.linked)for(i=0;i<this.linked.length;++i)if(u=this.linked[i],u.doc==t){this.linked.splice(i,1),t.unlinkDoc(this);break}t.history==this.history&&(r=[t.id],sr(t,function(n){r.push(n.id)},!0),t.history=ue(),t.history.done=fe(this.history.done,r),t.history.undone=fe(this.history.undone,r))},iterLinkedDocs:function(n){sr(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),w.prototype.eachLine=w.prototype.iter,pl="iter insert remove copy getEditor".split(" ");for(hu in w.prototype)w.prototype.hasOwnProperty(hu)&&ot(pl,hu)<0&&(n.prototype[hu]=function(n){return function(){return n.apply(this.doc,arguments)}}(w.prototype[hu]));hr(w),n.e_stop=vu,n.e_preventDefault=v,n.e_stopPropagation=na,yu=0,n.on=o,n.off=kt,n.signal=l,ai=30,ws=n.Pass={toString:function(){return"CodeMirror.Pass"}},bs.prototype={set:function(n,t){clearTimeout(this.id),this.id=setTimeout(t,n)}},n.countColumn=ii,pu=[""],ea=/[\u00df\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,sa=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,n.replaceGetRect=function(n){c=n},ca=function(){if(b)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}(),vi?ku=function(n,t){return n.charCodeAt(t-1)==36&&n.charCodeAt(t)==39}:le&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?ku=function(n,t){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(n.slice(t-1,t+1))}:y&&/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)?ku=function(n,t){var i=n.charCodeAt(t-1);return i>=8208&&i<=8212}:y&&(ku=function(n,t){if(t>1&&n.charCodeAt(t-1)==45){if(/\w/.test(n.charAt(t-2))&&/[^\-?\.]/.test(n.charAt(t)))return!0;if(t>2&&/[\d\.,]/.test(n.charAt(t-2))&&/[\d\.,]/.test(n.charAt(t)))return!1}return/[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(n.slice(t-1,t+1))}),ri="\n\nb".split(/\n/).length!=3?function(n){for(var i=0,f=[],e=n.length,t,r,u;i<=e;)t=n.indexOf("\n",i),t==-1&&(t=n.length),r=n.slice(i,n.charAt(t-1)=="\r"?t-1:t),u=r.indexOf("\r"),u!=-1?(f.push(r.slice(0,u)),i+=u+1):(f.push(r),i=t+1);return f}:function(n){return n.split(/\r\n?|\n/)},n.splitLines=ri;var ep=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(t){return!1}}:function(n){try{var t=n.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=n?!1:t.compareEndPoints("StartToEnd",t)!=0},la=function(){var n=i("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")}(),ui={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};return n.keyNames=ui,function(){for(var n=0;n<10;n++)ui[n+48]=ui[n+96]=String(n);for(n=65;n<=90;n++)ui[n]=String.fromCharCode(n);for(n=1;n<=12;n++)ui[n+111]=ui[n+63235]="F"+n}(),ya=function(){function o(n){return n<=255?f.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1791?e.charAt(n-1536):1792<=n&&n<=2220?"r":"L"}var f="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",e="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,u=/[1n]/,n="L";return function(f){var a,h,p,d,w,c,v,y,k,e,tt,b,g,l,it;if(!s.test(f))return!1;for(a=f.length,h=[],e=0;e<a;++e)h.push(c=o(f.charCodeAt(e)));for(e=0,p=n;e<a;++e)c=h[e],c=="m"?h[e]=p:p=c;for(e=0,w=n;e<a;++e)c=h[e],c=="1"&&w=="r"?h[e]="n":i.test(c)&&(w=c,c=="r"&&(h[e]="R"));for(e=1,p=h[0];e<a-1;++e)c=h[e],c=="+"&&p=="1"&&h[e+1]=="1"?h[e]="1":c==","&&p==h[e+1]&&(p=="1"||p=="n")&&(h[e]=p),p=c;for(e=0;e<a;++e)if(c=h[e],c==",")h[e]="N";else if(c=="%"){for(v=e+1;v<a&&h[v]=="%";++v);for(d=e&&h[e-1]=="!"||v<a&&h[v]=="1"?"1":"N",l=e;l<v;++l)h[l]=d;e=v-1}for(e=0,w=n;e<a;++e)c=h[e],w=="L"&&c=="1"?h[e]="L":i.test(c)&&(w=c);for(e=0;e<a;++e)if(t.test(h[e])){for(v=e+1;v<a&&t.test(h[v]);++v);var rt=(e?h[e-1]:n)=="L",ut=(v<a?h[v]:n)=="L",d=rt||ut?"L":"R";for(l=e;l<v;++l)h[l]=d;e=v-1}for(y=[],e=0;e<a;)if(r.test(h[e])){for(tt=e,++e;e<a&&r.test(h[e]);++e);y.push({from:tt,to:e,level:0})}else{for(b=e,g=y.length,++e;e<a&&h[e]!="L";++e);for(l=b;l<e;)if(u.test(h[l])){for(b<l&&y.splice(g,0,{from:b,to:l,level:1}),it=l,++l;l<e&&u.test(h[l]);++l);y.splice(g,0,{from:it,to:l,level:2}),b=l}else++l;b<e&&y.splice(g,0,{from:b,to:e,level:1})}return y[0].level==1&&(k=f.match(/^\s+/))&&(y[0].from=k[0].length,y.unshift({from:0,to:k[0].length,level:0})),nt(y).level==1&&(k=f.match(/\s+$/))&&(nt(y).to-=k[0].length,y.push({from:a-k[0].length,to:a,level:0})),y[0].level!=nt(y).level&&y.push({from:a,to:a,level:y[0].level}),y}}(),n.version="3.22.0",n}(),CodeMirror.defineMode("css",function(n,t){"use strict";function u(n,t){return c=t,n}function tt(n,t){var i=n.next(),r;if(a[i]&&(r=a[i](n,t),r!==!1))return r;if(i=="@")return n.eatWhile(/[\w\\\-]/),u("def",n.current());if(i=="="||(i=="~"||i=="|")&&n.eat("="))return u(null,"compare");if(i=='"'||i=="'")return t.tokenize=v(i),t.tokenize(n,t);if(i=="#")return n.eatWhile(/[\w\\\-]/),u("atom","hash");if(i=="!")return n.match(/^\s*\w*/),u("keyword","important");if(/\d/.test(i)||i=="."&&n.eat(/\d/))return n.eatWhile(/[\w.%]/),u("number","unit");if(i==="-"){if(/[\d.]/.test(n.peek()))return n.eatWhile(/[\w.%]/),u("number","unit");if(n.match(/^[^-]+-/))return u("meta","meta")}else return/[,+>*\/]/.test(i)?u(null,"select-op"):i=="."&&n.match(/^-?[_a-z][_a-z0-9-]*/i)?u("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(i)?u(null,i):i=="u"&&n.match("rl(")?(n.backUp(1),t.tokenize=it,u("property","word")):/[\w\\\-]/.test(i)?(n.eatWhile(/[\w\\\-]/),u("property","word")):u(null,null)}function v(n){return function(t,i){for(var r=!1,f;(f=t.next())!=null;){if(f==n&&!r){n==")"&&t.backUp(1);break}r=!r&&f=="\\"}return f!=n&&(r||n==")")||(i.tokenize=null),u("string","string")}}function it(n,t){return n.next(),t.tokenize=n.match(/\s*[\"\']/,!1)?null:v(")"),u(null,"(")}function y(n,t,i){this.type=n,this.indent=t,this.prev=i}function f(n,t,i){return n.context=new y(i,t.indentation()+l,n.context),i}function e(n){return n.context=n.context.prev,n.context.type}function h(n,t,i){return r[i.context.type](n,t,i)}function o(n,t,i,r){for(var u=r||1;u>0;u--)i.context=i.context.prev;return h(n,t,i)}function p(n){var t=n.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":d.hasOwnProperty(t)?"keyword":"variable"}var r;t.propertyKeywords||(t=CodeMirror.resolveMode("text/css"));var l=n.indentUnit,a=t.tokenHooks,w=t.mediaTypes||{},b=t.mediaFeatures||{},k=t.propertyKeywords||{},d=t.colorKeywords||{},g=t.valueKeywords||{},nt=t.fontProperties||{},s=t.allowNested,c,i;return r={},r.top=function(n,t,r){if(n=="{")return f(r,t,"block");if(n=="}"&&r.context.prev)return e(r);if(n=="@media")return f(r,t,"media");if(n=="@font-face")return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(n))return"keyframes";if(n&&n.charAt(0)=="@")return f(r,t,"at");if(n=="hash")i="builtin";else if(n=="word")i="tag";else{if(n=="variable-definition")return"maybeprop";if(n=="interpolation")return f(r,t,"interpolation");if(n==":")return"pseudo";if(s&&n=="(")return f(r,t,"params")}return r.context.type},r.block=function(n,t,u){return n=="word"?k.hasOwnProperty(t.current().toLowerCase())?(i="property","maybeprop"):s?(i=t.match(/^\s*:/,!1)?"property":"tag","block"):(i+=" error","maybeprop"):n=="meta"?"block":s||n!="hash"&&n!="qualifier"?r.top(n,t,u):(i="error","block")},r.maybeprop=function(n,t,i){return n==":"?f(i,t,"prop"):h(n,t,i)},r.prop=function(n,t,r){if(n==";")return e(r);if(n=="{"&&s)return f(r,t,"propBlock");if(n=="}"||n=="{")return o(n,t,r);if(n=="(")return f(r,t,"parens");if(n!="hash"||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if(n=="word")p(t);else if(n=="interpolation")return f(r,t,"interpolation")}else i+=" error";return"prop"},r.propBlock=function(n,t,r){return n=="}"?e(r):n=="word"?(i="property","maybeprop"):r.context.type},r.parens=function(n,t,i){return n=="{"||n=="}"?o(n,t,i):n==")"?e(i):"parens"},r.pseudo=function(n,t,r){return n=="word"?(i="variable-3",r.context.type):h(n,t,r)},r.media=function(n,t,r){if(n=="(")return f(r,t,"media_parens");if(n=="}")return o(n,t,r);if(n=="{")return e(r)&&f(r,t,s?"block":"top");if(n=="word"){var u=t.current().toLowerCase();i=u=="only"||u=="not"||u=="and"?"keyword":w.hasOwnProperty(u)?"attribute":b.hasOwnProperty(u)?"property":"error"}return r.context.type},r.media_parens=function(n,t,i){return n==")"?e(i):n=="{"||n=="}"?o(n,t,i,2):r.media(n,t,i)},r.font_face_before=function(n,t,i){return n=="{"?f(i,t,"font_face"):h(n,t,i)},r.font_face=function(n,t,r){return n=="}"?e(r):n=="word"?(i=nt.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},r.keyframes=function(n,t,r){return n=="word"?(i="variable","keyframes"):n=="{"?f(r,t,"top"):h(n,t,r)},r.at=function(n,t,r){return n==";"?e(r):n=="{"||n=="}"?o(n,t,r):(n=="word"?i="tag":n=="hash"&&(i="builtin"),"at")},r.interpolation=function(n,t,r){return n=="}"?e(r):n=="{"||n==";"?o(n,t,r):(n!="variable"&&(i="error"),"interpolation")},r.params=function(n,t,i){return n==")"?e(i):n=="{"||n=="}"?o(n,t,i):(n=="word"&&p(t),"params")},{startState:function(n){return{tokenize:null,state:"top",context:new y("top",n||0,null)}},token:function(n,t){if(!t.tokenize&&n.eatSpace())return null;var u=(t.tokenize||tt)(n,t);return u&&typeof u=="object"&&(c=u[1],u=u[0]),i=u,t.state=r[t.state](c,n,t),i},indent:function(n,t){var i=n.context,r=t&&t.charAt(0),u=i.indent;return i.type=="prop"&&r=="}"&&(i=i.prev),i.prev&&(r=="}"&&(i.type=="block"||i.type=="top"||i.type=="interpolation"||i.type=="font_face")||r==")"&&(i.type=="parens"||i.type=="params"||i.type=="media_parens")||r=="{"&&(i.type=="at"||i.type=="media"))&&(u=i.indent-l,i=i.prev),u},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}),function(){function n(n){for(var i={},t=0;t<n.length;++t)i[n[t]]=!0;return i}function t(n,t){for(var r=!1,i;(i=n.next())!=null;){if(r&&i=="/"){t.tokenize=null;break}r=i=="*"}return["comment","comment"]}function v(n,t){return n.skipTo("-->")?(n.match("-->"),t.tokenize=null):n.skipToEnd(),["comment","comment"]}var s=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=n(s),h=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],r=n(h),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"],u=n(c),l=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],f=n(l),a=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],e=n(a),o=n(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),y=s.concat(h).concat(c).concat(l).concat(a);CodeMirror.registerHelper("hintWords","css",y),CodeMirror.defineMIME("text/css",{mediaTypes:i,mediaFeatures:r,propertyKeywords:u,colorKeywords:f,valueKeywords:e,fontProperties:o,tokenHooks:{"<":function(n,t){return n.match("!--")?(t.tokenize=v,v(n,t)):!1},"/":function(n,i){return n.eat("*")?(i.tokenize=t,t(n,i)):!1}},name:"css"}),CodeMirror.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:r,propertyKeywords:u,colorKeywords:f,valueKeywords:e,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(n,i){return n.eat("/")?(n.skipToEnd(),["comment","comment"]):n.eat("*")?(i.tokenize=t,t(n,i)):["operator","operator"]},":":function(n){return n.match(/\s*{/)?[null,"{"]:!1},$:function(n){return(n.match(/^[\w-]+/),n.match(/^\s*:/,!1))?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(n){return n.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),CodeMirror.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:r,propertyKeywords:u,colorKeywords:f,valueKeywords:e,fontProperties:o,allowNested:!0,tokenHooks:{"/":function(n,i){return n.eat("/")?(n.skipToEnd(),["comment","comment"]):n.eat("*")?(i.tokenize=t,t(n,i)):["operator","operator"]},"@":function(n){return n.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(n.eatWhile(/[\w\\\-]/),n.match(/^\s*:/,!1))?["variable-2","variable-definition"]:["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}(),function(n){typeof exports=="object"&&typeof module=="object"?n(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(n){"use strict";n.defineMode("javascript",function(t,i){function yi(n){for(var r=!1,t,i=!1;(t=n.next())!=null;){if(!r){if(t=="/"&&!i)return;t=="["?i=!0:i&&t=="]"&&(i=!1)}r=!r&&t=="\\"}}function c(n,t,i){return tt=n,ut=i,t}function p(n,t){var i=n.next(),r,u;return i=='"'||i=="'"?(t.tokenize=pi(i),t.tokenize(n,t)):i=="."&&n.match(/^\d+(?:[eE][+\-]?\d+)?/)?c("number","number"):i=="."&&n.match("..")?c("spread","meta"):/[\[\]{}\(\),;\:\.]/.test(i)?c(i):i=="="&&n.eat(">")?c("=>","operator"):i=="0"&&n.eat(/x/i)?(n.eatWhile(/[\da-f]/i),c("number","number")):/\d/.test(i)?(n.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),c("number","number")):i=="/"?n.eat("*")?(t.tokenize=ft,ft(n,t)):n.eat("/")?(n.skipToEnd(),c("comment","comment")):t.lastType=="operator"||t.lastType=="keyword c"||t.lastType=="sof"||/^[\[{}\(,;:]$/.test(t.lastType)?(yi(n),n.eatWhile(/[gimy]/),c("regexp","string-2")):(n.eatWhile(ht),c("operator","operator",n.current())):i=="`"?(t.tokenize=ct,ct(n,t)):i=="#"?(n.skipToEnd(),c("error","error")):ht.test(i)?(n.eatWhile(ht),c("operator","operator",n.current())):(n.eatWhile(/[\w\$_]/),r=n.current(),u=ti.propertyIsEnumerable(r)&&ti[r],u&&t.lastType!="."?c(u.type,u.style,r):c("variable","variable",r))}function pi(n){return function(t,i){var r=!1,u;if(rt&&t.peek()=="@"&&t.match(vi))return i.tokenize=p,c("jsonld-keyword","meta");while((u=t.next())!=null){if(u==n&&!r)break;r=!r&&u=="\\"}return r||(i.tokenize=p),c("string","string")}}function ft(n,t){for(var r=!1,i;i=n.next();){if(i=="/"&&r){t.tokenize=p;break}r=i=="*"}return c("comment","comment")}function ct(n,t){for(var r=!1,i;(i=n.next())!=null;){if(!r&&(i=="`"||i=="$"&&n.eat("{"))){t.tokenize=p;break}r=!r&&i=="\\"}return c("quasi","string-2",n.current())}function lt(n,t){var e,r,f,i,o,u;if(t.fatArrowAt&&(t.fatArrowAt=null),e=n.string.indexOf("=>",n.start),!(e<0)){for(r=0,f=!1,i=e-1;i>=0;--i)if(o=n.string.charAt(i),u=wi.indexOf(o),u>=0&&u<3){if(!r){++i;break}if(--r==0)break}else if(u>=3&&u<6)++r;else if(/[$\w]/.test(o))f=!0;else if(f&&!r){++i;break}f&&!r&&(t.fatArrowAt=i)}}function ri(n,t,i,r,u,f){this.indented=n,this.column=t,this.type=i,this.prev=u,this.info=f,r!=null&&(this.align=r)}function bi(n,t){for(var r,i=n.localVars;i;i=i.next)if(i.name==t)return!0;for(r=n.context;r;r=r.prev)for(i=r.vars;i;i=i.next)if(i.name==t)return!0}function ki(n,t,i,r,f){var e=n.cc,o;for(u.state=n,u.stream=f,u.marked=null,u.cc=e,n.lexical.hasOwnProperty("align")||(n.lexical.align=!0);;)if(o=e.length?e.pop():y?h:l,o(i,r)){while(e.length&&e[e.length-1].lex)e.pop()();return u.marked?u.marked:i=="variable"&&bi(n,r)?"variable-2":t}}function f(){for(var n=arguments.length-1;n>=0;n--)u.cc.push(arguments[n])}function r(){return f.apply(null,arguments),!0}function w(n){function r(t){for(var i=t;i;i=i.next)if(i.name==n)return!0;return!1}var t=u.state;if(t.context){if(u.marked="def",r(t.localVars))return;t.localVars={name:n,next:t.localVars}}else{if(r(t.globalVars))return;i.globalVars&&(t.globalVars={name:n,next:t.globalVars})}}function b(){u.state.context={prev:u.state.context,vars:u.state.localVars},u.state.localVars=di}function k(){u.state.localVars=u.state.context.vars,u.state.context=u.state.context.prev}function o(n,t){var i=function(){var i=u.state,r=i.indented;i.lexical.type=="stat"&&(r=i.lexical.indented),i.lexical=new ri(r,u.stream.column(),n,null,i.lexical,t)};return i.lex=!0,i}function e(){var n=u.state;n.lexical.prev&&(n.lexical.type==")"&&(n.indented=n.lexical.indented),n.lexical=n.lexical.prev)}function s(n){function t(i){return i==n?r():n==";"?f():r(t)}return t}function l(n,t){return n=="var"?r(o("vardef",t.length),wt,s(";"),e):n=="keyword a"?r(o("form"),h,l,e):n=="keyword b"?r(o("form"),l,e):n=="{"?r(o("}"),pt,e):n==";"?r():n=="if"?r(o("form"),h,l,e,hi):n=="function"?r(nt):n=="for"?r(o("form"),ci,l,e):n=="variable"?r(o("stat"),ir):n=="switch"?r(o("form"),h,o("}","switch"),s("{"),pt,e,e):n=="case"?r(h,s(":")):n=="default"?r(s(":")):n=="catch"?r(o("form"),b,s("("),kt,s(")"),l,e,k):n=="module"?r(o("form"),b,vr,k,e):n=="class"?r(o("form"),cr,ar,e):n=="export"?r(o("form"),yr,e):n=="import"?r(o("form"),pr,e):f(o("stat"),h,s(";"),e)}function h(n){return ui(n,!1)}function a(n){return ui(n,!0)}function ui(n,t){var c,i;if(u.state.fatArrowAt==u.stream.start){if(c=t?ei:fi,n=="(")return r(b,o(")"),it(g,")"),e,s("=>"),c,k);if(n=="variable")return f(b,g,s("=>"),c,k)}return(i=t?vt:et,ii.hasOwnProperty(n))?r(i):n=="function"?r(nt,i):n=="keyword c"?r(t?gi:at):n=="("?r(o(")"),at,st,s(")"),e,i):n=="operator"||n=="spread"?r(t?a:h):n=="["?r(o("]"),wr,e,i):n=="{"?d(oi,"}",null,i):r()}function at(n){return n.match(/[;\}\)\],]/)?f():f(h)}function gi(n){return n.match(/[;\}\)\],]/)?f():f(a)}function et(n,t){return n==","?r(h):vt(n,t,!1)}function vt(n,t,i){var f=i==!1?et:vt,c=i==!1?h:a;return t=="=>"?r(b,i?ei:fi,k):n=="operator"?/\+\+|--/.test(t)?r(f):t=="?"?r(h,s(":"),c):r(c):n=="quasi"?(u.cc.push(f),nr(t)):n==";"?void 0:n=="("?d(a,")","call",f):n=="."?r(rr,f):n=="["?r(o("]"),at,s("]"),e,f):void 0}function nr(n){return n.slice(n.length-2)!="${"?r():r(h,tr)}function tr(n){if(n=="}")return u.marked="string-2",u.state.tokenize=ct,r()}function fi(n){return(lt(u.stream,u.state),n=="{")?f(l):f(h)}function ei(n){return(lt(u.stream,u.state),n=="{")?f(l):f(a)}function ir(n){return n==":"?r(e,l):f(et,s(";"),e)}function rr(n){if(n=="variable")return u.marked="property",r()}function oi(n,t){if(n=="variable"){if(u.marked="property",t=="get"||t=="set")return r(ur)}else if(n=="number"||n=="string")u.marked=rt?"property":n+" property";else if(n=="[")return r(h,s("]"),yt);if(ii.hasOwnProperty(n))return r(yt)}function ur(n){return n!="variable"?f(yt):(u.marked="property",r(nt))}function yt(n){return n==":"?r(a):n=="("?f(nt):void 0}function it(n,t){function i(f){if(f==","){var e=u.state.lexical;return e.info=="call"&&(e.pos=(e.pos||0)+1),r(n,i)}return f==t?r():r(s(t))}return function(u){return u==t?r():f(n,i)}}function d(n,t,i){for(var f=3;f<arguments.length;f++)u.cc.push(arguments[f]);return r(o(t,i),it(n,t),e)}function pt(n){return n=="}"?r():f(l,pt)}function si(n){if(ni&&n==":")return r(fr)}function fr(n){if(n=="variable")return u.marked="variable-3",r()}function wt(){return f(g,si,bt,or)}function g(n,t){return n=="variable"?(w(t),r()):n=="["?d(g,"]"):n=="{"?d(er,"}"):void 0}function er(n,t){return n=="variable"&&!u.stream.match(/^\s*:/,!1)?(w(t),r(bt)):(n=="variable"&&(u.marked="property"),r(s(":"),g,bt))}function bt(n,t){if(t=="=")return r(a)}function or(n){if(n==",")return r(wt)}function hi(n,t){if(n=="keyword b"&&t=="else")return r(o("form"),l,e)}function ci(n){if(n=="(")return r(o(")"),sr,s(")"),e)}function sr(n){return n=="var"?r(wt,s(";"),ot):n==";"?r(ot):n=="variable"?r(hr):f(h,s(";"),ot)}function hr(n,t){return t=="in"||t=="of"?(u.marked="keyword",r(h)):r(et,ot)}function ot(n,t){return n==";"?r(li):t=="in"||t=="of"?(u.marked="keyword",r(h)):f(h,s(";"),li)}function li(n){n!=")"&&r(h)}function nt(n,t){return t=="*"?(u.marked="keyword",r(nt)):n=="variable"?(w(t),r(nt)):n=="("?r(b,o(")"),it(kt,")"),e,l,k):void 0}function kt(n){return n=="spread"?r(kt):f(g,si)}function cr(n,t){if(n=="variable")return w(t),r(lr)}function lr(n,t){if(t=="extends")return r(h)}function ar(n){if(n=="{")return d(oi,"}")}function vr(n,t){return n=="string"?r(l):n=="variable"?(w(t),r(dt)):void 0}function yr(n,t){return t=="*"?(u.marked="keyword",r(dt,s(";"))):t=="default"?(u.marked="keyword",r(h,s(";"))):f(l)}function pr(n){return n=="string"?r():f(ai,dt)}function ai(n,t){return n=="{"?d(ai,"}"):(n=="variable"&&w(t),r())}function dt(n,t){if(t=="from")return u.marked="keyword",r(h)}function wr(n){return n=="]"?r():f(a,br)}function br(n){return n=="for"?f(st,s("]")):n==","?r(it(a,"]")):f(it(a,"]"))}function st(n){return n=="for"?r(ci,st):n=="if"?r(h,st):void 0}var v=t.indentUnit,gt=i.statementIndent,rt=i.jsonld,y=i.json||rt,ni=i.typescript,ti=function(){function n(n){return{type:n,style:"keyword"}}var s=n("keyword a"),u=n("keyword b"),t=n("keyword c"),f=n("operator"),i={type:"atom",style:"atom"},h={"if":n("if"),"while":s,"with":s,"else":u,"do":u,"try":u,"finally":u,"return":t,"break":t,"continue":t,"new":t,"delete":t,"throw":t,"debugger":t,"var":n("var"),"const":n("var"),"let":n("var"),"function":n("function"),"catch":n("catch"),"for":n("for"),"switch":n("switch"),"case":n("case"),"default":n("default"),"in":f,"typeof":f,"instanceof":f,"true":i,"false":i,"null":i,undefined:i,NaN:i,Infinity:i,"this":n("this"),module:n("module"),"class":n("class"),"super":n("atom"),"yield":t,"export":n("export"),"import":n("import"),"extends":t},r,e,o;if(ni){r={type:"variable",style:"variable-3"},e={"interface":n("interface"),"extends":n("extends"),constructor:n("constructor"),"public":n("public"),"private":n("private"),"protected":n("protected"),"static":n("static"),string:r,number:r,bool:r,any:r};for(o in e)h[o]=e[o]}return h}(),ht=/[+\-*&%=<>!?|~^]/,vi=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,tt,ut,wi="([{}])",ii={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},u={state:null,column:null,marked:null,cc:null},di={name:"this",next:{name:"arguments"}};return e.lex=!0,{startState:function(n){var t={tokenize:p,lastType:"sof",cc:[],lexical:new ri((n||0)-v,0,"block",!1),localVars:i.localVars,context:i.localVars&&{vars:i.localVars},indented:0};return i.globalVars&&typeof i.globalVars=="object"&&(t.globalVars=i.globalVars),t},token:function(n,t){if(n.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=n.indentation(),lt(n,t)),t.tokenize!=ft&&n.eatSpace())return null;var i=t.tokenize(n,t);return tt=="comment"?i:(t.lastType=tt=="operator"&&(ut=="++"||ut=="--")?"incdec":tt,ki(t,i,tt,ut,n))},indent:function(t,r){var o,u,s,c,f,h;if(t.tokenize==ft)return n.Pass;if(t.tokenize!=p)return 0;for(o=r&&r.charAt(0),u=t.lexical,s=t.cc.length-1;s>=0;--s)if(c=t.cc[s],c==e)u=u.prev;else if(c!=hi)break;return u.type=="stat"&&o=="}"&&(u=u.prev),gt&&u.type==")"&&u.prev.type=="stat"&&(u=u.prev),f=u.type,h=o==f,f=="vardef"?u.indented+(t.lastType=="operator"||t.lastType==","?u.info+1:0):f=="form"&&o=="{"?u.indented:f=="form"?u.indented+v:f=="stat"?u.indented+(t.lastType=="operator"||t.lastType==","?gt||v:0):u.info!="switch"||h||i.doubleIndentSwitch==!1?u.align?u.column+(h?0:1):u.indented+(h?0:v):u.indented+(/^(?:case|default)\b/.test(r)?v:2*v)},electricChars:":{}",blockCommentStart:y?null:"/*",blockCommentEnd:y?null:"*/",lineComment:y?null:"//",fold:"brace",helperType:y?"json":"javascript",jsonldMode:rt,jsonMode:y}}),n.defineMIME("text/javascript","javascript"),n.defineMIME("text/ecmascript","javascript"),n.defineMIME("application/javascript","javascript"),n.defineMIME("application/ecmascript","javascript"),n.defineMIME("application/json",{name:"javascript",json:!0}),n.defineMIME("application/x-json",{name:"javascript",json:!0}),n.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),n.defineMIME("text/typescript",{name:"javascript",typescript:!0}),n.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(){function t(n){return n.toString().split(".")[1]}var n=Ember.RSVP.Promise;Ember.OfflineAdapter=Ember.Adapter.extend({find:function(t,i){var r=this._getItem(t.constructor,i);return new n(function(n,u){r?(t.load(i,r),n(t)):u(t)})},findAll:function(i,r){var u=this,f=this.applicationData;return new n(function(n){var e=f.meta[t(i)+"!ids"],s=[],o,h;if(e)for(e=e.split(","),o=0,h=e.length;o<h;o++)s.push(u._getItem(i,e[o]));r.load(i,s),n(r)})},createRecord:function(i){var u=this,r=i.constructor,f=this.applicationData;return new n(function(n){var e=f.meta[t(r)+"!nextId"]||"1",o;i.set(r.primaryKey,e),o=i.toJSON(),u._setItem(r,e,o),u._updateIds(r,e),f.meta[t(r)+"!nextId"]=parseInt(e,10)+1,i.load(e,o),i.didCreateRecord(),n(i)})},saveRecord:function(t){var r=this,i=t.constructor;return new n(function(n){r._setItem(i,t.get(i.primaryKey),t.toJSON()),t.didSaveRecord(),n(t)})},deleteRecord:function(t){var r=this,i=t.constructor;return new n(function(n){r._deleteItem(i,t.get(i.primaryKey)),t.didDeleteRecord(),n(t)})},_getItem:function(n,t){var i=this.applicationData[n][t];return i&&JSON.parse(i)},_setItem:function(n,t,i){this.applicationData[n]||(this.applicationData[n]={}),this.applicationData[n][t]=JSON.stringify(i)},_deleteItem:function(n,i){var f,r,u,e;for(delete this.applicationData[n][i],f=t(n)+"!ids",r=this.applicationData.meta[f].split(","),u=0,e=r.length;u<e;u++)if(r[u]===""+i){r.splice(u,1);break}this.applicationData.meta[f]=r.join(",")},_updateIds:function(n,i){i=String(i);var r=t(n)+"!ids",u=this.applicationData.meta[r];u?this.applicationData.meta[r]+=","+i:this.applicationData.meta[r]=i}})}();
|
33 |
-
/*!
|
1 |
+
/*!
|
2 |
+
* Master Slider WordPress Lite Panel - Required JS Modules
|
3 |
+
* @date Jan 2015
|
4 |
+
*/
|
5 |
/*!
|
6 |
* @overview Averta JavaScript Libraries
|
7 |
* @copyright Copyright 2014 Averta Ltd.
|
8 |
* http://www.averta.net
|
9 |
*/
|
10 |
+
window.averta={},function($){function getVendorPrefix(){if("result"in arguments.callee)return arguments.callee.result;var regex=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,someScript=document.getElementsByTagName("script")[0];for(var prop in someScript.style)if(regex.test(prop))return arguments.callee.result=prop.match(regex)[0];return arguments.callee.result="WebkitOpacity"in someScript.style?"Webkit":"KhtmlOpacity"in someScript.style?"Khtml":""}function checkStyleValue(prop){var b=document.body||document.documentElement,s=b.style,p=prop;if("string"==typeof s[p])return!0;v=["Moz","Webkit","Khtml","O","ms"],p=p.charAt(0).toUpperCase()+p.substr(1);for(var i=0;i<v.length;i++)if("string"==typeof s[v[i]+p])return!0;return!1}function supportsTransitions(){return checkStyleValue("transition")}function supportsTransforms(){return checkStyleValue("transform")}function supports3DTransforms(){if(!supportsTransforms())return!1;var has3d,el=document.createElement("p"),transforms={WebkitTransform:"-webkit-transform",OTransform:"-o-transform",MSTransform:"-ms-transform",MozTransform:"-moz-transform",Transform:"transform"};document.body.insertBefore(el,null);for(var t in transforms)void 0!==el.style[t]&&(el.style[t]="translate3d(1px,1px,1px)",has3d=window.getComputedStyle(el).getPropertyValue(transforms[t]));return document.body.removeChild(el),null!=has3d&&has3d.length>0&&"none"!==has3d}window["package"]=function(name){window[name]||(window[name]={})};var trans={Moz:"-moz-",Webkit:"-webkit-",Khtml:"-khtml-",O:"-o-",ms:"-ms-",Icab:"-icab-"};$(document).ready(function(){window._jcsspfx=getVendorPrefix(),window._csspfx=trans[window._jcsspfx],window._cssanim=supportsTransitions(),window._css3d=supports3DTransforms(),window._css2d=supportsTransforms(),window._mobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),window._touch="ontouchstart"in document}),window.parseQueryString=function(url){var queryString={};return url.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function($0,$1,$2,$3){queryString[$1]=$3}),queryString};var fps60=50/3;window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,fps60)}}()),window.getComputedStyle||(window.getComputedStyle=function(el){return this.el=el,this.getPropertyValue=function(prop){var re=/(\-([a-z]){1})/g;return"float"==prop&&(prop="styleFloat"),re.test(prop)&&(prop=prop.replace(re,function(){return arguments[2].toUpperCase()})),el.currentStyle[prop]?el.currentStyle[prop]:null},el.currentStyle}),jQuery&&($.jqLoadFix=function(){if(this.complete){var that=this;setTimeout(function(){$(that).load()},1)}},jQuery.uaMatch=jQuery.uaMatch||function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}},jQuery.browser||(matched=jQuery.uaMatch(navigator.userAgent),browser={},matched.browser&&(browser[matched.browser]=!0,browser.version=matched.version),browser.chrome?browser.webkit=!0:browser.webkit&&(browser.safari=!0),jQuery.browser=browser),$.fn.preloadImg=function(src,_event){return this.each(function(){var $this=$(this),self=this,img=new Image;img.onload=function(event){$this.attr("src",src),event.width=img.width,event.height=img.height,setTimeout(function(){_event.call(self,event)},50),img=null},img.src=src}),this}),window.parseTransform=function(transformCSS_str){if(null===transformCSS_str)return{};transformCSS_str=transformCSS_str.replace(/\s+/g,"");var fullFun_array=transformCSS_str.split(")");fullFun_array.pop();for(var parsed_obj={},i=0,l=fullFun_array.length;l>i;++i){var fun=fullFun_array[i];parsed_obj[fun.slice(0,fun.indexOf("("))]=fun.slice(fun.indexOf("(")+1).split(",")}return parsed_obj},window.convertEaseName=function(easeName){if("linear"===easeName)return Linear.easeNone;var isInOut=-1!==easeName.indexOf("InOut"),isIn=-1!==easeName.indexOf("In");return isInOut?window[easeName.slice(9)].easeInOut:isIn?window[easeName.slice(6)].easeIn:window[easeName.slice(7)].easeOut},jQuery.fn.extend({insertAtCaret:function(myValue){return this.each(function(){if(document.selection){this.focus();var sel=document.selection.createRange();sel.text=myValue,this.focus()}else if(this.selectionStart||"0"==this.selectionStart){var startPos=this.selectionStart,endPos=this.selectionEnd,scrollTop=this.scrollTop;this.value=this.value.substring(0,startPos)+myValue+this.value.substring(endPos,this.value.length),this.focus(),this.selectionStart=startPos+myValue.length,this.selectionEnd=startPos+myValue.length,this.scrollTop=scrollTop}else this.value+=myValue,this.focus()})}})}(jQuery),"function"!=typeof Object.create&&(Object.create=function(obj){function F(){}return F.prototype=obj,new F}),function($){var Container={init:function(el,options){var self=this;self.options=$.extend({},$.fn.avertaLiveTabs.defaultOptions,options||{}),self.$el=$(el),self.el=el,self.$tabs=self.$el.find(self.options.tabs),self.$contents=self.$el.find(self.options.contents),self.setup()},setup:function(){var $active_tab,self=this;if(self.$tabs.on("click",{self:self},self.onTabClicked),self.options.enableHash&&""!==window.location.hash){var id=window.location.hash.substring(1);$active_tab=self.getTabById(id)}else $active_tab=self.$tabs.filter("."+self.options.tabsActiveClass);$active_tab=$active_tab.length?$active_tab:self.$tabs.first(),$active_tab.trigger("click",!0)},onTabClicked:function(event,fromSetup){event.preventDefault();var $tab_content,active_id,self=event.data.self,$this=$(this);(fromSetup||!$this.hasClass("active"))&&(self.$tabs.removeClass(self.options.tabsActiveClass),$this.addClass(self.options.tabsActiveClass),self.$contents.hide(),"id"==self.options.connectType?(active_id=self.getIdByTab($this),$tab_content=self.getContentById(active_id)):$tab_content=self.$contents.eq($this.index()),$tab_content.fadeIn(self.options.duration),self.options.updateHash&&(active_id=self.getIdByTab($this),active_id=active_id?active_id+self.options.hashSuffix:"",window.history&&window.history.pushState?window.history.pushState(null,null,window.location.href.split("#")[0]+"#"+active_id):window.location.hash=active_id),self.$el.trigger("avtTabChange",$tab_content.attr("id")))},getTabById:function(id){id=id.split(this.options.hashSuffix)[0];var $active_tab=this.$tabs.find('[href="#'+id+'"]').eq(0);return $active_tab.length||($active_tab=this.$tabs.find('[href="'+id+'"]').eq(0)),$active_tab.length?$active_tab.parent():$active_tab},getContentById:function(id){return this.$contents.filter("#"+id)},getIdByTab:function($tab){var $anchor=$tab.find("[href]").eq(0);return $anchor.length?$anchor.attr("href"):!1}};$.fn.avertaLiveTabs=function(options){return this.each(function(){var container=Object.create(Container);container.init(this,options)})},$.fn.avertaLiveTabs.defaultOptions={tabs:"ul.tabs > li",tabsActiveClass:"active",contents:"ul.tabs-content > li",contentsActiveClass:"active",transition:"fade",duration:"500",connectType:"index",enableHash:!1,updateHash:!1,hashSuffix:"-tab"}}(jQuery),window.averta=window.averta||{},function($){"use strict";var rangeSlider=function(){this.ranges=[],this.$element=$("<div></div>")},p=rangeSlider.prototype;p.addRange=function(id,value,classname,labelProxy){var element=$("<div></div>").width(value).appendTo(this.$element).addClass(classname),tt=$("<div></div>").addClass("avt-range-tooltip"),range={element:element,value:value,id:id,labelProxy:labelProxy,tt:tt},that=this;return element.data("range",range),element.mousedown(function(event){if(!that.disabled){var $this=$(this);$this.addClass("rangeslider-start"),that._startX=event.pageX,that._startW=$this.width(),that._draging=$this,that._start=!0,$(document).bind("mousemove",{ref:that},that._onMouseMove).bind("mouseup",{ref:that},that._onMouseUp),that.onStart&&that.onStart.call(that.onStartRef,range)}}).mouseover(function(){that._start||(tt.stop(!0).fadeIn(150),tt.appendTo("body"),that._updateTT(range))}).mouseout(function(){that._start||tt.stop(!0).fadeOut(150,function(){tt.detach()})}),this.ranges.push(range),range},p.hideRange=function(range){range.element.css("display","none")},p.showRange=function(range){range.element.css("display","")},p.removeRange=function(range){range.element.remove(),this.ranges.splice(this.ranges.indexOf(range),1),range=null},p.setValue=function(range,value){range.value=value,range.element.width(value)},p.remove=function(){for(var i=0,l=this.ranges.length;i!==l;++i)this.ranges[i].element.remove(),this.ranges[i].tt.remove(),this.ranges[i]=null},p.disable=function(){this.disabled||(this.disabled=!0,this.$element.addClass("avt-disabled"))},p.enable=function(){this.disabled&&(this.disabled=!1,this.$element.removeClass("avt-disabled"))},p._updateTT=function(range){var tt=range.tt,ele_pos=range.element.offset();tt.css({top:ele_pos.top,left:ele_pos.left}),tt.html(range.labelProxy.call(null,range))},p._onMouseMove=function(event){var that=event.data.ref,range=that._draging.data("range");that.setValue(range,Math.max(0,that._startW+(event.pageX-that._startX))),that.onMove&&that.onMove.call(that.onMoveRef,that._draging.data("range")),that._updateTT(range),event.preventDefault()},p._onMouseUp=function(event){var that=event.data.ref;that._start=!1,that._draging.trigger("mouseout"),that._draging=null,$(document).unbind("mousemove",that._onMouseMove).unbind("mouseup",that._onMouseUp)},averta.rangeSlider=rangeSlider}(jQuery),function(){"use strict";window.MSAligner=function(type,$container,$img){this.$container=$container,this.$img=$img,this.type=type||"stretch",this.widthOnly=!1,this.heightOnly=!1};var p=MSAligner.prototype;p.init=function(w,h){switch(this.baseWidth=w,this.baseHeight=h,this.imgRatio=w/h,this.imgRatio2=h/w,this.type){case"tile":this.$container.css("background-image","url("+this.$img.attr("src")+")"),this.$img.detach();break;case"center":this.$container.css("background-image","url("+this.$img.attr("src")+")"),this.$container.css({backgroundPosition:"center center",backgroundRepeat:"no-repeat"}),this.$img.detach();break;case"stretch":this.$img.css({width:"100%",height:"100%"});break;case"fill":case"fit":this.needAlign=!0,this.align()}},p.align=function(){if(this.needAlign){var cont_w=this.$container.width(),cont_h=this.$container.height(),contRatio=cont_w/cont_h;"fill"==this.type?this.imgRatio<contRatio?(this.$img.width(cont_w),this.$img.height(cont_w*this.imgRatio2)):(this.$img.height(cont_h),this.$img.width(cont_h*this.imgRatio)):"fit"==this.type&&(this.imgRatio<contRatio?(this.$img.height(cont_h),this.$img.width(cont_h*this.imgRatio)):(this.$img.width(cont_w),this.$img.height(cont_w*this.imgRatio2))),this.setMargin()}},p.changeType=function(type){this.reset(),this.type=type,this.reinit()},p.reinit=function(){this.init(this.baseWidth,this.baseHeight)},p.reset=function(){"center"===this.type||"tile"===this.type?(this.$container.css({"background-image":"",backgroundPosition:"",backgroundRepeat:""}),this.$img.appendTo(this.$container)):this.$img.css({width:"",height:"","margin-top":"","margin-left":""})},p.setMargin=function(){var cont_w=this.$container.width(),cont_h=this.$container.height();this.$img.css("margin-top",(cont_h-this.$img[0].offsetHeight)/2+"px"),this.$img.css("margin-left",(cont_w-this.$img[0].offsetWidth)/2+"px")}}(),/*!
|
|
|
11 |
* Custom DropDown plugin by PC
|
12 |
* http://designwithpc.com/Plugins/ddslick
|
13 |
* Author: PC
|
14 |
*/
|
15 |
+
function($){function selectIndex(obj,index){var pluginData=obj.data("ddslick"),ddSelected=obj.find(".dd-selected"),ddSelectedValue=ddSelected.siblings(".dd-selected-value"),selectedOption=(obj.find(".dd-options"),ddSelected.siblings(".dd-pointer"),obj.find(".dd-option").eq(index)),selectedLiItem=selectedOption.closest("li"),settings=pluginData.settings,selectedData=pluginData.settings.data[index];obj.find(".dd-option").removeClass("dd-option-selected"),selectedOption.addClass("dd-option-selected"),pluginData.selectedIndex=index,pluginData.selectedItem=selectedLiItem,pluginData.selectedData=selectedData,ddSelected.html(settings.showSelectedHTML?(selectedData.imageSrc?'<img class="dd-selected-image'+("right"==settings.imagePosition?" dd-image-right":"")+'" src="'+selectedData.imageSrc+'" />':"")+(selectedData.text?'<label class="dd-selected-text">'+selectedData.text+"</label>":"")+(selectedData.description?'<small class="dd-selected-description dd-desc'+(settings.truncateDescription?" dd-selected-description-truncated":"")+'" >'+selectedData.description+"</small>":""):selectedData.text),ddSelectedValue.val(selectedData.value),pluginData.original.val(selectedData.value),obj.data("ddslick",pluginData),close(obj),adjustSelectedHeight(obj),"function"==typeof settings.onSelected&&settings.onSelected.call(this,pluginData)}function open(obj){var $this=obj.find(".dd-select"),ddOptions=$this.siblings(".dd-options"),ddPointer=$this.find(".dd-pointer"),wasOpen=ddOptions.is(":visible");$(".dd-click-off-close").not(ddOptions).slideUp(50),$(".dd-pointer").removeClass("dd-pointer-up"),wasOpen?(ddOptions.slideUp("fast"),ddPointer.removeClass("dd-pointer-up")):(ddOptions.slideDown("fast"),ddPointer.addClass("dd-pointer-up")),adjustOptionsHeight(obj)}function close(obj){obj.find(".dd-options").slideUp(50),obj.find(".dd-pointer").removeClass("dd-pointer-up").removeClass("dd-pointer-up")}function adjustSelectedHeight(obj){var lSHeight=obj.find(".dd-select").css("height"),descriptionSelected=obj.find(".dd-selected-description"),imgSelected=obj.find(".dd-selected-image");descriptionSelected.length<=0&&imgSelected.length>0&&obj.find(".dd-selected-text").css("lineHeight",lSHeight)}function adjustOptionsHeight(obj){obj.find(".dd-option").each(function(){var $this=$(this),lOHeight=$this.css("height"),descriptionOption=$this.find(".dd-option-description"),imgOption=obj.find(".dd-option-image");descriptionOption.length<=0&&imgOption.length>0&&$this.find(".dd-option-text").css("lineHeight",lOHeight)})}$.fn.ddslick=function(method){return methods[method]?methods[method].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof method&&method?void $.error("Method "+method+" does not exists."):methods.init.apply(this,arguments)};var methods={},defaults={data:[],keepJSONItemsOnTop:!1,width:260,height:null,background:"#eee",selectText:"",defaultSelectedIndex:null,truncateDescription:!0,imagePosition:"left",showSelectedHTML:!0,clickOffToClose:!0,onSelected:function(){}},ddSelectHtml='<div class="dd-select"><input class="dd-selected-value" type="hidden" /><a class="dd-selected"></a><span class="dd-pointer dd-pointer-down"></span></div>',ddOptionsHtml='<ul class="dd-options"></ul>';methods.init=function(options){var options=$.extend({},defaults,options);return this.each(function(){var obj=$(this),data=obj.data("ddslick");if(!data){{var ddSelect=[];options.data}obj.find("option").each(function(){var $this=$(this),thisData=$this.data();ddSelect.push({text:$.trim($this.text()),value:$this.val(),selected:$this.is(":selected"),description:thisData.description,imageSrc:thisData.imagesrc})}),options.keepJSONItemsOnTop?$.merge(options.data,ddSelect):options.data=$.merge(ddSelect,options.data);var original=obj,placeholder=$('<div id="'+obj.attr("id")+'"></div>');obj.replaceWith(placeholder),obj=placeholder,obj.addClass("dd-container").append(ddSelectHtml).append(ddOptionsHtml);var ddSelect=obj.find(".dd-select"),ddOptions=obj.find(".dd-options");ddOptions.css({width:options.width}),ddSelect.css({width:options.width,background:options.background}),obj.css({width:options.width}),null!=options.height&&ddOptions.css({height:options.height,overflow:"auto"}),$.each(options.data,function(index,item){item.selected&&(options.defaultSelectedIndex=index),ddOptions.append('<li><a class="dd-option">'+(item.value?' <input class="dd-option-value" type="hidden" value="'+item.value+'" />':"")+(item.imageSrc?' <img class="dd-option-image'+("right"==options.imagePosition?" dd-image-right":"")+'" src="'+item.imageSrc+'" />':"")+(item.text?' <label class="dd-option-text">'+item.text+"</label>":"")+(item.description?' <small class="dd-option-description dd-desc">'+item.description+"</small>":"")+"</a></li>")});var pluginData={settings:options,original:original,selectedIndex:-1,selectedItem:null,selectedData:null};if(obj.data("ddslick",pluginData),options.selectText.length>0&&null==options.defaultSelectedIndex)obj.find(".dd-selected").html(options.selectText);else{var index=null!=options.defaultSelectedIndex&&options.defaultSelectedIndex>=0&&options.defaultSelectedIndex<options.data.length?options.defaultSelectedIndex:0;selectIndex(obj,index)}obj.find(".dd-select").on("click.ddslick",function(){open(obj)}),obj.find(".dd-option").on("click.ddslick",function(){selectIndex(obj,$(this).closest("li").index())}),options.clickOffToClose&&(ddOptions.addClass("dd-click-off-close"),obj.on("click.ddslick",function(e){e.stopPropagation()}),$("body").on("click",function(){$(".dd-click-off-close").slideUp(50).siblings(".dd-select").find(".dd-pointer").removeClass("dd-pointer-up")}))}})},methods.select=function(options){return this.each(function(){null!==options.index&&selectIndex($(this),options.index)})},methods.open=function(){return this.each(function(){var $this=$(this),pluginData=$this.data("ddslick");pluginData&&open($this)})},methods.close=function(){return this.each(function(){var $this=$(this),pluginData=$this.data("ddslick");pluginData&&close($this)})},methods.destroy=function(){return this.each(function(){var $this=$(this),pluginData=$this.data("ddslick");if(pluginData){var originalElement=pluginData.original;$this.removeData("ddslick").unbind(".ddslick").replaceWith(originalElement)}})}}(jQuery),function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports&&"object"==typeof module?module.exports=factory:factory(jQuery)}(function($,undefined){"use strict";function paletteTemplate(p,color,className,opts){for(var html=[],i=0;i<p.length;i++){var current=p[i];if(current){var tiny=tinycolor(current),c=tiny.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";c+=tinycolor.equals(color,current)?" sp-thumb-active":"";var formattedString=tiny.toString(opts.preferredFormat||"rgb"),swatchStyle=rgbaSupport?"background-color:"+tiny.toRgbString():"filter:"+tiny.toFilter();html.push('<span title="'+formattedString+'" data-color="'+tiny.toRgbString()+'" class="'+c+'"><span class="sp-thumb-inner" style="'+swatchStyle+';" /></span>')}else{var cls="sp-clear-display";html.push($("<div />").append($('<span data-color="" style="background-color:transparent;" class="'+cls+'"></span>').attr("title",opts.noColorSelectedText)).html())}}return"<div class='sp-cf "+className+"'>"+html.join("")+"</div>"}function hideAll(){for(var i=0;i<spectrums.length;i++)spectrums[i]&&spectrums[i].hide()}function instanceOptions(o,callbackContext){var opts=$.extend({},defaultOpts,o);return opts.callbacks={move:bind(opts.move,callbackContext),change:bind(opts.change,callbackContext),show:bind(opts.show,callbackContext),hide:bind(opts.hide,callbackContext),beforeShow:bind(opts.beforeShow,callbackContext)},opts}function spectrum(element,o){function applyOptions(){if(opts.showPaletteOnly&&(opts.showPalette=!0),toggleButton.text(opts.showPaletteOnly?opts.togglePaletteMoreText:opts.togglePaletteLessText),opts.palette){palette=opts.palette.slice(0),paletteArray=$.isArray(palette[0])?palette:[palette],paletteLookup={};for(var i=0;i<paletteArray.length;i++)for(var j=0;j<paletteArray[i].length;j++){var rgb=tinycolor(paletteArray[i][j]).toRgbString();paletteLookup[rgb]=!0}}container.toggleClass("sp-flat",flat),container.toggleClass("sp-input-disabled",!opts.showInput),container.toggleClass("sp-alpha-enabled",opts.showAlpha),container.toggleClass("sp-clear-enabled",allowEmpty),container.toggleClass("sp-buttons-disabled",!opts.showButtons),container.toggleClass("sp-palette-buttons-disabled",!opts.togglePaletteOnly),container.toggleClass("sp-palette-disabled",!opts.showPalette),container.toggleClass("sp-palette-only",opts.showPaletteOnly),container.toggleClass("sp-initial-disabled",!opts.showInitial),container.addClass(opts.className).addClass(opts.containerClassName),reflow()}function initialize(){function paletteElementClick(e){return e.data&&e.data.ignore?(set($(e.target).closest(".sp-thumb-el").data("color")),move()):(set($(e.target).closest(".sp-thumb-el").data("color")),move(),updateOriginalInput(!0),opts.hideAfterPaletteSelect&&hide()),!1}if(IE&&container.find("*:not(input)").attr("unselectable","on"),applyOptions(),shouldReplace&&boundElement.after(replacer).hide(),allowEmpty||clearButton.hide(),flat)boundElement.after(container).hide();else{var appendTo="parent"===opts.appendTo?boundElement.parent():$(opts.appendTo);1!==appendTo.length&&(appendTo=$("body")),appendTo.append(container)}updateSelectionPaletteFromStorage(),offsetElement.bind("click.spectrum touchstart.spectrum",function(e){disabled||toggle(),e.stopPropagation(),$(e.target).is("input")||e.preventDefault()}),(boundElement.is(":disabled")||opts.disabled===!0)&&disable(),container.click(stopPropagation),textInput.change(setFromTextInput),textInput.bind("paste",function(){setTimeout(setFromTextInput,1)}),textInput.keydown(function(e){13==e.keyCode&&setFromTextInput()}),cancelButton.text(opts.cancelText),cancelButton.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),revert(),hide()}),clearButton.attr("title",opts.clearText),clearButton.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),isEmpty=!0,move(),flat&&updateOriginalInput(!0)}),chooseButton.text(opts.chooseText),chooseButton.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),isValid()&&(updateOriginalInput(!0),hide())}),toggleButton.text(opts.showPaletteOnly?opts.togglePaletteMoreText:opts.togglePaletteLessText),toggleButton.bind("click.spectrum",function(e){e.stopPropagation(),e.preventDefault(),opts.showPaletteOnly=!opts.showPaletteOnly,opts.showPaletteOnly||flat||container.css("left","-="+(pickerContainer.outerWidth(!0)+5)),applyOptions()}),draggable(alphaSlider,function(dragX,dragY,e){currentAlpha=dragX/alphaWidth,isEmpty=!1,e.shiftKey&&(currentAlpha=Math.round(10*currentAlpha)/10),move()},dragStart,dragStop),draggable(slider,function(dragX,dragY){currentHue=parseFloat(dragY/slideHeight),isEmpty=!1,opts.showAlpha||(currentAlpha=1),move()},dragStart,dragStop),draggable(dragger,function(dragX,dragY,e){if(e.shiftKey){if(!shiftMovementDirection){var oldDragX=currentSaturation*dragWidth,oldDragY=dragHeight-currentValue*dragHeight,furtherFromX=Math.abs(dragX-oldDragX)>Math.abs(dragY-oldDragY);shiftMovementDirection=furtherFromX?"x":"y"}}else shiftMovementDirection=null;var setSaturation=!shiftMovementDirection||"x"===shiftMovementDirection,setValue=!shiftMovementDirection||"y"===shiftMovementDirection;setSaturation&&(currentSaturation=parseFloat(dragX/dragWidth)),setValue&&(currentValue=parseFloat((dragHeight-dragY)/dragHeight)),isEmpty=!1,opts.showAlpha||(currentAlpha=1),move()},dragStart,dragStop),initialColor?(set(initialColor),updateUI(),currentPreferredFormat=preferredFormat||tinycolor(initialColor).format,addColorToSelectionPalette(initialColor)):updateUI(),flat&&show();var paletteEvent=IE?"mousedown.spectrum":"click.spectrum touchstart.spectrum";paletteContainer.delegate(".sp-thumb-el",paletteEvent,paletteElementClick),initialColorContainer.delegate(".sp-thumb-el:nth-child(1)",paletteEvent,{ignore:!0},paletteElementClick)}function updateSelectionPaletteFromStorage(){if(localStorageKey&&window.localStorage){try{var oldPalette=window.localStorage[localStorageKey].split(",#");oldPalette.length>1&&(delete window.localStorage[localStorageKey],$.each(oldPalette,function(i,c){addColorToSelectionPalette(c)}))}catch(e){}try{selectionPalette=window.localStorage[localStorageKey].split(";")}catch(e){}}}function addColorToSelectionPalette(color){if(showSelectionPalette){var rgb=tinycolor(color).toRgbString();if(!paletteLookup[rgb]&&-1===$.inArray(rgb,selectionPalette))for(selectionPalette.push(rgb);selectionPalette.length>maxSelectionSize;)selectionPalette.shift();if(localStorageKey&&window.localStorage)try{window.localStorage[localStorageKey]=selectionPalette.join(";")}catch(e){}}}function getUniqueSelectionPalette(){var unique=[];if(opts.showPalette)for(var i=0;i<selectionPalette.length;i++){var rgb=tinycolor(selectionPalette[i]).toRgbString();paletteLookup[rgb]||unique.push(selectionPalette[i])}return unique.reverse().slice(0,opts.maxSelectionSize)}function drawPalette(){var currentColor=get(),html=$.map(paletteArray,function(palette,i){return paletteTemplate(palette,currentColor,"sp-palette-row sp-palette-row-"+i,opts)});updateSelectionPaletteFromStorage(),selectionPalette&&html.push(paletteTemplate(getUniqueSelectionPalette(),currentColor,"sp-palette-row sp-palette-row-selection",opts)),paletteContainer.html(html.join(""))}function drawInitial(){if(opts.showInitial){var initial=colorOnShow,current=get();initialColorContainer.html(paletteTemplate([initial,current],current,"sp-palette-row-initial",opts))}}function dragStart(){(0>=dragHeight||0>=dragWidth||0>=slideHeight)&&reflow(),container.addClass(draggingClass),shiftMovementDirection=null,boundElement.trigger("dragstart.spectrum",[get()])}function dragStop(){container.removeClass(draggingClass),boundElement.trigger("dragstop.spectrum",[get()])}function setFromTextInput(){var value=textInput.val();if(null!==value&&""!==value||!allowEmpty){var tiny=tinycolor(value);tiny.isValid()?(set(tiny),updateOriginalInput(!0)):textInput.addClass("sp-validation-error")}else set(null),updateOriginalInput(!0)}function toggle(){visible?hide():show()}function show(){var event=$.Event("beforeShow.spectrum");return visible?void reflow():(boundElement.trigger(event,[get()]),void(callbacks.beforeShow(get())===!1||event.isDefaultPrevented()||(hideAll(),visible=!0,$(doc).bind("click.spectrum",clickout),$(window).bind("resize.spectrum",resize),replacer.addClass("sp-active"),container.removeClass("sp-hidden"),reflow(),updateUI(),colorOnShow=get(),drawInitial(),callbacks.show(colorOnShow),boundElement.trigger("show.spectrum",[colorOnShow]))))}function clickout(e){2!=e.button&&(clickoutFiresChange?updateOriginalInput(!0):revert(),hide())}function hide(){visible&&!flat&&(visible=!1,$(doc).unbind("click.spectrum",clickout),$(window).unbind("resize.spectrum",resize),replacer.removeClass("sp-active"),container.addClass("sp-hidden"),callbacks.hide(get()),boundElement.trigger("hide.spectrum",[get()]))}function revert(){set(colorOnShow,!0)}function set(color,ignoreFormatChange){if(tinycolor.equals(color,get()))return void updateUI();var newColor,newHsv;!color&&allowEmpty?isEmpty=!0:(isEmpty=!1,newColor=tinycolor(color),newHsv=newColor.toHsv(),currentHue=newHsv.h%360/360,currentSaturation=newHsv.s,currentValue=newHsv.v,currentAlpha=newHsv.a),updateUI(),newColor&&newColor.isValid()&&!ignoreFormatChange&&(currentPreferredFormat=preferredFormat||newColor.getFormat())}function get(opts){return opts=opts||{},allowEmpty&&isEmpty?null:tinycolor.fromRatio({h:currentHue,s:currentSaturation,v:currentValue,a:Math.round(100*currentAlpha)/100},{format:opts.format||currentPreferredFormat})}function isValid(){return!textInput.hasClass("sp-validation-error")}function move(){updateUI(),callbacks.move(get()),boundElement.trigger("move.spectrum",[get()])}function updateUI(){textInput.removeClass("sp-validation-error"),updateHelperLocations();var flatColor=tinycolor.fromRatio({h:currentHue,s:1,v:1});dragger.css("background-color",flatColor.toHexString());var format=currentPreferredFormat;1>currentAlpha&&(0!==currentAlpha||"name"!==format)&&("hex"===format||"hex3"===format||"hex6"===format||"name"===format)&&(format="rgb");var realColor=get({format:format}),displayColor="";if(previewElement.removeClass("sp-clear-display"),previewElement.css("background-color","transparent"),!realColor&&allowEmpty)previewElement.addClass("sp-clear-display");else{var realHex=realColor.toHexString(),realRgb=realColor.toRgbString();if(rgbaSupport||1===realColor.alpha?previewElement.css("background-color",realRgb):(previewElement.css("background-color","transparent"),previewElement.css("filter",realColor.toFilter())),opts.showAlpha){var rgb=realColor.toRgb();rgb.a=0;var realAlpha=tinycolor(rgb).toRgbString(),gradient="linear-gradient(left, "+realAlpha+", "+realHex+")";IE?alphaSliderInner.css("filter",tinycolor(realAlpha).toFilter({gradientType:1},realHex)):(alphaSliderInner.css("background","-webkit-"+gradient),alphaSliderInner.css("background","-moz-"+gradient),alphaSliderInner.css("background","-ms-"+gradient),alphaSliderInner.css("background","linear-gradient(to right, "+realAlpha+", "+realHex+")"))}displayColor=realColor.toString(format)}opts.showInput&&textInput.val(displayColor),opts.showPalette&&drawPalette(),drawInitial()}function updateHelperLocations(){var s=currentSaturation,v=currentValue;if(allowEmpty&&isEmpty)alphaSlideHelper.hide(),slideHelper.hide(),dragHelper.hide();else{alphaSlideHelper.show(),slideHelper.show(),dragHelper.show();var dragX=s*dragWidth,dragY=dragHeight-v*dragHeight;dragX=Math.max(-dragHelperHeight,Math.min(dragWidth-dragHelperHeight,dragX-dragHelperHeight)),dragY=Math.max(-dragHelperHeight,Math.min(dragHeight-dragHelperHeight,dragY-dragHelperHeight)),dragHelper.css({top:dragY+"px",left:dragX+"px"});var alphaX=currentAlpha*alphaWidth;alphaSlideHelper.css({left:alphaX-alphaSlideHelperWidth/2+"px"});var slideY=currentHue*slideHeight;slideHelper.css({top:slideY-slideHelperHeight+"px"})}}function updateOriginalInput(fireCallback){var color=get(),displayColor="",hasChanged=!tinycolor.equals(color,colorOnShow);color&&(displayColor=color.toString(currentPreferredFormat),addColorToSelectionPalette(color)),isInput&&boundElement.val(displayColor),fireCallback&&hasChanged&&(callbacks.change(color),boundElement.trigger("change",[color]))}function reflow(){dragWidth=dragger.width(),dragHeight=dragger.height(),dragHelperHeight=dragHelper.height(),slideWidth=slider.width(),slideHeight=slider.height(),slideHelperHeight=slideHelper.height(),alphaWidth=alphaSlider.width(),alphaSlideHelperWidth=alphaSlideHelper.width(),flat||(container.css("position","absolute"),container.offset(opts.offset?opts.offset:getOffset(container,offsetElement))),updateHelperLocations(),opts.showPalette&&drawPalette(),boundElement.trigger("reflow.spectrum")}function destroy(){boundElement.show(),offsetElement.unbind("click.spectrum touchstart.spectrum"),container.remove(),replacer.remove(),spectrums[spect.id]=null}function option(optionName,optionValue){return optionName===undefined?$.extend({},opts):optionValue===undefined?opts[optionName]:(opts[optionName]=optionValue,void applyOptions())}function enable(){disabled=!1,boundElement.attr("disabled",!1),offsetElement.removeClass("sp-disabled")}function disable(){hide(),disabled=!0,boundElement.attr("disabled",!0),offsetElement.addClass("sp-disabled")}function setOffset(coord){opts.offset=coord,reflow()}var opts=instanceOptions(o,element),flat=opts.flat,showSelectionPalette=opts.showSelectionPalette,localStorageKey=opts.localStorageKey,theme=opts.theme,callbacks=opts.callbacks,resize=throttle(reflow,10),visible=!1,dragWidth=0,dragHeight=0,dragHelperHeight=0,slideHeight=0,slideWidth=0,alphaWidth=0,alphaSlideHelperWidth=0,slideHelperHeight=0,currentHue=0,currentSaturation=0,currentValue=0,currentAlpha=1,palette=[],paletteArray=[],paletteLookup={},selectionPalette=opts.selectionPalette.slice(0),maxSelectionSize=opts.maxSelectionSize,draggingClass="sp-dragging",shiftMovementDirection=null,doc=element.ownerDocument,boundElement=(doc.body,$(element)),disabled=!1,container=$(markup,doc).addClass(theme),pickerContainer=container.find(".sp-picker-container"),dragger=container.find(".sp-color"),dragHelper=container.find(".sp-dragger"),slider=container.find(".sp-hue"),slideHelper=container.find(".sp-slider"),alphaSliderInner=container.find(".sp-alpha-inner"),alphaSlider=container.find(".sp-alpha"),alphaSlideHelper=container.find(".sp-alpha-handle"),textInput=container.find(".sp-input"),paletteContainer=container.find(".sp-palette"),initialColorContainer=container.find(".sp-initial"),cancelButton=container.find(".sp-cancel"),clearButton=container.find(".sp-clear"),chooseButton=container.find(".sp-choose"),toggleButton=container.find(".sp-palette-toggle"),isInput=boundElement.is("input"),isInputTypeColor=isInput&&inputTypeColorSupport&&"color"===boundElement.attr("type"),shouldReplace=isInput&&!flat,replacer=shouldReplace?$(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName):$([]),offsetElement=shouldReplace?replacer:boundElement,previewElement=replacer.find(".sp-preview-inner"),initialColor=opts.color||isInput&&boundElement.val(),colorOnShow=!1,preferredFormat=opts.preferredFormat,currentPreferredFormat=preferredFormat,clickoutFiresChange=!opts.showButtons||opts.clickoutFiresChange,isEmpty=!initialColor,allowEmpty=opts.allowEmpty&&!isInputTypeColor;initialize();var spect={show:show,hide:hide,toggle:toggle,reflow:reflow,option:option,enable:enable,disable:disable,offset:setOffset,set:function(c){set(c),updateOriginalInput()},get:get,destroy:destroy,container:container};return spect.id=spectrums.push(spect)-1,spect}function getOffset(picker,input){var extraY=0,dpWidth=picker.outerWidth(),dpHeight=picker.outerHeight(),inputHeight=input.outerHeight(),doc=picker[0].ownerDocument,docElem=doc.documentElement,viewWidth=docElem.clientWidth+$(doc).scrollLeft(),viewHeight=docElem.clientHeight+$(doc).scrollTop(),offset=input.offset();return offset.top+=inputHeight,offset.left-=Math.min(offset.left,offset.left+dpWidth>viewWidth&&viewWidth>dpWidth?Math.abs(offset.left+dpWidth-viewWidth):0),offset.top-=Math.min(offset.top,offset.top+dpHeight>viewHeight&&viewHeight>dpHeight?Math.abs(dpHeight+inputHeight-extraY):extraY),offset}function noop(){}function stopPropagation(e){e.stopPropagation()}function bind(func,obj){var slice=Array.prototype.slice,args=slice.call(arguments,2);return function(){return func.apply(obj,args.concat(slice.call(arguments)))}}function draggable(element,onmove,onstart,onstop){function prevent(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function move(e){if(dragging){if(IE&&doc.documentMode<9&&!e.button)return stop();var touches=e.originalEvent&&e.originalEvent.touches,pageX=touches?touches[0].pageX:e.pageX,pageY=touches?touches[0].pageY:e.pageY,dragX=Math.max(0,Math.min(pageX-offset.left,maxWidth)),dragY=Math.max(0,Math.min(pageY-offset.top,maxHeight));hasTouch&&prevent(e),onmove.apply(element,[dragX,dragY,e])}}function start(e){var rightclick=e.which?3==e.which:2==e.button;rightclick||dragging||onstart.apply(element,arguments)!==!1&&(dragging=!0,maxHeight=$(element).height(),maxWidth=$(element).width(),offset=$(element).offset(),$(doc).bind(duringDragEvents),$(doc.body).addClass("sp-dragging"),hasTouch||move(e),prevent(e))}function stop(){dragging&&($(doc).unbind(duringDragEvents),$(doc.body).removeClass("sp-dragging"),onstop.apply(element,arguments)),dragging=!1}onmove=onmove||function(){},onstart=onstart||function(){},onstop=onstop||function(){};var doc=document,dragging=!1,offset={},maxHeight=0,maxWidth=0,hasTouch="ontouchstart"in window,duringDragEvents={};duringDragEvents.selectstart=prevent,duringDragEvents.dragstart=prevent,duringDragEvents["touchmove mousemove"]=move,duringDragEvents["touchend mouseup"]=stop,$(element).bind("touchstart mousedown",start)}function throttle(func,wait,debounce){var timeout;return function(){var context=this,args=arguments,throttler=function(){timeout=null,func.apply(context,args)};debounce&&clearTimeout(timeout),(debounce||!timeout)&&(timeout=setTimeout(throttler,wait))}}var defaultOpts={beforeShow:noop,move:noop,change:noop,show:noop,hide:noop,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!1,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},spectrums=[],IE=!!/msie/i.exec(window.navigator.userAgent),rgbaSupport=function(){function contains(str,substr){return!!~(""+str).indexOf(substr)}var elem=document.createElement("div"),style=elem.style;return style.cssText="background-color:rgba(0,0,0,.5)",contains(style.backgroundColor,"rgba")||contains(style.backgroundColor,"hsla")}(),inputTypeColorSupport=function(){var colorInput=$("<input type='color' value='!' />")[0];return"color"===colorInput.type&&"!"!==colorInput.value}(),replaceInput=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>▼</div>","</div>"].join(""),markup=function(){var gradientFix="";if(IE)for(var i=1;6>=i;i++)gradientFix+="<div class='sp-"+i+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",gradientFix,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false' />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}(),dataID="spectrum.id";$.fn.spectrum=function(opts){if("string"==typeof opts){var returnValue=this,args=Array.prototype.slice.call(arguments,1);return this.each(function(){var spect=spectrums[$(this).data(dataID)];if(spect){var method=spect[opts];if(!method)throw new Error("Spectrum: no such method: '"+opts+"'");"get"==opts?returnValue=spect.get():"container"==opts?returnValue=spect.container:"option"==opts?returnValue=spect.option.apply(spect,args):"destroy"==opts?(spect.destroy(),$(this).removeData(dataID)):method.apply(spect,args)}}),returnValue}return this.spectrum("destroy").each(function(){var options=$.extend({},opts,$(this).data()),spect=spectrum(this,options);$(this).data(dataID,spect.id)})},$.fn.spectrum.load=!0,$.fn.spectrum.loadOpts={},$.fn.spectrum.draggable=draggable,$.fn.spectrum.defaults=defaultOpts,$.spectrum={},$.spectrum.localization={},$.spectrum.palettes={},$.fn.spectrum.processNativeColorInputs=function(){inputTypeColorSupport||$("input[type=color]").spectrum({preferredFormat:"hex6"})},function(){function inputToRGB(color){var rgb={r:0,g:0,b:0},a=1,ok=!1,format=!1;return"string"==typeof color&&(color=stringInputToObject(color)),"object"==typeof color&&(color.hasOwnProperty("r")&&color.hasOwnProperty("g")&&color.hasOwnProperty("b")?(rgb=rgbToRgb(color.r,color.g,color.b),ok=!0,format="%"===String(color.r).substr(-1)?"prgb":"rgb"):color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("v")?(color.s=convertToPercentage(color.s),color.v=convertToPercentage(color.v),rgb=hsvToRgb(color.h,color.s,color.v),ok=!0,format="hsv"):color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("l")&&(color.s=convertToPercentage(color.s),color.l=convertToPercentage(color.l),rgb=hslToRgb(color.h,color.s,color.l),ok=!0,format="hsl"),color.hasOwnProperty("a")&&(a=color.a)),a=boundAlpha(a),{ok:ok,format:color.format||format,r:mathMin(255,mathMax(rgb.r,0)),g:mathMin(255,mathMax(rgb.g,0)),b:mathMin(255,mathMax(rgb.b,0)),a:a}}function rgbToRgb(r,g,b){return{r:255*bound01(r,255),g:255*bound01(g,255),b:255*bound01(b,255)}}function rgbToHsl(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);var h,s,max=mathMax(r,g,b),min=mathMin(r,g,b),l=(max+min)/2;if(max==min)h=s=0;else{var d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h=(g-b)/d+(b>g?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4}h/=6}return{h:h,s:s,l:l}}function hslToRgb(h,s,l){function hue2rgb(p,q,t){return 0>t&&(t+=1),t>1&&(t-=1),1/6>t?p+6*(q-p)*t:.5>t?q:2/3>t?p+(q-p)*(2/3-t)*6:p}var r,g,b;if(h=bound01(h,360),s=bound01(s,100),l=bound01(l,100),0===s)r=g=b=l;else{var q=.5>l?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3)}return{r:255*r,g:255*g,b:255*b}}function rgbToHsv(r,g,b){r=bound01(r,255),g=bound01(g,255),b=bound01(b,255);var h,s,max=mathMax(r,g,b),min=mathMin(r,g,b),v=max,d=max-min;if(s=0===max?0:d/max,max==min)h=0;else{switch(max){case r:h=(g-b)/d+(b>g?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4}h/=6}return{h:h,s:s,v:v}}function hsvToRgb(h,s,v){h=6*bound01(h,360),s=bound01(s,100),v=bound01(v,100);var i=math.floor(h),f=h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),mod=i%6,r=[v,q,p,p,t,v][mod],g=[t,v,v,q,p,p][mod],b=[p,p,t,v,v,q][mod];return{r:255*r,g:255*g,b:255*b}}function rgbToHex(r,g,b,allow3Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return allow3Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)?hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0):hex.join("")}function rgbaToHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join("")}function desaturate(color,amount){amount=0===amount?0:amount||10;var hsl=tinycolor(color).toHsl();return hsl.s-=amount/100,hsl.s=clamp01(hsl.s),tinycolor(hsl)}function saturate(color,amount){amount=0===amount?0:amount||10;var hsl=tinycolor(color).toHsl();return hsl.s+=amount/100,hsl.s=clamp01(hsl.s),tinycolor(hsl)}function greyscale(color){return tinycolor(color).desaturate(100)}function lighten(color,amount){amount=0===amount?0:amount||10;var hsl=tinycolor(color).toHsl();return hsl.l+=amount/100,hsl.l=clamp01(hsl.l),tinycolor(hsl)}function brighten(color,amount){amount=0===amount?0:amount||10;var rgb=tinycolor(color).toRgb();return rgb.r=mathMax(0,mathMin(255,rgb.r-mathRound(255*-(amount/100)))),rgb.g=mathMax(0,mathMin(255,rgb.g-mathRound(255*-(amount/100)))),rgb.b=mathMax(0,mathMin(255,rgb.b-mathRound(255*-(amount/100)))),tinycolor(rgb)}function darken(color,amount){amount=0===amount?0:amount||10;var hsl=tinycolor(color).toHsl();return hsl.l-=amount/100,hsl.l=clamp01(hsl.l),tinycolor(hsl)}function spin(color,amount){var hsl=tinycolor(color).toHsl(),hue=(mathRound(hsl.h)+amount)%360;return hsl.h=0>hue?360+hue:hue,tinycolor(hsl)}function complement(color){var hsl=tinycolor(color).toHsl();
|
16 |
+
return hsl.h=(hsl.h+180)%360,tinycolor(hsl)}function triad(color){var hsl=tinycolor(color).toHsl(),h=hsl.h;return[tinycolor(color),tinycolor({h:(h+120)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+240)%360,s:hsl.s,l:hsl.l})]}function tetrad(color){var hsl=tinycolor(color).toHsl(),h=hsl.h;return[tinycolor(color),tinycolor({h:(h+90)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+180)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+270)%360,s:hsl.s,l:hsl.l})]}function splitcomplement(color){var hsl=tinycolor(color).toHsl(),h=hsl.h;return[tinycolor(color),tinycolor({h:(h+72)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+216)%360,s:hsl.s,l:hsl.l})]}function analogous(color,results,slices){results=results||6,slices=slices||30;var hsl=tinycolor(color).toHsl(),part=360/slices,ret=[tinycolor(color)];for(hsl.h=(hsl.h-(part*results>>1)+720)%360;--results;)hsl.h=(hsl.h+part)%360,ret.push(tinycolor(hsl));return ret}function monochromatic(color,results){results=results||6;for(var hsv=tinycolor(color).toHsv(),h=hsv.h,s=hsv.s,v=hsv.v,ret=[],modification=1/results;results--;)ret.push(tinycolor({h:h,s:s,v:v})),v=(v+modification)%1;return ret}function flip(o){var flipped={};for(var i in o)o.hasOwnProperty(i)&&(flipped[o[i]]=i);return flipped}function boundAlpha(a){return a=parseFloat(a),(isNaN(a)||0>a||a>1)&&(a=1),a}function bound01(n,max){isOnePointZero(n)&&(n="100%");var processPercent=isPercentage(n);return n=mathMin(max,mathMax(0,parseFloat(n))),processPercent&&(n=parseInt(n*max,10)/100),math.abs(n-max)<1e-6?1:n%max/parseFloat(max)}function clamp01(val){return mathMin(1,mathMax(0,val))}function parseIntFromHex(val){return parseInt(val,16)}function isOnePointZero(n){return"string"==typeof n&&-1!=n.indexOf(".")&&1===parseFloat(n)}function isPercentage(n){return"string"==typeof n&&-1!=n.indexOf("%")}function pad2(c){return 1==c.length?"0"+c:""+c}function convertToPercentage(n){return 1>=n&&(n=100*n+"%"),n}function convertDecimalToHex(d){return Math.round(255*parseFloat(d)).toString(16)}function convertHexToDecimal(h){return parseIntFromHex(h)/255}function stringInputToObject(color){color=color.replace(trimLeft,"").replace(trimRight,"").toLowerCase();var named=!1;if(names[color])color=names[color],named=!0;else if("transparent"==color)return{r:0,g:0,b:0,a:0,format:"name"};var match;return(match=matchers.rgb.exec(color))?{r:match[1],g:match[2],b:match[3]}:(match=matchers.rgba.exec(color))?{r:match[1],g:match[2],b:match[3],a:match[4]}:(match=matchers.hsl.exec(color))?{h:match[1],s:match[2],l:match[3]}:(match=matchers.hsla.exec(color))?{h:match[1],s:match[2],l:match[3],a:match[4]}:(match=matchers.hsv.exec(color))?{h:match[1],s:match[2],v:match[3]}:(match=matchers.hsva.exec(color))?{h:match[1],s:match[2],v:match[3],a:match[4]}:(match=matchers.hex8.exec(color))?{a:convertHexToDecimal(match[1]),r:parseIntFromHex(match[2]),g:parseIntFromHex(match[3]),b:parseIntFromHex(match[4]),format:named?"name":"hex8"}:(match=matchers.hex6.exec(color))?{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"}:(match=matchers.hex3.exec(color))?{r:parseIntFromHex(match[1]+""+match[1]),g:parseIntFromHex(match[2]+""+match[2]),b:parseIntFromHex(match[3]+""+match[3]),format:named?"name":"hex"}:!1}var trimLeft=/^[\s,#]+/,trimRight=/\s+$/,tinyCounter=0,math=Math,mathRound=math.round,mathMin=math.min,mathMax=math.max,mathRandom=math.random,tinycolor=function tinycolor(color,opts){if(color=color?color:"",opts=opts||{},color instanceof tinycolor)return color;if(!(this instanceof tinycolor))return new tinycolor(color,opts);var rgb=inputToRGB(color);this._originalInput=color,this._r=rgb.r,this._g=rgb.g,this._b=rgb.b,this._a=rgb.a,this._roundA=mathRound(100*this._a)/100,this._format=opts.format||rgb.format,this._gradientType=opts.gradientType,this._r<1&&(this._r=mathRound(this._r)),this._g<1&&(this._g=mathRound(this._g)),this._b<1&&(this._b=mathRound(this._b)),this._ok=rgb.ok,this._tc_id=tinyCounter++};tinycolor.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var rgb=this.toRgb();return(299*rgb.r+587*rgb.g+114*rgb.b)/1e3},setAlpha:function(value){return this._a=boundAlpha(value),this._roundA=mathRound(100*this._a)/100,this},toHsv:function(){var hsv=rgbToHsv(this._r,this._g,this._b);return{h:360*hsv.h,s:hsv.s,v:hsv.v,a:this._a}},toHsvString:function(){var hsv=rgbToHsv(this._r,this._g,this._b),h=mathRound(360*hsv.h),s=mathRound(100*hsv.s),v=mathRound(100*hsv.v);return 1==this._a?"hsv("+h+", "+s+"%, "+v+"%)":"hsva("+h+", "+s+"%, "+v+"%, "+this._roundA+")"},toHsl:function(){var hsl=rgbToHsl(this._r,this._g,this._b);return{h:360*hsl.h,s:hsl.s,l:hsl.l,a:this._a}},toHslString:function(){var hsl=rgbToHsl(this._r,this._g,this._b),h=mathRound(360*hsl.h),s=mathRound(100*hsl.s),l=mathRound(100*hsl.l);return 1==this._a?"hsl("+h+", "+s+"%, "+l+"%)":"hsla("+h+", "+s+"%, "+l+"%, "+this._roundA+")"},toHex:function(allow3Char){return rgbToHex(this._r,this._g,this._b,allow3Char)},toHexString:function(allow3Char){return"#"+this.toHex(allow3Char)},toHex8:function(){return rgbaToHex(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:mathRound(this._r),g:mathRound(this._g),b:mathRound(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+")":"rgba("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:mathRound(100*bound01(this._r,255))+"%",g:mathRound(100*bound01(this._g,255))+"%",b:mathRound(100*bound01(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+mathRound(100*bound01(this._r,255))+"%, "+mathRound(100*bound01(this._g,255))+"%, "+mathRound(100*bound01(this._b,255))+"%)":"rgba("+mathRound(100*bound01(this._r,255))+"%, "+mathRound(100*bound01(this._g,255))+"%, "+mathRound(100*bound01(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":this._a<1?!1:hexNames[rgbToHex(this._r,this._g,this._b,!0)]||!1},toFilter:function(secondColor){var hex8String="#"+rgbaToHex(this._r,this._g,this._b,this._a),secondHex8String=hex8String,gradientType=this._gradientType?"GradientType = 1, ":"";if(secondColor){var s=tinycolor(secondColor);secondHex8String=s.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"},toString:function(format){var formatSet=!!format;format=format||this._format;var formattedString=!1,hasAlpha=this._a<1&&this._a>=0,needsAlphaFormat=!formatSet&&hasAlpha&&("hex"===format||"hex6"===format||"hex3"===format||"name"===format);return needsAlphaFormat?"name"===format&&0===this._a?this.toName():this.toRgbString():("rgb"===format&&(formattedString=this.toRgbString()),"prgb"===format&&(formattedString=this.toPercentageRgbString()),("hex"===format||"hex6"===format)&&(formattedString=this.toHexString()),"hex3"===format&&(formattedString=this.toHexString(!0)),"hex8"===format&&(formattedString=this.toHex8String()),"name"===format&&(formattedString=this.toName()),"hsl"===format&&(formattedString=this.toHslString()),"hsv"===format&&(formattedString=this.toHsvString()),formattedString||this.toHexString())},_applyModification:function(fn,args){var color=fn.apply(null,[this].concat([].slice.call(args)));return this._r=color._r,this._g=color._g,this._b=color._b,this.setAlpha(color._a),this},lighten:function(){return this._applyModification(lighten,arguments)},brighten:function(){return this._applyModification(brighten,arguments)},darken:function(){return this._applyModification(darken,arguments)},desaturate:function(){return this._applyModification(desaturate,arguments)},saturate:function(){return this._applyModification(saturate,arguments)},greyscale:function(){return this._applyModification(greyscale,arguments)},spin:function(){return this._applyModification(spin,arguments)},_applyCombination:function(fn,args){return fn.apply(null,[this].concat([].slice.call(args)))},analogous:function(){return this._applyCombination(analogous,arguments)},complement:function(){return this._applyCombination(complement,arguments)},monochromatic:function(){return this._applyCombination(monochromatic,arguments)},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments)},triad:function(){return this._applyCombination(triad,arguments)},tetrad:function(){return this._applyCombination(tetrad,arguments)}},tinycolor.fromRatio=function(color,opts){if("object"==typeof color){var newColor={};for(var i in color)color.hasOwnProperty(i)&&(newColor[i]="a"===i?color[i]:convertToPercentage(color[i]));color=newColor}return tinycolor(color,opts)},tinycolor.equals=function(color1,color2){return color1&&color2?tinycolor(color1).toRgbString()==tinycolor(color2).toRgbString():!1},tinycolor.random=function(){return tinycolor.fromRatio({r:mathRandom(),g:mathRandom(),b:mathRandom()})},tinycolor.mix=function(color1,color2,amount){amount=0===amount?0:amount||50;var w1,rgb1=tinycolor(color1).toRgb(),rgb2=tinycolor(color2).toRgb(),p=amount/100,w=2*p-1,a=rgb2.a-rgb1.a;w1=w*a==-1?w:(w+a)/(1+w*a),w1=(w1+1)/2;var w2=1-w1,rgba={r:rgb2.r*w1+rgb1.r*w2,g:rgb2.g*w1+rgb1.g*w2,b:rgb2.b*w1+rgb1.b*w2,a:rgb2.a*p+rgb1.a*(1-p)};return tinycolor(rgba)},tinycolor.readability=function(color1,color2){var c1=tinycolor(color1),c2=tinycolor(color2),rgb1=c1.toRgb(),rgb2=c2.toRgb(),brightnessA=c1.getBrightness(),brightnessB=c2.getBrightness(),colorDiff=Math.max(rgb1.r,rgb2.r)-Math.min(rgb1.r,rgb2.r)+Math.max(rgb1.g,rgb2.g)-Math.min(rgb1.g,rgb2.g)+Math.max(rgb1.b,rgb2.b)-Math.min(rgb1.b,rgb2.b);return{brightness:Math.abs(brightnessA-brightnessB),color:colorDiff}},tinycolor.isReadable=function(color1,color2){var readability=tinycolor.readability(color1,color2);return readability.brightness>125&&readability.color>500},tinycolor.mostReadable=function(baseColor,colorList){for(var bestColor=null,bestScore=0,bestIsReadable=!1,i=0;i<colorList.length;i++){var readability=tinycolor.readability(baseColor,colorList[i]),readable=readability.brightness>125&&readability.color>500,score=3*(readability.brightness/125)+readability.color/500;(readable&&!bestIsReadable||readable&&bestIsReadable&&score>bestScore||!readable&&!bestIsReadable&&score>bestScore)&&(bestIsReadable=readable,bestScore=score,bestColor=tinycolor(colorList[i]))}return bestColor};var names=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},hexNames=tinycolor.hexNames=flip(names),matchers=function(){var CSS_INTEGER="[-\\+]?\\d+%?",CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?",CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")",PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?",PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";return{rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();window.tinycolor=tinycolor}(),$(function(){$.fn.spectrum.load&&$.fn.spectrum.processNativeColorInputs()})}),function(mod){if("object"==typeof exports&&"object"==typeof module)module.exports=mod();else{if("function"==typeof define&&define.amd)return define([],mod);this.CodeMirror=mod()}}(function(){"use strict";function CodeMirror(place,options){if(!(this instanceof CodeMirror))return new CodeMirror(place,options);this.options=options=options?copyObj(options):{},copyObj(defaults,options,!1),setGuttersForLineNumbers(options);var doc=options.value;"string"==typeof doc&&(doc=new Doc(doc,options.mode)),this.doc=doc;var display=this.display=new Display(place,doc);display.wrapper.CodeMirror=this,updateGutters(this),themeChanged(this),options.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),options.autofocus&&!mobile&&focusInput(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new Delayed,keySeq:null},ie&&11>ie_version&&setTimeout(bind(resetInput,this,!0),20),registerEventHandlers(this),ensureGlobalHandlers(),startOperation(this),this.curOp.forceUpdate=!0,attachDoc(this,doc),options.autofocus&&!mobile||activeElt()==display.input?setTimeout(bind(onFocus,this),20):onBlur(this);for(var opt in optionHandlers)optionHandlers.hasOwnProperty(opt)&&optionHandlers[opt](this,options[opt],Init);maybeUpdateLineNumberWidth(this);for(var i=0;i<initHooks.length;++i)initHooks[i](this);endOperation(this)}function Display(place,doc){var d=this,input=d.input=elt("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");webkit?input.style.width="1000px":input.setAttribute("wrap","off"),ios&&(input.style.border="1px solid black"),input.setAttribute("autocorrect","off"),input.setAttribute("autocapitalize","off"),input.setAttribute("spellcheck","false"),d.inputDiv=elt("div",[input],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),d.scrollbarH=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar"),d.scrollbarV=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),d.scrollbarFiller=elt("div",null,"CodeMirror-scrollbar-filler"),d.gutterFiller=elt("div",null,"CodeMirror-gutter-filler"),d.lineDiv=elt("div",null,"CodeMirror-code"),d.selectionDiv=elt("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=elt("div",null,"CodeMirror-cursors"),d.measure=elt("div",null,"CodeMirror-measure"),d.lineMeasure=elt("div",null,"CodeMirror-measure"),d.lineSpace=elt("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=elt("div",[elt("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=elt("div",[d.mover],"CodeMirror-sizer"),d.heightForcer=elt("div",null,null,"position: absolute; height: "+scrollerCutOff+"px; width: 1px;"),d.gutters=elt("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=elt("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=elt("div",[d.inputDiv,d.scrollbarH,d.scrollbarV,d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),ie&&8>ie_version&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),ios&&(input.style.width="0px"),webkit||(d.scroller.draggable=!0),khtml&&(d.inputDiv.style.height="1px",d.inputDiv.style.position="absolute"),ie&&8>ie_version&&(d.scrollbarH.style.minHeight=d.scrollbarV.style.minWidth="18px"),place&&(place.appendChild?place.appendChild(d.wrapper):place(d.wrapper)),d.viewFrom=d.viewTo=doc.first,d.view=[],d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.prevInput="",d.alignWidgets=!1,d.pollingFast=!1,d.poll=new Delayed,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.inaccurateSelection=!1,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null}function loadMode(cm){cm.doc.mode=CodeMirror.getMode(cm.options,cm.doc.modeOption),resetModeState(cm)}function resetModeState(cm){cm.doc.iter(function(line){line.stateAfter&&(line.stateAfter=null),line.styles&&(line.styles=null)}),cm.doc.frontier=cm.doc.first,startWorker(cm,100),cm.state.modeGen++,cm.curOp&®Change(cm)}function wrappingChanged(cm){cm.options.lineWrapping?(addClass(cm.display.wrapper,"CodeMirror-wrap"),cm.display.sizer.style.minWidth=""):(rmClass(cm.display.wrapper,"CodeMirror-wrap"),findMaxLine(cm)),estimateLineHeights(cm),regChange(cm),clearCaches(cm),setTimeout(function(){updateScrollbars(cm)},100)}function estimateHeight(cm){var th=textHeight(cm.display),wrapping=cm.options.lineWrapping,perLine=wrapping&&Math.max(5,cm.display.scroller.clientWidth/charWidth(cm.display)-3);return function(line){if(lineIsHidden(cm.doc,line))return 0;var widgetsHeight=0;if(line.widgets)for(var i=0;i<line.widgets.length;i++)line.widgets[i].height&&(widgetsHeight+=line.widgets[i].height);return wrapping?widgetsHeight+(Math.ceil(line.text.length/perLine)||1)*th:widgetsHeight+th}}function estimateLineHeights(cm){var doc=cm.doc,est=estimateHeight(cm);doc.iter(function(line){var estHeight=est(line);estHeight!=line.height&&updateLineHeight(line,estHeight)})}function themeChanged(cm){cm.display.wrapper.className=cm.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+cm.options.theme.replace(/(^|\s)\s*/g," cm-s-"),clearCaches(cm)}function guttersChanged(cm){updateGutters(cm),regChange(cm),setTimeout(function(){alignHorizontally(cm)},20)}function updateGutters(cm){var gutters=cm.display.gutters,specs=cm.options.gutters;removeChildren(gutters);for(var i=0;i<specs.length;++i){var gutterClass=specs[i],gElt=gutters.appendChild(elt("div",null,"CodeMirror-gutter "+gutterClass));"CodeMirror-linenumbers"==gutterClass&&(cm.display.lineGutter=gElt,gElt.style.width=(cm.display.lineNumWidth||1)+"px")}gutters.style.display=i?"":"none",updateGutterSpace(cm)}function updateGutterSpace(cm){var width=cm.display.gutters.offsetWidth;cm.display.sizer.style.marginLeft=width+"px",cm.display.scrollbarH.style.left=cm.options.fixedGutter?width+"px":0}function lineLength(line){if(0==line.height)return 0;for(var merged,len=line.text.length,cur=line;merged=collapsedSpanAtStart(cur);){var found=merged.find(0,!0);cur=found.from.line,len+=found.from.ch-found.to.ch}for(cur=line;merged=collapsedSpanAtEnd(cur);){var found=merged.find(0,!0);len-=cur.text.length-found.from.ch,cur=found.to.line,len+=cur.text.length-found.to.ch}return len}function findMaxLine(cm){var d=cm.display,doc=cm.doc;d.maxLine=getLine(doc,doc.first),d.maxLineLength=lineLength(d.maxLine),d.maxLineChanged=!0,doc.iter(function(line){var len=lineLength(line);len>d.maxLineLength&&(d.maxLineLength=len,d.maxLine=line)})}function setGuttersForLineNumbers(options){var found=indexOf(options.gutters,"CodeMirror-linenumbers");-1==found&&options.lineNumbers?options.gutters=options.gutters.concat(["CodeMirror-linenumbers"]):found>-1&&!options.lineNumbers&&(options.gutters=options.gutters.slice(0),options.gutters.splice(found,1))}function hScrollbarTakesSpace(cm){return cm.display.scroller.clientHeight-cm.display.wrapper.clientHeight<scrollerCutOff-3}function measureForScrollbars(cm){var scroll=cm.display.scroller;return{clientHeight:scroll.clientHeight,barHeight:cm.display.scrollbarV.clientHeight,scrollWidth:scroll.scrollWidth,clientWidth:scroll.clientWidth,hScrollbarTakesSpace:hScrollbarTakesSpace(cm),barWidth:cm.display.scrollbarH.clientWidth,docHeight:Math.round(cm.doc.height+paddingVert(cm.display))}}function updateScrollbars(cm,measure){measure||(measure=measureForScrollbars(cm));var d=cm.display,sWidth=scrollbarWidth(d.measure),scrollHeight=measure.docHeight+scrollerCutOff,needsH=measure.scrollWidth>measure.clientWidth;needsH&&measure.scrollWidth<=measure.clientWidth+1&&sWidth>0&&!measure.hScrollbarTakesSpace&&(needsH=!1);var needsV=scrollHeight>measure.clientHeight;if(needsV?(d.scrollbarV.style.display="block",d.scrollbarV.style.bottom=needsH?sWidth+"px":"0",d.scrollbarV.firstChild.style.height=Math.max(0,scrollHeight-measure.clientHeight+(measure.barHeight||d.scrollbarV.clientHeight))+"px"):(d.scrollbarV.style.display="",d.scrollbarV.firstChild.style.height="0"),needsH?(d.scrollbarH.style.display="block",d.scrollbarH.style.right=needsV?sWidth+"px":"0",d.scrollbarH.firstChild.style.width=measure.scrollWidth-measure.clientWidth+(measure.barWidth||d.scrollbarH.clientWidth)+"px"):(d.scrollbarH.style.display="",d.scrollbarH.firstChild.style.width="0"),needsH&&needsV?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=d.scrollbarFiller.style.width=sWidth+"px"):d.scrollbarFiller.style.display="",needsH&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=sWidth+"px",d.gutterFiller.style.width=d.gutters.offsetWidth+"px"):d.gutterFiller.style.display="",!cm.state.checkedOverlayScrollbar&&measure.clientHeight>0){if(0===sWidth){var w=mac&&!mac_geMountainLion?"12px":"18px";d.scrollbarV.style.minWidth=d.scrollbarH.style.minHeight=w;var barMouseDown=function(e){e_target(e)!=d.scrollbarV&&e_target(e)!=d.scrollbarH&&operation(cm,onMouseDown)(e)};on(d.scrollbarV,"mousedown",barMouseDown),on(d.scrollbarH,"mousedown",barMouseDown)}cm.state.checkedOverlayScrollbar=!0}}function visibleLines(display,doc,viewport){var top=viewport&&null!=viewport.top?Math.max(0,viewport.top):display.scroller.scrollTop;top=Math.floor(top-paddingTop(display));var bottom=viewport&&null!=viewport.bottom?viewport.bottom:top+display.wrapper.clientHeight,from=lineAtHeight(doc,top),to=lineAtHeight(doc,bottom);if(viewport&&viewport.ensure){var ensureFrom=viewport.ensure.from.line,ensureTo=viewport.ensure.to.line;if(from>ensureFrom)return{from:ensureFrom,to:lineAtHeight(doc,heightAtLine(getLine(doc,ensureFrom))+display.wrapper.clientHeight)};if(Math.min(ensureTo,doc.lastLine())>=to)return{from:lineAtHeight(doc,heightAtLine(getLine(doc,ensureTo))-display.wrapper.clientHeight),to:ensureTo}}return{from:from,to:Math.max(to,from+1)}}function alignHorizontally(cm){var display=cm.display,view=display.view;if(display.alignWidgets||display.gutters.firstChild&&cm.options.fixedGutter){for(var comp=compensateForHScroll(display)-display.scroller.scrollLeft+cm.doc.scrollLeft,gutterW=display.gutters.offsetWidth,left=comp+"px",i=0;i<view.length;i++)if(!view[i].hidden){cm.options.fixedGutter&&view[i].gutter&&(view[i].gutter.style.left=left);var align=view[i].alignable;if(align)for(var j=0;j<align.length;j++)align[j].style.left=left}cm.options.fixedGutter&&(display.gutters.style.left=comp+gutterW+"px")}}function maybeUpdateLineNumberWidth(cm){if(!cm.options.lineNumbers)return!1;var doc=cm.doc,last=lineNumberFor(cm.options,doc.first+doc.size-1),display=cm.display;if(last.length!=display.lineNumChars){var test=display.measure.appendChild(elt("div",[elt("div",last)],"CodeMirror-linenumber CodeMirror-gutter-elt")),innerW=test.firstChild.offsetWidth,padding=test.offsetWidth-innerW;return display.lineGutter.style.width="",display.lineNumInnerWidth=Math.max(innerW,display.lineGutter.offsetWidth-padding),display.lineNumWidth=display.lineNumInnerWidth+padding,display.lineNumChars=display.lineNumInnerWidth?last.length:-1,display.lineGutter.style.width=display.lineNumWidth+"px",updateGutterSpace(cm),!0}return!1}function lineNumberFor(options,i){return String(options.lineNumberFormatter(i+options.firstLineNumber))}function compensateForHScroll(display){return display.scroller.getBoundingClientRect().left-display.sizer.getBoundingClientRect().left}function DisplayUpdate(cm,viewport,force){var display=cm.display;this.viewport=viewport,this.visible=visibleLines(display,cm.doc,viewport),this.editorIsHidden=!display.wrapper.offsetWidth,this.wrapperHeight=display.wrapper.clientHeight,this.wrapperWidth=display.wrapper.clientWidth,this.oldViewFrom=display.viewFrom,this.oldViewTo=display.viewTo,this.oldScrollerWidth=display.scroller.clientWidth,this.force=force,this.dims=getDimensions(cm)}function updateDisplayIfNeeded(cm,update){var display=cm.display,doc=cm.doc;if(update.editorIsHidden)return resetView(cm),!1;if(!update.force&&update.visible.from>=display.viewFrom&&update.visible.to<=display.viewTo&&(null==display.updateLineNumbers||display.updateLineNumbers>=display.viewTo)&&0==countDirtyView(cm))return!1;maybeUpdateLineNumberWidth(cm)&&(resetView(cm),update.dims=getDimensions(cm));var end=doc.first+doc.size,from=Math.max(update.visible.from-cm.options.viewportMargin,doc.first),to=Math.min(end,update.visible.to+cm.options.viewportMargin);display.viewFrom<from&&from-display.viewFrom<20&&(from=Math.max(doc.first,display.viewFrom)),display.viewTo>to&&display.viewTo-to<20&&(to=Math.min(end,display.viewTo)),sawCollapsedSpans&&(from=visualLineNo(cm.doc,from),to=visualLineEndNo(cm.doc,to));var different=from!=display.viewFrom||to!=display.viewTo||display.lastWrapHeight!=update.wrapperHeight||display.lastWrapWidth!=update.wrapperWidth;adjustView(cm,from,to),display.viewOffset=heightAtLine(getLine(cm.doc,display.viewFrom)),cm.display.mover.style.top=display.viewOffset+"px";var toUpdate=countDirtyView(cm);if(!different&&0==toUpdate&&!update.force&&(null==display.updateLineNumbers||display.updateLineNumbers>=display.viewTo))return!1;var focused=activeElt();return toUpdate>4&&(display.lineDiv.style.display="none"),patchDisplay(cm,display.updateLineNumbers,update.dims),toUpdate>4&&(display.lineDiv.style.display=""),focused&&activeElt()!=focused&&focused.offsetHeight&&focused.focus(),removeChildren(display.cursorDiv),removeChildren(display.selectionDiv),different&&(display.lastWrapHeight=update.wrapperHeight,display.lastWrapWidth=update.wrapperWidth,startWorker(cm,400)),display.updateLineNumbers=null,!0}function postUpdateDisplay(cm,update){for(var force=update.force,viewport=update.viewport,first=!0;;first=!1){if(first&&cm.options.lineWrapping&&update.oldScrollerWidth!=cm.display.scroller.clientWidth)force=!0;else if(force=!1,viewport&&null!=viewport.top&&(viewport={top:Math.min(cm.doc.height+paddingVert(cm.display)-scrollerCutOff-cm.display.scroller.clientHeight,viewport.top)}),update.visible=visibleLines(cm.display,cm.doc,viewport),update.visible.from>=cm.display.viewFrom&&update.visible.to<=cm.display.viewTo)break;if(!updateDisplayIfNeeded(cm,update))break;updateHeightsInViewport(cm);var barMeasure=measureForScrollbars(cm);updateSelection(cm),setDocumentHeight(cm,barMeasure),updateScrollbars(cm,barMeasure)}signalLater(cm,"update",cm),(cm.display.viewFrom!=update.oldViewFrom||cm.display.viewTo!=update.oldViewTo)&&signalLater(cm,"viewportChange",cm,cm.display.viewFrom,cm.display.viewTo)}function updateDisplaySimple(cm,viewport){var update=new DisplayUpdate(cm,viewport);if(updateDisplayIfNeeded(cm,update)){updateHeightsInViewport(cm),postUpdateDisplay(cm,update);var barMeasure=measureForScrollbars(cm);updateSelection(cm),setDocumentHeight(cm,barMeasure),updateScrollbars(cm,barMeasure)}}function setDocumentHeight(cm,measure){cm.display.sizer.style.minHeight=cm.display.heightForcer.style.top=measure.docHeight+"px",cm.display.gutters.style.height=Math.max(measure.docHeight,measure.clientHeight-scrollerCutOff)+"px"}function checkForWebkitWidthBug(cm,measure){cm.display.sizer.offsetWidth+cm.display.gutters.offsetWidth<cm.display.scroller.clientWidth-1&&(cm.display.sizer.style.minHeight=cm.display.heightForcer.style.top="0px",cm.display.gutters.style.height=measure.docHeight+"px")}function updateHeightsInViewport(cm){for(var display=cm.display,prevBottom=display.lineDiv.offsetTop,i=0;i<display.view.length;i++){var height,cur=display.view[i];if(!cur.hidden){if(ie&&8>ie_version){var bot=cur.node.offsetTop+cur.node.offsetHeight;height=bot-prevBottom,prevBottom=bot}else{var box=cur.node.getBoundingClientRect();height=box.bottom-box.top}var diff=cur.line.height-height;if(2>height&&(height=textHeight(display)),(diff>.001||-.001>diff)&&(updateLineHeight(cur.line,height),updateWidgetHeight(cur.line),cur.rest))for(var j=0;j<cur.rest.length;j++)updateWidgetHeight(cur.rest[j])}}}function updateWidgetHeight(line){if(line.widgets)for(var i=0;i<line.widgets.length;++i)line.widgets[i].height=line.widgets[i].node.offsetHeight}function getDimensions(cm){for(var d=cm.display,left={},width={},gutterLeft=d.gutters.clientLeft,n=d.gutters.firstChild,i=0;n;n=n.nextSibling,++i)left[cm.options.gutters[i]]=n.offsetLeft+n.clientLeft+gutterLeft,width[cm.options.gutters[i]]=n.clientWidth;return{fixedPos:compensateForHScroll(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:left,gutterWidth:width,wrapperWidth:d.wrapper.clientWidth}}function patchDisplay(cm,updateNumbersFrom,dims){function rm(node){var next=node.nextSibling;return webkit&&mac&&cm.display.currentWheelTarget==node?node.style.display="none":node.parentNode.removeChild(node),next}for(var display=cm.display,lineNumbers=cm.options.lineNumbers,container=display.lineDiv,cur=container.firstChild,view=display.view,lineN=display.viewFrom,i=0;i<view.length;i++){var lineView=view[i];if(lineView.hidden);else if(lineView.node){for(;cur!=lineView.node;)cur=rm(cur);var updateNumber=lineNumbers&&null!=updateNumbersFrom&&lineN>=updateNumbersFrom&&lineView.lineNumber;lineView.changes&&(indexOf(lineView.changes,"gutter")>-1&&(updateNumber=!1),updateLineForChanges(cm,lineView,lineN,dims)),updateNumber&&(removeChildren(lineView.lineNumber),lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options,lineN)))),cur=lineView.node.nextSibling}else{var node=buildLineElement(cm,lineView,lineN,dims);
|
17 |
+
container.insertBefore(node,cur)}lineN+=lineView.size}for(;cur;)cur=rm(cur)}function updateLineForChanges(cm,lineView,lineN,dims){for(var j=0;j<lineView.changes.length;j++){var type=lineView.changes[j];"text"==type?updateLineText(cm,lineView):"gutter"==type?updateLineGutter(cm,lineView,lineN,dims):"class"==type?updateLineClasses(lineView):"widget"==type&&updateLineWidgets(lineView,dims)}lineView.changes=null}function ensureLineWrapped(lineView){return lineView.node==lineView.text&&(lineView.node=elt("div",null,null,"position: relative"),lineView.text.parentNode&&lineView.text.parentNode.replaceChild(lineView.node,lineView.text),lineView.node.appendChild(lineView.text),ie&&8>ie_version&&(lineView.node.style.zIndex=2)),lineView.node}function updateLineBackground(lineView){var cls=lineView.bgClass?lineView.bgClass+" "+(lineView.line.bgClass||""):lineView.line.bgClass;if(cls&&(cls+=" CodeMirror-linebackground"),lineView.background)cls?lineView.background.className=cls:(lineView.background.parentNode.removeChild(lineView.background),lineView.background=null);else if(cls){var wrap=ensureLineWrapped(lineView);lineView.background=wrap.insertBefore(elt("div",null,cls),wrap.firstChild)}}function getLineContent(cm,lineView){var ext=cm.display.externalMeasured;return ext&&ext.line==lineView.line?(cm.display.externalMeasured=null,lineView.measure=ext.measure,ext.built):buildLineContent(cm,lineView)}function updateLineText(cm,lineView){var cls=lineView.text.className,built=getLineContent(cm,lineView);lineView.text==lineView.node&&(lineView.node=built.pre),lineView.text.parentNode.replaceChild(built.pre,lineView.text),lineView.text=built.pre,built.bgClass!=lineView.bgClass||built.textClass!=lineView.textClass?(lineView.bgClass=built.bgClass,lineView.textClass=built.textClass,updateLineClasses(lineView)):cls&&(lineView.text.className=cls)}function updateLineClasses(lineView){updateLineBackground(lineView),lineView.line.wrapClass?ensureLineWrapped(lineView).className=lineView.line.wrapClass:lineView.node!=lineView.text&&(lineView.node.className="");var textClass=lineView.textClass?lineView.textClass+" "+(lineView.line.textClass||""):lineView.line.textClass;lineView.text.className=textClass||""}function updateLineGutter(cm,lineView,lineN,dims){lineView.gutter&&(lineView.node.removeChild(lineView.gutter),lineView.gutter=null);var markers=lineView.line.gutterMarkers;if(cm.options.lineNumbers||markers){var wrap=ensureLineWrapped(lineView),gutterWrap=lineView.gutter=wrap.insertBefore(elt("div",null,"CodeMirror-gutter-wrapper","left: "+(cm.options.fixedGutter?dims.fixedPos:-dims.gutterTotalWidth)+"px; width: "+dims.gutterTotalWidth+"px"),lineView.text);if(lineView.line.gutterClass&&(gutterWrap.className+=" "+lineView.line.gutterClass),!cm.options.lineNumbers||markers&&markers["CodeMirror-linenumbers"]||(lineView.lineNumber=gutterWrap.appendChild(elt("div",lineNumberFor(cm.options,lineN),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dims.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+cm.display.lineNumInnerWidth+"px"))),markers)for(var k=0;k<cm.options.gutters.length;++k){var id=cm.options.gutters[k],found=markers.hasOwnProperty(id)&&markers[id];found&&gutterWrap.appendChild(elt("div",[found],"CodeMirror-gutter-elt","left: "+dims.gutterLeft[id]+"px; width: "+dims.gutterWidth[id]+"px"))}}}function updateLineWidgets(lineView,dims){lineView.alignable&&(lineView.alignable=null);for(var next,node=lineView.node.firstChild;node;node=next){var next=node.nextSibling;"CodeMirror-linewidget"==node.className&&lineView.node.removeChild(node)}insertLineWidgets(lineView,dims)}function buildLineElement(cm,lineView,lineN,dims){var built=getLineContent(cm,lineView);return lineView.text=lineView.node=built.pre,built.bgClass&&(lineView.bgClass=built.bgClass),built.textClass&&(lineView.textClass=built.textClass),updateLineClasses(lineView),updateLineGutter(cm,lineView,lineN,dims),insertLineWidgets(lineView,dims),lineView.node}function insertLineWidgets(lineView,dims){if(insertLineWidgetsFor(lineView.line,lineView,dims,!0),lineView.rest)for(var i=0;i<lineView.rest.length;i++)insertLineWidgetsFor(lineView.rest[i],lineView,dims,!1)}function insertLineWidgetsFor(line,lineView,dims,allowAbove){if(line.widgets)for(var wrap=ensureLineWrapped(lineView),i=0,ws=line.widgets;i<ws.length;++i){var widget=ws[i],node=elt("div",[widget.node],"CodeMirror-linewidget");widget.handleMouseEvents||(node.ignoreEvents=!0),positionLineWidget(widget,node,lineView,dims),allowAbove&&widget.above?wrap.insertBefore(node,lineView.gutter||lineView.text):wrap.appendChild(node),signalLater(widget,"redraw")}}function positionLineWidget(widget,node,lineView,dims){if(widget.noHScroll){(lineView.alignable||(lineView.alignable=[])).push(node);var width=dims.wrapperWidth;node.style.left=dims.fixedPos+"px",widget.coverGutter||(width-=dims.gutterTotalWidth,node.style.paddingLeft=dims.gutterTotalWidth+"px"),node.style.width=width+"px"}widget.coverGutter&&(node.style.zIndex=5,node.style.position="relative",widget.noHScroll||(node.style.marginLeft=-dims.gutterTotalWidth+"px"))}function copyPos(x){return Pos(x.line,x.ch)}function maxPos(a,b){return cmp(a,b)<0?b:a}function minPos(a,b){return cmp(a,b)<0?a:b}function Selection(ranges,primIndex){this.ranges=ranges,this.primIndex=primIndex}function Range(anchor,head){this.anchor=anchor,this.head=head}function normalizeSelection(ranges,primIndex){var prim=ranges[primIndex];ranges.sort(function(a,b){return cmp(a.from(),b.from())}),primIndex=indexOf(ranges,prim);for(var i=1;i<ranges.length;i++){var cur=ranges[i],prev=ranges[i-1];if(cmp(prev.to(),cur.from())>=0){var from=minPos(prev.from(),cur.from()),to=maxPos(prev.to(),cur.to()),inv=prev.empty()?cur.from()==cur.head:prev.from()==prev.head;primIndex>=i&&--primIndex,ranges.splice(--i,2,new Range(inv?to:from,inv?from:to))}}return new Selection(ranges,primIndex)}function simpleSelection(anchor,head){return new Selection([new Range(anchor,head||anchor)],0)}function clipLine(doc,n){return Math.max(doc.first,Math.min(n,doc.first+doc.size-1))}function clipPos(doc,pos){if(pos.line<doc.first)return Pos(doc.first,0);var last=doc.first+doc.size-1;return pos.line>last?Pos(last,getLine(doc,last).text.length):clipToLen(pos,getLine(doc,pos.line).text.length)}function clipToLen(pos,linelen){var ch=pos.ch;return null==ch||ch>linelen?Pos(pos.line,linelen):0>ch?Pos(pos.line,0):pos}function isLine(doc,l){return l>=doc.first&&l<doc.first+doc.size}function clipPosArray(doc,array){for(var out=[],i=0;i<array.length;i++)out[i]=clipPos(doc,array[i]);return out}function extendRange(doc,range,head,other){if(doc.cm&&doc.cm.display.shift||doc.extend){var anchor=range.anchor;if(other){var posBefore=cmp(head,anchor)<0;posBefore!=cmp(other,anchor)<0?(anchor=head,head=other):posBefore!=cmp(head,other)<0&&(head=other)}return new Range(anchor,head)}return new Range(other||head,head)}function extendSelection(doc,head,other,options){setSelection(doc,new Selection([extendRange(doc,doc.sel.primary(),head,other)],0),options)}function extendSelections(doc,heads,options){for(var out=[],i=0;i<doc.sel.ranges.length;i++)out[i]=extendRange(doc,doc.sel.ranges[i],heads[i],null);var newSel=normalizeSelection(out,doc.sel.primIndex);setSelection(doc,newSel,options)}function replaceOneSelection(doc,i,range,options){var ranges=doc.sel.ranges.slice(0);ranges[i]=range,setSelection(doc,normalizeSelection(ranges,doc.sel.primIndex),options)}function setSimpleSelection(doc,anchor,head,options){setSelection(doc,simpleSelection(anchor,head),options)}function filterSelectionChange(doc,sel){var obj={ranges:sel.ranges,update:function(ranges){this.ranges=[];for(var i=0;i<ranges.length;i++)this.ranges[i]=new Range(clipPos(doc,ranges[i].anchor),clipPos(doc,ranges[i].head))}};return signal(doc,"beforeSelectionChange",doc,obj),doc.cm&&signal(doc.cm,"beforeSelectionChange",doc.cm,obj),obj.ranges!=sel.ranges?normalizeSelection(obj.ranges,obj.ranges.length-1):sel}function setSelectionReplaceHistory(doc,sel,options){var done=doc.history.done,last=lst(done);last&&last.ranges?(done[done.length-1]=sel,setSelectionNoUndo(doc,sel,options)):setSelection(doc,sel,options)}function setSelection(doc,sel,options){setSelectionNoUndo(doc,sel,options),addSelectionToHistory(doc,doc.sel,doc.cm?doc.cm.curOp.id:0/0,options)}function setSelectionNoUndo(doc,sel,options){(hasHandler(doc,"beforeSelectionChange")||doc.cm&&hasHandler(doc.cm,"beforeSelectionChange"))&&(sel=filterSelectionChange(doc,sel));var bias=options&&options.bias||(cmp(sel.primary().head,doc.sel.primary().head)<0?-1:1);setSelectionInner(doc,skipAtomicInSelection(doc,sel,bias,!0)),options&&options.scroll===!1||!doc.cm||ensureCursorVisible(doc.cm)}function setSelectionInner(doc,sel){sel.equals(doc.sel)||(doc.sel=sel,doc.cm&&(doc.cm.curOp.updateInput=doc.cm.curOp.selectionChanged=!0,signalCursorActivity(doc.cm)),signalLater(doc,"cursorActivity",doc))}function reCheckSelection(doc){setSelectionInner(doc,skipAtomicInSelection(doc,doc.sel,null,!1),sel_dontScroll)}function skipAtomicInSelection(doc,sel,bias,mayClear){for(var out,i=0;i<sel.ranges.length;i++){var range=sel.ranges[i],newAnchor=skipAtomic(doc,range.anchor,bias,mayClear),newHead=skipAtomic(doc,range.head,bias,mayClear);(out||newAnchor!=range.anchor||newHead!=range.head)&&(out||(out=sel.ranges.slice(0,i)),out[i]=new Range(newAnchor,newHead))}return out?normalizeSelection(out,sel.primIndex):sel}function skipAtomic(doc,pos,bias,mayClear){var flipped=!1,curPos=pos,dir=bias||1;doc.cantEdit=!1;search:for(;;){var line=getLine(doc,curPos.line);if(line.markedSpans)for(var i=0;i<line.markedSpans.length;++i){var sp=line.markedSpans[i],m=sp.marker;if((null==sp.from||(m.inclusiveLeft?sp.from<=curPos.ch:sp.from<curPos.ch))&&(null==sp.to||(m.inclusiveRight?sp.to>=curPos.ch:sp.to>curPos.ch))){if(mayClear&&(signal(m,"beforeCursorEnter"),m.explicitlyCleared)){if(line.markedSpans){--i;continue}break}if(!m.atomic)continue;var newPos=m.find(0>dir?-1:1);if(0==cmp(newPos,curPos)&&(newPos.ch+=dir,newPos.ch<0?newPos=newPos.line>doc.first?clipPos(doc,Pos(newPos.line-1)):null:newPos.ch>line.text.length&&(newPos=newPos.line<doc.first+doc.size-1?Pos(newPos.line+1,0):null),!newPos)){if(flipped)return mayClear?(doc.cantEdit=!0,Pos(doc.first,0)):skipAtomic(doc,pos,bias,!0);flipped=!0,newPos=pos,dir=-dir}curPos=newPos;continue search}}return curPos}}function drawSelection(cm){for(var display=cm.display,doc=cm.doc,result={},curFragment=result.cursors=document.createDocumentFragment(),selFragment=result.selection=document.createDocumentFragment(),i=0;i<doc.sel.ranges.length;i++){var range=doc.sel.ranges[i],collapsed=range.empty();(collapsed||cm.options.showCursorWhenSelecting)&&drawSelectionCursor(cm,range,curFragment),collapsed||drawSelectionRange(cm,range,selFragment)}if(cm.options.moveInputWithCursor){var headPos=cursorCoords(cm,doc.sel.primary().head,"div"),wrapOff=display.wrapper.getBoundingClientRect(),lineOff=display.lineDiv.getBoundingClientRect();result.teTop=Math.max(0,Math.min(display.wrapper.clientHeight-10,headPos.top+lineOff.top-wrapOff.top)),result.teLeft=Math.max(0,Math.min(display.wrapper.clientWidth-10,headPos.left+lineOff.left-wrapOff.left))}return result}function showSelection(cm,drawn){removeChildrenAndAdd(cm.display.cursorDiv,drawn.cursors),removeChildrenAndAdd(cm.display.selectionDiv,drawn.selection),null!=drawn.teTop&&(cm.display.inputDiv.style.top=drawn.teTop+"px",cm.display.inputDiv.style.left=drawn.teLeft+"px")}function updateSelection(cm){showSelection(cm,drawSelection(cm))}function drawSelectionCursor(cm,range,output){var pos=cursorCoords(cm,range.head,"div",null,null,!cm.options.singleCursorHeightPerLine),cursor=output.appendChild(elt("div"," ","CodeMirror-cursor"));if(cursor.style.left=pos.left+"px",cursor.style.top=pos.top+"px",cursor.style.height=Math.max(0,pos.bottom-pos.top)*cm.options.cursorHeight+"px",pos.other){var otherCursor=output.appendChild(elt("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));otherCursor.style.display="",otherCursor.style.left=pos.other.left+"px",otherCursor.style.top=pos.other.top+"px",otherCursor.style.height=.85*(pos.other.bottom-pos.other.top)+"px"}}function drawSelectionRange(cm,range,output){function add(left,top,width,bottom){0>top&&(top=0),top=Math.round(top),bottom=Math.round(bottom),fragment.appendChild(elt("div",null,"CodeMirror-selected","position: absolute; left: "+left+"px; top: "+top+"px; width: "+(null==width?rightSide-left:width)+"px; height: "+(bottom-top)+"px"))}function drawForLine(line,fromArg,toArg){function coords(ch,bias){return charCoords(cm,Pos(line,ch),"div",lineObj,bias)}var start,end,lineObj=getLine(doc,line),lineLen=lineObj.text.length;return iterateBidiSections(getOrder(lineObj),fromArg||0,null==toArg?lineLen:toArg,function(from,to,dir){var rightPos,left,right,leftPos=coords(from,"left");if(from==to)rightPos=leftPos,left=right=leftPos.left;else{if(rightPos=coords(to-1,"right"),"rtl"==dir){var tmp=leftPos;leftPos=rightPos,rightPos=tmp}left=leftPos.left,right=rightPos.right}null==fromArg&&0==from&&(left=leftSide),rightPos.top-leftPos.top>3&&(add(left,leftPos.top,null,leftPos.bottom),left=leftSide,leftPos.bottom<rightPos.top&&add(left,leftPos.bottom,null,rightPos.top)),null==toArg&&to==lineLen&&(right=rightSide),(!start||leftPos.top<start.top||leftPos.top==start.top&&leftPos.left<start.left)&&(start=leftPos),(!end||rightPos.bottom>end.bottom||rightPos.bottom==end.bottom&&rightPos.right>end.right)&&(end=rightPos),leftSide+1>left&&(left=leftSide),add(left,rightPos.top,right-left,rightPos.bottom)}),{start:start,end:end}}var display=cm.display,doc=cm.doc,fragment=document.createDocumentFragment(),padding=paddingH(cm.display),leftSide=padding.left,rightSide=display.lineSpace.offsetWidth-padding.right,sFrom=range.from(),sTo=range.to();if(sFrom.line==sTo.line)drawForLine(sFrom.line,sFrom.ch,sTo.ch);else{var fromLine=getLine(doc,sFrom.line),toLine=getLine(doc,sTo.line),singleVLine=visualLine(fromLine)==visualLine(toLine),leftEnd=drawForLine(sFrom.line,sFrom.ch,singleVLine?fromLine.text.length+1:null).end,rightStart=drawForLine(sTo.line,singleVLine?0:null,sTo.ch).start;singleVLine&&(leftEnd.top<rightStart.top-2?(add(leftEnd.right,leftEnd.top,null,leftEnd.bottom),add(leftSide,rightStart.top,rightStart.left,rightStart.bottom)):add(leftEnd.right,leftEnd.top,rightStart.left-leftEnd.right,leftEnd.bottom)),leftEnd.bottom<rightStart.top&&add(leftSide,leftEnd.bottom,null,rightStart.top)}output.appendChild(fragment)}function restartBlink(cm){if(cm.state.focused){var display=cm.display;clearInterval(display.blinker);var on=!0;display.cursorDiv.style.visibility="",cm.options.cursorBlinkRate>0?display.blinker=setInterval(function(){display.cursorDiv.style.visibility=(on=!on)?"":"hidden"},cm.options.cursorBlinkRate):cm.options.cursorBlinkRate<0&&(display.cursorDiv.style.visibility="hidden")}}function startWorker(cm,time){cm.doc.mode.startState&&cm.doc.frontier<cm.display.viewTo&&cm.state.highlight.set(time,bind(highlightWorker,cm))}function highlightWorker(cm){var doc=cm.doc;if(doc.frontier<doc.first&&(doc.frontier=doc.first),!(doc.frontier>=cm.display.viewTo)){var end=+new Date+cm.options.workTime,state=copyState(doc.mode,getStateBefore(cm,doc.frontier)),changedLines=[];doc.iter(doc.frontier,Math.min(doc.first+doc.size,cm.display.viewTo+500),function(line){if(doc.frontier>=cm.display.viewFrom){var oldStyles=line.styles,highlighted=highlightLine(cm,line,state,!0);line.styles=highlighted.styles;var oldCls=line.styleClasses,newCls=highlighted.classes;newCls?line.styleClasses=newCls:oldCls&&(line.styleClasses=null);for(var ischange=!oldStyles||oldStyles.length!=line.styles.length||oldCls!=newCls&&(!oldCls||!newCls||oldCls.bgClass!=newCls.bgClass||oldCls.textClass!=newCls.textClass),i=0;!ischange&&i<oldStyles.length;++i)ischange=oldStyles[i]!=line.styles[i];ischange&&changedLines.push(doc.frontier),line.stateAfter=copyState(doc.mode,state)}else processLine(cm,line.text,state),line.stateAfter=doc.frontier%5==0?copyState(doc.mode,state):null;return++doc.frontier,+new Date>end?(startWorker(cm,cm.options.workDelay),!0):void 0}),changedLines.length&&runInOp(cm,function(){for(var i=0;i<changedLines.length;i++)regLineChange(cm,changedLines[i],"text")})}}function findStartLine(cm,n,precise){for(var minindent,minline,doc=cm.doc,lim=precise?-1:n-(cm.doc.mode.innerMode?1e3:100),search=n;search>lim;--search){if(search<=doc.first)return doc.first;var line=getLine(doc,search-1);if(line.stateAfter&&(!precise||search<=doc.frontier))return search;var indented=countColumn(line.text,null,cm.options.tabSize);(null==minline||minindent>indented)&&(minline=search-1,minindent=indented)}return minline}function getStateBefore(cm,n,precise){var doc=cm.doc,display=cm.display;if(!doc.mode.startState)return!0;var pos=findStartLine(cm,n,precise),state=pos>doc.first&&getLine(doc,pos-1).stateAfter;return state=state?copyState(doc.mode,state):startState(doc.mode),doc.iter(pos,n,function(line){processLine(cm,line.text,state);var save=pos==n-1||pos%5==0||pos>=display.viewFrom&&pos<display.viewTo;line.stateAfter=save?copyState(doc.mode,state):null,++pos}),precise&&(doc.frontier=pos),state}function paddingTop(display){return display.lineSpace.offsetTop}function paddingVert(display){return display.mover.offsetHeight-display.lineSpace.offsetHeight}function paddingH(display){if(display.cachedPaddingH)return display.cachedPaddingH;var e=removeChildrenAndAdd(display.measure,elt("pre","x")),style=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,data={left:parseInt(style.paddingLeft),right:parseInt(style.paddingRight)};return isNaN(data.left)||isNaN(data.right)||(display.cachedPaddingH=data),data}function ensureLineHeights(cm,lineView,rect){var wrapping=cm.options.lineWrapping,curWidth=wrapping&&cm.display.scroller.clientWidth;if(!lineView.measure.heights||wrapping&&lineView.measure.width!=curWidth){var heights=lineView.measure.heights=[];if(wrapping){lineView.measure.width=curWidth;for(var rects=lineView.text.firstChild.getClientRects(),i=0;i<rects.length-1;i++){var cur=rects[i],next=rects[i+1];Math.abs(cur.bottom-next.bottom)>2&&heights.push((cur.bottom+next.top)/2-rect.top)}}heights.push(rect.bottom-rect.top)}}function mapFromLineView(lineView,line,lineN){if(lineView.line==line)return{map:lineView.measure.map,cache:lineView.measure.cache};for(var i=0;i<lineView.rest.length;i++)if(lineView.rest[i]==line)return{map:lineView.measure.maps[i],cache:lineView.measure.caches[i]};for(var i=0;i<lineView.rest.length;i++)if(lineNo(lineView.rest[i])>lineN)return{map:lineView.measure.maps[i],cache:lineView.measure.caches[i],before:!0}}function updateExternalMeasurement(cm,line){line=visualLine(line);var lineN=lineNo(line),view=cm.display.externalMeasured=new LineView(cm.doc,line,lineN);view.lineN=lineN;var built=view.built=buildLineContent(cm,view);return view.text=built.pre,removeChildrenAndAdd(cm.display.lineMeasure,built.pre),view}function measureChar(cm,line,ch,bias){return measureCharPrepared(cm,prepareMeasureForLine(cm,line),ch,bias)}function findViewForLine(cm,lineN){if(lineN>=cm.display.viewFrom&&lineN<cm.display.viewTo)return cm.display.view[findViewIndex(cm,lineN)];var ext=cm.display.externalMeasured;return ext&&lineN>=ext.lineN&&lineN<ext.lineN+ext.size?ext:void 0}function prepareMeasureForLine(cm,line){var lineN=lineNo(line),view=findViewForLine(cm,lineN);view&&!view.text?view=null:view&&view.changes&&updateLineForChanges(cm,view,lineN,getDimensions(cm)),view||(view=updateExternalMeasurement(cm,line));var info=mapFromLineView(view,line,lineN);return{line:line,view:view,rect:null,map:info.map,cache:info.cache,before:info.before,hasHeights:!1}}function measureCharPrepared(cm,prepared,ch,bias,varHeight){prepared.before&&(ch=-1);var found,key=ch+(bias||"");return prepared.cache.hasOwnProperty(key)?found=prepared.cache[key]:(prepared.rect||(prepared.rect=prepared.view.text.getBoundingClientRect()),prepared.hasHeights||(ensureLineHeights(cm,prepared.view,prepared.rect),prepared.hasHeights=!0),found=measureCharInner(cm,prepared,ch,bias),found.bogus||(prepared.cache[key]=found)),{left:found.left,right:found.right,top:varHeight?found.rtop:found.top,bottom:varHeight?found.rbottom:found.bottom}}function measureCharInner(cm,prepared,ch,bias){for(var node,start,end,collapse,map=prepared.map,i=0;i<map.length;i+=3){var mStart=map[i],mEnd=map[i+1];if(mStart>ch?(start=0,end=1,collapse="left"):mEnd>ch?(start=ch-mStart,end=start+1):(i==map.length-3||ch==mEnd&&map[i+3]>ch)&&(end=mEnd-mStart,start=end-1,ch>=mEnd&&(collapse="right")),null!=start){if(node=map[i+2],mStart==mEnd&&bias==(node.insertLeft?"left":"right")&&(collapse=bias),"left"==bias&&0==start)for(;i&&map[i-2]==map[i-3]&&map[i-1].insertLeft;)node=map[(i-=3)+2],collapse="left";if("right"==bias&&start==mEnd-mStart)for(;i<map.length-3&&map[i+3]==map[i+4]&&!map[i+5].insertLeft;)node=map[(i+=3)+2],collapse="right";break}}var rect;if(3==node.nodeType){for(var i=0;4>i;i++){for(;start&&isExtendingChar(prepared.line.text.charAt(mStart+start));)--start;for(;mEnd>mStart+end&&isExtendingChar(prepared.line.text.charAt(mStart+end));)++end;if(ie&&9>ie_version&&0==start&&end==mEnd-mStart)rect=node.parentNode.getBoundingClientRect();else if(ie&&cm.options.lineWrapping){var rects=range(node,start,end).getClientRects();rect=rects.length?rects["right"==bias?rects.length-1:0]:nullRect}else rect=range(node,start,end).getBoundingClientRect()||nullRect;if(rect.left||rect.right||0==start)break;end=start,start-=1,collapse="right"}ie&&11>ie_version&&(rect=maybeUpdateRectForZooming(cm.display.measure,rect))}else{start>0&&(collapse=bias="right");var rects;rect=cm.options.lineWrapping&&(rects=node.getClientRects()).length>1?rects["right"==bias?rects.length-1:0]:node.getBoundingClientRect()}if(ie&&9>ie_version&&!start&&(!rect||!rect.left&&!rect.right)){var rSpan=node.parentNode.getClientRects()[0];rect=rSpan?{left:rSpan.left,right:rSpan.left+charWidth(cm.display),top:rSpan.top,bottom:rSpan.bottom}:nullRect}for(var rtop=rect.top-prepared.rect.top,rbot=rect.bottom-prepared.rect.top,mid=(rtop+rbot)/2,heights=prepared.view.measure.heights,i=0;i<heights.length-1&&!(mid<heights[i]);i++);var top=i?heights[i-1]:0,bot=heights[i],result={left:("right"==collapse?rect.right:rect.left)-prepared.rect.left,right:("left"==collapse?rect.left:rect.right)-prepared.rect.left,top:top,bottom:bot};return rect.left||rect.right||(result.bogus=!0),cm.options.singleCursorHeightPerLine||(result.rtop=rtop,result.rbottom=rbot),result}function maybeUpdateRectForZooming(measure,rect){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!hasBadZoomedRects(measure))return rect;var scaleX=screen.logicalXDPI/screen.deviceXDPI,scaleY=screen.logicalYDPI/screen.deviceYDPI;return{left:rect.left*scaleX,right:rect.right*scaleX,top:rect.top*scaleY,bottom:rect.bottom*scaleY}}function clearLineMeasurementCacheFor(lineView){if(lineView.measure&&(lineView.measure.cache={},lineView.measure.heights=null,lineView.rest))for(var i=0;i<lineView.rest.length;i++)lineView.measure.caches[i]={}}function clearLineMeasurementCache(cm){cm.display.externalMeasure=null,removeChildren(cm.display.lineMeasure);for(var i=0;i<cm.display.view.length;i++)clearLineMeasurementCacheFor(cm.display.view[i])}function clearCaches(cm){clearLineMeasurementCache(cm),cm.display.cachedCharWidth=cm.display.cachedTextHeight=cm.display.cachedPaddingH=null,cm.options.lineWrapping||(cm.display.maxLineChanged=!0),cm.display.lineNumChars=null}function pageScrollX(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pageScrollY(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function intoCoordSystem(cm,lineObj,rect,context){if(lineObj.widgets)for(var i=0;i<lineObj.widgets.length;++i)if(lineObj.widgets[i].above){var size=widgetHeight(lineObj.widgets[i]);rect.top+=size,rect.bottom+=size}if("line"==context)return rect;context||(context="local");var yOff=heightAtLine(lineObj);if("local"==context?yOff+=paddingTop(cm.display):yOff-=cm.display.viewOffset,"page"==context||"window"==context){var lOff=cm.display.lineSpace.getBoundingClientRect();yOff+=lOff.top+("window"==context?0:pageScrollY());var xOff=lOff.left+("window"==context?0:pageScrollX());rect.left+=xOff,rect.right+=xOff}return rect.top+=yOff,rect.bottom+=yOff,rect}function fromCoordSystem(cm,coords,context){if("div"==context)return coords;var left=coords.left,top=coords.top;if("page"==context)left-=pageScrollX(),top-=pageScrollY();else if("local"==context||!context){var localBox=cm.display.sizer.getBoundingClientRect();left+=localBox.left,top+=localBox.top}var lineSpaceBox=cm.display.lineSpace.getBoundingClientRect();return{left:left-lineSpaceBox.left,top:top-lineSpaceBox.top}}function charCoords(cm,pos,context,lineObj,bias){return lineObj||(lineObj=getLine(cm.doc,pos.line)),intoCoordSystem(cm,lineObj,measureChar(cm,lineObj,pos.ch,bias),context)}function cursorCoords(cm,pos,context,lineObj,preparedMeasure,varHeight){function get(ch,right){var m=measureCharPrepared(cm,preparedMeasure,ch,right?"right":"left",varHeight);return right?m.left=m.right:m.right=m.left,intoCoordSystem(cm,lineObj,m,context)}function getBidi(ch,partPos){var part=order[partPos],right=part.level%2;return ch==bidiLeft(part)&&partPos&&part.level<order[partPos-1].level?(part=order[--partPos],ch=bidiRight(part)-(part.level%2?0:1),right=!0):ch==bidiRight(part)&&partPos<order.length-1&&part.level<order[partPos+1].level&&(part=order[++partPos],ch=bidiLeft(part)-part.level%2,right=!1),right&&ch==part.to&&ch>part.from?get(ch-1):get(ch,right)}lineObj=lineObj||getLine(cm.doc,pos.line),preparedMeasure||(preparedMeasure=prepareMeasureForLine(cm,lineObj));var order=getOrder(lineObj),ch=pos.ch;if(!order)return get(ch);var partPos=getBidiPartAt(order,ch),val=getBidi(ch,partPos);return null!=bidiOther&&(val.other=getBidi(ch,bidiOther)),val}function estimateCoords(cm,pos){var left=0,pos=clipPos(cm.doc,pos);cm.options.lineWrapping||(left=charWidth(cm.display)*pos.ch);var lineObj=getLine(cm.doc,pos.line),top=heightAtLine(lineObj)+paddingTop(cm.display);return{left:left,right:left,top:top,bottom:top+lineObj.height}}function PosWithInfo(line,ch,outside,xRel){var pos=Pos(line,ch);return pos.xRel=xRel,outside&&(pos.outside=!0),pos}function coordsChar(cm,x,y){var doc=cm.doc;if(y+=cm.display.viewOffset,0>y)return PosWithInfo(doc.first,0,!0,-1);var lineN=lineAtHeight(doc,y),last=doc.first+doc.size-1;if(lineN>last)return PosWithInfo(doc.first+doc.size-1,getLine(doc,last).text.length,!0,1);0>x&&(x=0);for(var lineObj=getLine(doc,lineN);;){var found=coordsCharInner(cm,lineObj,lineN,x,y),merged=collapsedSpanAtEnd(lineObj),mergedPos=merged&&merged.find(0,!0);if(!merged||!(found.ch>mergedPos.from.ch||found.ch==mergedPos.from.ch&&found.xRel>0))return found;lineN=lineNo(lineObj=mergedPos.to.line)}}function coordsCharInner(cm,lineObj,lineNo,x,y){function getX(ch){var sp=cursorCoords(cm,Pos(lineNo,ch),"line",lineObj,preparedMeasure);return wrongLine=!0,innerOff>sp.bottom?sp.left-adjust:innerOff<sp.top?sp.left+adjust:(wrongLine=!1,sp.left)}var innerOff=y-heightAtLine(lineObj),wrongLine=!1,adjust=2*cm.display.wrapper.clientWidth,preparedMeasure=prepareMeasureForLine(cm,lineObj),bidi=getOrder(lineObj),dist=lineObj.text.length,from=lineLeft(lineObj),to=lineRight(lineObj),fromX=getX(from),fromOutside=wrongLine,toX=getX(to),toOutside=wrongLine;if(x>toX)return PosWithInfo(lineNo,to,toOutside,1);for(;;){if(bidi?to==from||to==moveVisually(lineObj,from,1):1>=to-from){for(var ch=fromX>x||toX-x>=x-fromX?from:to,xDiff=x-(ch==from?fromX:toX);isExtendingChar(lineObj.text.charAt(ch));)++ch;var pos=PosWithInfo(lineNo,ch,ch==from?fromOutside:toOutside,-1>xDiff?-1:xDiff>1?1:0);return pos}var step=Math.ceil(dist/2),middle=from+step;if(bidi){middle=from;for(var i=0;step>i;++i)middle=moveVisually(lineObj,middle,1)}var middleX=getX(middle);middleX>x?(to=middle,toX=middleX,(toOutside=wrongLine)&&(toX+=1e3),dist=step):(from=middle,fromX=middleX,fromOutside=wrongLine,dist-=step)}}function textHeight(display){if(null!=display.cachedTextHeight)return display.cachedTextHeight;if(null==measureText){measureText=elt("pre");for(var i=0;49>i;++i)measureText.appendChild(document.createTextNode("x")),measureText.appendChild(elt("br"));measureText.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(display.measure,measureText);var height=measureText.offsetHeight/50;return height>3&&(display.cachedTextHeight=height),removeChildren(display.measure),height||1}function charWidth(display){if(null!=display.cachedCharWidth)return display.cachedCharWidth;var anchor=elt("span","xxxxxxxxxx"),pre=elt("pre",[anchor]);removeChildrenAndAdd(display.measure,pre);var rect=anchor.getBoundingClientRect(),width=(rect.right-rect.left)/10;return width>2&&(display.cachedCharWidth=width),width||10}function startOperation(cm){cm.curOp={cm:cm,viewChanged:!1,startHeight:cm.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++nextOpId},operationGroup?operationGroup.ops.push(cm.curOp):cm.curOp.ownsGroup=operationGroup={ops:[cm.curOp],delayedCallbacks:[]}}function fireCallbacksForOps(group){var callbacks=group.delayedCallbacks,i=0;do{for(;i<callbacks.length;i++)callbacks[i]();for(var j=0;j<group.ops.length;j++){var op=group.ops[j];if(op.cursorActivityHandlers)for(;op.cursorActivityCalled<op.cursorActivityHandlers.length;)op.cursorActivityHandlers[op.cursorActivityCalled++](op.cm)}}while(i<callbacks.length)}function endOperation(cm){var op=cm.curOp,group=op.ownsGroup;if(group)try{fireCallbacksForOps(group)}finally{operationGroup=null;for(var i=0;i<group.ops.length;i++)group.ops[i].cm.curOp=null;endOperations(group)}}function endOperations(group){for(var ops=group.ops,i=0;i<ops.length;i++)endOperation_R1(ops[i]);for(var i=0;i<ops.length;i++)endOperation_W1(ops[i]);for(var i=0;i<ops.length;i++)endOperation_R2(ops[i]);for(var i=0;i<ops.length;i++)endOperation_W2(ops[i]);for(var i=0;i<ops.length;i++)endOperation_finish(ops[i])}function endOperation_R1(op){var cm=op.cm,display=cm.display;op.updateMaxLine&&findMaxLine(cm),op.mustUpdate=op.viewChanged||op.forceUpdate||null!=op.scrollTop||op.scrollToPos&&(op.scrollToPos.from.line<display.viewFrom||op.scrollToPos.to.line>=display.viewTo)||display.maxLineChanged&&cm.options.lineWrapping,op.update=op.mustUpdate&&new DisplayUpdate(cm,op.mustUpdate&&{top:op.scrollTop,ensure:op.scrollToPos},op.forceUpdate)}function endOperation_W1(op){op.updatedDisplay=op.mustUpdate&&updateDisplayIfNeeded(op.cm,op.update)}function endOperation_R2(op){var cm=op.cm,display=cm.display;op.updatedDisplay&&updateHeightsInViewport(cm),op.barMeasure=measureForScrollbars(cm),display.maxLineChanged&&!cm.options.lineWrapping&&(op.adjustWidthTo=measureChar(cm,display.maxLine,display.maxLine.text.length).left+3,op.maxScrollLeft=Math.max(0,display.sizer.offsetLeft+op.adjustWidthTo+scrollerCutOff-display.scroller.clientWidth)),(op.updatedDisplay||op.selectionChanged)&&(op.newSelectionNodes=drawSelection(cm))}function endOperation_W2(op){var cm=op.cm;null!=op.adjustWidthTo&&(cm.display.sizer.style.minWidth=op.adjustWidthTo+"px",op.maxScrollLeft<cm.doc.scrollLeft&&setScrollLeft(cm,Math.min(cm.display.scroller.scrollLeft,op.maxScrollLeft),!0),cm.display.maxLineChanged=!1),op.newSelectionNodes&&showSelection(cm,op.newSelectionNodes),op.updatedDisplay&&setDocumentHeight(cm,op.barMeasure),(op.updatedDisplay||op.startHeight!=cm.doc.height)&&updateScrollbars(cm,op.barMeasure),op.selectionChanged&&restartBlink(cm),cm.state.focused&&op.updateInput&&resetInput(cm,op.typing)}function endOperation_finish(op){var cm=op.cm,display=cm.display,doc=cm.doc;if(null!=op.adjustWidthTo&&Math.abs(op.barMeasure.scrollWidth-cm.display.scroller.scrollWidth)>1&&updateScrollbars(cm),op.updatedDisplay&&postUpdateDisplay(cm,op.update),null==display.wheelStartX||null==op.scrollTop&&null==op.scrollLeft&&!op.scrollToPos||(display.wheelStartX=display.wheelStartY=null),null!=op.scrollTop&&(display.scroller.scrollTop!=op.scrollTop||op.forceScroll)){var top=Math.max(0,Math.min(display.scroller.scrollHeight-display.scroller.clientHeight,op.scrollTop));
|
18 |
+
display.scroller.scrollTop=display.scrollbarV.scrollTop=doc.scrollTop=top}if(null!=op.scrollLeft&&(display.scroller.scrollLeft!=op.scrollLeft||op.forceScroll)){var left=Math.max(0,Math.min(display.scroller.scrollWidth-display.scroller.clientWidth,op.scrollLeft));display.scroller.scrollLeft=display.scrollbarH.scrollLeft=doc.scrollLeft=left,alignHorizontally(cm)}if(op.scrollToPos){var coords=scrollPosIntoView(cm,clipPos(doc,op.scrollToPos.from),clipPos(doc,op.scrollToPos.to),op.scrollToPos.margin);op.scrollToPos.isCursor&&cm.state.focused&&maybeScrollWindow(cm,coords)}var hidden=op.maybeHiddenMarkers,unhidden=op.maybeUnhiddenMarkers;if(hidden)for(var i=0;i<hidden.length;++i)hidden[i].lines.length||signal(hidden[i],"hide");if(unhidden)for(var i=0;i<unhidden.length;++i)unhidden[i].lines.length&&signal(unhidden[i],"unhide");display.wrapper.offsetHeight&&(doc.scrollTop=cm.display.scroller.scrollTop),op.updatedDisplay&&webkit&&(cm.options.lineWrapping&&checkForWebkitWidthBug(cm,op.barMeasure),op.barMeasure.scrollWidth>op.barMeasure.clientWidth&&op.barMeasure.scrollWidth<op.barMeasure.clientWidth+1&&!hScrollbarTakesSpace(cm)&&updateScrollbars(cm)),op.changeObjs&&signal(cm,"changes",cm,op.changeObjs)}function runInOp(cm,f){if(cm.curOp)return f();startOperation(cm);try{return f()}finally{endOperation(cm)}}function operation(cm,f){return function(){if(cm.curOp)return f.apply(cm,arguments);startOperation(cm);try{return f.apply(cm,arguments)}finally{endOperation(cm)}}}function methodOp(f){return function(){if(this.curOp)return f.apply(this,arguments);startOperation(this);try{return f.apply(this,arguments)}finally{endOperation(this)}}}function docMethodOp(f){return function(){var cm=this.cm;if(!cm||cm.curOp)return f.apply(this,arguments);startOperation(cm);try{return f.apply(this,arguments)}finally{endOperation(cm)}}}function LineView(doc,line,lineN){this.line=line,this.rest=visualLineContinued(line),this.size=this.rest?lineNo(lst(this.rest))-lineN+1:1,this.node=this.text=null,this.hidden=lineIsHidden(doc,line)}function buildViewArray(cm,from,to){for(var nextPos,array=[],pos=from;to>pos;pos=nextPos){var view=new LineView(cm.doc,getLine(cm.doc,pos),pos);nextPos=pos+view.size,array.push(view)}return array}function regChange(cm,from,to,lendiff){null==from&&(from=cm.doc.first),null==to&&(to=cm.doc.first+cm.doc.size),lendiff||(lendiff=0);var display=cm.display;if(lendiff&&to<display.viewTo&&(null==display.updateLineNumbers||display.updateLineNumbers>from)&&(display.updateLineNumbers=from),cm.curOp.viewChanged=!0,from>=display.viewTo)sawCollapsedSpans&&visualLineNo(cm.doc,from)<display.viewTo&&resetView(cm);else if(to<=display.viewFrom)sawCollapsedSpans&&visualLineEndNo(cm.doc,to+lendiff)>display.viewFrom?resetView(cm):(display.viewFrom+=lendiff,display.viewTo+=lendiff);else if(from<=display.viewFrom&&to>=display.viewTo)resetView(cm);else if(from<=display.viewFrom){var cut=viewCuttingPoint(cm,to,to+lendiff,1);cut?(display.view=display.view.slice(cut.index),display.viewFrom=cut.lineN,display.viewTo+=lendiff):resetView(cm)}else if(to>=display.viewTo){var cut=viewCuttingPoint(cm,from,from,-1);cut?(display.view=display.view.slice(0,cut.index),display.viewTo=cut.lineN):resetView(cm)}else{var cutTop=viewCuttingPoint(cm,from,from,-1),cutBot=viewCuttingPoint(cm,to,to+lendiff,1);cutTop&&cutBot?(display.view=display.view.slice(0,cutTop.index).concat(buildViewArray(cm,cutTop.lineN,cutBot.lineN)).concat(display.view.slice(cutBot.index)),display.viewTo+=lendiff):resetView(cm)}var ext=display.externalMeasured;ext&&(to<ext.lineN?ext.lineN+=lendiff:from<ext.lineN+ext.size&&(display.externalMeasured=null))}function regLineChange(cm,line,type){cm.curOp.viewChanged=!0;var display=cm.display,ext=cm.display.externalMeasured;if(ext&&line>=ext.lineN&&line<ext.lineN+ext.size&&(display.externalMeasured=null),!(line<display.viewFrom||line>=display.viewTo)){var lineView=display.view[findViewIndex(cm,line)];if(null!=lineView.node){var arr=lineView.changes||(lineView.changes=[]);-1==indexOf(arr,type)&&arr.push(type)}}}function resetView(cm){cm.display.viewFrom=cm.display.viewTo=cm.doc.first,cm.display.view=[],cm.display.viewOffset=0}function findViewIndex(cm,n){if(n>=cm.display.viewTo)return null;if(n-=cm.display.viewFrom,0>n)return null;for(var view=cm.display.view,i=0;i<view.length;i++)if(n-=view[i].size,0>n)return i}function viewCuttingPoint(cm,oldN,newN,dir){var diff,index=findViewIndex(cm,oldN),view=cm.display.view;if(!sawCollapsedSpans||newN==cm.doc.first+cm.doc.size)return{index:index,lineN:newN};for(var i=0,n=cm.display.viewFrom;index>i;i++)n+=view[i].size;if(n!=oldN){if(dir>0){if(index==view.length-1)return null;diff=n+view[index].size-oldN,index++}else diff=n-oldN;oldN+=diff,newN+=diff}for(;visualLineNo(cm.doc,newN)!=newN;){if(index==(0>dir?0:view.length-1))return null;newN+=dir*view[index-(0>dir?1:0)].size,index+=dir}return{index:index,lineN:newN}}function adjustView(cm,from,to){var display=cm.display,view=display.view;0==view.length||from>=display.viewTo||to<=display.viewFrom?(display.view=buildViewArray(cm,from,to),display.viewFrom=from):(display.viewFrom>from?display.view=buildViewArray(cm,from,display.viewFrom).concat(display.view):display.viewFrom<from&&(display.view=display.view.slice(findViewIndex(cm,from))),display.viewFrom=from,display.viewTo<to?display.view=display.view.concat(buildViewArray(cm,display.viewTo,to)):display.viewTo>to&&(display.view=display.view.slice(0,findViewIndex(cm,to)))),display.viewTo=to}function countDirtyView(cm){for(var view=cm.display.view,dirty=0,i=0;i<view.length;i++){var lineView=view[i];lineView.hidden||lineView.node&&!lineView.changes||++dirty}return dirty}function slowPoll(cm){cm.display.pollingFast||cm.display.poll.set(cm.options.pollInterval,function(){readInput(cm),cm.state.focused&&slowPoll(cm)})}function fastPoll(cm){function p(){var changed=readInput(cm);changed||missed?(cm.display.pollingFast=!1,slowPoll(cm)):(missed=!0,cm.display.poll.set(60,p))}var missed=!1;cm.display.pollingFast=!0,cm.display.poll.set(20,p)}function readInput(cm){var input=cm.display.input,prevInput=cm.display.prevInput,doc=cm.doc;if(!cm.state.focused||hasSelection(input)&&!prevInput||isReadOnly(cm)||cm.options.disableInput||cm.state.keySeq)return!1;cm.state.pasteIncoming&&cm.state.fakedLastChar&&(input.value=input.value.substring(0,input.value.length-1),cm.state.fakedLastChar=!1);var text=input.value;if(text==prevInput&&!cm.somethingSelected())return!1;if(ie&&ie_version>=9&&cm.display.inputHasSelection===text||mac&&/[\uf700-\uf7ff]/.test(text))return resetInput(cm),!1;var withOp=!cm.curOp;withOp&&startOperation(cm),cm.display.shift=!1,8203!=text.charCodeAt(0)||doc.sel!=cm.display.selForContextMenu||prevInput||(prevInput="");for(var same=0,l=Math.min(prevInput.length,text.length);l>same&&prevInput.charCodeAt(same)==text.charCodeAt(same);)++same;var inserted=text.slice(same),textLines=splitLines(inserted),multiPaste=null;cm.state.pasteIncoming&&doc.sel.ranges.length>1&&(lastCopied&&lastCopied.join("\n")==inserted?multiPaste=doc.sel.ranges.length%lastCopied.length==0&&map(lastCopied,splitLines):textLines.length==doc.sel.ranges.length&&(multiPaste=map(textLines,function(l){return[l]})));for(var i=doc.sel.ranges.length-1;i>=0;i--){var range=doc.sel.ranges[i],from=range.from(),to=range.to();same<prevInput.length?from=Pos(from.line,from.ch-(prevInput.length-same)):cm.state.overwrite&&range.empty()&&!cm.state.pasteIncoming&&(to=Pos(to.line,Math.min(getLine(doc,to.line).text.length,to.ch+lst(textLines).length)));var updateInput=cm.curOp.updateInput,changeEvent={from:from,to:to,text:multiPaste?multiPaste[i%multiPaste.length]:textLines,origin:cm.state.pasteIncoming?"paste":cm.state.cutIncoming?"cut":"+input"};if(makeChange(cm.doc,changeEvent),signalLater(cm,"inputRead",cm,changeEvent),inserted&&!cm.state.pasteIncoming&&cm.options.electricChars&&cm.options.smartIndent&&range.head.ch<100&&(!i||doc.sel.ranges[i-1].head.line!=range.head.line)){var mode=cm.getModeAt(range.head),end=changeEnd(changeEvent);if(mode.electricChars){for(var j=0;j<mode.electricChars.length;j++)if(inserted.indexOf(mode.electricChars.charAt(j))>-1){indentLine(cm,end.line,"smart");break}}else mode.electricInput&&mode.electricInput.test(getLine(doc,end.line).text.slice(0,end.ch))&&indentLine(cm,end.line,"smart")}}return ensureCursorVisible(cm),cm.curOp.updateInput=updateInput,cm.curOp.typing=!0,text.length>1e3||text.indexOf("\n")>-1?input.value=cm.display.prevInput="":cm.display.prevInput=text,withOp&&endOperation(cm),cm.state.pasteIncoming=cm.state.cutIncoming=!1,!0}function resetInput(cm,typing){var minimal,selected,doc=cm.doc;if(cm.somethingSelected()){cm.display.prevInput="";var range=doc.sel.primary();minimal=hasCopyEvent&&(range.to().line-range.from().line>100||(selected=cm.getSelection()).length>1e3);var content=minimal?"-":selected||cm.getSelection();cm.display.input.value=content,cm.state.focused&&selectInput(cm.display.input),ie&&ie_version>=9&&(cm.display.inputHasSelection=content)}else typing||(cm.display.prevInput=cm.display.input.value="",ie&&ie_version>=9&&(cm.display.inputHasSelection=null));cm.display.inaccurateSelection=minimal}function focusInput(cm){"nocursor"==cm.options.readOnly||mobile&&activeElt()==cm.display.input||cm.display.input.focus()}function ensureFocus(cm){cm.state.focused||(focusInput(cm),onFocus(cm))}function isReadOnly(cm){return cm.options.readOnly||cm.doc.cantEdit}function registerEventHandlers(cm){function reFocus(){cm.state.focused&&setTimeout(bind(focusInput,cm),0)}function drag_(e){signalDOMEvent(cm,e)||e_stop(e)}function prepareCopyCut(e){if(cm.somethingSelected())lastCopied=cm.getSelections(),d.inaccurateSelection&&(d.prevInput="",d.inaccurateSelection=!1,d.input.value=lastCopied.join("\n"),selectInput(d.input));else{for(var text=[],ranges=[],i=0;i<cm.doc.sel.ranges.length;i++){var line=cm.doc.sel.ranges[i].head.line,lineRange={anchor:Pos(line,0),head:Pos(line+1,0)};ranges.push(lineRange),text.push(cm.getRange(lineRange.anchor,lineRange.head))}"cut"==e.type?cm.setSelections(ranges,null,sel_dontScroll):(d.prevInput="",d.input.value=text.join("\n"),selectInput(d.input)),lastCopied=text}"cut"==e.type&&(cm.state.cutIncoming=!0)}var d=cm.display;on(d.scroller,"mousedown",operation(cm,onMouseDown)),ie&&11>ie_version?on(d.scroller,"dblclick",operation(cm,function(e){if(!signalDOMEvent(cm,e)){var pos=posFromMouse(cm,e);if(pos&&!clickInGutter(cm,e)&&!eventInWidget(cm.display,e)){e_preventDefault(e);var word=cm.findWordAt(pos);extendSelection(cm.doc,word.anchor,word.head)}}})):on(d.scroller,"dblclick",function(e){signalDOMEvent(cm,e)||e_preventDefault(e)}),on(d.lineSpace,"selectstart",function(e){eventInWidget(d,e)||e_preventDefault(e)}),captureRightClick||on(d.scroller,"contextmenu",function(e){onContextMenu(cm,e)}),on(d.scroller,"scroll",function(){d.scroller.clientHeight&&(setScrollTop(cm,d.scroller.scrollTop),setScrollLeft(cm,d.scroller.scrollLeft,!0),signal(cm,"scroll",cm))}),on(d.scrollbarV,"scroll",function(){d.scroller.clientHeight&&setScrollTop(cm,d.scrollbarV.scrollTop)}),on(d.scrollbarH,"scroll",function(){d.scroller.clientHeight&&setScrollLeft(cm,d.scrollbarH.scrollLeft)}),on(d.scroller,"mousewheel",function(e){onScrollWheel(cm,e)}),on(d.scroller,"DOMMouseScroll",function(e){onScrollWheel(cm,e)}),on(d.scrollbarH,"mousedown",reFocus),on(d.scrollbarV,"mousedown",reFocus),on(d.wrapper,"scroll",function(){d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),on(d.input,"keyup",function(e){onKeyUp.call(cm,e)}),on(d.input,"input",function(){ie&&ie_version>=9&&cm.display.inputHasSelection&&(cm.display.inputHasSelection=null),fastPoll(cm)}),on(d.input,"keydown",operation(cm,onKeyDown)),on(d.input,"keypress",operation(cm,onKeyPress)),on(d.input,"focus",bind(onFocus,cm)),on(d.input,"blur",bind(onBlur,cm)),cm.options.dragDrop&&(on(d.scroller,"dragstart",function(e){onDragStart(cm,e)}),on(d.scroller,"dragenter",drag_),on(d.scroller,"dragover",drag_),on(d.scroller,"drop",operation(cm,onDrop))),on(d.scroller,"paste",function(e){eventInWidget(d,e)||(cm.state.pasteIncoming=!0,focusInput(cm),fastPoll(cm))}),on(d.input,"paste",function(){if(webkit&&!cm.state.fakedLastChar&&!(new Date-cm.state.lastMiddleDown<200)){var start=d.input.selectionStart,end=d.input.selectionEnd;d.input.value+="$",d.input.selectionEnd=end,d.input.selectionStart=start,cm.state.fakedLastChar=!0}cm.state.pasteIncoming=!0,fastPoll(cm)}),on(d.input,"cut",prepareCopyCut),on(d.input,"copy",prepareCopyCut),khtml&&on(d.sizer,"mouseup",function(){activeElt()==d.input&&d.input.blur(),focusInput(cm)})}function onResize(cm){var d=cm.display;(d.lastWrapHeight!=d.wrapper.clientHeight||d.lastWrapWidth!=d.wrapper.clientWidth)&&(d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,cm.setSize())}function eventInWidget(display,e){for(var n=e_target(e);n!=display.wrapper;n=n.parentNode)if(!n||n.ignoreEvents||n.parentNode==display.sizer&&n!=display.mover)return!0}function posFromMouse(cm,e,liberal,forRect){var display=cm.display;if(!liberal){var target=e_target(e);if(target==display.scrollbarH||target==display.scrollbarV||target==display.scrollbarFiller||target==display.gutterFiller)return null}var x,y,space=display.lineSpace.getBoundingClientRect();try{x=e.clientX-space.left,y=e.clientY-space.top}catch(e){return null}var line,coords=coordsChar(cm,x,y);if(forRect&&1==coords.xRel&&(line=getLine(cm.doc,coords.line).text).length==coords.ch){var colDiff=countColumn(line,line.length,cm.options.tabSize)-line.length;coords=Pos(coords.line,Math.max(0,Math.round((x-paddingH(cm.display).left)/charWidth(cm.display))-colDiff))}return coords}function onMouseDown(e){if(!signalDOMEvent(this,e)){var cm=this,display=cm.display;if(display.shift=e.shiftKey,eventInWidget(display,e))return void(webkit||(display.scroller.draggable=!1,setTimeout(function(){display.scroller.draggable=!0},100)));if(!clickInGutter(cm,e)){var start=posFromMouse(cm,e);switch(window.focus(),e_button(e)){case 1:start?leftButtonDown(cm,e,start):e_target(e)==display.scroller&&e_preventDefault(e);break;case 2:webkit&&(cm.state.lastMiddleDown=+new Date),start&&extendSelection(cm.doc,start),setTimeout(bind(focusInput,cm),20),e_preventDefault(e);break;case 3:captureRightClick&&onContextMenu(cm,e)}}}}function leftButtonDown(cm,e,start){setTimeout(bind(ensureFocus,cm),0);var type,now=+new Date;lastDoubleClick&&lastDoubleClick.time>now-400&&0==cmp(lastDoubleClick.pos,start)?type="triple":lastClick&&lastClick.time>now-400&&0==cmp(lastClick.pos,start)?(type="double",lastDoubleClick={time:now,pos:start}):(type="single",lastClick={time:now,pos:start});var sel=cm.doc.sel,modifier=mac?e.metaKey:e.ctrlKey;cm.options.dragDrop&&dragAndDrop&&!isReadOnly(cm)&&"single"==type&&sel.contains(start)>-1&&sel.somethingSelected()?leftButtonStartDrag(cm,e,start,modifier):leftButtonSelect(cm,e,start,type,modifier)}function leftButtonStartDrag(cm,e,start,modifier){var display=cm.display,dragEnd=operation(cm,function(e2){webkit&&(display.scroller.draggable=!1),cm.state.draggingText=!1,off(document,"mouseup",dragEnd),off(display.scroller,"drop",dragEnd),Math.abs(e.clientX-e2.clientX)+Math.abs(e.clientY-e2.clientY)<10&&(e_preventDefault(e2),modifier||extendSelection(cm.doc,start),focusInput(cm),ie&&9==ie_version&&setTimeout(function(){document.body.focus(),focusInput(cm)},20))});webkit&&(display.scroller.draggable=!0),cm.state.draggingText=dragEnd,display.scroller.dragDrop&&display.scroller.dragDrop(),on(document,"mouseup",dragEnd),on(display.scroller,"drop",dragEnd)}function leftButtonSelect(cm,e,start,type,addNew){function extendTo(pos){if(0!=cmp(lastPos,pos))if(lastPos=pos,"rect"==type){for(var ranges=[],tabSize=cm.options.tabSize,startCol=countColumn(getLine(doc,start.line).text,start.ch,tabSize),posCol=countColumn(getLine(doc,pos.line).text,pos.ch,tabSize),left=Math.min(startCol,posCol),right=Math.max(startCol,posCol),line=Math.min(start.line,pos.line),end=Math.min(cm.lastLine(),Math.max(start.line,pos.line));end>=line;line++){var text=getLine(doc,line).text,leftPos=findColumn(text,left,tabSize);left==right?ranges.push(new Range(Pos(line,leftPos),Pos(line,leftPos))):text.length>leftPos&&ranges.push(new Range(Pos(line,leftPos),Pos(line,findColumn(text,right,tabSize))))}ranges.length||ranges.push(new Range(start,start)),setSelection(doc,normalizeSelection(startSel.ranges.slice(0,ourIndex).concat(ranges),ourIndex),{origin:"*mouse",scroll:!1}),cm.scrollIntoView(pos)}else{var oldRange=ourRange,anchor=oldRange.anchor,head=pos;if("single"!=type){if("double"==type)var range=cm.findWordAt(pos);else var range=new Range(Pos(pos.line,0),clipPos(doc,Pos(pos.line+1,0)));cmp(range.anchor,anchor)>0?(head=range.head,anchor=minPos(oldRange.from(),range.anchor)):(head=range.anchor,anchor=maxPos(oldRange.to(),range.head))}var ranges=startSel.ranges.slice(0);ranges[ourIndex]=new Range(clipPos(doc,anchor),head),setSelection(doc,normalizeSelection(ranges,ourIndex),sel_mouse)}}function extend(e){var curCount=++counter,cur=posFromMouse(cm,e,!0,"rect"==type);if(cur)if(0!=cmp(cur,lastPos)){ensureFocus(cm),extendTo(cur);var visible=visibleLines(display,doc);(cur.line>=visible.to||cur.line<visible.from)&&setTimeout(operation(cm,function(){counter==curCount&&extend(e)}),150)}else{var outside=e.clientY<editorSize.top?-20:e.clientY>editorSize.bottom?20:0;outside&&setTimeout(operation(cm,function(){counter==curCount&&(display.scroller.scrollTop+=outside,extend(e))}),50)}}function done(e){counter=1/0,e_preventDefault(e),focusInput(cm),off(document,"mousemove",move),off(document,"mouseup",up),doc.history.lastSelOrigin=null}var display=cm.display,doc=cm.doc;e_preventDefault(e);var ourRange,ourIndex,startSel=doc.sel;if(addNew&&!e.shiftKey?(ourIndex=doc.sel.contains(start),ourRange=ourIndex>-1?doc.sel.ranges[ourIndex]:new Range(start,start)):ourRange=doc.sel.primary(),e.altKey)type="rect",addNew||(ourRange=new Range(start,start)),start=posFromMouse(cm,e,!0,!0),ourIndex=-1;else if("double"==type){var word=cm.findWordAt(start);ourRange=cm.display.shift||doc.extend?extendRange(doc,ourRange,word.anchor,word.head):word}else if("triple"==type){var line=new Range(Pos(start.line,0),clipPos(doc,Pos(start.line+1,0)));ourRange=cm.display.shift||doc.extend?extendRange(doc,ourRange,line.anchor,line.head):line}else ourRange=extendRange(doc,ourRange,start);addNew?ourIndex>-1?replaceOneSelection(doc,ourIndex,ourRange,sel_mouse):(ourIndex=doc.sel.ranges.length,setSelection(doc,normalizeSelection(doc.sel.ranges.concat([ourRange]),ourIndex),{scroll:!1,origin:"*mouse"})):(ourIndex=0,setSelection(doc,new Selection([ourRange],0),sel_mouse),startSel=doc.sel);var lastPos=start,editorSize=display.wrapper.getBoundingClientRect(),counter=0,move=operation(cm,function(e){e_button(e)?extend(e):done(e)}),up=operation(cm,done);on(document,"mousemove",move),on(document,"mouseup",up)}function gutterEvent(cm,e,type,prevent,signalfn){try{var mX=e.clientX,mY=e.clientY}catch(e){return!1}if(mX>=Math.floor(cm.display.gutters.getBoundingClientRect().right))return!1;prevent&&e_preventDefault(e);var display=cm.display,lineBox=display.lineDiv.getBoundingClientRect();if(mY>lineBox.bottom||!hasHandler(cm,type))return e_defaultPrevented(e);mY-=lineBox.top-display.viewOffset;for(var i=0;i<cm.options.gutters.length;++i){var g=display.gutters.childNodes[i];if(g&&g.getBoundingClientRect().right>=mX){var line=lineAtHeight(cm.doc,mY),gutter=cm.options.gutters[i];return signalfn(cm,type,cm,line,gutter,e),e_defaultPrevented(e)}}}function clickInGutter(cm,e){return gutterEvent(cm,e,"gutterClick",!0,signalLater)}function onDrop(e){var cm=this;if(!signalDOMEvent(cm,e)&&!eventInWidget(cm.display,e)){e_preventDefault(e),ie&&(lastDrop=+new Date);var pos=posFromMouse(cm,e,!0),files=e.dataTransfer.files;if(pos&&!isReadOnly(cm))if(files&&files.length&&window.FileReader&&window.File)for(var n=files.length,text=Array(n),read=0,loadFile=function(file,i){var reader=new FileReader;reader.onload=operation(cm,function(){if(text[i]=reader.result,++read==n){pos=clipPos(cm.doc,pos);var change={from:pos,to:pos,text:splitLines(text.join("\n")),origin:"paste"};makeChange(cm.doc,change),setSelectionReplaceHistory(cm.doc,simpleSelection(pos,changeEnd(change)))}}),reader.readAsText(file)},i=0;n>i;++i)loadFile(files[i],i);else{if(cm.state.draggingText&&cm.doc.sel.contains(pos)>-1)return cm.state.draggingText(e),void setTimeout(bind(focusInput,cm),20);try{var text=e.dataTransfer.getData("Text");if(text){if(cm.state.draggingText&&!(mac?e.metaKey:e.ctrlKey))var selected=cm.listSelections();if(setSelectionNoUndo(cm.doc,simpleSelection(pos,pos)),selected)for(var i=0;i<selected.length;++i)replaceRange(cm.doc,"",selected[i].anchor,selected[i].head,"drag");cm.replaceSelection(text,"around","paste"),focusInput(cm)}}catch(e){}}}}function onDragStart(cm,e){if(ie&&(!cm.state.draggingText||+new Date-lastDrop<100))return void e_stop(e);if(!signalDOMEvent(cm,e)&&!eventInWidget(cm.display,e)&&(e.dataTransfer.setData("Text",cm.getSelection()),e.dataTransfer.setDragImage&&!safari)){var img=elt("img",null,null,"position: fixed; left: 0; top: 0;");img.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",presto&&(img.width=img.height=1,cm.display.wrapper.appendChild(img),img._top=img.offsetTop),e.dataTransfer.setDragImage(img,0,0),presto&&img.parentNode.removeChild(img)}}function setScrollTop(cm,val){Math.abs(cm.doc.scrollTop-val)<2||(cm.doc.scrollTop=val,gecko||updateDisplaySimple(cm,{top:val}),cm.display.scroller.scrollTop!=val&&(cm.display.scroller.scrollTop=val),cm.display.scrollbarV.scrollTop!=val&&(cm.display.scrollbarV.scrollTop=val),gecko&&updateDisplaySimple(cm),startWorker(cm,100))}function setScrollLeft(cm,val,isScroller){(isScroller?val==cm.doc.scrollLeft:Math.abs(cm.doc.scrollLeft-val)<2)||(val=Math.min(val,cm.display.scroller.scrollWidth-cm.display.scroller.clientWidth),cm.doc.scrollLeft=val,alignHorizontally(cm),cm.display.scroller.scrollLeft!=val&&(cm.display.scroller.scrollLeft=val),cm.display.scrollbarH.scrollLeft!=val&&(cm.display.scrollbarH.scrollLeft=val))}function onScrollWheel(cm,e){var dx=e.wheelDeltaX,dy=e.wheelDeltaY;null==dx&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(dx=e.detail),null==dy&&e.detail&&e.axis==e.VERTICAL_AXIS?dy=e.detail:null==dy&&(dy=e.wheelDelta);var display=cm.display,scroll=display.scroller;if(dx&&scroll.scrollWidth>scroll.clientWidth||dy&&scroll.scrollHeight>scroll.clientHeight){if(dy&&mac&&webkit)outer:for(var cur=e.target,view=display.view;cur!=scroll;cur=cur.parentNode)for(var i=0;i<view.length;i++)if(view[i].node==cur){cm.display.currentWheelTarget=cur;break outer}if(dx&&!gecko&&!presto&&null!=wheelPixelsPerUnit)return dy&&setScrollTop(cm,Math.max(0,Math.min(scroll.scrollTop+dy*wheelPixelsPerUnit,scroll.scrollHeight-scroll.clientHeight))),setScrollLeft(cm,Math.max(0,Math.min(scroll.scrollLeft+dx*wheelPixelsPerUnit,scroll.scrollWidth-scroll.clientWidth))),e_preventDefault(e),void(display.wheelStartX=null);if(dy&&null!=wheelPixelsPerUnit){var pixels=dy*wheelPixelsPerUnit,top=cm.doc.scrollTop,bot=top+display.wrapper.clientHeight;0>pixels?top=Math.max(0,top+pixels-50):bot=Math.min(cm.doc.height,bot+pixels+50),updateDisplaySimple(cm,{top:top,bottom:bot})}20>wheelSamples&&(null==display.wheelStartX?(display.wheelStartX=scroll.scrollLeft,display.wheelStartY=scroll.scrollTop,display.wheelDX=dx,display.wheelDY=dy,setTimeout(function(){if(null!=display.wheelStartX){var movedX=scroll.scrollLeft-display.wheelStartX,movedY=scroll.scrollTop-display.wheelStartY,sample=movedY&&display.wheelDY&&movedY/display.wheelDY||movedX&&display.wheelDX&&movedX/display.wheelDX;display.wheelStartX=display.wheelStartY=null,sample&&(wheelPixelsPerUnit=(wheelPixelsPerUnit*wheelSamples+sample)/(wheelSamples+1),++wheelSamples)}},200)):(display.wheelDX+=dx,display.wheelDY+=dy))}}function doHandleBinding(cm,bound,dropShift){if("string"==typeof bound&&(bound=commands[bound],!bound))return!1;cm.display.pollingFast&&readInput(cm)&&(cm.display.pollingFast=!1);var prevShift=cm.display.shift,done=!1;try{isReadOnly(cm)&&(cm.state.suppressEdits=!0),dropShift&&(cm.display.shift=!1),done=bound(cm)!=Pass}finally{cm.display.shift=prevShift,cm.state.suppressEdits=!1}return done}function lookupKeyForEditor(cm,name,handle){for(var i=0;i<cm.state.keyMaps.length;i++){var result=lookupKey(name,cm.state.keyMaps[i],handle);if(result)return result}return cm.options.extraKeys&&lookupKey(name,cm.options.extraKeys,handle)||lookupKey(name,cm.options.keyMap,handle)}function dispatchKey(cm,name,e,handle){var seq=cm.state.keySeq;if(seq){if(isModifierKey(name))return"handled";stopSeq.set(50,function(){cm.state.keySeq==seq&&(cm.state.keySeq=null,resetInput(cm))}),name=seq+" "+name}var result=lookupKeyForEditor(cm,name,handle);return"multi"==result&&(cm.state.keySeq=name),"handled"==result&&signalLater(cm,"keyHandled",cm,name,e),("handled"==result||"multi"==result)&&(e_preventDefault(e),restartBlink(cm)),seq&&!result&&/\'$/.test(name)?(e_preventDefault(e),!0):!!result}function handleKeyBinding(cm,e){var name=keyName(e,!0);return name?e.shiftKey&&!cm.state.keySeq?dispatchKey(cm,"Shift-"+name,e,function(b){return doHandleBinding(cm,b,!0)})||dispatchKey(cm,name,e,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?doHandleBinding(cm,b):void 0}):dispatchKey(cm,name,e,function(b){return doHandleBinding(cm,b)}):!1}function handleCharBinding(cm,e,ch){return dispatchKey(cm,"'"+ch+"'",e,function(b){return doHandleBinding(cm,b,!0)})}function onKeyDown(e){var cm=this;if(ensureFocus(cm),!signalDOMEvent(cm,e)){ie&&11>ie_version&&27==e.keyCode&&(e.returnValue=!1);var code=e.keyCode;cm.display.shift=16==code||e.shiftKey;var handled=handleKeyBinding(cm,e);presto&&(lastStoppedKey=handled?code:null,!handled&&88==code&&!hasCopyEvent&&(mac?e.metaKey:e.ctrlKey)&&cm.replaceSelection("",null,"cut")),18!=code||/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)||showCrossHair(cm)}}function showCrossHair(cm){function up(e){18!=e.keyCode&&e.altKey||(rmClass(lineDiv,"CodeMirror-crosshair"),off(document,"keyup",up),off(document,"mouseover",up))}var lineDiv=cm.display.lineDiv;addClass(lineDiv,"CodeMirror-crosshair"),on(document,"keyup",up),on(document,"mouseover",up)}function onKeyUp(e){16==e.keyCode&&(this.doc.sel.shift=!1),signalDOMEvent(this,e)}function onKeyPress(e){var cm=this;if(!(signalDOMEvent(cm,e)||e.ctrlKey&&!e.altKey||mac&&e.metaKey)){var keyCode=e.keyCode,charCode=e.charCode;if(presto&&keyCode==lastStoppedKey)return lastStoppedKey=null,void e_preventDefault(e);if(!(presto&&(!e.which||e.which<10)||khtml)||!handleKeyBinding(cm,e)){var ch=String.fromCharCode(null==charCode?keyCode:charCode);handleCharBinding(cm,e,ch)||(ie&&ie_version>=9&&(cm.display.inputHasSelection=null),fastPoll(cm))}}}function onFocus(cm){"nocursor"!=cm.options.readOnly&&(cm.state.focused||(signal(cm,"focus",cm),cm.state.focused=!0,addClass(cm.display.wrapper,"CodeMirror-focused"),cm.curOp||cm.display.selForContextMenu==cm.doc.sel||(resetInput(cm),webkit&&setTimeout(bind(resetInput,cm,!0),0))),slowPoll(cm),restartBlink(cm))}function onBlur(cm){cm.state.focused&&(signal(cm,"blur",cm),cm.state.focused=!1,rmClass(cm.display.wrapper,"CodeMirror-focused")),clearInterval(cm.display.blinker),setTimeout(function(){cm.state.focused||(cm.display.shift=!1)},150)}function onContextMenu(cm,e){function prepareSelectAllHack(){if(null!=display.input.selectionStart){var selected=cm.somethingSelected(),extval=display.input.value=""+(selected?display.input.value:"");display.prevInput=selected?"":"",display.input.selectionStart=1,display.input.selectionEnd=extval.length,display.selForContextMenu=cm.doc.sel}}function rehide(){if(display.inputDiv.style.position="relative",display.input.style.cssText=oldCSS,ie&&9>ie_version&&(display.scrollbarV.scrollTop=display.scroller.scrollTop=scrollPos),slowPoll(cm),null!=display.input.selectionStart){(!ie||ie&&9>ie_version)&&prepareSelectAllHack();var i=0,poll=function(){display.selForContextMenu==cm.doc.sel&&0==display.input.selectionStart?operation(cm,commands.selectAll)(cm):i++<10?display.detectingSelectAll=setTimeout(poll,500):resetInput(cm)};display.detectingSelectAll=setTimeout(poll,200)}}if(!signalDOMEvent(cm,e,"contextmenu")){var display=cm.display;if(!eventInWidget(display,e)&&!contextMenuInGutter(cm,e)){var pos=posFromMouse(cm,e),scrollPos=display.scroller.scrollTop;if(pos&&!presto){var reset=cm.options.resetSelectionOnContextMenu;reset&&-1==cm.doc.sel.contains(pos)&&operation(cm,setSelection)(cm.doc,simpleSelection(pos),sel_dontScroll);var oldCSS=display.input.style.cssText;if(display.inputDiv.style.position="absolute",display.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(ie?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",webkit)var oldScrollY=window.scrollY;if(focusInput(cm),webkit&&window.scrollTo(null,oldScrollY),resetInput(cm),cm.somethingSelected()||(display.input.value=display.prevInput=" "),display.selForContextMenu=cm.doc.sel,clearTimeout(display.detectingSelectAll),ie&&ie_version>=9&&prepareSelectAllHack(),captureRightClick){e_stop(e);var mouseup=function(){off(window,"mouseup",mouseup),setTimeout(rehide,20)};on(window,"mouseup",mouseup)}else setTimeout(rehide,50)}}}}function contextMenuInGutter(cm,e){return hasHandler(cm,"gutterContextMenu")?gutterEvent(cm,e,"gutterContextMenu",!1,signal):!1}function adjustForChange(pos,change){if(cmp(pos,change.from)<0)return pos;if(cmp(pos,change.to)<=0)return changeEnd(change);var line=pos.line+change.text.length-(change.to.line-change.from.line)-1,ch=pos.ch;return pos.line==change.to.line&&(ch+=changeEnd(change).ch-change.to.ch),Pos(line,ch)}function computeSelAfterChange(doc,change){for(var out=[],i=0;i<doc.sel.ranges.length;i++){var range=doc.sel.ranges[i];out.push(new Range(adjustForChange(range.anchor,change),adjustForChange(range.head,change)))}return normalizeSelection(out,doc.sel.primIndex)}function offsetPos(pos,old,nw){return pos.line==old.line?Pos(nw.line,pos.ch-old.ch+nw.ch):Pos(nw.line+(pos.line-old.line),pos.ch)}function computeReplacedSel(doc,changes,hint){for(var out=[],oldPrev=Pos(doc.first,0),newPrev=oldPrev,i=0;i<changes.length;i++){var change=changes[i],from=offsetPos(change.from,oldPrev,newPrev),to=offsetPos(changeEnd(change),oldPrev,newPrev);if(oldPrev=change.to,newPrev=to,"around"==hint){var range=doc.sel.ranges[i],inv=cmp(range.head,range.anchor)<0;out[i]=new Range(inv?to:from,inv?from:to)}else out[i]=new Range(from,from)}return new Selection(out,doc.sel.primIndex)}function filterChange(doc,change,update){var obj={canceled:!1,from:change.from,to:change.to,text:change.text,origin:change.origin,cancel:function(){this.canceled=!0}};return update&&(obj.update=function(from,to,text,origin){from&&(this.from=clipPos(doc,from)),to&&(this.to=clipPos(doc,to)),text&&(this.text=text),void 0!==origin&&(this.origin=origin)}),signal(doc,"beforeChange",doc,obj),doc.cm&&signal(doc.cm,"beforeChange",doc.cm,obj),obj.canceled?null:{from:obj.from,to:obj.to,text:obj.text,origin:obj.origin}}function makeChange(doc,change,ignoreReadOnly){if(doc.cm){if(!doc.cm.curOp)return operation(doc.cm,makeChange)(doc,change,ignoreReadOnly);if(doc.cm.state.suppressEdits)return}if(!(hasHandler(doc,"beforeChange")||doc.cm&&hasHandler(doc.cm,"beforeChange"))||(change=filterChange(doc,change,!0))){var split=sawReadOnlySpans&&!ignoreReadOnly&&removeReadOnlyRanges(doc,change.from,change.to);if(split)for(var i=split.length-1;i>=0;--i)makeChangeInner(doc,{from:split[i].from,to:split[i].to,text:i?[""]:change.text});else makeChangeInner(doc,change)}}function makeChangeInner(doc,change){if(1!=change.text.length||""!=change.text[0]||0!=cmp(change.from,change.to)){var selAfter=computeSelAfterChange(doc,change);addChangeToHistory(doc,change,selAfter,doc.cm?doc.cm.curOp.id:0/0),makeChangeSingleDoc(doc,change,selAfter,stretchSpansOverChange(doc,change));
|
19 |
+
var rebased=[];linkedDocs(doc,function(doc,sharedHist){sharedHist||-1!=indexOf(rebased,doc.history)||(rebaseHist(doc.history,change),rebased.push(doc.history)),makeChangeSingleDoc(doc,change,null,stretchSpansOverChange(doc,change))})}}function makeChangeFromHistory(doc,type,allowSelectionOnly){if(!doc.cm||!doc.cm.state.suppressEdits){for(var event,hist=doc.history,selAfter=doc.sel,source="undo"==type?hist.done:hist.undone,dest="undo"==type?hist.undone:hist.done,i=0;i<source.length&&(event=source[i],allowSelectionOnly?!event.ranges||event.equals(doc.sel):event.ranges);i++);if(i!=source.length){for(hist.lastOrigin=hist.lastSelOrigin=null;event=source.pop(),event.ranges;){if(pushSelectionToHistory(event,dest),allowSelectionOnly&&!event.equals(doc.sel))return void setSelection(doc,event,{clearRedo:!1});selAfter=event}var antiChanges=[];pushSelectionToHistory(selAfter,dest),dest.push({changes:antiChanges,generation:hist.generation}),hist.generation=event.generation||++hist.maxGeneration;for(var filter=hasHandler(doc,"beforeChange")||doc.cm&&hasHandler(doc.cm,"beforeChange"),i=event.changes.length-1;i>=0;--i){var change=event.changes[i];if(change.origin=type,filter&&!filterChange(doc,change,!1))return void(source.length=0);antiChanges.push(historyChangeFromChange(doc,change));var after=i?computeSelAfterChange(doc,change):lst(source);makeChangeSingleDoc(doc,change,after,mergeOldSpans(doc,change)),!i&&doc.cm&&doc.cm.scrollIntoView({from:change.from,to:changeEnd(change)});var rebased=[];linkedDocs(doc,function(doc,sharedHist){sharedHist||-1!=indexOf(rebased,doc.history)||(rebaseHist(doc.history,change),rebased.push(doc.history)),makeChangeSingleDoc(doc,change,null,mergeOldSpans(doc,change))})}}}}function shiftDoc(doc,distance){if(0!=distance&&(doc.first+=distance,doc.sel=new Selection(map(doc.sel.ranges,function(range){return new Range(Pos(range.anchor.line+distance,range.anchor.ch),Pos(range.head.line+distance,range.head.ch))}),doc.sel.primIndex),doc.cm)){regChange(doc.cm,doc.first,doc.first-distance,distance);for(var d=doc.cm.display,l=d.viewFrom;l<d.viewTo;l++)regLineChange(doc.cm,l,"gutter")}}function makeChangeSingleDoc(doc,change,selAfter,spans){if(doc.cm&&!doc.cm.curOp)return operation(doc.cm,makeChangeSingleDoc)(doc,change,selAfter,spans);if(change.to.line<doc.first)return void shiftDoc(doc,change.text.length-1-(change.to.line-change.from.line));if(!(change.from.line>doc.lastLine())){if(change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|