Hueman Addons - Version 2.0.10

Version Description

April 28th 2017 = * added : customizer help blocks * improved : customizer performance on load * improved : sharre bar behaviour for mobile devices and on scroll

Download this release

Release Info

Developer nikeo
Plugin Icon 128x128 Hueman Addons
Version 2.0.10
Comparing to
See all releases

Code changes from version 2.0.9 to 2.0.10

addons/assets/czr/css/czr-control-base.css CHANGED
@@ -654,7 +654,81 @@ span.czr-panel-subtitle {
654
  display: block;
655
  font-size: 12px;
656
  font-style: italic;
657
- }/*******************************************************************
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  * DYNAMIC CONTROLS : sidebars, socials, ...
659
  ********************************************************************/
660
  .czr-open-pre-add-new {
@@ -873,6 +947,7 @@ span.czr-panel-subtitle {
873
  .width-100 .czr-input, .czr-sub-set .customize-control-title.width-100 {
874
  width: 100%;
875
  }
 
876
  .czr-sub-set .customize-control-title {
877
  float: left;
878
  width: 40%;
@@ -883,6 +958,14 @@ span.czr-panel-subtitle {
883
  .rtl.wp-customizer .czr-sub-set .customize-control-title {
884
  float: right;
885
  }
 
 
 
 
 
 
 
 
886
  .czr-item-title .fa {
887
  font-size: 18px;
888
  }
@@ -1049,7 +1132,7 @@ span.czr-panel-subtitle {
1049
 
1050
  /* MODULE OPTIONS ICON AND PANEL*/
1051
  .czr-toggle-modopt {
1052
- color: #95a5a6;
1053
  text-shadow: 1px 1px 0px white;
1054
  -webkit-transition: color 0.4s;
1055
  transition: color 0.4s;
@@ -1387,6 +1470,87 @@ section .czr-sub-set:first-child {
1387
  .czr_slide_module .slide-title {
1388
  padding-left: 5px;
1389
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1390
  .in-sub-panel #czr-donate-customizer,
1391
  .in-sub-panel .czr-cta-wrap {
1392
  left: -450px;
@@ -1746,8 +1910,12 @@ body .select2-container {
1746
  outline: none;
1747
  }
1748
 
1749
-
1750
-
 
 
 
 
1751
 
1752
 
1753
  /* SPECIFIC INPUT STYLE */
@@ -1925,21 +2093,44 @@ body.czr-customize-content_editor-pane-resize #customize-preview:before {
1925
  .czr-sub-set[data-input-type="content_picker"] .czr-input {
1926
  width: 100%;
1927
  }
 
 
 
 
 
 
 
1928
  .content-item-bar {
1929
- line-height: 1.5em;
 
 
 
 
 
 
 
 
 
 
1930
  }
1931
 
1932
- .czr-sub-set[data-input-type="content_picker"] span.item-title {
1933
  display: block;
1934
  float: left;
1935
  max-width: 80%;
 
 
 
 
 
1936
  }
1937
 
1938
- .czr-sub-set[data-input-type="content_picker"] span.item-type {
1939
  display: inline-block;
1940
  padding: 0;
1941
  padding-right: 10px;
1942
  float: right;
 
1943
  }
1944
 
1945
 
@@ -2527,6 +2718,11 @@ body.czr-editing-sektion #customize-preview {
2527
  background-color: #fcad06;
2528
  }
2529
 
 
 
 
 
 
2530
 
2531
  /* HEADER AND SCOPE SWITCHER */
2532
  .czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header {
@@ -2635,7 +2831,7 @@ h2.czr-current-skope-title {
2635
  }
2636
  .czr-scope-switcher .active, .czr-scope-switcher .czr-scope:hover {
2637
  opacity: 1;
2638
- /*border-bottom: 2px solid #52ff3f;*/
2639
  }
2640
  .czr-skopes-wrapper {
2641
  overflow: hidden;
@@ -2766,7 +2962,7 @@ h2.czr-current-skope-title {
2766
 
2767
  /* DIALOG BOX REACTIONS */
2768
  .active .czr-scope-switch {
2769
- color: #52ff3f;
2770
  cursor:inherit;
2771
  }
2772
 
@@ -2785,7 +2981,7 @@ h2.czr-current-skope-title {
2785
  }
2786
 
2787
  .is_winner .czr-scope-winner {
2788
- color: #52ff3f;
2789
  font-size: 14px;
2790
  position: absolute;
2791
  bottom: 2px;
@@ -2797,7 +2993,7 @@ h2.czr-current-skope-title {
2797
  }
2798
 
2799
  /* Underline skope switch text in control notices and in the main skope switcher title */
2800
- .czr-skope-notice .czr-skope-switch, .czr-scope-switcher .czr-skope-switch {
2801
  cursor: pointer;
2802
  text-decoration: underline;
2803
  }
@@ -2894,7 +3090,9 @@ body.czr-skop-loading #czr-skope-pane {
2894
  top : 0;
2895
  }
2896
  body.czr-skop-loading #customize-preview {
2897
- opacity: 0!important;
 
 
2898
  }
2899
 
2900
  /* Pure CSS loader */
@@ -2973,12 +3171,11 @@ body.czr-skop-loading #customize-preview {
2973
 
2974
 
2975
 
2976
- /* TOP NOTE ( for Welcome, etc ) */
2977
- #czr-top-note {
 
2978
  position: absolute;
2979
  text-align: center;
2980
- padding: 2%;
2981
- top : -100%;
2982
  right: 0;
2983
  left: 0;
2984
  z-index: 20;
@@ -2990,16 +3187,10 @@ body.czr-skop-loading #customize-preview {
2990
  -o-transition: all, 0.3s ease-in-out;
2991
  transition: all 0.3s ease-in-out;
2992
  visibility: hidden;
2993
- background: rgba(0, 0, 0, 0.80);
2994
- }
2995
- #czr-top-note h2 {
2996
- color: #fff;
2997
- font-size: 25px
2998
- }
2999
- #czr-top-note a {
3000
- color: #fff;
3001
  }
3002
- #czr-top-note .czr-top-note-close {
 
 
3003
  position: absolute;
3004
  top: 10px;
3005
  right: 25px;
@@ -3007,26 +3198,56 @@ body.czr-skop-loading #customize-preview {
3007
  cursor: pointer;
3008
  }
3009
 
3010
- #czr-top-note .fa-arrow-left {
3011
  position: absolute;
3012
  bottom: 10px;
3013
  left: 25px;
3014
  font-size: 40px;
3015
  }
3016
- #czr-top-note .czr-note-content {
3017
  display: inline-block;
3018
  line-height: 20px;
3019
  width: 80%;
3020
  }
3021
- #czr-top-note .czr-note-message {
3022
  font-size: 16px;
3023
- line-height: 20px;
 
3024
  }
 
 
 
 
 
3025
  body.czr-top-note-open #czr-top-note {
3026
  top: 0;
3027
  visibility: inherit;
3028
  }
3029
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3030
 
3031
 
3032
 
@@ -3094,7 +3315,13 @@ body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper {
3094
 
3095
  /* CONTROL INFOS */
3096
  .customize-control .czr-skope-notice {
3097
- color: #0029ff;
 
 
 
 
 
 
3098
  }
3099
 
3100
  .czr-toggle-notice {
@@ -3108,7 +3335,7 @@ body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper {
3108
  display: none;
3109
  }
3110
  .czr-notice-visible .czr-toggle-notice, .czr-toggle-notice:hover {
3111
- color: #0029ff;
3112
  }
3113
 
3114
 
@@ -3161,6 +3388,4 @@ body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper {
3161
  -ms-transition: background .3s ease-in-out!important;
3162
  -o-transition: background .3s ease-in-out!important;
3163
  transition: background .3s ease-in-out!important;
3164
- }
3165
-
3166
-
654
  display: block;
655
  font-size: 12px;
656
  font-style: italic;
657
+ }
658
+
659
+ /* PRO BLOCK BEFORE SECTIONS AND PANELS TITLE */
660
+ .pro-title-block {
661
+ background: #f0ad4e;
662
+ border: 1px solid #eea236;
663
+ padding: 0px 6px;
664
+ font-size: 0.7em;
665
+ display: inline-block;
666
+ margin-right: 3px;
667
+ bottom: 2px;
668
+ position: relative;
669
+ color: #fff;
670
+ webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
671
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
672
+ border-radius: 3px;
673
+ -webkit-user-select: none;
674
+ -moz-user-select: none;
675
+ -ms-user-select: none;
676
+ }
677
+
678
+
679
+ /* GOPRO SECTION STYLE */
680
+ /* for both hueman and customizr */
681
+ #customize-controls .control-section-czr-customize-section-pro .accordion-section-title:hover,
682
+ #customize-controls .control-section-czr-customize-section-pro .accordion-section-title:focus {
683
+ background-color: #fff;
684
+ }
685
+ #customize-theme-controls .control-section-czr-customize-section-pro .accordion-section-title:after {
686
+ content: none;
687
+ }
688
+ #accordion-section-go_pro_sec .accordion-section-title{
689
+ margin: 0 0 15px;
690
+ }
691
+ .control-section-czr-customize-section-pro .accordion-section-title .button {
692
+ font-size: 15px;
693
+ line-height: 24px;
694
+ height: 30px;
695
+ padding: 1px 20px;
696
+ display: inline-block;
697
+ color: #fff;
698
+ background: #f0ad4e;
699
+ border: 1px solid #eea236;
700
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
701
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
702
+ text-align: center;
703
+ white-space: nowrap;
704
+ vertical-align: middle;
705
+ cursor: pointer;
706
+ border-radius: 3px;
707
+ -webkit-transition: all 0.2s ease-in-out;
708
+ -moz-transition: all 0.2s ease-in-out;
709
+ -o-transition: all 0.2s ease-in-out;
710
+ -ms-transition: all 0.2s ease-in-out;
711
+ transition: all 0.2s ease-in-out;
712
+ -webkit-user-select: none;
713
+ -moz-user-select: none;
714
+ -ms-user-select: none;
715
+ user-select: none;
716
+ margin-top: -4px;
717
+ font-weight: 400;
718
+ margin-left: 8px;
719
+
720
+ }
721
+ .control-section-czr-customize-section-pro .accordion-section-title .button:hover {
722
+ color: #fff;
723
+ background: #ed9c28;
724
+ border-color: #d58512;
725
+ }
726
+ .rtl .control-section-czr-customize-section-pro .accordion-section-title .button {
727
+ margin-left: 0;
728
+ margin-right: 8px;
729
+ }
730
+
731
+ /* END GO PRO SECTION STYLE *//*******************************************************************
732
  * DYNAMIC CONTROLS : sidebars, socials, ...
733
  ********************************************************************/
734
  .czr-open-pre-add-new {
947
  .width-100 .czr-input, .czr-sub-set .customize-control-title.width-100 {
948
  width: 100%;
949
  }
950
+
951
  .czr-sub-set .customize-control-title {
952
  float: left;
953
  width: 40%;
958
  .rtl.wp-customizer .czr-sub-set .customize-control-title {
959
  float: right;
960
  }
961
+
962
+ /* DISABLED STATE */
963
+ .disabled .customize-control-title, .disabled .czr-input {
964
+ opacity: 0.6;
965
+ filter: blur(1px);
966
+ -webkit-filter: blur(1px);
967
+ }
968
+
969
  .czr-item-title .fa {
970
  font-size: 18px;
971
  }
1132
 
1133
  /* MODULE OPTIONS ICON AND PANEL*/
1134
  .czr-toggle-modopt {
1135
+ color: #495050;
1136
  text-shadow: 1px 1px 0px white;
1137
  -webkit-transition: color 0.4s;
1138
  transition: color 0.4s;
1470
  .czr_slide_module .slide-title {
1471
  padding-left: 5px;
1472
  }
1473
+
1474
+ .slide-mod-skope-notice {
1475
+ padding: 3%;
1476
+ background: rgba(116, 210, 116, 0.42);
1477
+ float: left;
1478
+ font-size: 12px;
1479
+ line-height: 1.5em;
1480
+ }
1481
+ /* Underline skope switch text in control notices and in the main skope switcher title */
1482
+ .slide-mod-skope-notice .czr-skope-switch {
1483
+ cursor: pointer;
1484
+ text-decoration: underline;
1485
+ }
1486
+
1487
+ .modopts-top-buttons {
1488
+ width: 100%;
1489
+ float: left;
1490
+ margin-bottom: 4%;
1491
+ text-align: center;
1492
+ }
1493
+
1494
+ .item-bottom-buttons {
1495
+ width: 100%;
1496
+ float: left;
1497
+ padding: 1% 0;
1498
+ }
1499
+ .item-bottom-btn {
1500
+
1501
+ }
1502
+ .item-bottom-btn, .modopt-top-btn {
1503
+ opacity: 1;
1504
+ color: #fff;
1505
+ font-size: 14px;
1506
+ cursor: pointer;
1507
+ border-width: 1px;
1508
+ -webkit-appearance: none;
1509
+ -webkit-border-radius: 3px;
1510
+ border-radius: 4px;
1511
+ -webkit-box-sizing: border-box;
1512
+ -moz-box-sizing: border-box;
1513
+ box-sizing: border-box;
1514
+ -webkit-transition: all 0.2s ease-in-out;
1515
+ -moz-transition: all 0.2s ease-in-out;
1516
+ -ms-transition: all 0.2s ease-in-out;
1517
+ -o-transition: all 0.2s ease-in-out;
1518
+ transition: all 0.2s ease-in-out;
1519
+ opacity: 1;
1520
+ }
1521
+ .item-bottom-btn {
1522
+ background: #868686;
1523
+ width: 47%;
1524
+ margin-right: 2%;
1525
+ padding: 1% 0;
1526
+ }
1527
+ .modopt-top-btn {
1528
+ background: rgba(171, 171, 171, 0.5);
1529
+ width: 170px;
1530
+ padding: 2px 0;
1531
+ }
1532
+ .item-bottom-btn:hover {
1533
+ background: #5d5d5d;
1534
+ }
1535
+ .modopt-top-btn:hover {
1536
+ background:rgba(41, 41, 41, 0.53);
1537
+ }
1538
+
1539
+ .item-bottom-btn[disabled], .modopt-top-btn[disabled], .item-bottom-btn[disabled]:hover, .modopt-top-btn[disabled]:hover {
1540
+ opacity: 0.4;
1541
+ cursor: default;
1542
+ -webkit-box-shadow: none !important;
1543
+ box-shadow: none !important;
1544
+ /*border: none!important;*/
1545
+ background: inherit;
1546
+ }
1547
+
1548
+
1549
+ /* NOTICES */
1550
+ .czr-notice {
1551
+ font-size: 12px;
1552
+ font-weight: normal;
1553
+ }
1554
  .in-sub-panel #czr-donate-customizer,
1555
  .in-sub-panel .czr-cta-wrap {
1556
  left: -450px;
1910
  outline: none;
1911
  }
1912
 
1913
+ /* Old SELECT2
1914
+ * https://github.com/presscustomizr/themes-customizer-fmk/issues/30
1915
+ */
1916
+ body .select2-drop {
1917
+ z-index: 1000000;
1918
+ }
1919
 
1920
 
1921
  /* SPECIFIC INPUT STYLE */
2093
  .czr-sub-set[data-input-type="content_picker"] .czr-input {
2094
  width: 100%;
2095
  }
2096
+ .content-picker-item {
2097
+ height: 2em;
2098
+ }
2099
+ .content-picker-item .czr-picker-item-type {
2100
+ float: right;
2101
+ display: inline-block;
2102
+ }
2103
  .content-item-bar {
2104
+ line-height: 1.2em;
2105
+ font-size: 0.9em;
2106
+ }
2107
+ .content-item-bar .czr-picker-item-title {
2108
+ display: block;
2109
+ float: left;
2110
+ max-width: 80%;
2111
+ text-overflow: ellipsis;
2112
+ overflow: hidden;
2113
+ font-size: 13px;
2114
+ line-height: 1.3em;
2115
  }
2116
 
2117
+ .czr-sub-set[data-input-type="content_picker"] span.czr-picker-item-title {
2118
  display: block;
2119
  float: left;
2120
  max-width: 80%;
2121
+ text-overflow: ellipsis;
2122
+ overflow: hidden;
2123
+ font-size: 14px;
2124
+ line-height: 2em;
2125
+ color: #000;
2126
  }
2127
 
2128
+ .czr-sub-set[data-input-type="content_picker"] span.czr-picker-item-type {
2129
  display: inline-block;
2130
  padding: 0;
2131
  padding-right: 10px;
2132
  float: right;
2133
+ line-height: 2em;
2134
  }
2135
 
2136
 
2718
  background-color: #fcad06;
2719
  }
2720
 
2721
+ /* FIX CUSTOMIZE INFO OVERLAPPING SKOPE SWITCHER */
2722
+ .czr-skop-on #customize-controls .customize-info.is-in-view, #customize-controls .customize-section-title.is-in-view {
2723
+ opacity: 0;
2724
+ }
2725
+
2726
 
2727
  /* HEADER AND SCOPE SWITCHER */
2728
  .czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header {
2831
  }
2832
  .czr-scope-switcher .active, .czr-scope-switcher .czr-scope:hover {
2833
  opacity: 1;
2834
+ /*border-bottom: 2px solid #59b15c;*/
2835
  }
2836
  .czr-skopes-wrapper {
2837
  overflow: hidden;
2962
 
2963
  /* DIALOG BOX REACTIONS */
2964
  .active .czr-scope-switch {
2965
+ color: #59b15c;
2966
  cursor:inherit;
2967
  }
2968
 
2981
  }
2982
 
2983
  .is_winner .czr-scope-winner {
2984
+ color: #59b15c;
2985
  font-size: 14px;
2986
  position: absolute;
2987
  bottom: 2px;
2993
  }
2994
 
2995
  /* Underline skope switch text in control notices and in the main skope switcher title */
2996
+ .czr-skope-switch {
2997
  cursor: pointer;
2998
  text-decoration: underline;
2999
  }
3090
  top : 0;
3091
  }
3092
  body.czr-skop-loading #customize-preview {
3093
+ /*opacity: 0!important;*/
3094
+ filter: blur(3px);
3095
+ -webkit-filter: blur(3px);
3096
  }
3097
 
3098
  /* Pure CSS loader */
3171
 
3172
 
3173
 
3174
+ /* PREVIEW NOTIFICATIONS BLOCKS ( for Welcome, etc ) */
3175
+ /* COMMONS */
3176
+ #czr-top-note, #czr-bottom-infos {
3177
  position: absolute;
3178
  text-align: center;
 
 
3179
  right: 0;
3180
  left: 0;
3181
  z-index: 20;
3187
  -o-transition: all, 0.3s ease-in-out;
3188
  transition: all 0.3s ease-in-out;
3189
  visibility: hidden;
 
 
 
 
 
 
 
 
3190
  }
3191
+ .czr-preview-notification a, .czr-preview-notification h2 {color: #fff; margin: 1em 0;}
3192
+
3193
+ .czr-preview-notification .czr-preview-note-close {
3194
  position: absolute;
3195
  top: 10px;
3196
  right: 25px;
3198
  cursor: pointer;
3199
  }
3200
 
3201
+ .czr-preview-notification .fa-arrow-left {
3202
  position: absolute;
3203
  bottom: 10px;
3204
  left: 25px;
3205
  font-size: 40px;
3206
  }
3207
+ .czr-preview-notification .czr-note-content {
3208
  display: inline-block;
3209
  line-height: 20px;
3210
  width: 80%;
3211
  }
3212
+ .czr-preview-notification .czr-note-message {
3213
  font-size: 16px;
3214
+ line-height: 1.5em;
3215
+ margin: 0.5em 0;
3216
  }
3217
+
3218
+ /* TOP NOTE */
3219
+ #czr-top-note { top : -100%; background: rgba(0, 0, 0, 0.80); padding: 2%;}
3220
+ #czr-top-note h2 {font-size: 25px; }
3221
+
3222
  body.czr-top-note-open #czr-top-note {
3223
  top: 0;
3224
  visibility: inherit;
3225
  }
3226
 
3227
+ /* BOTTOM SKOPE INFOS */
3228
+ #czr-bottom-infos { bottom : -100%; background-color: rgba(0, 0, 0, 0.85);padding: 1px;}
3229
+ body.czr-bottom-infos-open #czr-bottom-infos {
3230
+ bottom: 0;
3231
+ visibility: inherit;
3232
+ }
3233
+ #czr-bottom-infos .czr-note-content .czr-note-message {
3234
+ font-size: 13px;
3235
+ }
3236
+ #czr-bottom-infos .action-links-wrap {
3237
+ width: 100%;
3238
+ }
3239
+ #czr-bottom-infos .action-link {
3240
+ font-style: italic;
3241
+ display: inline-block;
3242
+ width: 40%;
3243
+ }
3244
+ #czr-bottom-infos .action-link a:hover {
3245
+ color: #fff;
3246
+ }
3247
+ .czr-disable-bottom-infos {
3248
+ text-decoration: underline;
3249
+ cursor: pointer;
3250
+ }
3251
 
3252
 
3253
 
3315
 
3316
  /* CONTROL INFOS */
3317
  .customize-control .czr-skope-notice {
3318
+ color: #3a3a3a;
3319
+ font-family: Verdana, 'DejaVu Sans', 'Bitstream Vera Sans', 'Geneva', sans-serif;
3320
+ font-size: 10px;
3321
+ line-height: 1.5em;
3322
+ font-style: normal;
3323
+ border-left: 3px solid rgba(99, 99, 99, 0.36);
3324
+ padding-left: 5px;
3325
  }
3326
 
3327
  .czr-toggle-notice {
3335
  display: none;
3336
  }
3337
  .czr-notice-visible .czr-toggle-notice, .czr-toggle-notice:hover {
3338
+ color: rgba(0, 0, 0, 0.67);
3339
  }
3340
 
3341
 
3388
  -ms-transition: background .3s ease-in-out!important;
3389
  -o-transition: background .3s ease-in-out!important;
3390
  transition: background .3s ease-in-out!important;
3391
+ }
 
 
addons/assets/czr/css/czr-control-base.min.css CHANGED
@@ -1 +1 @@
1
- .rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:440px}i.czr-notice,span.czr-notice{display:block;clear:both}.tabs nav ul,li.czr-module-candidate.gu-mirror,li.czr-single-module.gu-mirror{list-style:none}.wp-customizer a{color:#000}.wp-customizer a:focus,.wp-customizer a:hover{color:#0073aa}.wp-customizer .wp-full-overlay.expanded{margin-left:440px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-440px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-440px}.accordion-sub-container.control-panel-content{left:440px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:440px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-440px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-440px}.rtl .accordion-sub-container.control-panel-content{right:440px}.customize-section-description-container+#customize-control-custom_css:last-child{margin:0;width:100%}li#customize-control-custom_css textarea{font-size:13px;background:#394143;color:#95ff0c;min-height:300px}@media screen and (max-width:1400px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:380px}.wp-customizer .wp-full-overlay.expanded{margin-left:380px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-380px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-380px}.accordion-sub-container.control-panel-content{left:380px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:380px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-380px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-380px}.rtl .accordion-sub-container.control-panel-content{right:380px}}@media screen and (max-width:979px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:300px}.wp-customizer .wp-full-overlay.expanded{margin-left:300px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-300px}.accordion-sub-container.control-panel-content{left:300px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:300px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-300px}.rtl .accordion-sub-container.control-panel-content{right:300px}}@media screen and (max-width:640px){.wp-customizer .customize-controls-preview-toggle{height:46px;border-bottom:1px solid #ddd;left:87px}.wp-customizer .wp-full-overlay.expanded{margin-left:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-100%}.accordion-sub-container.control-panel-content{left:100%}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title,.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}.rtl .accordion-sub-container.control-panel-content{right:100%}}.wp-customizer .control-section.control-panel .accordion-section-title .panel-title{font-size:24px;font-weight:inherit;line-height:30px}.wp-core-ui h3{color:#555}.accordion-section-title:after,.control-section.control-panel>.accordion-section-title:after,.handlediv,.item-edit,.sidebar-name-arrow,.widget-action,.wp-customizer #available-menu-items .menu-item-handle:hover .item-add,.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus,.wp-customizer #customize-controls .customize-info .customize-help-toggle:hover,.wp-customizer #customize-controls .customize-info.open .customize-help-toggle,.wp-customizer .menu-item-handle:hover,.wp-customizer .menu-item-handle:hover .item-edit,.wp-customizer .menu-item-handle:hover .item-type{color:#00a0d2}.accordion-section-content{padding:10px 10px 15px 20px}.customize-control-title{line-height:19px}.wp-customizer #customize-theme-controls .accordion-section-content{background:#fff}.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus:before,.wp-customizer .customize-screen-options-toggle:focus:before{-webkit-box-shadow:0 0 0 1px #00a0d2;box-shadow:0 0 0 1px #00a0d2;-webkit-border-radius:100%;border-radius:100%}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#00a0d2!important}.customize-control input[type=text]{line-height:23px}li[id*=customize-control-]{padding:2%;width:96%;border:1px solid rgba(221,221,221,.43);box-shadow:1px 0 2px 0 rgba(204,204,204,.45);-webkit-box-shadow:1px 0 2px 0 rgba(204,204,204,.45);margin:8px 0}.control-section .accordion-section-content{overflow-y:auto}.wp-customizer .control-section h3.accordion-section-title{padding:10px 25px 11px 14px}.wp-customizer #customize-controls h3{font-size:15px;font-weight:400}.control-section .accordion-section-title:after{top:7px}.control-section.control-panel .accordion-section-title:after{top:11px;-webkit-transition:right .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:right .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:right .3s ease-in-out,opacity .3s ease-in-out;-o-transition:right .3s ease-in-out,opacity .3s ease-in-out;transition:right .3s ease-in-out,opacity .3s ease-in-out;right:10px;opacity:.7}.rtl .control-section.control-panel .accordion-section-title:after{-webkit-transition:left .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:left .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:left .3s ease-in-out,opacity .3s ease-in-out;-o-transition:left .3s ease-in-out,opacity .3s ease-in-out;transition:left .3s ease-in-out,opacity .3s ease-in-out;left:10px;right:initial}#customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{right:8px;opacity:1;color:#666!important}.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{left:6px;right:initial}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after,.control-section.control-panel>.accordion-section-title:after{background:0 0!important;border:none!important}#customize-theme-controls h3.accordion-section-title{-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.customize-control-checkbox label,.customize-control-nav_menu_auto_add label,.customize-control-radio label{line-height:16px;margin-left:0}input::-webkit-input-placeholder{color:#9A9A9A;font-style:italic}input:-moz-placeholder{color:#9A9A9A;font-style:italic}input::-moz-placeholder{color:#9A9A9A;font-style:italic}input:-ms-input-placeholder{color:#9A9A9A;font-style:italic}.czr-customizr-title{text-transform:uppercase;margin:1em 0 5px;font-size:15px!important;border-bottom:1px dotted #00a0d2;padding-bottom:5px;text-align:center}h3.czr-customizr-title::before{content:'\00b7';padding-right:3px}h3.czr-customizr-title::after{content:'\00b7';padding-left:3px}.czr-after-button{border-color:#fff;margin-top:15px}.czr-emphasize{line-height:1.2em;color:#2E2E2E}span.czr-notice{color:#313131;font-size:12px;font-style:italic;line-height:18px}.czr-customizer-separator-invisible{border:none;margin-top:15px}.czr-skin-gen-label{float:left}.czr-skin-gen-color-picker{float:right}.czr-number-label{float:left}.czr-number-input{float:right}.czr-check-label{float:left;max-width:85%}.rtl .czr-check-label{float:right}input[type=checkbox],input[type=radio]{float:right;min-height:18px}.czr-font-select{float:left}li#customize-control-tc_theme_options-tc_custom_css textarea{font-size:14px;background:#394143;color:#E2E728;min-height:300px}.customize-control .czr-navigate-to-post-list{color:#00a0d2;font-weight:700;float:left;clear:both;width:100%;margin-bottom:8px}.czr-sub-control{padding-left:13%;max-width:87%;position:relative}.czr-sub-control:before{content:'';height:116%;background:#00a0d2;width:2%;position:absolute;left:7%}.customize-control-tc_cropped_image .upload-button{float:right}.customize-control-tc_cropped_image .remove-button{float:left;margin-right:3px}.customize-control-tc_cropped_image .actions{margin-bottom:32px}.customize-control-tc_cropped_image .current{margin-bottom:8px}.customize-control-tc_cropped_image .remove-button,.customize-control-tc_cropped_image .upload-button{white-space:normal;width:48%;height:auto}.customize-control-tc_cropped_image .current .container{min-height:40px;overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image .inner{line-height:20px;top:10px}.rtl .customize-control-tc_cropped_image .upload-button{float:left}.rtl .customize-control-tc_cropped_image .remove-button{float:right;margin-left:3px}.czr-layout-img{height:26px;padding-top:2px;border:1px solid #FFF}.czr-layout-title{padding:0 0 18px 12px;display:inline-block;line-height:0;vertical-align:middle}.customize-control-czr_multi_input{width:96%;border:1px solid #ccc;padding:2%}.czr-multi-input-wrapper{width:95%;padding:0 0 0 5%}.czr-multi-input-wrapper [data-input-type=color] .czr-input{float:left;clear:both}#customize-theme-controls #accordion-panel-czr-footer-panel{border-bottom:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{margin-top:10px}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-hu-header-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{border-top:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-general-panel,#customize-theme-controls #accordion-section-static_front_page{margin-bottom:10px}#customize-header-actions .customize-controls-close{left:45px}.customize-controls-close,.customize-controls-home{top:-1px}.customize-controls-home{display:block;position:absolute;left:0;width:45px;height:41px;padding:0 2px 0 0;background:#eee;border:none;border-top:4px solid #eee;border-right:1px solid #ddd;border-bottom:1px solid #ddd;color:#444;text-align:left;cursor:pointer;text-decoration:none;-webkit-transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;transition:color .1s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.czr-add-success,.czr-location-alert,.tabs nav,.tabs nav ul li{text-align:center}.customize-controls-home:before{font-size:17px;line-height:45px;position:relative;top:-4px;left:15px}.customize-controls-home:hover{background:#fff;color:#0073aa;border-top-color:#0073aa;outline:0;-webkit-box-shadow:none;box-shadow:none}.rtl.wp-customizer #customize-header-actions .customize-controls-close{right:45px;left:auto}.rtl.wp-customizer .customize-controls-home{left:auto;right:0;border-right:0;border-left:1px solid #ddd}.control-panel-content .hu-menu-notice{margin-left:3%}span.czr-panel-subtitle{display:block;font-size:12px;font-style:italic}.czr-open-pre-add-new{display:block;float:left;margin:2% 2% 0;width:99%;padding:2%;background:#3b8dbd;opacity:1;color:#fff;font-size:16px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-open-pre-add-new.active{background:#646464;opacity:.5;border-radius:3px 3px 0 0}.czr-adding-new .czr-items-wrapper,.czr-items-wrapper .inactive{opacity:.6}.czr-single-item{padding:0;border:1px solid #ccc;margin:1% 0 0 2%;float:left;width:98%;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-single-item .czr-item-content input,.czr-sub-set{margin-bottom:0}#customize-theme-controls .czr-single-item.open{border:1px solid #dedede}#customize-theme-controls .mono-item-mod .czr-single-item{border:1px solid #ccc}.czr-single-item .czr-item-content,.czr-single-item .czr-item-header{padding:1%}.czr-items-wrapper .czr-single-item .czr-builtin-model{background:#E1DFDF;color:#555}.czr-item-sort-handle{cursor:move}.czr-single-item .czr-item-header{position:relative;background:#dfdfdf;color:#fff;float:left;width:98%;-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.czr_widget_areas_module .czr-single-item .czr-custom-model{background:#3b8dbd}. .czr-single-item .czr-custom-model:hover{background:#aaa}.czr-items-wrapper .czr-single-item .czr-builtin-model:hover,.czr-single-item .czr-item-header:hover{background:#ccc}.czr-move-icon{position:absolute;top:-2px;left:3px;font-size:10px;color:#999}.czr-item-title{float:left;font-size:17px;color:#000;padding:7px;width:67%}.czr-inactive-alert{font-size:12px;font-style:italic}.czr_widget_areas_module .czr-item-title{color:#fff}.czr-builtin-model .czr-item-title{color:#23282d}.czr-item-title h4{margin:0}.czr-item-title .fa:before{padding-right:2px}.czr-item-btns{float:right}.czr-item-btns a{font-size:17px;padding:7px 5px;color:#777;-webkit-transition:color .1s ease-in-out;-moz-transition:color .1s ease-in-out;-ms-transition:color .1s ease-in-out;-o-transition:color .1s ease-in-out;transition:color .1s ease-in-out}.czr-item-btns a:active,.czr-item-btns a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.czr_widget_areas_module .czr-item-btns a{color:#fff}.czr-builtin-model .czr-item-btns a{color:#555}.czr-builtin-model .czr-item-btns .czr-edit-view.active,.czr-builtin-model .czr-item-btns .czr-edit-view:hover,.czr-item-btns .czr-edit-view.active,.czr-item-btns .czr-edit-view:hover{color:#00a0d2}.czr_widget_areas_module .czr-edit-view:hover,.czr_widget_areas_module .czr-item-btns .czr-edit-view.active{color:#000}.czr_widget_areas_module .czr-builtin-model .czr-edit-view.active,.czr_widget_areas_module .czr-builtin-model .czr-edit-view:hover{color:#00a0d2}.czr-item-btns .czr-display-alert.active,.czr-item-btns .czr-display-alert:hover{color:#23282d}.czr-single-item .czr-item-content{display:none;background:rgba(238,238,238,.5);clear:both;width:96%;padding:2%}.czr-sub-set{display:block;float:left;width:100%;padding:1% 0;position:relative}.czr-sub-set .czr-input{float:right;width:60%}.czr-sub-set .customize-control-title.width-100,.width-100 .czr-input{width:100%}.czr-sub-set .customize-control-title{float:left;width:40%;padding:1px 0;font-size:13px}.rtl.wp-customizer .czr-sub-set .customize-control-title{float:right}.czr-item-title .fa{font-size:18px}.czr-remove-alert-wrapper{display:none;clear:both;float:left;padding:2%;width:95%;margin:10px 0;text-shadow:0 1px 0 rgba(255,255,255,.5);background-color:#EEE;color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.czr-remove-alert-wrapper p{padding:5px;margin:0}.czr-pre-add-wrapper{position:relative;float:left;width:100%}.czr-pre-add-view-content{display:none;padding:3%;border:1px solid #00a0d2;border-top:none;margin:0 0 0 2%;float:left;width:92%;background:#eee;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;position:relative;opacity:1;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-ms-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.czr-model-added .czr-pre-add-view-content{opacity:.2}.czr-pre-add-wrapper .czr-add-new{background:#3b8dbd;color:#fff;-webkit-transition:background .5s linear;-moz-transition:background .5s linear;-ms-transition:background .5s linear;-o-transition:background .5s linear;transition:background .5s linear;float:right;border:none}.czr-add-success{width:100%;margin:0 0 0 2%;position:absolute;top:0;left:0;font-size:25px;opacity:0;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-ms-transition:opacity .1s linear;-o-transition:opacity .1s linear;transition:opacity .1s linear}.czr-model-added .czr-add-success{opacity:1}.czr-unavailable-location,body.czr-editing-modopt #customize-preview{opacity:.7}.czr-add-success p{vertical-align:middle;display:inline-block;line-height:35px;margin:0;font-size:25px;color:#82b965;padding:0 3%}.control-section-widget_zones_management{margin:10px 0;z-index:1}.czr-zone-infos{width:96%;padding:0 2%;font-size:12px;float:left;font-style:italic}.czr-location-alert{float:left;width:100%;padding:1% 0;margin:1% 0;border:1px solid orange;background:#FEE5B6;color:#000;font-size:11px;font-style:italic}.czr-toggle-modopt{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;right:0;padding-left:3px;font-size:25px;line-height:24px}.rtl.wp-customizer .czr-toggle-modopt{left:0;right:auto;padding-left:0;padding-right:3px}.czr-modopt-visible .czr-toggle-modopt,.czr-toggle-modopt:hover{color:#3b8dbd}body #customize-controls{-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;-ms-transition:opacity .4s ease-in-out;-o-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}body.czr-editing-modopt #customize-controls{opacity:.4}.czr-mod-opt-wrapper{position:absolute;top:0;bottom:0;left:-301px;opacity:0;overflow-x:hidden;overflow-y:auto;margin:0;z-index:4;width:60%;min-width:300px;padding:1% 2%;color:#fff;background:rgba(0,0,0,.8);-webkit-transition:all .18s ease-in-out;-moz-transition:all .18s ease-in-out;-ms-transition:all .18s ease-in-out;-o-transition:all .18s ease-in-out;transition:all .18s ease-in-out;border-right:1px solid #4c4c4c}body.czr-editing-modopt .czr-mod-opt-wrapper{left:0;visibility:visible;opacity:1}.czr-close-modopt{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}.czr-mod-opt-wrapper .czr-sub-set{background:rgba(238,238,238,.13);padding:3% 2%;width:96%;margin:5px 0}.tabs,.tabs nav ul{position:relative;margin:0 auto;overflow:hidden}.czr-mod-opt-wrapper .czr-notice{color:#fff}.czr-mod-opt-wrapper .mod-opt-title{color:#fff;border-bottom:1px solid #fff;padding:5% 0;text-align:center}.tabs{display:none;width:100%;font-weight:300;font-size:1.25em}.tabs nav ul{display:-ms-flexbox;display:-webkit-flex;display:-moz-flex;display:-ms-flex;display:flex;padding:0;max-width:1200px;-ms-box-orient:horizontal;-ms-box-pack:center;-webkit-flex-flow:row wrap;-moz-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center}.tabs nav a,.tabs nav ul li{position:relative;display:block}.tabs nav ul li{z-index:1;margin:0;-webkit-flex:1;-moz-flex:1;-ms-flex:1;flex:1}.tabs nav ul li.cols-4{width:25%}.tabs nav ul li.cols-3{width:33%}.tabs nav ul li.cols-2{width:50%}.tabs nav ul li.cols-1{width:100%}.tabs nav a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:2.5}li.tab-current::after,li.tab-current::before,li.tab-inactive::after{content:'';width:100%;position:absolute}.tabs nav a span{vertical-align:middle;font-size:.75em}.tabs nav li.tab-current a{color:#74777b}.tabs nav a:focus{outline:0}li.tab-current::after,li.tab-current::before{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(37,37,37,.63);box-shadow:4px 0 15px 0 rgba(37,37,37,.63);top:0;right:0;z-index:4}li.tab-current::before{left:0;-webkit-box-shadow:0 0 15px 4px rgba(37,37,37,.63);box-shadow:0 0 15px 4px rgba(37,37,37,.63)}li.tab-inactive::after{height:2px;bottom:-7px;left:0;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(0,0,0,.86)}.content-wrap{position:relative}.content-wrap section{display:none;margin:0 auto;max-width:1200px}section .czr-sub-set:first-child{margin:0}.content-wrap section.content-current,.no-flexbox nav ul{display:block}.no-flexbox nav ul li{min-width:15%;display:inline-block}.tabs-style-topline{max-width:1200px}.tabs-style-topline nav li{border:1px solid rgba(40,44,42,.1)}.czr-items-wrapper .tabs-style-topline nav li{border:none}.tabs-style-topline nav li:not(:last-child){border-right:none}.tabs-style-topline nav li.tab-current{border-top-color:#fff;border-bottom:none;background:rgba(238,238,238,.13)}.tabs-style-topline nav a{padding:.65em .5em;background:rgba(40,44,42,.05);color:#fff;line-height:1;-webkit-transition:color .2s;transition:color .2s;text-decoration:none}.czr-skp-switch-link:hover,.tabs-style-topline nav a:focus,.tabs-style-topline nav a:hover,.tabs-style-topline nav li.tab-current a{text-decoration:underline}.czr-items-wrapper .tabs-style-topline nav a{background:rgba(40,44,42,.45)}.tabs-style-topline nav li.tab-current a{background:0 0;box-shadow:inset 0 3px 0 #fff;color:#fff}.czr-items-wrapper .tabs-style-topline nav li.tab-current a{color:#000}.tabs-style-topline .icon::before{display:block;margin:0}.tabs-style-topline nav a span{text-transform:uppercase;letter-spacing:1px;font-weight:700}@media screen and (max-width:58em){.tabs nav a.icon span{display:none}.tabs nav a:before{margin-right:0}}.czr_slide_module .czr-item-title{padding:0 7px;height:32px}.czr_slide_module .slide-thumb,.czr_slide_module .slide-title{display:block;height:32px;line-height:32px;float:left}.czr_slide_module .slide-title{padding-left:5px}.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-450px;height:0}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-450px}@media screen and (max-width:1400px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-380px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-380px}}@media screen and (max-width:979px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-300px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-300px}}@media screen and (max-width:640px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-100%}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}}@media screen and (min-width:980px){.wp-customizer .expanded #customize-footer-actions{width:380px}}@media screen and (min-width:1401px){.wp-customizer .expanded #customize-footer-actions{width:440px}}.selecter-element{position:absolute;opacity:0}.selecter{display:block;float:right;margin:2px 0;position:relative;width:100%;z-index:100}.selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) right center no-repeat #F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;padding:4px 4.6%;position:relative;text-overflow:clip;z-index:49;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);height:auto;line-height:18px;width:90%}.selecter .selecter-options{border:1px solid #ccc;border-width:0 1px 1px;background-color:#fefefe;border-radius:0 0 3px 3px;box-shadow:0 1px 4px rgba(0,0,0,.15);display:none;left:0;margin:0;max-height:260px;overflow:auto;overflow-x:hidden;padding:0;position:relative;top:100%;width:99%;z-index:50}.selecter .selecter-group{background:#F9F9F9;border-bottom:1px solid #e3e3e3;color:#999;display:block;font-size:11px;padding:5px 10px 4px;text-transform:uppercase}.selecter .selecter-item{background:#fff;border-bottom:1px solid #e3e3e3;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;text-overflow:ellipsis;width:86%;height:auto;line-height:14px;padding:8px 24px 8px 10px}.selecter.disabled .selecter-group,.selecter.disabled .selecter-item,.selecter.disabled .selecter-selected{cursor:default;color:#ccc;border-color:#eee}.selecter .selecter-item.selected{background:#F9F9F9}.selecter .selecter-item.disabled{color:#999;cursor:default}.selecter .selecter-item:first-child{border-radius:0}.selecter .selecter-item:last-child{border-radius:0 0 2px 2px;border-bottom:0}.rtl .selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) 4% center no-repeat #F9F9F9}@media screen and (min-width:980px){.selecter .selecter-item.selected:hover,.selecter .selecter-item:hover{background-color:#f3f3f3}.selecter .selecter-item.disabled:hover,.selecter:hover .selecter-selected{background-color:#fff}.selecter.disabled .selecter-item:hover{background:#fff}}.selecter.open{z-index:101}.selecter.open .selecter-selected{border-radius:3px 3px 0 0;z-index:51}.selecter.focus .selecter-selected,.selecter.open .selecter-selected{background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.1)}.selecter.cover .selecter-options{border-radius:3px;border-width:1px;top:0}.selecter.cover .selecter-options .selecter-item.first{border-radius:3px 3px 0 0}.selecter.cover.open .selecter-selected{border-radius:3px 3px 0 0;z-index:49}.selecter.bottom .selecter-options{border-width:1px 1px 0;bottom:100%;top:auto}.selecter.bottom .selecter-item:last-child{border:none}.selecter.bottom.open .selecter-selected{border-radius:0 0 3px 3px}.selecter.bottom.open .selecter-options{border-radius:3px 3px 0 0}.selecter.bottom.cover.open .selecter-options,.selecter.bottom.cover.open .selecter-selected,.stepper{border-radius:3px}.selecter.bottom.cover .selecter-options{bottom:0;top:auto}.selecter.multiple .selecter-options{border-radius:3px;border-width:1px;box-shadow:none;display:block;position:static;width:100%}.selecter.disabled .selecter-selected{background:#fff}.selecter.disabled .selecter-options{background:#fff;border-color:#eee}.selecter.disabled .selecter-item.selected{background:#fafafa}.selecter .selecter-options.scroller{overflow:hidden}.selecter .selecter-options.scroller .scroller-content{max-height:260px;padding:0}@media screen and (max-width:740px){.selecter{max-width:100%}}@media screen and (max-width:500px){.selecter{max-width:100%}}.stepper{margin:0 0 10px;overflow:hidden;position:relative;width:35%;float:left;clear:both}.stepper .stepper-input{background:#F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;font-size:13px;line-height:1.2;margin:0;overflow:hidden;padding:5px 10px!important;width:100%!important;z-index:49;-moz-appearance:textfield;max-width:none!important}.stepper .stepper-input::-webkit-inner-spin-button,.stepper .stepper-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.stepper .stepper-input:focus{background-color:#fff}.stepper .stepper-arrow{background:url(img/jquery.fs.stepper-arrows.png) no-repeat #eee;border:1px solid #ccc;cursor:pointer;display:block;height:46%;position:absolute;right:0;text-indent:-99999px;width:20px;z-index:50}.stepper .stepper-arrow.up{background-position:center top;border-bottom:none;top:0}.stepper .stepper-arrow.down{background-position:center bottom;bottom:0}.rtl .stepper .stepper-input{text-align:left}@media screen and (min-width:740px){.stepper:hover .stepper-input{background-color:#fff}.stepper .stepper-step:hover{background-color:#F9F9F9}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}}.stepper.disabled .stepper-input{background:#fff;border-color:#eee;color:#ccc}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}.icheckbox_flat-green,.icheckbox_flat-grey,.iradio_flat-green,.iradio_flat-grey{display:inline-block;margin:0;padding:0;width:20px;height:20px;border:none;top:4px;vertical-align:middle}.icheckbox_flat-green,.iradio_flat-green{background:url(img/green.png) no-repeat;cursor:pointer;float:right}.rtl [class*=icheckbox_flat-]{float:left}.icheckbox_flat-green{background-position:0 0}.icheckbox_flat-green.checked{background-position:-22px 0}.icheckbox_flat-green.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-green.checked.disabled{background-position:-66px 0}.iradio_flat-green{background-position:-88px 0}.iradio_flat-green.checked{background-position:-110px 0}.iradio_flat-green.disabled{background-position:-132px 0;cursor:default}.iradio_flat-green.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-green,.iradio_flat-green{background-image:url(img/green@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.icheckbox_flat-grey,.iradio_flat-grey{background:url(img/grey.png) no-repeat;cursor:pointer;float:right}.icheckbox_flat-grey{background-position:0 0}.icheckbox_flat-grey.checked{background-position:-22px 0}.icheckbox_flat-grey.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-grey.checked.disabled{background-position:-66px 0}.iradio_flat-grey{background-position:-88px 0}.iradio_flat-grey.checked{background-position:-110px 0}.iradio_flat-grey.disabled{background-position:-132px 0;cursor:default}.iradio_flat-grey.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-grey,.iradio_flat-grey{background-image:url(img/grey@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.czr-sub-set .icheckbox_flat-green,.iradio_flat-green{float:left}body .select2-container{z-index:1000000;width:100%!important}.customize-control-czr_layouts .select2-selection--single{height:33px}.customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow{height:30px}.customize-control-czr_layouts .select2-selection--single:focus,.select2-selection__rendered:focus{outline:0}body .select2-container,span.select2-results{font-size:14px}.select2-container--default .select2-selection--multiple{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;width:99%;min-height:36px;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#00a0d2!important;-webkit-box-shadow:0 0 2px rgba(26,188,156,.8)!important;box-shadow:0 0 2px rgba(26,188,156,.8)!important}.select2-results__options li{margin-bottom:0}.select2-container--default .select2-selection--multiple .select2-selection__choice{padding:2px;font-size:13px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;margin-bottom:0}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#00a0d2}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{font-size:17px;position:relative;top:2px;color:#23282d}.customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered{padding:5px;line-height:16px}#czr-customize-content_editor-pane{border-top:solid 1px #ddd;position:absolute;height:300px;bottom:-301px;right:0;left:0;z-index:20;background:#f1f1f1;display:block;-webkit-transition:all .2s;transition:all .2s;visibility:hidden}body.czr-customize-content_editor-pane-resize #customize-preview,body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane{-webkit-transition:none;transition:none}body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{top:0}body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{bottom:0;visibility:inherit}#czr-customize-content_editor-pane .wp-editor-tools{padding-top:5px;padding-right:10px}#czr-customize-content_editor-pane .wp-media-buttons{padding-left:5px}#customize-preview{height:auto}body.czr-customize-content_editor-pane-open #customize-preview{bottom:300px}body.mce-fullscreen #customize-preview{bottom:0}body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen{position:relative;left:0}#wp-czr-customize-content_editor-container{border-left:0}#czr-customize-content_editor-dragbar{top:0;cursor:row-resize;display:block;height:4px;position:absolute;width:100%;z-index:21}body.czr-customize-content_editor-pane-resize #customize-preview:before{top:0;right:0;bottom:0;left:0;position:absolute;height:100%;width:100%;z-index:999999}.wp-customizer .ui-autocomplete.wplink-autocomplete{z-index:500110}.wp-customizer #wp-link-wrap{z-index:500105}.wp-customizer #wp_editbtns,.wp-customizer #wp_gallerybtns{z-index:500020}.wp-customizer #TB_overlay,.wp-customizer #TB_window{z-index:500050}.wp-customizer .mce-panel,.wp-customizer .mce-tooltip{z-index:500100!important}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar{bottom:308px}.czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar{-webkit-transition:none;transition:none}.czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar{bottom:8px!important}.czr-sub-set[data-input-type=content_picker] .customize-control-title,.czr-sub-set[data-input-type=content_picker] .czr-input{width:100%}.content-item-bar{line-height:1.5em}.czr-sub-set[data-input-type=content_picker] span.item-title{display:block;float:left;max-width:80%}.czr-sub-set[data-input-type=content_picker] span.item-type{display:inline-block;padding:0 10px 0 0;float:right}.rangeslider,.rangeslider__fill{display:block;-moz-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}.rangeslider{background:#e6e6e6;position:relative}.rangeslider--horizontal{height:20px;width:100%}.rangeslider--vertical{width:20px;min-height:150px;max-height:100%}.rangeslider--disabled{filter:alpha(Opacity=40);opacity:.4}.rangeslider__fill{background:#3b8dbd;position:absolute}.rangeslider--horizontal .rangeslider__fill{top:0;height:100%}.rangeslider--vertical .rangeslider__fill{bottom:0;width:100%}.rangeslider__handle{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g) #fff;border:1px solid #ccc;cursor:pointer;display:inline-block;width:40px;height:40px;position:absolute;background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(0,0,0,.1)));background-image:-moz-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:-webkit-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));-moz-box-shadow:0 0 8px rgba(0,0,0,.3);-webkit-box-shadow:0 0 8px rgba(0,0,0,.3);box-shadow:0 0 8px rgba(0,0,0,.3);-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;line-height:42px;text-align:center;color:#000;font-size:13px;font-weight:700}.rangeslider__handle:after{content:"";display:block;width:18px;height:18px;margin:auto;position:absolute;top:0;right:0;bottom:0;left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.13)),color-stop(100%,rgba(255,255,255,0)));background-image:-moz-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:-webkit-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%}.rangeslider--active .rangeslider__handle,.rangeslider__handle:active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,rgba(0,0,0,.12)));background-image:-moz-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:-webkit-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12))}.rangeslider--horizontal .rangeslider__handle{top:-10px;touch-action:pan-y;-ms-touch-action:pan-y}.rangeslider--vertical .rangeslider__handle{left:-10px;touch-action:pan-x;-ms-touch-action:pan-x}input[type=range]:focus+.rangeslider .rangeslider__handle{-moz-box-shadow:0 0 8px rgba(255,0,255,.9);-webkit-box-shadow:0 0 8px rgba(255,0,255,.9);box-shadow:0 0 8px rgba(255,0,255,.9)}.attachment-media-view button{color:#000;padding:5px 7px;line-height:1.5em}.czr-sektion-buttons{position:absolute;right:0}.czr-column{width:99%;margin-bottom:1%;float:left;padding:2% 0;border:2px dotted #aaa;text-align:center}.czr-column-header{position:relative}.czr-col-drag-handler{position:absolute;left:0;padding:1%;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-module-collection-wrapper{width:100%;min-height:5px;float:left}.czr-single-module{width:98%;float:left;min-height:20px;margin:1px 1%;border:1px solid #ccc}.czr-single-module textarea{max-width:100%}#customize-theme-controls .czr-single-module .czr-single-item{width:96%}.czr-mod-header{background:#eee;float:left;width:100%}.czr-mod-title{position:relative}.czr-mod-title>h4{float:left;width:70%;margin:2% 0}.czr-mod-drag-handler{position:absolute;left:0;padding:1%;margin:2% 0;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-mod-buttons{float:right;width:30%;margin:2% 0}.czr-mod-content{position:absolute;top:0;left:100%;float:left;width:100%;background:#d5e9cc;display:none}.czr-module-open #customize-info,.czr-module-open #customize-theme-controls{left:-200%}.czr-module-open #customize-theme-controls .accordion-section-content{overflow:visible}.czr-module-description-container{margin-bottom:15px}.czr-module-title{border-bottom:1px solid #ddd;background:#fff}.czr-module-title h3{padding:10px 10px 12px 14px;margin:0;color:#555;font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .czr-module-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;display:block;font-weight:400}.czr-module-back{display:block;float:left;width:48px;height:74px;padding:0 24px 0 0;margin:0;background:#fff;border:none;border-right:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;-webkit-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-moz-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-ms-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-o-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.czr-module-back:focus,.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.czr-module-back:before{font:400 20px/72px dashicons;content:"\f341";position:relative;left:13px}.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.gu-mirror{position:fixed!important;margin:0!important;z-index:999999!important;opacity:.8;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";filter:alpha(opacity=80)}#czr-module-list-panel,#czr-sektion-settings-panel{left:-301px;overflow-x:hidden;overflow-y:auto;z-index:4;bottom:0}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter:alpha(opacity=20)}.gu-unselectable .czr-module-collection-wrapper{width:98%;border:1px dotted green;background:#d1ffe0;min-height:31px}#czr-module-list-panel{position:absolute;top:0;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd}#czr-available-modules-filter,#czr-module-list-panel{width:45%;min-width:300px}body.czr-adding-module #czr-module-list-panel{left:0;visibility:visible;opacity:1}body.czr-adding-module #customize-preview{opacity:.7}.add-new-module:before{content:"\f132";display:inline-block;position:relative;left:-2px;top:-1px;font:400 20px/1 dashicons;vertical-align:middle;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.czr-column .add-new-module{margin:1%;float:right}body.czr-adding-module .add-new-module,body.czr-adding-module .add-new-module:hover{background:#eee;border-color:#929793;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}body.czr-adding-module .add-new-module:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#czr-available-modules-list{top:60px;position:absolute;overflow:auto;bottom:0;width:100%}#czr-available-modules-filter{position:fixed;top:0;z-index:1;background:rgba(0,0,0,.47);border-bottom:1px solid #e5e5e5;padding:12px 15px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#czr-available-modules-filter input{padding:6px 10px;width:100%}#czr-available-modules-list .czr-module-candidate{position:relative;border-bottom:1px solid #e5e5e5}#czr-available-modules-list .czr-module-candidate h3{color:#fff;padding:0;margin:0}#czr-available-modules-list .czr-mod-drag-handler{position:relative;left:0;padding:1%;margin:2% 4%;color:inherit;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}#czr-sektion-settings-panel{position:absolute;top:0;width:45%;min-width:300px;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd;color:#fff}#czr-sektion-settings-panel h3{color:#fff}body.czr-editing-sektion #czr-sektion-settings-panel{left:0;visibility:visible;opacity:1}body.czr-editing-sektion #customize-preview{opacity:.7}.czr-api-dirty input#save{background-color:#FFBD2E;border-color:#d99400;color:#000;text-shadow:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out;-ms-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.czr-api-dirty input#save:hover{background-color:#fcad06}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header{height:185px}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{top:185px}.wp-customizer .in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding:0 15px}.customize-controls-close{border-bottom:1px solid #ddd}.wp-customizer #customize-header-actions{border-bottom:0}.czr-scope-switcher{width:100%;float:right;position:absolute;left:0;bottom:0;overflow:hidden}.czr-scope-switcher .czr-skp-permanent-title{position:relative;color:#5f5f5f}#customize-header-actions .czr-scope-switcher .spinner{float:none;display:none;margin:0;left:-26px;top:0;position:absolute;visibility:visible}#czr-top-note,.czr-spinner-wrapper{visibility:hidden}h2.czr-current-skope-title{font-size:13px;line-height:21px;margin:6px 0 4px;text-align:center;height:63px;font-weight:400;overflow:hidden}.czr-main-title{max-height:24px;overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:nowrap;width:95%}.czr-skope-title{display:block;font-size:17px;font-style:italic;line-height:25px}.czr-toggle-title-notice{cursor:pointer;font-size:14px;color:#777}.czr-skope-inherits-from{display:inline-block;opacity:0;width:90%;font-size:12px;line-height:18px;color:#0029ff;top:-6px;position:relative}.notice-visible .czr-toggle-title-notice{color:#0029ff}.notice-visible .czr-skope-inherits-from{opacity:1;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope,.czr-scope-switcher .button{-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;float:left}.czr-scope-switcher .button{width:40%;text-align:center;margin:0 2%;opacity:.7;transition:opacity .3s ease-in-out}.czr-scope-switcher .button.active{font-weight:700;opacity:1}.czr-scope-switcher .active,.czr-scope-switcher .czr-scope:hover{opacity:1}.czr-skopes-wrapper{overflow:hidden;position:relative}.czr-scope-switcher .active:after,.czr-scope.active:before{position:absolute;content:'';top:0}.czr-scope.active:before{height:101%;float:left;z-index:1;-webkit-box-shadow:-4px 0 15px 0 rgba(119,119,119,.58);box-shadow:-4px 0 15px 0 rgba(119,119,119,.58)}.czr-scope-switcher .active:after{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(119,119,119,.58);z-index:3}.czr-skopes-wrapper .active-collection.local:after{right:0}.czr-scope-switcher .czr-scope:last-child:after{-webkit-box-shadow:none;box-shadow:none;right:0}.czr-scope-switcher .czr-scope:first-child:after{left:0}.czr-scope{width:30.5%;background:#fff;border-top:1px solid #ccc;overflow:hidden;opacity:.65;transition:opacity .3s ease-in-out}.czr-scope-switcher .width-100,.czr-scope.width-100.active:after,.czr-scope.width-100.active:before{width:100%}.czr-scope-switcher .width-50,.czr-scope.width-50.active:after,.czr-scope.width-50.active:before{width:50%}.czr-scope-switcher .width-33,.czr-scope.width-33.active:after,.czr-scope.width-33.active:before{width:33.33%}.czr-scope-switcher .width-25,.czr-scope.width-25.active:after,.czr-scope.width-25.active:before{width:25%}.czr-scope-footer,.czr-scope-header{width:100%;min-height:16px;position:relative;z-index:5}.inactive .czr-scope-footer:after{content:'';width:100%;position:absolute;height:5px;bottom:-7px;left:0;-webkit-box-shadow:0 0 13px 4px rgba(119,119,119,.85);box-shadow:0 0 13px 4px rgba(119,119,119,.85)}.czr-scope-content{height:35px;padding:0 3%;width:94%;line-height:35px;text-align:center;clear:both;color:#000;overflow:hidden}.czr-scope-content h4{margin:0;display:inline-block;text-align:center;font-size:14px;line-height:18px;font-weight:400;text-shadow:1px 1px 0 #dedede}.czr-reset-fail,.czr-reset-success,.czr-scope-force{display:none}.czr-scope .fa{font-size:10px;padding:2%;color:#585858;cursor:pointer;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope .czr-scope-footer .info{cursor:inherit}.czr-scope-header .czr-scope-switch{font-size:22px;padding:0 2px 0 0;text-shadow:1px 1px 2px #fff}.czr-skp-switch-link{cursor:pointer}.czr-pull-left{float:left}.czr-pull-right{float:right}.active .czr-scope-switch{color:#52ff3f;cursor:inherit}.czr-scope .czr-scope-reset{display:none;font-size:13px;text-shadow:1px 1px 0 #dedede}.has-db-val .czr-scope-reset{color:#00a0d2}.dirty .czr-scope-reset{color:#FFBD2E!important}.is_winner .czr-scope-winner{color:#52ff3f;font-size:14px;position:absolute;bottom:2px;left:2px}.czr-scope-switcher .czr-skope-switch,.czr-skope-notice .czr-skope-switch{cursor:pointer;text-decoration:underline}.czr-spinner{background:url(img/czr-spinner.gif) no-repeat;-webkit-background-size:32px 32px;background-size:32px 32px;display:inline-block;float:right;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:32px;height:32px;margin:4px 10px 0}.customize-control span.customize-control-title:first-child{padding-left:16px;-webkit-transition:left,right,.15s ease-in-out;-moz-transition:left,right,.15s ease-in-out;-ms-transition:left,right,.15s ease-in-out;-o-transition:left,right,.15s ease-in-out;transition:left,right,.15s ease-in-out;position:relative}.wp-customizer .customize-control.czr-not-skoped .customize-control-title{padding-left:0}#czr-skope-pane,#czr-top-note{padding:2%;z-index:20;text-align:center;position:absolute}.czr-setting-reset{color:#eee;-webkit-transition:color .4s;transition:color .4s;position:absolute;left:0;line-height:21px;display:none;text-shadow:1px 1px 0 #a0a0a0}#czr-top-note,.czr-resetting-control .czr-remove-alert-wrapper{-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out}.czr-global-skope-level .is-wp-authorized-setting.has-db-val .czr-setting-reset{color:#eee}.has-db-val .czr-setting-reset{color:#00a0d2}.is-dirty .czr-setting-reset{color:#FFBD2E!important}.czr-ctrl-reset-warning .czr-spinner{display:none}#czr-top-note,.czr-resetting-control .czr-ctrl-reset-warning .czr-spinner{display:block}.is-dirty .czr-remove-alert-wrapper{background-color:rgba(255,189,46,.54)!important;border:1px solid #FFBD2E!important;text-shadow:none;color:#000}.has-db-val .czr-remove-alert-wrapper{background-color:rgba(0,160,210,.45);border:1px solid #00a0d2;text-shadow:none;color:#000}.czr-resetting-control .czr-remove-alert-wrapper{-webkit-transition:all,.3s ease-in-out;transition:all,.3s ease-in-out}body.czr-skop-loading #czr-skope-pane{top:0}body.czr-skop-loading #customize-preview{opacity:0!important}@-webkit-keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.czr-css-loader{width:50px;height:50px;position:absolute;-webkit-transform:translate3d(-50%,-50%,0);-ms-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);top:50%;left:50%;display:block}.czr-mr-loader>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.czr-mr-loader>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.czr-mr-loader>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.czr-mr-loader>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.czr-mr-loader>div{position:absolute;top:-4%;left:-4%;width:100%;height:100%;border-radius:100%;border:2px solid #fff;-webkit-animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}#czr-top-note{top:-100%;right:0;left:0;color:#fff;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:rgba(0,0,0,.8)}#czr-top-note h2{color:#fff;font-size:25px}#czr-top-note a{color:#fff}#czr-top-note .czr-top-note-close{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}#czr-top-note .fa-arrow-left{position:absolute;bottom:10px;left:25px;font-size:40px}#czr-top-note .czr-note-content{display:inline-block;line-height:20px;width:80%}#czr-top-note .czr-note-message{font-size:16px;line-height:20px}body.czr-top-note-open #czr-top-note{top:0;visibility:inherit}#czr-skope-pane{min-height:100%;top:-100%;right:0;left:0;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;visibility:hidden}#czr-skope-pane.dirty-reset{background:rgba(252,173,6,.23)}#czr-skope-pane.db-reset{background:rgba(0,160,210,.3)}.czr-reset-content{display:inline-block;line-height:20px;width:80%;padding:5%;background:rgba(0,0,0,.63)}#czr-skope-pane h2{color:#fff;line-height:1.5em}body.czr-skope-pane-open #czr-skope-pane{top:0;visibility:inherit;min-height:100%}body.czr-skope-pane-open #customize-preview,body.czr-skope-pane-open .wp-full-overlay-sidebar{opacity:.5}body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper{visibility:visible}.czr-skope-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-skope-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.customize-control .czr-skope-notice{color:#0029ff}.czr-toggle-notice{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;padding-left:3px;line-height:21px;display:none}.czr-notice-visible .czr-toggle-notice,.czr-toggle-notice:hover{color:#0029ff}.wp-full-overlay-header,.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{-webkit-transition:height,top,.4s ease-in-out;-moz-transition:height,top,.4s ease-in-out;-ms-transition:height,top,.4s ease-in-out;-o-transition:height,top,.4s ease-in-out;transition:height,top,.4s ease-in-out}.czr-server-notice{width:calc(96% - 2px);bottom:75px;text-align:center;background:rgba(0,156,0,.18);color:#000;display:none;position:absolute;font-size:12px;line-height:13px;padding:2%;overflow:hidden}.czr-server-notice.czr-server-error{color:#000;background:rgba(255,0,0,.24)}.czr-dismiss-notification{position:absolute;right:5px;top:5px;cursor:pointer}.wp-customizer .icheckbox_flat-grey,.wp-customizer .iradio_flat-grey{border:1px solid #fff;-webkit-border-radius:5px;border-radius:5px;background-color:#fff}.czr-painted{-webkit-transition:background .3s ease-in-out!important;-moz-transition:background .3s ease-in-out!important;-ms-transition:background .3s ease-in-out!important;-o-transition:background .3s ease-in-out!important;transition:background .3s ease-in-out!important}
1
+ .rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:440px}i.czr-notice,span.czr-notice{display:block;clear:both}.tabs nav ul,li.czr-module-candidate.gu-mirror,li.czr-single-module.gu-mirror{list-style:none}.wp-customizer a{color:#000}.wp-customizer a:focus,.wp-customizer a:hover{color:#0073aa}.wp-customizer .wp-full-overlay.expanded{margin-left:440px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-440px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-440px}.accordion-sub-container.control-panel-content{left:440px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:440px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-440px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-440px}.rtl .accordion-sub-container.control-panel-content{right:440px}.customize-section-description-container+#customize-control-custom_css:last-child{margin:0;width:100%}li#customize-control-custom_css textarea{font-size:13px;background:#394143;color:#95ff0c;min-height:300px}@media screen and (max-width:1400px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:380px}.wp-customizer .wp-full-overlay.expanded{margin-left:380px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-380px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-380px}.accordion-sub-container.control-panel-content{left:380px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:380px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-380px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-380px}.rtl .accordion-sub-container.control-panel-content{right:380px}}@media screen and (max-width:979px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:300px}.wp-customizer .wp-full-overlay.expanded{margin-left:300px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-300px}.accordion-sub-container.control-panel-content{left:300px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:300px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-300px}.rtl .accordion-sub-container.control-panel-content{right:300px}}@media screen and (max-width:640px){.wp-customizer .customize-controls-preview-toggle{height:46px;border-bottom:1px solid #ddd;left:87px}.wp-customizer .wp-full-overlay.expanded{margin-left:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-100%}.accordion-sub-container.control-panel-content{left:100%}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title,.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}.rtl .accordion-sub-container.control-panel-content{right:100%}}.wp-customizer .control-section.control-panel .accordion-section-title .panel-title{font-size:24px;font-weight:inherit;line-height:30px}.wp-core-ui h3{color:#555}.accordion-section-title:after,.control-section.control-panel>.accordion-section-title:after,.handlediv,.item-edit,.sidebar-name-arrow,.widget-action,.wp-customizer #available-menu-items .menu-item-handle:hover .item-add,.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus,.wp-customizer #customize-controls .customize-info .customize-help-toggle:hover,.wp-customizer #customize-controls .customize-info.open .customize-help-toggle,.wp-customizer .menu-item-handle:hover,.wp-customizer .menu-item-handle:hover .item-edit,.wp-customizer .menu-item-handle:hover .item-type{color:#00a0d2}.accordion-section-content{padding:10px 10px 15px 20px}.customize-control-title{line-height:19px}.wp-customizer #customize-theme-controls .accordion-section-content{background:#fff}.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus:before,.wp-customizer .customize-screen-options-toggle:focus:before{-webkit-box-shadow:0 0 0 1px #00a0d2;box-shadow:0 0 0 1px #00a0d2;-webkit-border-radius:100%;border-radius:100%}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#00a0d2!important}.customize-control input[type=text]{line-height:23px}li[id*=customize-control-]{padding:2%;width:96%;border:1px solid rgba(221,221,221,.43);box-shadow:1px 0 2px 0 rgba(204,204,204,.45);-webkit-box-shadow:1px 0 2px 0 rgba(204,204,204,.45);margin:8px 0}.control-section .accordion-section-content{overflow-y:auto}.wp-customizer .control-section h3.accordion-section-title{padding:10px 25px 11px 14px}.wp-customizer #customize-controls h3{font-size:15px;font-weight:400}.control-section .accordion-section-title:after{top:7px}.control-section.control-panel .accordion-section-title:after{top:11px;-webkit-transition:right .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:right .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:right .3s ease-in-out,opacity .3s ease-in-out;-o-transition:right .3s ease-in-out,opacity .3s ease-in-out;transition:right .3s ease-in-out,opacity .3s ease-in-out;right:10px;opacity:.7}.rtl .control-section.control-panel .accordion-section-title:after{-webkit-transition:left .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:left .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:left .3s ease-in-out,opacity .3s ease-in-out;-o-transition:left .3s ease-in-out,opacity .3s ease-in-out;transition:left .3s ease-in-out,opacity .3s ease-in-out;left:10px;right:initial}#customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{right:8px;opacity:1;color:#666!important}.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{left:6px;right:initial}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after,.control-section.control-panel>.accordion-section-title:after{background:0 0!important;border:none!important}#customize-theme-controls h3.accordion-section-title{-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.customize-control-checkbox label,.customize-control-nav_menu_auto_add label,.customize-control-radio label{line-height:16px;margin-left:0}input::-webkit-input-placeholder{color:#9A9A9A;font-style:italic}input:-moz-placeholder{color:#9A9A9A;font-style:italic}input::-moz-placeholder{color:#9A9A9A;font-style:italic}input:-ms-input-placeholder{color:#9A9A9A;font-style:italic}.czr-customizr-title{text-transform:uppercase;margin:1em 0 5px;font-size:15px!important;border-bottom:1px dotted #00a0d2;padding-bottom:5px;text-align:center}h3.czr-customizr-title::before{content:'\00b7';padding-right:3px}h3.czr-customizr-title::after{content:'\00b7';padding-left:3px}.czr-after-button{border-color:#fff;margin-top:15px}.czr-emphasize{line-height:1.2em;color:#2E2E2E}span.czr-notice{color:#313131;font-size:12px;font-style:italic;line-height:18px}.czr-customizer-separator-invisible{border:none;margin-top:15px}.czr-skin-gen-label{float:left}.czr-skin-gen-color-picker{float:right}.czr-number-label{float:left}.czr-number-input{float:right}.czr-check-label{float:left;max-width:85%}.rtl .czr-check-label{float:right}input[type=checkbox],input[type=radio]{float:right;min-height:18px}.czr-font-select{float:left}li#customize-control-tc_theme_options-tc_custom_css textarea{font-size:14px;background:#394143;color:#E2E728;min-height:300px}.customize-control .czr-navigate-to-post-list{color:#00a0d2;font-weight:700;float:left;clear:both;width:100%;margin-bottom:8px}.czr-sub-control{padding-left:13%;max-width:87%;position:relative}.czr-sub-control:before{content:'';height:116%;background:#00a0d2;width:2%;position:absolute;left:7%}.customize-control-tc_cropped_image .upload-button{float:right}.customize-control-tc_cropped_image .remove-button{float:left;margin-right:3px}.customize-control-tc_cropped_image .actions{margin-bottom:32px}.customize-control-tc_cropped_image .current{margin-bottom:8px}.customize-control-tc_cropped_image .remove-button,.customize-control-tc_cropped_image .upload-button{white-space:normal;width:48%;height:auto}.customize-control-tc_cropped_image .current .container{min-height:40px;overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image .inner{line-height:20px;top:10px}.rtl .customize-control-tc_cropped_image .upload-button{float:left}.rtl .customize-control-tc_cropped_image .remove-button{float:right;margin-left:3px}.czr-layout-img{height:26px;padding-top:2px;border:1px solid #FFF}.czr-layout-title{padding:0 0 18px 12px;display:inline-block;line-height:0;vertical-align:middle}.customize-control-czr_multi_input{width:96%;border:1px solid #ccc;padding:2%}.czr-multi-input-wrapper{width:95%;padding:0 0 0 5%}.czr-multi-input-wrapper [data-input-type=color] .czr-input{float:left;clear:both}#customize-theme-controls #accordion-panel-czr-footer-panel{border-bottom:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{margin-top:10px}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-hu-header-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{border-top:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-general-panel,#customize-theme-controls #accordion-section-static_front_page{margin-bottom:10px}#customize-header-actions .customize-controls-close{left:45px}.customize-controls-close,.customize-controls-home{top:-1px}.customize-controls-home{display:block;position:absolute;left:0;width:45px;height:41px;padding:0 2px 0 0;background:#eee;border:none;border-top:4px solid #eee;border-right:1px solid #ddd;border-bottom:1px solid #ddd;color:#444;text-align:left;cursor:pointer;text-decoration:none;-webkit-transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;transition:color .1s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.customize-controls-home:before{font-size:17px;line-height:45px;position:relative;top:-4px;left:15px}.customize-controls-home:hover{background:#fff;color:#0073aa;border-top-color:#0073aa;outline:0;-webkit-box-shadow:none;box-shadow:none}.rtl.wp-customizer #customize-header-actions .customize-controls-close{right:45px;left:auto}.rtl.wp-customizer .customize-controls-home{left:auto;right:0;border-right:0;border-left:1px solid #ddd}.control-panel-content .hu-menu-notice{margin-left:3%}span.czr-panel-subtitle{display:block;font-size:12px;font-style:italic}.control-section-czr-customize-section-pro .accordion-section-title .button,.pro-title-block{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;color:#fff}.pro-title-block{background:#f0ad4e;border:1px solid #eea236;padding:0 6px;font-size:.7em;margin-right:3px;bottom:2px;position:relative;webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);border-radius:3px}#customize-controls .control-section-czr-customize-section-pro .accordion-section-title:focus,#customize-controls .control-section-czr-customize-section-pro .accordion-section-title:hover{background-color:#fff}#customize-theme-controls .control-section-czr-customize-section-pro .accordion-section-title:after{content:none}#accordion-section-go_pro_sec .accordion-section-title{margin:0 0 15px}.control-section-czr-customize-section-pro .accordion-section-title .button{font-size:15px;line-height:24px;height:30px;padding:1px 20px;background:#f0ad4e;border:1px solid #eea236;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;border-radius:3px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;transition:all .2s ease-in-out;user-select:none;margin-top:-4px;font-weight:400;margin-left:8px}.control-section-czr-customize-section-pro .accordion-section-title .button:hover{color:#fff;background:#ed9c28;border-color:#d58512}.rtl .control-section-czr-customize-section-pro .accordion-section-title .button{margin-left:0;margin-right:8px}.czr-open-pre-add-new{display:block;float:left;margin:2% 2% 0;width:99%;padding:2%;background:#3b8dbd;opacity:1;color:#fff;font-size:16px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-open-pre-add-new.active{background:#646464;opacity:.5;border-radius:3px 3px 0 0}.czr-adding-new .czr-items-wrapper,.czr-items-wrapper .inactive{opacity:.6}.czr-single-item{padding:0;border:1px solid #ccc;margin:1% 0 0 2%;float:left;width:98%;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-single-item .czr-item-content input,.czr-sub-set{margin-bottom:0}#customize-theme-controls .czr-single-item.open{border:1px solid #dedede}#customize-theme-controls .mono-item-mod .czr-single-item{border:1px solid #ccc}.czr-single-item .czr-item-content,.czr-single-item .czr-item-header{padding:1%}.czr-items-wrapper .czr-single-item .czr-builtin-model{background:#E1DFDF;color:#555}.czr-item-sort-handle{cursor:move}.czr-single-item .czr-item-header{position:relative;background:#dfdfdf;color:#fff;float:left;width:98%;-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.czr_widget_areas_module .czr-single-item .czr-custom-model{background:#3b8dbd}. .czr-single-item .czr-custom-model:hover{background:#aaa}.czr-items-wrapper .czr-single-item .czr-builtin-model:hover,.czr-single-item .czr-item-header:hover{background:#ccc}.czr-move-icon{position:absolute;top:-2px;left:3px;font-size:10px;color:#999}.czr-item-title{float:left;font-size:17px;color:#000;padding:7px;width:67%}.czr-inactive-alert{font-size:12px;font-style:italic}.czr_widget_areas_module .czr-item-title{color:#fff}.czr-builtin-model .czr-item-title{color:#23282d}.czr-item-title h4{margin:0}.czr-item-title .fa:before{padding-right:2px}.czr-item-btns{float:right}.czr-item-btns a{font-size:17px;padding:7px 5px;color:#777;-webkit-transition:color .1s ease-in-out;-moz-transition:color .1s ease-in-out;-ms-transition:color .1s ease-in-out;-o-transition:color .1s ease-in-out;transition:color .1s ease-in-out}.czr-item-btns a:active,.czr-item-btns a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.czr_widget_areas_module .czr-item-btns a{color:#fff}.czr-builtin-model .czr-item-btns a{color:#555}.czr-builtin-model .czr-item-btns .czr-edit-view.active,.czr-builtin-model .czr-item-btns .czr-edit-view:hover,.czr-item-btns .czr-edit-view.active,.czr-item-btns .czr-edit-view:hover{color:#00a0d2}.czr_widget_areas_module .czr-edit-view:hover,.czr_widget_areas_module .czr-item-btns .czr-edit-view.active{color:#000}.czr_widget_areas_module .czr-builtin-model .czr-edit-view.active,.czr_widget_areas_module .czr-builtin-model .czr-edit-view:hover{color:#00a0d2}.czr-item-btns .czr-display-alert.active,.czr-item-btns .czr-display-alert:hover{color:#23282d}.czr-single-item .czr-item-content{display:none;background:rgba(238,238,238,.5);clear:both;width:96%;padding:2%}.czr-sub-set{display:block;float:left;width:100%;padding:1% 0;position:relative}.czr-sub-set .czr-input{float:right;width:60%}.czr-sub-set .customize-control-title.width-100,.width-100 .czr-input{width:100%}.czr-sub-set .customize-control-title{float:left;width:40%;padding:1px 0;font-size:13px}.rtl.wp-customizer .czr-sub-set .customize-control-title{float:right}.disabled .customize-control-title,.disabled .czr-input{opacity:.6;filter:blur(1px);-webkit-filter:blur(1px)}.czr-item-title .fa{font-size:18px}.czr-remove-alert-wrapper{display:none;clear:both;float:left;padding:2%;width:95%;margin:10px 0;text-shadow:0 1px 0 rgba(255,255,255,.5);background-color:#EEE;color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.czr-remove-alert-wrapper p{padding:5px;margin:0}.czr-pre-add-wrapper{position:relative;float:left;width:100%}.czr-pre-add-view-content{display:none;padding:3%;border:1px solid #00a0d2;border-top:none;margin:0 0 0 2%;float:left;width:92%;background:#eee;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;position:relative;opacity:1;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-ms-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.czr-model-added .czr-pre-add-view-content{opacity:.2}.czr-pre-add-wrapper .czr-add-new{background:#3b8dbd;color:#fff;-webkit-transition:background .5s linear;-moz-transition:background .5s linear;-ms-transition:background .5s linear;-o-transition:background .5s linear;transition:background .5s linear;float:right;border:none}.czr-add-success{width:100%;margin:0 0 0 2%;position:absolute;top:0;left:0;font-size:25px;text-align:center;opacity:0;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-ms-transition:opacity .1s linear;-o-transition:opacity .1s linear;transition:opacity .1s linear}.czr-model-added .czr-add-success{opacity:1}.czr-unavailable-location,body.czr-editing-modopt #customize-preview{opacity:.7}.czr-add-success p{vertical-align:middle;display:inline-block;line-height:35px;margin:0;font-size:25px;color:#82b965;padding:0 3%}.control-section-widget_zones_management{margin:10px 0;z-index:1}.czr-zone-infos{width:96%;padding:0 2%;font-size:12px;float:left;font-style:italic}.czr-location-alert{float:left;width:100%;padding:1% 0;margin:1% 0;text-align:center;border:1px solid orange;background:#FEE5B6;color:#000;font-size:11px;font-style:italic}.czr-toggle-modopt{color:#495050;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;right:0;padding-left:3px;font-size:25px;line-height:24px}.rtl.wp-customizer .czr-toggle-modopt{left:0;right:auto;padding-left:0;padding-right:3px}.czr-modopt-visible .czr-toggle-modopt,.czr-toggle-modopt:hover{color:#3b8dbd}body #customize-controls{-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;-ms-transition:opacity .4s ease-in-out;-o-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}body.czr-editing-modopt #customize-controls{opacity:.4}.czr-mod-opt-wrapper{position:absolute;top:0;bottom:0;left:-301px;opacity:0;overflow-x:hidden;overflow-y:auto;margin:0;z-index:4;width:60%;min-width:300px;padding:1% 2%;color:#fff;background:rgba(0,0,0,.8);-webkit-transition:all .18s ease-in-out;-moz-transition:all .18s ease-in-out;-ms-transition:all .18s ease-in-out;-o-transition:all .18s ease-in-out;transition:all .18s ease-in-out;border-right:1px solid #4c4c4c}body.czr-editing-modopt .czr-mod-opt-wrapper{left:0;visibility:visible;opacity:1}.czr-close-modopt{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}.czr-mod-opt-wrapper .czr-sub-set{background:rgba(238,238,238,.13);padding:3% 2%;width:96%;margin:5px 0}.tabs,.tabs nav ul{position:relative;margin:0 auto;overflow:hidden}.czr-mod-opt-wrapper .czr-notice{color:#fff}.czr-mod-opt-wrapper .mod-opt-title{color:#fff;border-bottom:1px solid #fff;padding:5% 0;text-align:center}.tabs{display:none;width:100%;font-weight:300;font-size:1.25em}.tabs nav{text-align:center}.tabs nav ul{display:-ms-flexbox;display:-webkit-flex;display:-moz-flex;display:-ms-flex;display:flex;padding:0;max-width:1200px;-ms-box-orient:horizontal;-ms-box-pack:center;-webkit-flex-flow:row wrap;-moz-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center}.tabs nav a,.tabs nav ul li{position:relative;display:block}.tabs nav ul li{z-index:1;margin:0;text-align:center;-webkit-flex:1;-moz-flex:1;-ms-flex:1;flex:1}.tabs nav ul li.cols-4{width:25%}.tabs nav ul li.cols-3{width:33%}.tabs nav ul li.cols-2{width:50%}.tabs nav ul li.cols-1{width:100%}.tabs nav a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:2.5}li.tab-current::after,li.tab-current::before,li.tab-inactive::after{content:'';position:absolute;width:100%}.tabs nav a span{vertical-align:middle;font-size:.75em}.tabs nav li.tab-current a{color:#74777b}.tabs nav a:focus{outline:0}li.tab-current::after,li.tab-current::before{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(37,37,37,.63);box-shadow:4px 0 15px 0 rgba(37,37,37,.63);top:0;right:0;z-index:4}li.tab-current::before{left:0;-webkit-box-shadow:0 0 15px 4px rgba(37,37,37,.63);box-shadow:0 0 15px 4px rgba(37,37,37,.63)}li.tab-inactive::after{height:2px;bottom:-7px;left:0;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(0,0,0,.86)}.content-wrap{position:relative}.content-wrap section{display:none;margin:0 auto;max-width:1200px}section .czr-sub-set:first-child{margin:0}.content-wrap section.content-current,.no-flexbox nav ul{display:block}.no-flexbox nav ul li{min-width:15%;display:inline-block}.tabs-style-topline{max-width:1200px}.tabs-style-topline nav li{border:1px solid rgba(40,44,42,.1)}.czr-items-wrapper .tabs-style-topline nav li{border:none}.tabs-style-topline nav li:not(:last-child){border-right:none}.tabs-style-topline nav li.tab-current{border-top-color:#fff;border-bottom:none;background:rgba(238,238,238,.13)}.tabs-style-topline nav a{padding:.65em .5em;background:rgba(40,44,42,.05);color:#fff;line-height:1;-webkit-transition:color .2s;transition:color .2s;text-decoration:none}.czr-disable-bottom-infos,.czr-skope-switch,.czr-skp-switch-link:hover,.tabs-style-topline nav a:focus,.tabs-style-topline nav a:hover,.tabs-style-topline nav li.tab-current a{text-decoration:underline}.czr-items-wrapper .tabs-style-topline nav a{background:rgba(40,44,42,.45)}.tabs-style-topline nav li.tab-current a{background:0 0;box-shadow:inset 0 3px 0 #fff;color:#fff}.czr-items-wrapper .tabs-style-topline nav li.tab-current a{color:#000}.tabs-style-topline .icon::before{display:block;margin:0}.tabs-style-topline nav a span{text-transform:uppercase;letter-spacing:1px;font-weight:700}@media screen and (max-width:58em){.tabs nav a.icon span{display:none}.tabs nav a:before{margin-right:0}}.czr_slide_module .czr-item-title{padding:0 7px;height:32px}.czr_slide_module .slide-thumb,.czr_slide_module .slide-title{display:block;height:32px;line-height:32px;float:left}.czr_slide_module .slide-title{padding-left:5px}.slide-mod-skope-notice{padding:3%;background:rgba(116,210,116,.42);float:left;font-size:12px;line-height:1.5em}.slide-mod-skope-notice .czr-skope-switch{cursor:pointer;text-decoration:underline}.modopts-top-buttons{width:100%;float:left;margin-bottom:4%;text-align:center}.item-bottom-buttons{width:100%;float:left;padding:1% 0}.item-bottom-btn,.modopt-top-btn{color:#fff;font-size:14px;cursor:pointer;border-width:1px;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;opacity:1}.item-bottom-btn{background:#868686;width:47%;margin-right:2%;padding:1% 0}.modopt-top-btn{background:rgba(171,171,171,.5);width:170px;padding:2px 0}.item-bottom-btn:hover{background:#5d5d5d}.modopt-top-btn:hover{background:rgba(41,41,41,.53)}.item-bottom-btn[disabled],.item-bottom-btn[disabled]:hover,.modopt-top-btn[disabled],.modopt-top-btn[disabled]:hover{opacity:.4;cursor:default;-webkit-box-shadow:none!important;box-shadow:none!important;background:inherit}.czr-notice{font-size:12px;font-weight:400}.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-450px;height:0}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-450px}@media screen and (max-width:1400px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-380px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-380px}}@media screen and (max-width:979px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-300px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-300px}}@media screen and (max-width:640px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-100%}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}}@media screen and (min-width:980px){.wp-customizer .expanded #customize-footer-actions{width:380px}}@media screen and (min-width:1401px){.wp-customizer .expanded #customize-footer-actions{width:440px}}.selecter-element{position:absolute;opacity:0}.selecter{display:block;float:right;margin:2px 0;position:relative;width:100%;z-index:100}.selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) right center no-repeat #F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;padding:4px 4.6%;position:relative;text-overflow:clip;z-index:49;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);height:auto;line-height:18px;width:90%}.selecter .selecter-options{border:1px solid #ccc;border-width:0 1px 1px;background-color:#fefefe;border-radius:0 0 3px 3px;box-shadow:0 1px 4px rgba(0,0,0,.15);display:none;left:0;margin:0;max-height:260px;overflow:auto;overflow-x:hidden;padding:0;position:relative;top:100%;width:99%;z-index:50}.selecter .selecter-group{background:#F9F9F9;border-bottom:1px solid #e3e3e3;color:#999;display:block;font-size:11px;padding:5px 10px 4px;text-transform:uppercase}.selecter .selecter-item{background:#fff;border-bottom:1px solid #e3e3e3;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;text-overflow:ellipsis;width:86%;height:auto;line-height:14px;padding:8px 24px 8px 10px}.selecter.disabled .selecter-group,.selecter.disabled .selecter-item,.selecter.disabled .selecter-selected{cursor:default;color:#ccc;border-color:#eee}.selecter .selecter-item.selected{background:#F9F9F9}.selecter .selecter-item.disabled{color:#999;cursor:default}.selecter .selecter-item:first-child{border-radius:0}.selecter .selecter-item:last-child{border-radius:0 0 2px 2px;border-bottom:0}.rtl .selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) 4% center no-repeat #F9F9F9}@media screen and (min-width:980px){.selecter .selecter-item.selected:hover,.selecter .selecter-item:hover{background-color:#f3f3f3}.selecter .selecter-item.disabled:hover,.selecter:hover .selecter-selected{background-color:#fff}.selecter.disabled .selecter-item:hover{background:#fff}}.selecter.open{z-index:101}.selecter.open .selecter-selected{border-radius:3px 3px 0 0;z-index:51}.selecter.focus .selecter-selected,.selecter.open .selecter-selected{background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.1)}.selecter.cover .selecter-options{border-radius:3px;border-width:1px;top:0}.selecter.cover .selecter-options .selecter-item.first{border-radius:3px 3px 0 0}.selecter.cover.open .selecter-selected{border-radius:3px 3px 0 0;z-index:49}.selecter.bottom .selecter-options{border-width:1px 1px 0;bottom:100%;top:auto}.selecter.bottom .selecter-item:last-child{border:none}.selecter.bottom.open .selecter-selected{border-radius:0 0 3px 3px}.selecter.bottom.open .selecter-options{border-radius:3px 3px 0 0}.selecter.bottom.cover.open .selecter-options,.selecter.bottom.cover.open .selecter-selected,.stepper{border-radius:3px}.selecter.bottom.cover .selecter-options{bottom:0;top:auto}.selecter.multiple .selecter-options{border-radius:3px;border-width:1px;box-shadow:none;display:block;position:static;width:100%}.selecter.disabled .selecter-selected{background:#fff}.selecter.disabled .selecter-options{background:#fff;border-color:#eee}.selecter.disabled .selecter-item.selected{background:#fafafa}.selecter .selecter-options.scroller{overflow:hidden}.selecter .selecter-options.scroller .scroller-content{max-height:260px;padding:0}@media screen and (max-width:740px){.selecter{max-width:100%}}@media screen and (max-width:500px){.selecter{max-width:100%}}.stepper{margin:0 0 10px;overflow:hidden;position:relative;width:35%;float:left;clear:both}.stepper .stepper-input{background:#F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;font-size:13px;line-height:1.2;margin:0;overflow:hidden;padding:5px 10px!important;width:100%!important;z-index:49;-moz-appearance:textfield;max-width:none!important}.stepper .stepper-input::-webkit-inner-spin-button,.stepper .stepper-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.stepper .stepper-input:focus{background-color:#fff}.stepper .stepper-arrow{background:url(img/jquery.fs.stepper-arrows.png) no-repeat #eee;border:1px solid #ccc;cursor:pointer;display:block;height:46%;position:absolute;right:0;text-indent:-99999px;width:20px;z-index:50}.stepper .stepper-arrow.up{background-position:center top;border-bottom:none;top:0}.stepper .stepper-arrow.down{background-position:center bottom;bottom:0}.rtl .stepper .stepper-input{text-align:left}@media screen and (min-width:740px){.stepper:hover .stepper-input{background-color:#fff}.stepper .stepper-step:hover{background-color:#F9F9F9}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}}.stepper.disabled .stepper-input{background:#fff;border-color:#eee;color:#ccc}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}.icheckbox_flat-green,.icheckbox_flat-grey,.iradio_flat-green,.iradio_flat-grey{display:inline-block;margin:0;padding:0;width:20px;height:20px;border:none;top:4px;vertical-align:middle}.icheckbox_flat-green,.iradio_flat-green{background:url(img/green.png) no-repeat;cursor:pointer;float:right}.rtl [class*=icheckbox_flat-]{float:left}.icheckbox_flat-green{background-position:0 0}.icheckbox_flat-green.checked{background-position:-22px 0}.icheckbox_flat-green.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-green.checked.disabled{background-position:-66px 0}.iradio_flat-green{background-position:-88px 0}.iradio_flat-green.checked{background-position:-110px 0}.iradio_flat-green.disabled{background-position:-132px 0;cursor:default}.iradio_flat-green.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-green,.iradio_flat-green{background-image:url(img/green@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.icheckbox_flat-grey,.iradio_flat-grey{background:url(img/grey.png) no-repeat;cursor:pointer;float:right}.icheckbox_flat-grey{background-position:0 0}.icheckbox_flat-grey.checked{background-position:-22px 0}.icheckbox_flat-grey.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-grey.checked.disabled{background-position:-66px 0}.iradio_flat-grey{background-position:-88px 0}.iradio_flat-grey.checked{background-position:-110px 0}.iradio_flat-grey.disabled{background-position:-132px 0;cursor:default}.iradio_flat-grey.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-grey,.iradio_flat-grey{background-image:url(img/grey@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.czr-sub-set .icheckbox_flat-green,.iradio_flat-green{float:left}body .select2-container{z-index:1000000;width:100%!important}.customize-control-czr_layouts .select2-selection--single{height:33px}.customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow{height:30px}.customize-control-czr_layouts .select2-selection--single:focus,.select2-selection__rendered:focus{outline:0}body .select2-drop{z-index:1000000}body .select2-container,span.select2-results{font-size:14px}.select2-container--default .select2-selection--multiple{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;width:99%;min-height:36px;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#00a0d2!important;-webkit-box-shadow:0 0 2px rgba(26,188,156,.8)!important;box-shadow:0 0 2px rgba(26,188,156,.8)!important}.select2-results__options li{margin-bottom:0}.select2-container--default .select2-selection--multiple .select2-selection__choice{padding:2px;font-size:13px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;margin-bottom:0}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#00a0d2}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{font-size:17px;position:relative;top:2px;color:#23282d}.customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered{padding:5px;line-height:16px}#czr-customize-content_editor-pane{border-top:solid 1px #ddd;position:absolute;height:300px;bottom:-301px;right:0;left:0;z-index:20;background:#f1f1f1;display:block;-webkit-transition:all .2s;transition:all .2s;visibility:hidden}body.czr-customize-content_editor-pane-resize #customize-preview,body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane{-webkit-transition:none;transition:none}body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{top:0}body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{bottom:0;visibility:inherit}#czr-customize-content_editor-pane .wp-editor-tools{padding-top:5px;padding-right:10px}#czr-customize-content_editor-pane .wp-media-buttons{padding-left:5px}#customize-preview{height:auto}body.czr-customize-content_editor-pane-open #customize-preview{bottom:300px}body.mce-fullscreen #customize-preview{bottom:0}body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen{position:relative;left:0}#wp-czr-customize-content_editor-container{border-left:0}#czr-customize-content_editor-dragbar{top:0;cursor:row-resize;display:block;height:4px;position:absolute;width:100%;z-index:21}body.czr-customize-content_editor-pane-resize #customize-preview:before{top:0;right:0;bottom:0;left:0;position:absolute;height:100%;width:100%;z-index:999999}.wp-customizer .ui-autocomplete.wplink-autocomplete{z-index:500110}.wp-customizer #wp-link-wrap{z-index:500105}.wp-customizer #wp_editbtns,.wp-customizer #wp_gallerybtns{z-index:500020}.wp-customizer #TB_overlay,.wp-customizer #TB_window{z-index:500050}.wp-customizer .mce-panel,.wp-customizer .mce-tooltip{z-index:500100!important}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar{bottom:308px}.czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar{-webkit-transition:none;transition:none}.czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar{bottom:8px!important}.czr-sub-set[data-input-type=content_picker] .customize-control-title,.czr-sub-set[data-input-type=content_picker] .czr-input{width:100%}.content-picker-item{height:2em}.content-picker-item .czr-picker-item-type{float:right;display:inline-block}.content-item-bar{line-height:1.2em;font-size:.9em}.content-item-bar .czr-picker-item-title{display:block;float:left;max-width:80%;text-overflow:ellipsis;overflow:hidden;font-size:13px;line-height:1.3em}.czr-sub-set[data-input-type=content_picker] span.czr-picker-item-title{display:block;float:left;max-width:80%;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:2em;color:#000}.czr-sub-set[data-input-type=content_picker] span.czr-picker-item-type{display:inline-block;padding:0 10px 0 0;float:right;line-height:2em}.rangeslider,.rangeslider__fill{display:block;-moz-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}.rangeslider{background:#e6e6e6;position:relative}.rangeslider--horizontal{height:20px;width:100%}.rangeslider--vertical{width:20px;min-height:150px;max-height:100%}.rangeslider--disabled{filter:alpha(Opacity=40);opacity:.4}.rangeslider__fill{background:#3b8dbd;position:absolute}.rangeslider--horizontal .rangeslider__fill{top:0;height:100%}.rangeslider--vertical .rangeslider__fill{bottom:0;width:100%}.rangeslider__handle{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g) #fff;border:1px solid #ccc;cursor:pointer;display:inline-block;width:40px;height:40px;position:absolute;background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(0,0,0,.1)));background-image:-moz-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:-webkit-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));-moz-box-shadow:0 0 8px rgba(0,0,0,.3);-webkit-box-shadow:0 0 8px rgba(0,0,0,.3);box-shadow:0 0 8px rgba(0,0,0,.3);-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;line-height:42px;text-align:center;color:#000;font-size:13px;font-weight:700}.rangeslider__handle:after{content:"";display:block;width:18px;height:18px;margin:auto;position:absolute;top:0;right:0;bottom:0;left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.13)),color-stop(100%,rgba(255,255,255,0)));background-image:-moz-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:-webkit-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%}.rangeslider--active .rangeslider__handle,.rangeslider__handle:active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,rgba(0,0,0,.12)));background-image:-moz-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:-webkit-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12))}.rangeslider--horizontal .rangeslider__handle{top:-10px;touch-action:pan-y;-ms-touch-action:pan-y}.rangeslider--vertical .rangeslider__handle{left:-10px;touch-action:pan-x;-ms-touch-action:pan-x}input[type=range]:focus+.rangeslider .rangeslider__handle{-moz-box-shadow:0 0 8px rgba(255,0,255,.9);-webkit-box-shadow:0 0 8px rgba(255,0,255,.9);box-shadow:0 0 8px rgba(255,0,255,.9)}.attachment-media-view button{color:#000;padding:5px 7px;line-height:1.5em}.czr-sektion-buttons{position:absolute;right:0}.czr-column{width:99%;margin-bottom:1%;float:left;padding:2% 0;border:2px dotted #aaa;text-align:center}.czr-column-header{position:relative}.czr-col-drag-handler{position:absolute;left:0;padding:1%;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-module-collection-wrapper{width:100%;min-height:5px;float:left}.czr-single-module{width:98%;float:left;min-height:20px;margin:1px 1%;border:1px solid #ccc}.czr-single-module textarea{max-width:100%}#customize-theme-controls .czr-single-module .czr-single-item{width:96%}.czr-mod-header{background:#eee;float:left;width:100%}.czr-mod-title{position:relative}.czr-mod-title>h4{float:left;width:70%;margin:2% 0}.czr-mod-drag-handler{position:absolute;left:0;padding:1%;margin:2% 0;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-mod-buttons{float:right;width:30%;margin:2% 0}.czr-mod-content{position:absolute;top:0;left:100%;float:left;width:100%;background:#d5e9cc;display:none}.czr-module-open #customize-info,.czr-module-open #customize-theme-controls{left:-200%}.czr-module-open #customize-theme-controls .accordion-section-content{overflow:visible}.czr-module-description-container{margin-bottom:15px}.czr-module-title{border-bottom:1px solid #ddd;background:#fff}.czr-module-title h3{padding:10px 10px 12px 14px;margin:0;color:#555;font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .czr-module-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;display:block;font-weight:400}.czr-module-back{display:block;float:left;width:48px;height:74px;padding:0 24px 0 0;margin:0;background:#fff;border:none;border-right:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;-webkit-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-moz-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-ms-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-o-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.czr-module-back:focus,.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.czr-module-back:before{font:400 20px/72px dashicons;content:"\f341";position:relative;left:13px}.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.gu-mirror{position:fixed!important;margin:0!important;z-index:999999!important;opacity:.8;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";filter:alpha(opacity=80)}#czr-module-list-panel,#czr-sektion-settings-panel{left:-301px;overflow-x:hidden;overflow-y:auto;z-index:4;bottom:0}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter:alpha(opacity=20)}.gu-unselectable .czr-module-collection-wrapper{width:98%;border:1px dotted green;background:#d1ffe0;min-height:31px}#czr-module-list-panel{position:absolute;top:0;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd}#czr-available-modules-filter,#czr-module-list-panel{width:45%;min-width:300px}body.czr-adding-module #czr-module-list-panel{left:0;visibility:visible;opacity:1}body.czr-adding-module #customize-preview{opacity:.7}.add-new-module:before{content:"\f132";display:inline-block;position:relative;left:-2px;top:-1px;font:400 20px/1 dashicons;vertical-align:middle;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.czr-column .add-new-module{margin:1%;float:right}body.czr-adding-module .add-new-module,body.czr-adding-module .add-new-module:hover{background:#eee;border-color:#929793;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}body.czr-adding-module .add-new-module:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#czr-available-modules-list{top:60px;position:absolute;overflow:auto;bottom:0;width:100%}#czr-available-modules-filter{position:fixed;top:0;z-index:1;background:rgba(0,0,0,.47);border-bottom:1px solid #e5e5e5;padding:12px 15px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#czr-available-modules-filter input{padding:6px 10px;width:100%}#czr-available-modules-list .czr-module-candidate{position:relative;border-bottom:1px solid #e5e5e5}#czr-available-modules-list .czr-module-candidate h3{color:#fff;padding:0;margin:0}#czr-available-modules-list .czr-mod-drag-handler{position:relative;left:0;padding:1%;margin:2% 4%;color:inherit;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}#czr-sektion-settings-panel{position:absolute;top:0;width:45%;min-width:300px;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd;color:#fff}#czr-sektion-settings-panel h3{color:#fff}body.czr-editing-sektion #czr-sektion-settings-panel{left:0;visibility:visible;opacity:1}body.czr-editing-sektion #customize-preview{opacity:.7}.czr-api-dirty input#save{background-color:#FFBD2E;border-color:#d99400;color:#000;text-shadow:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out;-ms-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.czr-api-dirty input#save:hover{background-color:#fcad06}#customize-controls .customize-section-title.is-in-view,.czr-skop-on #customize-controls .customize-info.is-in-view{opacity:0}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header{height:185px}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{top:185px}.wp-customizer .in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding:0 15px}.customize-controls-close{border-bottom:1px solid #ddd}.wp-customizer #customize-header-actions{border-bottom:0}.czr-scope-switcher{width:100%;float:right;position:absolute;left:0;bottom:0;overflow:hidden}.czr-scope-switcher .czr-skp-permanent-title{position:relative;color:#5f5f5f}#customize-header-actions .czr-scope-switcher .spinner{float:none;display:none;margin:0;left:-26px;top:0;position:absolute;visibility:visible}h2.czr-current-skope-title{font-size:13px;line-height:21px;margin:6px 0 4px;text-align:center;height:63px;font-weight:400;overflow:hidden}.czr-main-title{max-height:24px;overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:nowrap;width:95%}.czr-skope-title{display:block;font-size:17px;font-style:italic;line-height:25px}.czr-toggle-title-notice{cursor:pointer;font-size:14px;color:#777}.czr-skope-inherits-from{display:inline-block;opacity:0;width:90%;font-size:12px;line-height:18px;color:#0029ff;top:-6px;position:relative}.notice-visible .czr-toggle-title-notice{color:#0029ff}.notice-visible .czr-skope-inherits-from{opacity:1;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope,.czr-scope-switcher .button{-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;float:left}.czr-scope-switcher .button{width:40%;text-align:center;margin:0 2%;opacity:.7;transition:opacity .3s ease-in-out}.czr-scope-switcher .button.active{font-weight:700;opacity:1}.czr-scope-switcher .active,.czr-scope-switcher .czr-scope:hover{opacity:1}.czr-skopes-wrapper{overflow:hidden;position:relative}.czr-scope-switcher .active:after,.czr-scope.active:before{position:absolute;content:'';top:0}.czr-scope.active:before{height:101%;float:left;z-index:1;-webkit-box-shadow:-4px 0 15px 0 rgba(119,119,119,.58);box-shadow:-4px 0 15px 0 rgba(119,119,119,.58)}.czr-scope-switcher .active:after{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(119,119,119,.58);z-index:3}.czr-skopes-wrapper .active-collection.local:after{right:0}.czr-scope-switcher .czr-scope:last-child:after{-webkit-box-shadow:none;box-shadow:none;right:0}.czr-scope-switcher .czr-scope:first-child:after{left:0}.czr-scope{width:30.5%;background:#fff;border-top:1px solid #ccc;overflow:hidden;opacity:.65;transition:opacity .3s ease-in-out}.czr-scope-switcher .width-100,.czr-scope.width-100.active:after,.czr-scope.width-100.active:before{width:100%}.czr-scope-switcher .width-50,.czr-scope.width-50.active:after,.czr-scope.width-50.active:before{width:50%}.czr-scope-switcher .width-33,.czr-scope.width-33.active:after,.czr-scope.width-33.active:before{width:33.33%}.czr-scope-switcher .width-25,.czr-scope.width-25.active:after,.czr-scope.width-25.active:before{width:25%}.czr-scope-footer,.czr-scope-header{width:100%;min-height:16px;position:relative;z-index:5}.inactive .czr-scope-footer:after{content:'';width:100%;position:absolute;height:5px;bottom:-7px;left:0;-webkit-box-shadow:0 0 13px 4px rgba(119,119,119,.85);box-shadow:0 0 13px 4px rgba(119,119,119,.85)}.czr-scope-content{height:35px;padding:0 3%;width:94%;line-height:35px;text-align:center;clear:both;color:#000;overflow:hidden}.czr-scope-content h4{margin:0;display:inline-block;text-align:center;font-size:14px;line-height:18px;font-weight:400;text-shadow:1px 1px 0 #dedede}.czr-reset-fail,.czr-reset-success,.czr-scope-force{display:none}.czr-scope .fa{font-size:10px;padding:2%;color:#585858;cursor:pointer;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope .czr-scope-footer .info{cursor:inherit}.czr-scope-header .czr-scope-switch{font-size:22px;padding:0 2px 0 0;text-shadow:1px 1px 2px #fff}.czr-skp-switch-link{cursor:pointer}.czr-pull-left{float:left}.czr-pull-right{float:right}.active .czr-scope-switch{color:#59b15c;cursor:inherit}.czr-scope .czr-scope-reset{display:none;font-size:13px;text-shadow:1px 1px 0 #dedede}.has-db-val .czr-scope-reset{color:#00a0d2}.dirty .czr-scope-reset{color:#FFBD2E!important}.is_winner .czr-scope-winner{color:#59b15c;font-size:14px;position:absolute;bottom:2px;left:2px}.czr-skope-switch{cursor:pointer}.czr-spinner-wrapper{visibility:hidden}.czr-spinner{background:url(img/czr-spinner.gif) no-repeat;-webkit-background-size:32px 32px;background-size:32px 32px;display:inline-block;float:right;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:32px;height:32px;margin:4px 10px 0}.customize-control span.customize-control-title:first-child{padding-left:16px;-webkit-transition:left,right,.15s ease-in-out;-moz-transition:left,right,.15s ease-in-out;-ms-transition:left,right,.15s ease-in-out;-o-transition:left,right,.15s ease-in-out;transition:left,right,.15s ease-in-out;position:relative}.wp-customizer .customize-control.czr-not-skoped .customize-control-title{padding-left:0}.czr-setting-reset{color:#eee;-webkit-transition:color .4s;transition:color .4s;position:absolute;left:0;line-height:21px;display:none;text-shadow:1px 1px 0 #a0a0a0}#czr-bottom-infos,#czr-top-note,.czr-resetting-control .czr-remove-alert-wrapper{-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out}.czr-global-skope-level .is-wp-authorized-setting.has-db-val .czr-setting-reset{color:#eee}.has-db-val .czr-setting-reset{color:#00a0d2}.is-dirty .czr-setting-reset{color:#FFBD2E!important}.czr-ctrl-reset-warning .czr-spinner{display:none}.czr-resetting-control .czr-ctrl-reset-warning .czr-spinner{display:block}.is-dirty .czr-remove-alert-wrapper{background-color:rgba(255,189,46,.54)!important;border:1px solid #FFBD2E!important;text-shadow:none;color:#000}.has-db-val .czr-remove-alert-wrapper{background-color:rgba(0,160,210,.45);border:1px solid #00a0d2;text-shadow:none;color:#000}.czr-resetting-control .czr-remove-alert-wrapper{-webkit-transition:all,.3s ease-in-out;transition:all,.3s ease-in-out}body.czr-skop-loading #czr-skope-pane{top:0}body.czr-skop-loading #customize-preview{filter:blur(3px);-webkit-filter:blur(3px)}@-webkit-keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.czr-css-loader{width:50px;height:50px;position:absolute;-webkit-transform:translate3d(-50%,-50%,0);-ms-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);top:50%;left:50%;display:block}.czr-mr-loader>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.czr-mr-loader>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.czr-mr-loader>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.czr-mr-loader>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.czr-mr-loader>div{position:absolute;top:-4%;left:-4%;width:100%;height:100%;border-radius:100%;border:2px solid #fff;-webkit-animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}#czr-bottom-infos,#czr-top-note{position:absolute;text-align:center;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;visibility:hidden}.czr-preview-notification a,.czr-preview-notification h2{color:#fff;margin:1em 0}.czr-preview-notification .czr-preview-note-close{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}.czr-preview-notification .fa-arrow-left{position:absolute;bottom:10px;left:25px;font-size:40px}.czr-preview-notification .czr-note-content{display:inline-block;line-height:20px;width:80%}.czr-preview-notification .czr-note-message{font-size:16px;line-height:1.5em;margin:.5em 0}#czr-top-note{top:-100%;background:rgba(0,0,0,.8);padding:2%}#czr-top-note h2{font-size:25px}body.czr-top-note-open #czr-top-note{top:0;visibility:inherit}#czr-bottom-infos{bottom:-100%;background-color:rgba(0,0,0,.85);padding:1px}body.czr-bottom-infos-open #czr-bottom-infos{bottom:0;visibility:inherit}#czr-bottom-infos .czr-note-content .czr-note-message{font-size:13px}#czr-bottom-infos .action-links-wrap{width:100%}#czr-bottom-infos .action-link{font-style:italic;display:inline-block;width:40%}#czr-bottom-infos .action-link a:hover{color:#fff}.czr-disable-bottom-infos{cursor:pointer}#czr-skope-pane{position:absolute;min-height:100%;text-align:center;padding:2%;top:-100%;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;visibility:hidden}#czr-skope-pane.dirty-reset{background:rgba(252,173,6,.23)}#czr-skope-pane.db-reset{background:rgba(0,160,210,.3)}.czr-reset-content{display:inline-block;line-height:20px;width:80%;padding:5%;background:rgba(0,0,0,.63)}#czr-skope-pane h2{color:#fff;line-height:1.5em}body.czr-skope-pane-open #czr-skope-pane{top:0;visibility:inherit;min-height:100%}body.czr-skope-pane-open #customize-preview,body.czr-skope-pane-open .wp-full-overlay-sidebar{opacity:.5}body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper{visibility:visible}.czr-skope-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-skope-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.customize-control .czr-skope-notice{color:#3a3a3a;font-family:Verdana,'DejaVu Sans','Bitstream Vera Sans',Geneva,sans-serif;font-size:10px;line-height:1.5em;font-style:normal;border-left:3px solid rgba(99,99,99,.36);padding-left:5px}.czr-toggle-notice{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;padding-left:3px;line-height:21px;display:none}.czr-notice-visible .czr-toggle-notice,.czr-toggle-notice:hover{color:rgba(0,0,0,.67)}.wp-full-overlay-header,.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{-webkit-transition:height,top,.4s ease-in-out;-moz-transition:height,top,.4s ease-in-out;-ms-transition:height,top,.4s ease-in-out;-o-transition:height,top,.4s ease-in-out;transition:height,top,.4s ease-in-out}.czr-server-notice{width:calc(96% - 2px);bottom:75px;text-align:center;background:rgba(0,156,0,.18);color:#000;display:none;position:absolute;font-size:12px;line-height:13px;padding:2%;overflow:hidden}.czr-server-notice.czr-server-error{color:#000;background:rgba(255,0,0,.24)}.czr-dismiss-notification{position:absolute;right:5px;top:5px;cursor:pointer}.wp-customizer .icheckbox_flat-grey,.wp-customizer .iradio_flat-grey{border:1px solid #fff;-webkit-border-radius:5px;border-radius:5px;background-color:#fff}.czr-painted{-webkit-transition:background .3s ease-in-out!important;-moz-transition:background .3s ease-in-out!important;-ms-transition:background .3s ease-in-out!important;-o-transition:background .3s ease-in-out!important;transition:background .3s ease-in-out!important}
addons/assets/czr/js/czr-control-base.js CHANGED
@@ -8,9 +8,23 @@ Array.from||(Array.from=function(){var a=Object.prototype.toString,b=function(b)
8
  if ( 'function' != typeof(jQuery.fn.iCheck) ) {
9
  !function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"==b?!1:"keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A),void 0)}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto);
10
  }
 
 
 
 
 
 
 
11
  if ( 'function' != typeof(jQuery.fn.selecter) ) {
12
  !function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{{var f=c.html();c.data("value")}b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window);
13
  }
 
 
 
 
 
 
 
14
  if ( 'function' != typeof(jQuery.fn.stepper) ) {
15
  !function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0===typeof e||isNaN(e)?!1:e,max:void 0===typeof f||isNaN(f)?!1:f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this);
16
  }/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
@@ -38,7 +52,7 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
38
  return string.length > 150 ? string.substr( 0, 149 ) : string;
39
  };
40
  if ( ! _.isEmpty( _.filter( _toArr, function( it ) { return ! _.isString( it ); } ) ) ) {
41
- _toArr = JSON.stringify( _toArr );
42
  } else {
43
  _toArr = _toArr.join(' ');
44
  }
@@ -52,7 +66,6 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
52
  return;
53
  if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
54
  return;
55
-
56
  console.log.apply( console, _prettyPrintLog( { consoleArguments : arguments } ) );
57
  };
58
 
@@ -70,8 +83,18 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
70
  api.czr_isChangeSetOn = function() {
71
  return serverControlParams.isChangeSetOn && true === true;//&& true === true is just there to hackily cast the returned value as boolean.
72
  };
 
 
 
 
 
 
73
  api.czr_activeSectionId = new api.Value('');
74
  api.czr_activePanelId = new api.Value('');
 
 
 
 
75
  if ( 'function' === typeof api.Section ) {
76
  api.control.bind( 'add', function( _ctrl ) {
77
  if ( _ctrl.params.ubq_section && _ctrl.params.ubq_section.section ) {
@@ -96,6 +119,10 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
96
  }
97
  });
98
  }
 
 
 
 
99
  var _closeModOpt = function() {
100
  if ( ! _.has( api, 'czr_ModOptVisible') )
101
  return;
@@ -103,6 +130,11 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
103
  };
104
  api.czr_activeSectionId.bind( _closeModOpt );
105
  api.czr_activePanelId.bind( _closeModOpt );
 
 
 
 
 
106
  api.bind('ready', function() {
107
  if ( 'function' != typeof api.Section ) {
108
  throw new Error( 'Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.' );
@@ -147,6 +179,11 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
147
  _do();
148
  });
149
  });
 
 
 
 
 
150
  api.czr_skopeReady = $.Deferred();
151
  api.bind( 'ready' , function() {
152
  if ( serverControlParams.isSkopOn ) {
@@ -159,6 +196,20 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
159
  api.czr_skopeReset = new api.CZR_skopeReset();
160
 
161
  api.trigger('czr-skope-started');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
  api.czr_skopeReady
164
  .done( function() {
@@ -166,31 +217,20 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
166
  })
167
  .fail( function( error ) {
168
  api.errorLog( 'Skope could not be instantiated : ' + error );
 
169
  serverControlParams.isSkopOn = false;
 
 
170
  api.czr_isLoadingSkope( false );
171
  });
172
  if ( 'rejected' != api.czr_skopeReady.state() ) {
173
  setTimeout( function() {
174
  if ( 'pending' == api.czr_skopeReady.state() ) {
175
- api.czr_skopeBase.toggleTopNote( true, {
176
- title : serverControlParams.i18n.skope['There was a problem when trying to load the customizer.'],
177
- message : [
178
- serverControlParams.i18n.skope['Please open your'],
179
- '<a href="http://docs.presscustomizr.com/article/272-inspect-your-webpages-in-your-browser-with-the-development-tools" target="_blank">',
180
- serverControlParams.i18n.skope['browser debug tool'],
181
- '</a>',
182
- ',',
183
- serverControlParams.i18n.skope['and report any error message (in red) printed in the javascript console in the'],
184
- '<a href="https://wordpress.org/support/theme/hueman" target="_blank">',
185
- serverControlParams.i18n.skope['Hueman theme forum'],
186
- '</a>.'
187
- ].join(' '),
188
- selfCloseAfter : 40000
189
- });
190
 
191
  api.czr_isLoadingSkope( false );
192
  }
193
- }, 30000);
194
  }
195
  }
196
  if ( serverControlParams.isChangeSetOn ) {
@@ -198,8 +238,23 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
198
  }
199
  } );
200
  if ( ! _.has( api, '_latestRevision') ) {
 
 
 
201
  api._latestRevision = 0;
 
 
 
 
202
  api._latestSettingRevisions = {};
 
 
 
 
 
 
 
 
203
  api.bind( 'change', function incrementChangedSettingRevision( setting ) {
204
  api._latestRevision += 1;
205
  api._latestSettingRevisions[ setting.id ] = api._latestRevision;
@@ -271,7 +326,68 @@ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push
271
  _destroy();
272
  }
273
  };//toggleSkopeLoadPane
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  })( wp.customize , jQuery, _);
 
 
 
 
 
 
 
275
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
276
  (function ( api, $, _ ) {
277
  $.extend( CZRSkopeBaseMths, {
@@ -283,8 +399,8 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
283
  self.skope_colors = {
284
  global : 'rgb(255, 255, 255)',
285
  special_group : 'rgba(173, 213, 247, 0.55)',
286
- group : 'rgba(173, 213, 247, 0.55)',
287
- local : 'rgba(78, 122, 199, 0.35)'
288
  };
289
  api.czr_isPreviewerSkopeAware = $.Deferred();
290
  api.czr_initialSkopeCollectionPopulated = $.Deferred();
@@ -310,11 +426,15 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
310
  }
311
  });
312
  api.previewer.bind( 'czr-skopes-synced', function( data ) {
313
- if ( ! serverControlParams.isSkopOn || 'rejected' == api.czr_skopeReady.state() )
314
- return;
 
315
  var preview = this,
316
  previousSkopeCollection = api.czr_currentSkopesCollection();
317
  if ( ! _.has( data, 'czr_skopes') ) {
 
 
 
318
  api.errorLog( "On 'czr-skopes-synced' : missing skopes in the server data" );
319
  return;
320
  }
@@ -324,6 +444,14 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
324
  api.czr_skopeReady.reject( er );
325
  return;
326
  }
 
 
 
 
 
 
 
 
327
  api.czr_initialSkopeCollectionPopulated.then( function() {
328
  var refreshActiveSkope = _.isUndefined( _.findWhere( api.czr_currentSkopesCollection(), {id : api.czr_activeSkopeId() } ) );
329
  api.czr_skopeBase.reactWhenSkopeSyncedDone( data ).done( function() {
@@ -334,7 +462,7 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
334
  if ( 'resolved' != api.czr_skopeReady.state() ) {
335
  api.czr_skopeReady.resolve( self.getActiveSkopeId() );
336
  }
337
- self._writeCurrentSkopeTitle();
338
  })
339
  .fail( function() {
340
  throw new Error( 'Error when trying to set the active skope after skope synced.' );
@@ -347,7 +475,7 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
347
  _newLoc =_.findWhere( data.czr_skopes, { skope : 'local' } ).opt_name;
348
 
349
  if ( _newLoc !== _prevLoc && 'resolved' == api.czr_skopeReady.state() ) {
350
- self._writeCurrentSkopeTitle();
351
  }
352
  }
353
  });
@@ -389,34 +517,7 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
389
  api.czr_serverNotification.bind( function( to, from ) {
390
  self.toggleServerNotice( to );
391
  });
392
- api.czr_topNoteVisible = new api.Value( false );
393
- api.czr_skopeReady.then( function() {
394
- api.czr_topNoteVisible.bind( function( visible ) {
395
- var noteParams = {},
396
- _defaultParams = {
397
- title : '',
398
- message : '',
399
- actions : '',
400
- selfCloseAfter : 20000
401
- };
402
- noteParams = $.extend( _defaultParams , serverControlParams.topNoteParams );
403
- noteParams.actions = function() {
404
- var _query = $.extend(
405
- api.previewer.query(),
406
- { nonce: api.previewer.nonce.save }
407
- );
408
- wp.ajax.post( 'czr_dismiss_top_note' , _query )
409
- .always( function () {})
410
- .fail( function ( response ) { api.consoleLog( 'czr_dismiss_top_note failed', _query, response ); })
411
- .done( function( response ) {});
412
- };
413
-
414
- self.toggleTopNote( visible, noteParams );
415
- });
416
- _.delay( function() {
417
- api.czr_topNoteVisible( ! _.isEmpty( serverControlParams.isTopNoteOn ) || 1 == serverControlParams.isTopNoteOn );
418
- }, 2000 );
419
- });
420
  self.scopeSwitcherEventMap = [
421
  {
422
  trigger : 'click keydown',
@@ -454,6 +555,26 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
454
  });
455
  });
456
  },//initialize
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  embedSkopeWrapper : function() {
458
  var self = this;
459
  $('#customize-header-actions').append( $('<div/>', {class:'czr-scope-switcher', html:'<div class="czr-skopes-wrapper"></div>'}) );
@@ -472,10 +593,34 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
472
  ];
473
  api.CZR_Helpers.setupDOMListeners( _eventMap , { dom_el : $('.czr-scope-switcher') }, self );
474
  },
 
 
 
 
 
 
 
 
 
 
 
 
475
  apiDirtynessReact : function( is_dirty ) {
476
  $('body').toggleClass('czr-api-dirty', is_dirty );
477
  api.state( 'saved')( ! is_dirty );
478
  },
 
 
 
 
 
 
 
 
 
 
 
 
479
  setSaveButtonStates : function() {
480
  if ( ! api.state.has('saving') ) {
481
  api.state.create('saving');
@@ -536,6 +681,11 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
536
  });
537
  });
538
  };
 
 
 
 
 
539
  _.delay( function() {
540
  _setupSectionControlDialogs();
541
  }, 500 );
@@ -543,6 +693,67 @@ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
543
  api.czr_skopeReady.then( function() {
544
  _doWhenSkopeReady();
545
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  }
547
  });//$.extend()
548
  })( wp.customize , jQuery, _);
@@ -682,10 +893,10 @@ $.extend( CZRSkopeBaseMths, {
682
  api.CZR_Helpers.setupDOMListeners(
683
  [ {
684
  trigger : 'click keydown',
685
- selector : '.czr-top-note-close',
686
- name : 'close-top-note',
687
  actions : function() {
688
- _destroy().done( function() {
 
689
  if ( _.isFunction( noteParams.actions ) ) {
690
  noteParams.actions();
691
  }
@@ -697,7 +908,7 @@ $.extend( CZRSkopeBaseMths, {
697
  );
698
  });
699
  },
700
- _destroy = function() {
701
  var dfd = $.Deferred();
702
  $('body').removeClass('czr-top-note-open');
703
  if ( self.welcomeNote.length ) {
@@ -716,10 +927,12 @@ $.extend( CZRSkopeBaseMths, {
716
  if ( visible ) {
717
  _renderAndSetup();
718
  } else {
719
- _destroy();
 
 
720
  }
721
  _.delay( function() {
722
- _destroy();
723
  },
724
  noteParams.selfCloseAfter || 20000
725
  );
@@ -748,6 +961,9 @@ $.extend( CZRSkopeBaseMths, {
748
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
749
  (function ( api, $, _ ) {
750
  $.extend( CZRSkopeBaseMths, {
 
 
 
751
  bindAPISettings : function( requestedSetId ) {
752
  var self = this,
753
  _settingChangeReact = function( new_val, old_val, o ) {
@@ -793,6 +1009,10 @@ $.extend( CZRSkopeBaseMths, {
793
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
794
  ( function ( api, $, _ ) {
795
  $.extend( CZRSkopeBaseMths, {
 
 
 
 
796
  reactWhenSkopeSyncedDone : function( server_params ) {
797
  var self = this, dfd = $.Deferred();
798
  if ( ! _.has( server_params, 'czr_skopes' ) || _.isEmpty( server_params.czr_skopes ) ) {
@@ -846,6 +1066,10 @@ $.extend( CZRSkopeBaseMths, {
846
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
847
  ( function ( api, $, _ ) {
848
  $.extend( CZRSkopeBaseMths, {
 
 
 
 
849
  _maybeSetupAssignedMenuLocations : function( active_section ) {
850
  if ( _.isUndefined( active_section ) || _.isEmpty( active_section ) || ! api.section.has( active_section.id ) ) {
851
  api.consoleLog( 'In _maybeSetupAssignedMenuLocations : no valid section_id provided.');
@@ -859,6 +1083,12 @@ $.extend( CZRSkopeBaseMths, {
859
  active_section.assignedLocations.bind( _assignedLocReact );
860
  }
861
  },
 
 
 
 
 
 
862
  activeSectionReact : function( active_sec_id , previous_sec_id ) {
863
  if ( 'add_menu' != active_sec_id ) {
864
  api.trigger('czr-paint', { active_section_id : active_sec_id } );
@@ -956,6 +1186,11 @@ $.extend( CZRSkopeBaseMths, {
956
  }
957
  });
958
  },
 
 
 
 
 
959
  activePanelReact : function( active_panel_id , previous_panel_id ) {
960
  var self = this;
961
  api.czr_initialSkopeCollectionPopulated.then( function() {
@@ -990,9 +1225,16 @@ $.extend( CZRSkopeBaseMths, {
990
  }
991
  });//$.extend()
992
  })( wp.customize , jQuery, _ );
 
 
 
993
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
994
  ( function ( api, $, _ ) {
995
  $.extend( CZRSkopeBaseMths, {
 
 
 
 
996
  wash : function( params ) {
997
  var self = this,
998
  _do_wash = function( element ) {
@@ -1093,8 +1335,215 @@ $.extend( CZRSkopeBaseMths, {
1093
  });//$.extend()
1094
  })( wp.customize , jQuery, _ );
1095
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1096
  ( function ( api, $, _ ) {
1097
  $.extend( CZRSkopeBaseMths, {
 
 
 
 
1098
  isSkopeRegisteredInCollection : function( skope_id, collection ) {
1099
  var self = this;
1100
  collection = collection || api.czr_skopeCollection();
@@ -1136,13 +1585,21 @@ $.extend( CZRSkopeBaseMths, {
1136
  getActiveSkopeId : function( _current_skope_collection ) {
1137
  _current_skope_collection = _current_skope_collection || api.czr_currentSkopesCollection();
1138
 
1139
- var _currentSkopeLevel = ( ! _.isEmpty( api.czr_activeSkopeId() ) && api.czr_skope.has( api.czr_activeSkopeId() ) ) ? api.czr_skope( api.czr_activeSkopeId() )().skope : serverControlParams.isLocalSkope ? 'local' : 'global',
1140
- _newSkopeCandidate = _.findWhere( _current_skope_collection, { skope : _currentSkopeLevel } );
 
 
 
 
 
 
 
 
1141
 
1142
  _skpId = ! _.isUndefined( _newSkopeCandidate ) ? _newSkopeCandidate.id : _.findWhere( _current_skope_collection, { skope : 'global' } ).id;
1143
 
1144
  if ( _.isUndefined( _skpId ) ) {
1145
- throw new Error( 'No default skope was found in getActiveSkopeId ', _current_skope_collection );
1146
  }
1147
  return _skpId;
1148
  },
@@ -1296,6 +1753,11 @@ $.extend( CZRSkopeBaseMths, {
1296
  return self.isSettingSkopeEligible( setId );
1297
  } );
1298
  },
 
 
 
 
 
1299
  parseWidgetId : function( widgetId, prefixToRemove ) {
1300
  var matches, parsed = {
1301
  number: null,
@@ -1314,6 +1776,11 @@ $.extend( CZRSkopeBaseMths, {
1314
  parsed.id_base = parsed.id_base.replace( prefixToRemove , '');
1315
  return parsed;
1316
  },
 
 
 
 
 
1317
  widgetIdToSettingId: function( widgetId , prefixToRemove ) {
1318
  var parsed = this.parseWidgetId( widgetId, prefixToRemove ), settingId;
1319
 
@@ -1826,7 +2293,7 @@ $.extend( CZRSkopeBaseMths, {
1826
  var self = this, dfd = $.Deferred();
1827
  if ( ! _.isUndefined(from) && api.czr_skope.has(from) )
1828
  api.czr_skope(from).active(false);
1829
- else if ( ! _.isUndefined(from) )
1830
  throw new Error('listenToActiveSkope : previous scope does not exist in the collection', from );
1831
 
1832
  if ( ! _.isUndefined(to) && api.czr_skope.has(to) )
@@ -1903,11 +2370,16 @@ $.extend( CZRSkopeBaseMths, {
1903
  throw new Error( 'Fail to process silent updates in _debouncedProcessSilentUpdates');
1904
  })
1905
  .done( function( _updatedSetIds ) {
1906
- api.previewer.refresh()
1907
- .always( function() {
1908
- dfd.resolve( _updatedSetIds );
1909
- api.state( 'switching-skope' )( false );
1910
- });
 
 
 
 
 
1911
  });
1912
  };
1913
  if ( _.has(api, 'czr_isModuleExpanded') && false !== api.czr_isModuleExpanded() ) {
@@ -1976,7 +2448,7 @@ $.extend( CZRSkopeBaseMths, {
1976
  api.state( 'switching-skope' ).isBound = true;
1977
  }
1978
  });
1979
- }
1980
  });//$.extend
1981
  })( wp.customize , jQuery, _ );
1982
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
@@ -2035,6 +2507,13 @@ $.extend( CZRSkopeBaseMths, {
2035
 
2036
  return dfd.promise();
2037
  },
 
 
 
 
 
 
 
2038
  silentlyUpdateSettings : function( _silentUpdateCands, refresh ) {
2039
  if ( ! api.state.has( 'silent-update-processing') )
2040
  api.state.create( 'silent-update-processing' )( false );
@@ -2145,6 +2624,13 @@ $.extend( CZRSkopeBaseMths, {
2145
 
2146
  return dfd.promise();
2147
  },//getSettingUpdatePromise()
 
 
 
 
 
 
 
2148
  _getSilentUpdateCandidates : function( section_id, awake_if_not_active ) {
2149
  var self = this,
2150
  SilentUpdateCands = [];
@@ -2175,6 +2661,10 @@ $.extend( CZRSkopeBaseMths, {
2175
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2176
  ( function ( api, $, _ ) {
2177
  $.extend( CZRSkopeBaseMths, {
 
 
 
 
2178
  _processCzrModuleSilentActions : function( wpSetId, control_type, skope_id, _control_data) {
2179
  var _synced_control_id, _synced_control_val, _synced_control_data, _synced_control_constructor, _syncSektionModuleId,
2180
  _synced_short_id = _.has( api.control( wpSetId ).params, 'syncCollection' ) ? api.control( wpSetId ).params.syncCollection : '',
@@ -2205,6 +2695,14 @@ $.extend( CZRSkopeBaseMths, {
2205
  api.control( wpSetId ).czr_Module( _syncSektionModuleId ).fireSektionModule();
2206
  }
2207
  },
 
 
 
 
 
 
 
 
2208
  _getCzrCroppedImagePromise : function( wpSetId, _control_data ) {
2209
  var _constructor = api.controlConstructor.czr_cropped_image, dfd = $.Deferred(),
2210
  val = api.has(wpSetId) ? api(wpSetId)() : null;
@@ -2224,6 +2722,12 @@ $.extend( CZRSkopeBaseMths, {
2224
  });
2225
  return dfd.promise();
2226
  },
 
 
 
 
 
 
2227
  _getHeaderImagePromise : function( wpSetId, skope_id ) {
2228
  var dfd = $.Deferred();
2229
  if ( ! _.has(api.settings.controls, 'header_image') || 'header_image' != wpSetId ) {
@@ -2274,9 +2778,16 @@ $.extend( CZRSkopeBaseMths, {
2274
  }
2275
  });//$.extend
2276
  })( wp.customize , jQuery, _ );
 
 
 
 
2277
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2278
  ( function ( api, $, _ ) {
2279
  $.extend( CZRSkopeBaseMths, {
 
 
 
2280
  setupActiveSkopedControls : function( obj ) {
2281
  var self = this, section_id, controls, setupParams, eligibleCtrls, dfd = $.Deferred();
2282
  defaultSetupParams = {
@@ -2487,6 +2998,10 @@ $.extend( CZRSkopeBaseMths, {
2487
  }
2488
  });//$.extend()
2489
  })( wp.customize , jQuery, _ );
 
 
 
 
2490
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2491
  ( function ( api, $, _ ) {
2492
  $.extend( CZRSkopeBaseMths, {
@@ -2709,6 +3224,10 @@ $.extend( CZRSkopeBaseMths, {
2709
  }
2710
  });//$.extend()
2711
  })( wp.customize , jQuery, _ );
 
 
 
 
2712
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2713
  ( function ( api, $, _ ) {
2714
  $.extend( CZRSkopeBaseMths, {
@@ -2744,13 +3263,15 @@ $.extend( CZRSkopeBaseMths, {
2744
  _isSkoped = function( setId ) {
2745
  return setId && self.isSettingSkopeEligible( setId );
2746
  },//filter only eligible ctrlIds
 
2747
  _generateControlNotice = function( setId, _localSkopeId ) {
2748
  var _currentSkopeId = api.czr_activeSkopeId(),
2749
  _inheritedFromSkopeId = self.getInheritedSkopeId( setId, _currentSkopeId ),
2750
  _overridedBySkopeId = self.getAppliedPrioritySkopeId( setId, _currentSkopeId ),
2751
  _html = [],
2752
  _isCustomized,
2753
- _hasDBVal;
 
2754
  if ( ! _isSkoped( setId ) ) {
2755
  _html.push( [
2756
  serverControlParams.i18n.skope['This option is always customized sitewide and cannot be reset.']
@@ -2761,6 +3282,10 @@ $.extend( CZRSkopeBaseMths, {
2761
  _isCustomized = ! _.isUndefined( api.czr_skope( _currentSkopeId ).dirtyValues()[setId] );
2762
  _hasDBVal = ! _.isUndefined( api.czr_skope( _currentSkopeId ).dbValues()[setId] );
2763
 
 
 
 
 
2764
  if ( _isCustomized ) {
2765
  if ( 'global' == api.czr_skope( _inheritedFromSkopeId )().skope ) {
2766
  _html.push( [
@@ -2769,7 +3294,7 @@ $.extend( CZRSkopeBaseMths, {
2769
  } else {
2770
  _html.push( [
2771
  serverControlParams.i18n.skope['Customized. Will be applied to'],
2772
- '<strong>' + api.czr_skope( _inheritedFromSkopeId )().ctx_title + '</strong>',
2773
  serverControlParams.i18n.skope['once published.']
2774
  ].join(' ') );
2775
  }
@@ -2782,7 +3307,7 @@ $.extend( CZRSkopeBaseMths, {
2782
  } else {
2783
  _html.push( [
2784
  serverControlParams.i18n.skope['Customized and applied to'],
2785
- '<strong>' + api.czr_skope( _inheritedFromSkopeId )().ctx_title + '.' + '</strong>'
2786
  ].join(' ') );
2787
  }
2788
  } else {
@@ -2793,12 +3318,17 @@ $.extend( CZRSkopeBaseMths, {
2793
  if ( _inheritedFromSkopeId !== _currentSkopeId && api.czr_skope.has( _inheritedFromSkopeId ) ) {
2794
  _isCustomized = ! _.isUndefined( api.czr_skope( _inheritedFromSkopeId ).dirtyValues()[setId] );
2795
  _hasDBVal = ! _.isUndefined( api.czr_skope( _inheritedFromSkopeId ).dbValues()[setId] );
 
 
 
 
 
2796
  if ( ! _isCustomized && ! _hasDBVal ) {
2797
  _html.push(
2798
  [
2799
  serverControlParams.i18n.skope['Default website value.'],
2800
  serverControlParams.i18n.skope['You can customize this specifically for'],
2801
- '<strong>' + api.czr_skope( _currentSkopeId )().ctx_title + '.' + '</strong>'
2802
  ].join(' ')
2803
  );
2804
  } else {
@@ -2807,7 +3337,7 @@ $.extend( CZRSkopeBaseMths, {
2807
  serverControlParams.i18n.skope['Currently inherited from'],
2808
  self.buildSkopeLink( _inheritedFromSkopeId ) + '.',
2809
  serverControlParams.i18n.skope['You can customize this specifically for'],
2810
- '<strong>' + api.czr_skope( _currentSkopeId )().ctx_title + '.' + '</strong>'
2811
  ].join(' ')
2812
  );
2813
  }
@@ -2815,9 +3345,13 @@ $.extend( CZRSkopeBaseMths, {
2815
  if ( _overridedBySkopeId !== _currentSkopeId && api.czr_skope.has( _overridedBySkopeId ) ) {
2816
  _isCustomized = ! _.isUndefined( api.czr_skope( _overridedBySkopeId ).dirtyValues()[setId] );
2817
 
 
 
 
 
2818
  _html.push( [
2819
  ! _isCustomized ? serverControlParams.i18n.skope['The value currently applied to'] : serverControlParams.i18n.skope['The value that will be applied to'],
2820
- '<strong>' + api.czr_skope( _localSkopeId )().ctx_title + '</strong>',
2821
  ! _isCustomized ? serverControlParams.i18n.skope['is set in'] : serverControlParams.i18n.skope['is customized in'],
2822
  self.buildSkopeLink( _overridedBySkopeId ),
2823
  serverControlParams.i18n.skope['which has a higher priority than the current option scope'],
@@ -2980,6 +3514,12 @@ $.extend( CZRSkopeSaveMths, {
2980
  api.state( 'changesetStatus' ).set( response.changeset_status );
2981
  if ( 'publish' === response.changeset_status ) {
2982
  api.each( function( setting ) {
 
 
 
 
 
 
2983
  if ( setting._dirty && ( _.isUndefined( api._latestSettingRevisions[ setting.id ] ) || api._latestSettingRevisions[ setting.id ] <= latestRevision ) ) {
2984
  setting._dirty = false;
2985
  }
@@ -3082,6 +3622,7 @@ $.extend( CZRSkopeSaveMths, {
3082
  opt_name : null
3083
  },
3084
  invalidSettings = [],
 
3085
  modifiedWhileSaving = {},
3086
  invalidControls,
3087
  submit_dfd = $.Deferred();
@@ -3095,6 +3636,12 @@ $.extend( CZRSkopeSaveMths, {
3095
  if ( _.isNull( params.the_dirties ) ) {
3096
  throw new Error( 'OVERRIDEN SAVE::submit : MISSING the_dirties');
3097
  }
 
 
 
 
 
 
3098
  if ( _.has( api, 'Notification') ) {
3099
  api.each( function( setting ) {
3100
  setting.notifications.each( function( notification ) {
@@ -3128,6 +3675,11 @@ $.extend( CZRSkopeSaveMths, {
3128
  if ( api.czr_isChangeSetOn() ) {
3129
  $.extend( query_params, { excludeCustomizedSaved: false } );
3130
  }
 
 
 
 
 
3131
  var query = $.extend( self.previewer.query( query_params ), {
3132
  nonce: self.previewer.nonce.save,
3133
  customize_changeset_status: self.changesetStatus,
@@ -3141,6 +3693,18 @@ $.extend( CZRSkopeSaveMths, {
3141
  query.customize_changeset_title = self.saveArgs.title;
3142
  }
3143
  }
 
 
 
 
 
 
 
 
 
 
 
 
3144
  var request = wp.ajax.post(
3145
  'global' !== query.skope ? 'customize_skope_changeset_save' : 'customize_save',
3146
  query
@@ -3632,6 +4196,9 @@ $.extend( CZRSkopeBaseMths, {
3632
  var CZRSkopeMths = CZRSkopeMths || {};
3633
  ( function ( api, $, _ ) {
3634
  $.extend( CZRSkopeMths, {
 
 
 
3635
  initialize: function( skope_id, constructor_options ) {
3636
  var skope = this;
3637
  api.Value.prototype.initialize.call( skope, null, constructor_options );
@@ -3710,6 +4277,13 @@ $.extend( CZRSkopeMths, {
3710
  }
3711
  });
3712
  },
 
 
 
 
 
 
 
3713
  dirtyValuesReact : function( to, from ) {
3714
  var skope = this;
3715
  skope.dirtyness( ! _.isEmpty( to ) );
@@ -3733,11 +4307,21 @@ $.extend( CZRSkopeMths, {
3733
  });
3734
  }
3735
  },
 
 
 
 
 
3736
  changesetValuesReact : function( to, from ) {
3737
  var skope = this,
3738
  _currentServerDirties = $.extend( true, {}, skope.dirtyValues() );
3739
  skope.dirtyValues( $.extend( _currentServerDirties, to ) );
3740
  },
 
 
 
 
 
3741
  dbValuesReact : function( to, from ) {
3742
  var skope = this;
3743
  skope.hasDBValues(
@@ -3769,6 +4353,11 @@ $.extend( CZRSkopeMths, {
3769
  });
3770
  }
3771
  },
 
 
 
 
 
3772
  skopeReact : function( to, from ) {
3773
  var skope = this,
3774
  _current_collection = [],
@@ -3789,6 +4378,18 @@ $.extend( CZRSkopeMths, {
3789
  api.czr_skopeCollection( _new_collection );
3790
  }
3791
  },
 
 
 
 
 
 
 
 
 
 
 
 
3792
  setupObservableViewValuesCallbacks : function() {
3793
  var skope = this;
3794
  skope.visible.bind( function( is_visible ){
@@ -3885,6 +4486,13 @@ $.extend( CZRSkopeMths, {
3885
  });
3886
  }
3887
  },
 
 
 
 
 
 
 
3888
  updateSkopeDirties : function( setId, new_val ) {
3889
  var skope = this,
3890
  shortSetId = api.CZR_Helpers.getOptionName( setId );
@@ -3940,6 +4548,12 @@ $.extend( CZRSkopeMths, {
3940
  $('.czr-skopes-wrapper', '#customize-header-actions').append( $( _tmpl ) );
3941
  return $( '.' + skope.el , '.czr-skopes-wrapper' );
3942
  },
 
 
 
 
 
 
3943
  renderResetWarningTmpl : function() {
3944
  var skope = this,
3945
  skope_model = $.extend( true, {}, skope() ),
@@ -3984,6 +4598,13 @@ $.extend( CZRSkopeMths, {
3984
 
3985
  return $( '#czr-skope-pane' );
3986
  },
 
 
 
 
 
 
 
3987
  getEl : function() {
3988
  var skope = this;
3989
  return $( skope.el, '#customize-header-actions');
@@ -3994,6 +4615,9 @@ $.extend( CZRSkopeMths, {
3994
  var CZRSkopeMths = CZRSkopeMths || {};
3995
  ( function ( api, $, _ ) {
3996
  $.extend( CZRSkopeMths, {
 
 
 
3997
  reactOnSkopeResetUserRequest : function() {
3998
  var skope = this,
3999
  _fireReaction = function() {
@@ -4153,6 +4777,17 @@ $.extend( CZRSkopeMths, {
4153
  });//$.extend(
4154
  })( wp.customize , jQuery, _ );
4155
  ( function ( api, $, _ ) {
 
 
 
 
 
 
 
 
 
 
 
4156
  api.Value.prototype.set = function( to, o ) {
4157
  var from = this._value, dfd = $.Deferred(), self = this, _promises = [];
4158
 
@@ -4209,6 +4844,14 @@ $.extend( CZRSkopeMths, {
4209
  }
4210
  return this;
4211
  };
 
 
 
 
 
 
 
 
4212
  api.Setting.prototype.silent_set =function( to, dirtyness ) {
4213
  var from = this._value,
4214
  _save_state = api.state('saved')();
@@ -4228,9 +4871,18 @@ $.extend( CZRSkopeMths, {
4228
  };
4229
  })( wp.customize , jQuery, _ );
4230
  ( function ( api, $, _ ) {
 
 
 
4231
  api.bind('ready', function() {
4232
  if ( ! serverControlParams.isSkopOn )
4233
  return;
 
 
 
 
 
 
4234
  var _coreQuery = api.previewer.query;
4235
  api.previewer.query = function( queryVars ) {
4236
  if ( ! serverControlParams.isSkopOn ) {
@@ -4371,6 +5023,10 @@ $.extend( CZRSkopeMths, {
4371
  (function (api, $, _) {
4372
  if ( ! serverControlParams.isSkopOn )
4373
  return;
 
 
 
 
4374
  api.Element.synchronizer.checkbox.update = function( to ) {
4375
  this.element.prop( 'checked', to );
4376
  this.element.iCheck('update');
@@ -4559,6 +5215,11 @@ $.extend( CZRSkopeMths, {
4559
  czr_override_refresh_for_skope = function() {
4560
  if ( ! serverControlParams.isSkopOn )
4561
  return;
 
 
 
 
 
4562
  api.previewer.refresh = function( _params_ ) {
4563
  var dfd = $.Deferred();
4564
  var _refresh_ = function( params ) {
@@ -4592,6 +5253,16 @@ $.extend( CZRSkopeMths, {
4592
  ( function ( api, $, _ ) {
4593
  if ( ! serverControlParams.isSkopOn )
4594
  return;
 
 
 
 
 
 
 
 
 
 
4595
  api.dirtyValues = function dirtyValues( options ) {
4596
  return api.czr_skopeBase.getSkopeDirties( api.czr_skopeBase.getGlobalSkopeId(), options );
4597
  };
@@ -4601,6 +5272,16 @@ $.extend( CZRSkopeMths, {
4601
  if ( ! serverControlParams.isSkopOn || ! api.czr_isChangeSetOn() )
4602
  return;
4603
  var _original_requestChangesetUpdate = api.requestChangesetUpdate;
 
 
 
 
 
 
 
 
 
 
4604
  api.requestChangesetUpdate = function( changes ) {
4605
  var self = this,
4606
  dfd = $.Deferred(),
@@ -4823,6 +5504,7 @@ $.extend( CZRSkopeMths, {
4823
  };//api.Setting.prototype.preview
4824
  })( wp.customize , jQuery, _ );
4825
  ( function ( api, $, _ ) {
 
4826
  if ( 'function' == typeof api.Section ) {
4827
  var _original_section_initialize = api.Section.prototype.initialize;
4828
  api.Section.prototype.initialize = function( id, options ) {
@@ -4879,6 +5561,12 @@ api.CZR_Helpers = $.extend( api.CZR_Helpers, {
4879
  '<span class="fa fa-question-circle-o"></span>'
4880
  ].join('');
4881
  },
 
 
 
 
 
 
4882
  build_setId : function ( setId ) {
4883
  if ( _.contains( serverControlParams.wpBuiltinSettings, setId ) )
4884
  return setId;
@@ -4887,6 +5575,11 @@ api.CZR_Helpers = $.extend( api.CZR_Helpers, {
4887
 
4888
  return -1 == setId.indexOf( serverControlParams.themeOptions ) ? [ serverControlParams.themeOptions +'[' , setId , ']' ].join('') : setId;
4889
  },
 
 
 
 
 
4890
  getOptionName : function(name) {
4891
  var self = this;
4892
  if ( -1 == name.indexOf(serverControlParams.themeOptions) )
@@ -5182,6 +5875,9 @@ api.CZR_Helpers = $.extend( api.CZR_Helpers, {
5182
  api.czr_wpQueryDataReady = $.Deferred();
5183
  api.czr_wpQueryInfos = api.czr_wpQueryInfos || new api.Value();
5184
  api.czr_partials = api.czr_partials || new api.Value();
 
 
 
5185
  api.bind( 'ready', function() {
5186
  api.previewer.bind('houston-widget-settings', function(data) {
5187
  var _candidates = _.filter( data.registeredSidebars, function( sb ) {
@@ -5209,6 +5905,8 @@ api.CZR_Helpers = $.extend( api.CZR_Helpers, {
5209
  } );
5210
 
5211
  });
 
 
5212
  api.previewer.bind( 'czr-query-data-ready', function( data ) {
5213
  api.czr_wpQueryInfos( data );
5214
  if ( 'pending' == api.czr_wpQueryDataReady.state() ) {
@@ -5286,6 +5984,12 @@ $.extend( CZRInputMths , {
5286
  input.container.stop( true, true ).slideUp( 200 );
5287
  });
5288
  });
 
 
 
 
 
 
5289
 
5290
  },
5291
  ready : function() {
@@ -5313,29 +6017,36 @@ $.extend( CZRInputMths , {
5313
  syncElement.set( input() );
5314
  },
5315
  inputReact : function( to, from, data ) {
5316
- var input = this,
5317
- _current_input_parent = input.input_parent(),
5318
- _new_model = _.clone( _current_input_parent ),//initialize it to the current value
5319
- _isPreItemInput = input.is_preItemInput;
5320
- _new_model = ( ! _.isObject(_new_model) || _.isEmpty(_new_model) ) ? {} : _new_model;
5321
- _new_model[input.id] = to;
5322
- input.input_parent.set( _new_model, {
5323
- input_changed : input.id,
5324
- input_transport : input.transport,
5325
- not_preview_sent : 'postMessage' === input.transport//<= this parameter set to true will prevent the setting to be sent to the preview ( @see api.Setting.prototype.preview override ). This is useful to decide if a specific input should refresh or not the preview.
5326
- } );
5327
- if ( ! _isPreItemInput ) {
5328
- input.input_parent.trigger( input.id + ':changed', to );
5329
- if ( ! _.isEmpty( from ) || ! _.isUndefined( from ) && 'postMessage' === input.transport ) {
5330
- input.module.sendInputToPreview( {
5331
- input_id : input.id,
5332
- input_parent_id : input.input_parent.id,
5333
- to : to,
5334
- from : from
5335
- } );
5336
- }
5337
- }
 
 
5338
  },
 
 
 
 
 
5339
  setupColorPicker : function() {
5340
  var input = this;
5341
 
@@ -5459,6 +6170,9 @@ $.extend( CZRInputMths , {
5459
  input.setupContentRendering(to,from);
5460
  });
5461
  },
 
 
 
5462
  czrImgUploadOpenFrame: function( event ) {
5463
  if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
5464
  return;
@@ -5472,6 +6186,10 @@ $.extend( CZRInputMths , {
5472
 
5473
  this.frame.open();
5474
  },
 
 
 
 
5475
  czrImgUploadInitFrame: function() {
5476
  var input = this,
5477
  button_labels = this.getUploaderLabels();
@@ -5491,6 +6209,12 @@ $.extend( CZRInputMths , {
5491
  });
5492
  input.frame.on( 'select', input.czrImgUploadSelect );
5493
  },
 
 
 
 
 
 
5494
  czrImgUploadRemoveFile: function( event ) {
5495
  var input = this;
5496
 
@@ -5501,6 +6225,12 @@ $.extend( CZRInputMths , {
5501
  input.attachment = {};
5502
  input.set('');
5503
  },
 
 
 
 
 
 
5504
  czrImgUploadSelect: function() {
5505
  var node,
5506
  input = this,
@@ -5567,12 +6297,16 @@ $.extend( CZRInputMths , {
5567
  setupContentPicker: function( wpObjectTypes ) {
5568
  var input = this,
5569
  _event_map = [];
 
 
5570
  $.extend( {
5571
  post : '',
5572
  taxonomy : ''
5573
  }, _.isObject( wpObjectTypes ) ? wpObjectTypes : {} );
5574
 
5575
  input.wpObjectTypes = wpObjectTypes;
 
 
5576
  input.container.find('.czr-input').append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>');
5577
  _event_map = [
5578
  {
@@ -5580,7 +6314,7 @@ $.extend( CZRInputMths , {
5580
  selector : 'select[data-select-type]',
5581
  name : 'set_input_value',
5582
  actions : function( obj ){
5583
- var $_changed_input = $(obj.dom_event.currentTarget, obj.dom_el ),
5584
  _raw_val = $( $_changed_input, obj.dom_el ).select2( 'data' ),
5585
  _val_candidate = {},
5586
  _default = {
@@ -5593,13 +6327,13 @@ $.extend( CZRInputMths , {
5593
 
5594
  _raw_val = _.isArray( _raw_val ) ? _raw_val[0] : _raw_val;
5595
  if ( ! _.isObject( _raw_val ) || _.isEmpty( _raw_val ) ) {
5596
- api.consoleLog( 'Content Picker Input : the picked value should be an object not empty.');
5597
  return;
5598
  }
5599
  _.each( _default, function( val, k ){
5600
  if ( '_custom_' !== _raw_val.id ) {
5601
  if ( ! _.has( _raw_val, k ) || _.isEmpty( _raw_val[ k ] ) ) {
5602
- api.consoleLog( 'content_picker : missing input param : ' + k );
5603
  return;
5604
  }
5605
  }
@@ -5611,13 +6345,23 @@ $.extend( CZRInputMths , {
5611
  ];
5612
 
5613
  input.setupDOMListeners( _event_map , { dom_el : input.container }, input );
5614
- input.setupContentSelecter();
5615
- },
 
5616
 
 
5617
  setupContentSelecter : function() {
5618
  var input = this;
 
 
 
 
 
 
 
 
5619
 
5620
- input.container.find('select').select2( {
5621
  placeholder: {
5622
  id: '-1', // the value of the option
5623
  title: 'Select'
@@ -5630,7 +6374,7 @@ $.extend( CZRInputMths , {
5630
  delay: 250,
5631
  debug: true,
5632
  data: function ( params ) {
5633
- var page = params.page ? params.page - 1 : 0;
5634
  page = params.term ? params.page : page;
5635
  return {
5636
  action : params.term ? "search-available-content-items-customizer" : "load-available-content-items-customizer",
@@ -5641,14 +6385,23 @@ $.extend( CZRInputMths , {
5641
  CZRCpNonce : serverControlParams.CZRCpNonce
5642
  };
5643
  },
 
 
 
 
 
 
 
 
5644
  processResults: function ( data, params ) {
5645
  input.defaultContentPickerOption = input.defaultContentPickerOption || [];
5646
 
5647
  if ( ! data.success )
5648
  return { results: input.defaultContentPickerOption };
5649
 
 
5650
  var items = data.data.items,
5651
- _results = _.clone( input.defaultContentPickerOption );
5652
 
5653
  _.each( items, function( item ) {
5654
  _results.push({
@@ -5661,25 +6414,23 @@ $.extend( CZRInputMths , {
5661
  });
5662
  return {
5663
  results: _results,
5664
- pagination: { more: data.data.items.length == 10 }
5665
  };
5666
  },
5667
  },//ajax
5668
  templateSelection: input.czrFormatContentSelected,
5669
  templateResult: input.czrFormatContentSelected,
5670
- escapeMarkup: function (markup) { return markup; },
5671
  });//select2 setup
5672
  },
5673
-
5674
-
5675
- czrFormatContentSelected: function (item) {
5676
  if ( item.loading ) return item.text;
5677
  var markup = "<div class='content-picker-item clearfix'>" +
5678
  "<div class='content-item-bar'>" +
5679
- "<span class='item-title'>" + item.title + "</span>";
5680
 
5681
  if ( item.type_label ) {
5682
- markup += "<span class='item-type'>" + item.type_label + "</span>";
5683
  }
5684
 
5685
  markup += "</div></div>";
@@ -5758,6 +6509,9 @@ $.extend( CZRInputMths , {
5758
  input.editorExpanded.bind( function (expanded) {
5759
 
5760
  api.consoleLog('in input.editorExpanded', expanded, input() );
 
 
 
5761
  if ( editor.locker && editor.locker !== input ) {
5762
  editor.locker.editorExpanded.set(false);
5763
  editor.locker = null;
@@ -6070,7 +6824,10 @@ $.extend( CZRItemMths , {
6070
  _new_collection = _.without( _new_collection, _.findWhere( _new_collection, {id: item.id }) );
6071
  module.itemCollection.set( _new_collection );
6072
  module.trigger('pre_item_api_remove', item() );
6073
- module.czr_Item.remove(item.id);
 
 
 
6074
  },
6075
  getModel : function(id) {
6076
  return this();
@@ -6116,6 +6873,10 @@ $.extend( CZRItemMths , {
6116
  if ( item.module.isMultiItem() ) {
6117
  item.viewState.callbacks.add( function( to, from ) {
6118
  var _isExpanded = -1 !== to.indexOf( 'expanded' );
 
 
 
 
6119
  if ( _isExpanded ) {
6120
  if ( _.isObject( item.contentContainer ) && false !== item.contentContainer.length ) {
6121
  item.toggleItemExpansion(to, from );
@@ -6235,7 +6996,7 @@ $.extend( CZRItemMths , {
6235
  _title = _.has( _model, 'title')? api.CZR_Helpers.capitalize( _model.title ) : _model.id;
6236
 
6237
  _title = api.CZR_Helpers.truncate( _title, 20 );
6238
- $( '.' + module.control.css_attr.item_title , item.container ).text(_title );
6239
  api.CZR_Helpers.doActions('after_writeViewTitle', item.container , _model, item );
6240
  },
6241
  setViewVisibility : function( obj, is_added_by_user ) {
@@ -6316,9 +7077,10 @@ $.extend( CZRModOptMths , {
6316
  var ctrl = modOpt.module.control;
6317
  modOpt.set( _initial_model );
6318
  api.czr_ModOptVisible = new api.Value( false );
6319
- api.czr_ModOptVisible.bind( function( visible ) {
 
6320
  if ( visible ) {
6321
- modOpt.module.closeRemoveDialogs();
6322
 
6323
  modOpt.modOptWrapperViewSetup( _initial_model ).done( function( $_container ) {
6324
  modOpt.container = $_container;
@@ -6327,6 +7089,13 @@ $.extend( CZRModOptMths , {
6327
  } catch(e) {
6328
  api.consoleLog(e);
6329
  }
 
 
 
 
 
 
 
6330
  });
6331
 
6332
  } else {
@@ -6497,6 +7266,7 @@ $.extend( CZRModuleMths, {
6497
 
6498
  } );
6499
  module.embedded = $.Deferred();
 
6500
  if ( ! module.isInSektion() ) {
6501
  module.container = $( module.control.selector );
6502
  module.embedded.resolve();
@@ -6509,6 +7279,10 @@ $.extend( CZRModuleMths, {
6509
  module.itemsWrapper = $_module_items_wrapper;
6510
  });
6511
  });
 
 
 
 
6512
  module.defaultAPImodOptModel = {
6513
  initial_modOpt_model : {},
6514
  defaultModOptModel : {},
@@ -6517,6 +7291,10 @@ $.extend( CZRModuleMths, {
6517
  };
6518
  module.defaultModOptModel = {};
6519
  module.modOptConstructor = api.CZRModOpt;
 
 
 
 
6520
  module.itemCollection = new api.Value( [] );
6521
  module.defaultAPIitemModel = {
6522
  id : '',
@@ -6529,11 +7307,21 @@ $.extend( CZRModuleMths, {
6529
  module.defaultItemModel = { id : '', title : '' };
6530
  module.itemConstructor = api.CZRItem;
6531
  module.czr_Item = new api.Values();
 
 
 
 
 
6532
  module.inputConstructor = api.CZRInput;//constructor for the items input
6533
  if ( module.hasModOpt() ) {
6534
  module.inputModOptConstructor = api.CZRInput;//constructor for the modOpt input
6535
  }
6536
  module.inputOptions = {};//<= can be set by each module specifically
 
 
 
 
 
6537
  module.isReady.done( function() {
6538
  module.isDirty = new api.Value( constructorOptions.dirty || false );
6539
  module.initializeModuleModel( constructorOptions )
@@ -6586,7 +7374,7 @@ $.extend( CZRModuleMths, {
6586
  moduleReact : function( to, from, data ) {
6587
  var module = this,
6588
  control = module.control,
6589
- isItemUpdate = ( _.size(from.items) == _.size(to.items) ) && ! _.isEmpty( _.difference(to.items, from.items) ),
6590
  isColumnUpdate = to.column_id != from.column_id,
6591
  refreshPreview = function() {
6592
  module.control.previewer.refresh();
@@ -6674,14 +7462,15 @@ $.extend( CZRModuleMths, {
6674
  module.control.previewer.send( 'czr_input', {
6675
  set_id : api.CZR_Helpers.getControlSettingId( module.control.id ),
6676
  module_id : module.id,//<= will allow us to target the right dom element on front end
6677
- module : { items : $.extend( true, {}, module().items) , modOpt : module.hasModOpt() ? $.extend( true, {}, module().modOpt ): {} },
6678
  input_parent_id : args.input_parent_id,//<= can be the mod opt or the item
6679
  input_id : args.input_id,
6680
- value : args.to
 
6681
  });
6682
  module.trigger( 'input_sent', { input : args.to , dom_el: module.container } );
6683
  },
6684
- sendModuleInputsToPreview : function() {
6685
  var module = this,
6686
  _sendInputData = function() {
6687
  var inputParent = this,//this is the input parent : item or modOpt
@@ -6693,7 +7482,8 @@ $.extend( CZRModuleMths, {
6693
  input_id : inputId,
6694
  input_parent_id : inputParent.id,
6695
  to : inputVal,
6696
- from : null
 
6697
  });
6698
  });
6699
  };
@@ -7072,6 +7862,12 @@ $.extend( CZRModuleMths, {
7072
  }
7073
  );
7074
  },
 
 
 
 
 
 
7075
  toggleTabVisibility : function( args ) {
7076
  var inputParent = this,
7077
  tabs = $( inputParent.container ).find('li'),
@@ -7126,6 +7922,8 @@ $.extend( CZRDynModuleMths, {
7126
  $.extend( module, {
7127
  itemPreAddEl : ''//is specific for each crud module
7128
  } );
 
 
7129
  module.itemAddedMessage = serverControlParams.i18n.successMessage;
7130
  module.userEventMap = new api.Value( [
7131
  {
@@ -7147,7 +7945,8 @@ $.extend( CZRDynModuleMths, {
7147
  module.setupDOMListeners( module.userEventMap() , { dom_el : module.container } );
7148
  module.preItem = new api.Value( module.getDefaultItemModel() );
7149
  module.preItemEmbedded = $.Deferred();//was module.czr_preItem.create('item_content');
7150
- module.preItemEmbedded.done( function() {
 
7151
  module.setupPreItemInputCollection();
7152
  });
7153
  module.preItemExpanded = new api.Value(false);
@@ -7181,27 +7980,37 @@ $.extend( CZRDynModuleMths, {
7181
  collapsePreItem = function() {
7182
  module.preItemExpanded.set(false);
7183
  module._resetPreItemInputs();
7184
- module.toggleSuccessMessage('off');
7185
- };
7186
 
7187
  if ( _.isEmpty(item) || ! _.isObject(item) ) {
7188
- throw new Error('addItem : an item should be an object and not empty. In : ' + module.id +'. Aborted.' );
 
7189
  }
7190
- collapsePreItem = _.debounce( collapsePreItem, 2000 );
7191
  module.instantiateItem( item, true ).ready(); //true == Added by user
7192
-
7193
- module.czr_Item( item.id ).isReady.then( function() {
7194
- module.toggleSuccessMessage('on');
7195
- collapsePreItem();
7196
-
7197
- module.trigger('item_added', item );
7198
- if ( 'postMessage' == api(module.control.id).transport && _.has( obj, 'dom_event') && ! _.has( obj.dom_event, 'isTrigger' ) && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
7199
- module.control.previewer.refresh();
7200
- }
 
 
 
 
 
 
 
 
 
 
 
7201
  });
7202
-
7203
-
7204
-
7205
  },
7206
 
7207
  _resetPreItemInputs : function() {
@@ -7232,7 +8041,7 @@ $.extend( CZRDynModuleMths, {
7232
 
7233
  var $_pre_add_el = $('.' + module.control.css_attr.pre_add_item_content, module.container );
7234
  $_pre_add_el.prepend( pre_add_template() );
7235
- module.preItemEmbedded.resolve();
7236
  },
7237
  _getPreItemView : function() {
7238
  var module = this;
@@ -7507,6 +8316,8 @@ $.extend( CZRSocialModuleMths, {
7507
  }
7508
  }
7509
  },
 
 
7510
  getTitleFromIcon : function( icon ) {
7511
  return api.CZR_Helpers.capitalize( icon.replace('fa-', '').replace('envelope', 'email') );
7512
  },
@@ -7528,7 +8339,7 @@ $.extend( CZRSocialModuleMths, {
7528
  module = input.module,
7529
  socialList = module.social_icons,
7530
  _model = item(),
7531
- is_preItem = _.isEmpty(_model.id);
7532
  if ( is_preItem ) {
7533
  socialList = _.union( [ serverControlParams.i18n.selectSocialIcon ], socialList );
7534
  }
@@ -7686,7 +8497,7 @@ $.extend( CZRWidgetAreaModuleMths, {
7686
  module.preItem_location_alert_view_state.callbacks.add( function( to, from ) {
7687
  module._toggleLocationAlertExpansion( module.container, to );
7688
  });
7689
- module.bind( 'item_added', function( model ) {
7690
  module.addWidgetSidebar( model );
7691
  });
7692
 
@@ -8367,7 +9178,7 @@ $.extend( CZRBaseControlMths, {
8367
  if ( ! control.czr_Module( _mod_.id ) )
8368
  return;
8369
 
8370
- control.czr_Module( _mod_.id ).sendModuleInputsToPreview();
8371
  });
8372
  }
8373
  });
@@ -8766,7 +9577,7 @@ $.extend( CZRBaseModuleControlMths, {
8766
  });
8767
  }
8768
  else {
8769
- _new_collection.push(module_api_ready);
8770
  }
8771
  var _params = {};
8772
  if ( _.has( obj, 'data') ) {
@@ -8812,10 +9623,10 @@ $.extend( CZRBaseModuleControlMths, {
8812
  if ( control.isMultiModuleControl() ) {
8813
  return _filtered_collection;
8814
  } else {
8815
- if ( _.size(collection) > 1 ) {
8816
  throw new Error('There should not be several modules in the collection of control : ' + control.id );
8817
  }
8818
- if ( ! _.isArray(collection) || _.isEmpty(collection) || ! _.has( collection[0], 'items' ) ) {
8819
  throw new Error('The setting value could not be populated in control : ' + control.id );
8820
  }
8821
  var module_id = collection[0].id;
@@ -9245,6 +10056,12 @@ $.extend( CZRMultiModuleControlMths, {
9245
  });//$.extend//CZRBaseControlMths
9246
  })( wp.customize , jQuery, _ );
9247
  var CZRMultiplePickerMths = CZRMultiplePickerMths || {};
 
 
 
 
 
 
9248
  ( function ( api, $, _ ) {
9249
  $.extend( CZRMultiplePickerMths , {
9250
  ready: function() {
@@ -9270,8 +10087,25 @@ $.extend( CZRMultiplePickerMths , {
9270
  var CZRCroppedImageMths = CZRCroppedImageMths || {};
9271
 
9272
  (function (api, $, _) {
 
9273
  if ( 'function' != typeof wp.media.controller.Cropper || 'function' != typeof api.CroppedImageControl )
9274
  return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9275
  wp.media.controller.CZRCustomizeImageCropper = wp.media.controller.Cropper.extend({
9276
  doCrop: function( attachment ) {
9277
  var cropDetails = attachment.get( 'cropDetails' ),
@@ -9289,7 +10123,19 @@ var CZRCroppedImageMths = CZRCroppedImageMths || {};
9289
  } );
9290
  }
9291
  });
 
 
 
 
9292
  $.extend( CZRCroppedImageMths , {
 
 
 
 
 
 
 
 
9293
  initFrame: function() {
9294
 
9295
  var l10n = _wpMediaViewsL10n;
@@ -9320,6 +10166,15 @@ var CZRCroppedImageMths = CZRCroppedImageMths || {};
9320
  this.frame.on( 'cropped', this.onCropped, this );
9321
  this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
9322
  },
 
 
 
 
 
 
 
 
 
9323
  onSelect: function() {
9324
  var attachment = this.frame.state().get( 'selection' ).first().toJSON();
9325
  if ( ! ( attachment.mime && attachment.mime.indexOf("image") > -1 ) ){
@@ -9339,6 +10194,11 @@ var CZRCroppedImageMths = CZRCroppedImageMths || {};
9339
 
9340
  var CZRUploadMths = CZRUploadMths || {};
9341
  ( function ( api, $, _ ) {
 
 
 
 
 
9342
  $.extend( CZRUploadMths, {
9343
  ready: function() {
9344
  var control = this;
@@ -9676,6 +10536,14 @@ $.extend( CZRLayoutSelectMths , {
9676
  }
9677
  return dfd.promise();
9678
  },
 
 
 
 
 
 
 
 
9679
  _processDominusCallbacks : function( shortDominusId, dominusParams, refresh ) {
9680
  var self = this,
9681
  wpDominusId = api.CZR_Helpers.build_setId( shortDominusId ),
@@ -9765,6 +10633,24 @@ $.extend( CZRLayoutSelectMths , {
9765
  }
9766
 
9767
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9768
  _getControlDeps : function() {
9769
  return {};
9770
  },
@@ -9818,6 +10704,18 @@ $.extend( CZRLayoutSelectMths , {
9818
 
9819
  return _ready_params;
9820
  },
 
 
 
 
 
 
 
 
 
 
 
 
9821
  _handleFaviconNote : function() {
9822
  var self = this,
9823
  _fav_setId = api.CZR_Helpers.build_setId( serverControlParams.faviconOptionName );
@@ -9847,6 +10745,8 @@ $.extend( CZRLayoutSelectMths , {
9847
  ( function ( wp, $ ) {
9848
  $( function($) {
9849
  var api = wp.customize || api;
 
 
9850
  $('.accordion-section').not('.control-panel').click( function () {
9851
  _recenter_current_section($(this));
9852
  });
@@ -9859,6 +10759,9 @@ $.extend( CZRLayoutSelectMths , {
9859
  }, 700);
9860
  }
9861
  }//end of fn
 
 
 
9862
  api.czrSetupCheckbox = function( controlId, refresh ) {
9863
  $('input[type=checkbox]', api.control(controlId).container ).each( function() {
9864
  if ( 0 === $(this).val() || '0' == $(this).val() || 'off' == $(this).val() || _.isEmpty($(this).val() ) ) {
@@ -9879,6 +10782,8 @@ $.extend( CZRLayoutSelectMths , {
9879
  });
9880
  });
9881
  };//api.czrSetupCheckbox()
 
 
9882
  api.czrSetupSelect = function(controlId, refresh) {
9883
  $('select[data-customize-setting-link]', api.control(controlId).container )
9884
  .not('.no-selecter-js')
@@ -9887,6 +10792,9 @@ $.extend( CZRLayoutSelectMths , {
9887
  });
9888
  });
9889
  };//api.czrSetupSelect()
 
 
 
9890
  api.czrSetupStepper = function( controlId, refresh ) {
9891
  $('input[type="number"]', api.control(controlId).container ).each( function() {
9892
  $(this).stepper();
8
  if ( 'function' != typeof(jQuery.fn.iCheck) ) {
9
  !function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"==b?!1:"keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A),void 0)}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto);
10
  }
11
+ /*
12
+ * Selecter v3.0.9 - 2014-02-10
13
+ * A jQuery plugin for replacing default select elements. Part of the Formstone Library.
14
+ * http://formstone.it/selecter/
15
+ *
16
+ * Copyright 2014 Ben Plum; MIT Licensed
17
+ */
18
  if ( 'function' != typeof(jQuery.fn.selecter) ) {
19
  !function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{{var f=c.html();c.data("value")}b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window);
20
  }
21
+ /*
22
+ * Stepper v3.0.5 - 2014-02-06
23
+ * A jQuery plugin for cross browser number inputs. Part of the Formstone Library.
24
+ * http://formstone.it/stepper/
25
+ *
26
+ * Copyright 2014 Ben Plum; MIT Licensed
27
+ */
28
  if ( 'function' != typeof(jQuery.fn.stepper) ) {
29
  !function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0===typeof e||isNaN(e)?!1:e,max:void 0===typeof f||isNaN(f)?!1:f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this);
30
  }/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
52
  return string.length > 150 ? string.substr( 0, 149 ) : string;
53
  };
54
  if ( ! _.isEmpty( _.filter( _toArr, function( it ) { return ! _.isString( it ); } ) ) ) {
55
+ _toArr = JSON.stringify( _toArr.join(' ') );
56
  } else {
57
  _toArr = _toArr.join(' ');
58
  }
66
  return;
67
  if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
68
  return;
 
69
  console.log.apply( console, _prettyPrintLog( { consoleArguments : arguments } ) );
70
  };
71
 
83
  api.czr_isChangeSetOn = function() {
84
  return serverControlParams.isChangeSetOn && true === true;//&& true === true is just there to hackily cast the returned value as boolean.
85
  };
86
+
87
+
88
+
89
+ /*****************************************************************************
90
+ * DEFINE SOME USEFUL OBSERVABLE VALUES
91
+ *****************************************************************************/
92
  api.czr_activeSectionId = new api.Value('');
93
  api.czr_activePanelId = new api.Value('');
94
+
95
+ /*****************************************************************************
96
+ * OBSERVE UBIQUE CONTROL'S SECTIONS EXPANSION
97
+ *****************************************************************************/
98
  if ( 'function' === typeof api.Section ) {
99
  api.control.bind( 'add', function( _ctrl ) {
100
  if ( _ctrl.params.ubq_section && _ctrl.params.ubq_section.section ) {
119
  }
120
  });
121
  }
122
+
123
+ /*****************************************************************************
124
+ * CLOSE THE MOD OPTION PANEL ( if exists ) ON : section change, panel change, skope switch
125
+ *****************************************************************************/
126
  var _closeModOpt = function() {
127
  if ( ! _.has( api, 'czr_ModOptVisible') )
128
  return;
130
  };
131
  api.czr_activeSectionId.bind( _closeModOpt );
132
  api.czr_activePanelId.bind( _closeModOpt );
133
+
134
+ /*****************************************************************************
135
+ * OBSERVE SECTIONS AND PANEL EXPANSION
136
+ * /store the current expanded section and panel
137
+ *****************************************************************************/
138
  api.bind('ready', function() {
139
  if ( 'function' != typeof api.Section ) {
140
  throw new Error( 'Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.' );
179
  _do();
180
  });
181
  });
182
+
183
+
184
+ /*****************************************************************************
185
+ * FIRE SKOPE ON READY
186
+ *****************************************************************************/
187
  api.czr_skopeReady = $.Deferred();
188
  api.bind( 'ready' , function() {
189
  if ( serverControlParams.isSkopOn ) {
196
  api.czr_skopeReset = new api.CZR_skopeReset();
197
 
198
  api.trigger('czr-skope-started');
199
+ var _toggleTopFailureNote = function() {
200
+ api.czr_skopeBase.toggleTopNote( true, {
201
+ title : serverControlParams.i18n.skope['There was a problem when trying to load the customizer.'],
202
+ message : [
203
+ serverControlParams.i18n.skope['Please refer to'],
204
+ '<a href="http://docs.presscustomizr.com/article/285-there-was-a-problem-when-trying-to-load-the-customizer" target="_blank">',
205
+ serverControlParams.i18n.skope['this documentation page'],
206
+ '</a>',
207
+ serverControlParams.i18n.skope['to understand how to fix the problem.']
208
+ ].join(' '),
209
+ selfCloseAfter : 40000
210
+ });
211
+ };
212
+
213
 
214
  api.czr_skopeReady
215
  .done( function() {
217
  })
218
  .fail( function( error ) {
219
  api.errorLog( 'Skope could not be instantiated : ' + error );
220
+ _toggleTopFailureNote();
221
  serverControlParams.isSkopOn = false;
222
+ })
223
+ .always( function() {
224
  api.czr_isLoadingSkope( false );
225
  });
226
  if ( 'rejected' != api.czr_skopeReady.state() ) {
227
  setTimeout( function() {
228
  if ( 'pending' == api.czr_skopeReady.state() ) {
229
+ _toggleTopFailureNote();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
 
231
  api.czr_isLoadingSkope( false );
232
  }
233
+ }, 40000);
234
  }
235
  }
236
  if ( serverControlParams.isChangeSetOn ) {
238
  }
239
  } );
240
  if ( ! _.has( api, '_latestRevision') ) {
241
+ /**
242
+ * Current change count.
243
+ */
244
  api._latestRevision = 0;
245
+
246
+ /**
247
+ * Latest revisions associated with the updated setting.
248
+ */
249
  api._latestSettingRevisions = {};
250
+
251
+ /*
252
+ * Keep track of the revision associated with each updated setting so that
253
+ * requestChangesetUpdate knows which dirty settings to include. Also, once
254
+ * ready is triggered and all initial settings have been added, increment
255
+ * revision for each newly-created initially-dirty setting so that it will
256
+ * also be included in changeset update requests.
257
+ */
258
  api.bind( 'change', function incrementChangedSettingRevision( setting ) {
259
  api._latestRevision += 1;
260
  api._latestSettingRevisions[ setting.id ] = api._latestRevision;
326
  _destroy();
327
  }
328
  };//toggleSkopeLoadPane
329
+
330
+
331
+ /*****************************************************************************
332
+ * REACT TO PREVIEW DEVICE SWITCH => send device to preview
333
+ *****************************************************************************/
334
+ api.bind( 'ready' , function() {
335
+ if ( api.previewedDevice ) {
336
+ api.previewedDevice.bind( function( device ) {
337
+ api.previewer.send( 'previewed-device', device );
338
+ });
339
+ }
340
+ });
341
+
342
+ /*****************************************************************************
343
+ * ADD PRO BEFORE SPECIFIC SECTIONS AND PANELS
344
+ *****************************************************************************/
345
+ if ( serverControlParams.isPro ) {
346
+ _.each( [ 'tc_font_customizer_settings', 'header_image_sec', 'content_blog_sec', 'static_front_page' ], function( _secId ) {
347
+ _.delay( function() {
348
+ api.section.when( _secId, function( _sec_ ) {
349
+ if ( 1 >= _sec_.headContainer.length ) {
350
+ _sec_.headContainer.find('.accordion-section-title').prepend( '<span class="pro-title-block">Pro</span>' );
351
+ }
352
+ });
353
+ }, 1000 );
354
+ });
355
+ _.each( ['hu-header-panel', 'hu-content-panel' ], function( _secId ) {
356
+ api.panel.when( _secId, function( _sec_ ) {
357
+ if ( 1 >= _sec_.headContainer.length ) {
358
+ _sec_.headContainer.find('.accordion-section-title').prepend( '<span class="pro-title-block">Pro</span>' );
359
+ }
360
+ });
361
+ });
362
+ }
363
+
364
+
365
+ /*****************************************************************************
366
+ * ADD PRO BEFORE SPECIFIC SECTIONS AND PANELS
367
+ *****************************************************************************/
368
+ if ( ! serverControlParams.isPro && _.isFunction( api.Section ) ) {
369
+ proSectionConstructor = api.Section.extend( {
370
+ active : true,
371
+ attachEvents: function () {},
372
+ isContextuallyActive: function () {
373
+ return this.active();
374
+ },
375
+ _toggleActive: function(){ return true; },
376
+
377
+ } );
378
+
379
+ $.extend( api.sectionConstructor, {
380
+ 'czr-customize-section-pro' : proSectionConstructor
381
+ });
382
+ }
383
  })( wp.customize , jQuery, _);
384
+
385
+
386
+
387
+
388
+ /*****************************************************************************
389
+ * THE SKOPE BASE OBJECT
390
+ *****************************************************************************/
391
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
392
  (function ( api, $, _ ) {
393
  $.extend( CZRSkopeBaseMths, {
399
  self.skope_colors = {
400
  global : 'rgb(255, 255, 255)',
401
  special_group : 'rgba(173, 213, 247, 0.55)',
402
+ group : 'rgba(39, 59, 88, 0.12)',// 'rgba(173, 213, 247, 0.55)',
403
+ local : 'rgba(39, 59, 88, 0.28)'// 'rgba(78, 122, 199, 0.35)'
404
  };
405
  api.czr_isPreviewerSkopeAware = $.Deferred();
406
  api.czr_initialSkopeCollectionPopulated = $.Deferred();
426
  }
427
  });
428
  api.previewer.bind( 'czr-skopes-synced', function( data ) {
429
+ if ( ! serverControlParams.isSkopOn || 'rejected' == api.czr_skopeReady.state() ) {
430
+ return;
431
+ }
432
  var preview = this,
433
  previousSkopeCollection = api.czr_currentSkopesCollection();
434
  if ( ! _.has( data, 'czr_skopes') ) {
435
+ if ( 'resolved' != api.czr_skopeReady.state() ) {
436
+ api.czr_skopeReady.reject();
437
+ }
438
  api.errorLog( "On 'czr-skopes-synced' : missing skopes in the server data" );
439
  return;
440
  }
444
  api.czr_skopeReady.reject( er );
445
  return;
446
  }
447
+ var _refreshSkopeInfosNotices = function() {
448
+ self._writeCurrentSkopeTitle();
449
+ if ( api.czr_bottomInfosVisible() ) {
450
+ self.renderBottomInfosTmpl();//<= will build a new bottom skope message infos in the preview based on the new active skopes
451
+ } else {
452
+ api.czr_bottomInfosVisible( true );
453
+ }
454
+ };
455
  api.czr_initialSkopeCollectionPopulated.then( function() {
456
  var refreshActiveSkope = _.isUndefined( _.findWhere( api.czr_currentSkopesCollection(), {id : api.czr_activeSkopeId() } ) );
457
  api.czr_skopeBase.reactWhenSkopeSyncedDone( data ).done( function() {
462
  if ( 'resolved' != api.czr_skopeReady.state() ) {
463
  api.czr_skopeReady.resolve( self.getActiveSkopeId() );
464
  }
465
+ _refreshSkopeInfosNotices();
466
  })
467
  .fail( function() {
468
  throw new Error( 'Error when trying to set the active skope after skope synced.' );
475
  _newLoc =_.findWhere( data.czr_skopes, { skope : 'local' } ).opt_name;
476
 
477
  if ( _newLoc !== _prevLoc && 'resolved' == api.czr_skopeReady.state() ) {
478
+ _refreshSkopeInfosNotices();
479
  }
480
  }
481
  });
517
  api.czr_serverNotification.bind( function( to, from ) {
518
  self.toggleServerNotice( to );
519
  });
520
+ self._setupPreviewNotificationsBlocks();//top note and bottom skope infos
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  self.scopeSwitcherEventMap = [
522
  {
523
  trigger : 'click keydown',
555
  });
556
  });
557
  },//initialize
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+ /*****************************************************************************
576
+ * EMBED WRAPPER
577
+ *****************************************************************************/
578
  embedSkopeWrapper : function() {
579
  var self = this;
580
  $('#customize-header-actions').append( $('<div/>', {class:'czr-scope-switcher', html:'<div class="czr-skopes-wrapper"></div>'}) );
593
  ];
594
  api.CZR_Helpers.setupDOMListeners( _eventMap , { dom_el : $('.czr-scope-switcher') }, self );
595
  },
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+ /*****************************************************************************
606
+ * API DIRTYNESS REACTIONS
607
+ *****************************************************************************/
608
  apiDirtynessReact : function( is_dirty ) {
609
  $('body').toggleClass('czr-api-dirty', is_dirty );
610
  api.state( 'saved')( ! is_dirty );
611
  },
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+ /*****************************************************************************
622
+ * OVERRIDE SAVE BUTTON STATES : api.state.bind( 'change') callback
623
+ *****************************************************************************/
624
  setSaveButtonStates : function() {
625
  if ( ! api.state.has('saving') ) {
626
  api.state.create('saving');
681
  });
682
  });
683
  };
684
+ if ( api.czr_bottomInfosVisible() ) {
685
+ self.renderBottomInfosTmpl();//<= will build a new bottom skope message infos in the preview based on the new active skopes
686
+ } else {
687
+ api.czr_bottomInfosVisible( true );
688
+ }
689
  _.delay( function() {
690
  _setupSectionControlDialogs();
691
  }, 500 );
693
  api.czr_skopeReady.then( function() {
694
  _doWhenSkopeReady();
695
  });
696
+ },
697
+ _setupPreviewNotificationsBlocks : function() {
698
+ var self = this;
699
+ api.czr_topNoteVisible = new api.Value( false );
700
+ api.czr_skopeReady.then( function() {
701
+ api.czr_topNoteVisible.bind( function( visible ) {
702
+ var noteParams = {},
703
+ _defaultParams = {
704
+ title : '',
705
+ message : '',
706
+ actions : '',
707
+ selfCloseAfter : 20000
708
+ };
709
+ noteParams = $.extend( _defaultParams , serverControlParams.topNoteParams );
710
+ noteParams.actions = function() {
711
+ var _query = $.extend(
712
+ api.previewer.query(),
713
+ { nonce: api.previewer.nonce.save }
714
+ );
715
+ wp.ajax.post( 'czr_dismiss_top_note' , _query )
716
+ .always( function () {})
717
+ .fail( function ( response ) { api.consoleLog( 'czr_dismiss_top_note failed', _query, response ); })
718
+ .done( function( response ) {});
719
+ };
720
+
721
+ self.toggleTopNote( visible, noteParams );
722
+ });
723
+ _.delay( function() {
724
+ api.czr_topNoteVisible( ! _.isEmpty( serverControlParams.isTopNoteOn ) || 1 == serverControlParams.isTopNoteOn );
725
+ }, 2000 );
726
+ });
727
+ api.czr_bottomInfosVisible = new api.Value( false );
728
+ api.czr_skopeReady.then( function() {
729
+ api.czr_bottomInfosVisible.bind( function( visible ) {
730
+ var noteParams = {},
731
+ _defaultParams = {
732
+ title : '',
733
+ message : '',
734
+ actions : '',
735
+ selfCloseAfter : 20000
736
+ };
737
+ noteParams = $.extend( _defaultParams , {} );
738
+
739
+ return self.toggleBottomInfos( visible, noteParams );//returns a promise()
740
+ }, { deferred : true } );
741
+ var _skopeInfosSetId = api.CZR_Helpers.build_setId( 'show-skope-infos' );
742
+ api.when( _skopeInfosSetId, function( _set_ ){
743
+ api.czr_bottomInfosVisible.validate = function( value ) {
744
+ var _v = _set_(),
745
+ _isChecked = 0 !== _v && '0' !== _v && false !== _v && 'off' !== _v;
746
+
747
+ return _isChecked ? value : false;
748
+ };
749
+ _set_.bind( function( visible ) {
750
+ api.czr_bottomInfosVisible( 0 !== visible && '0' !== visible && false !== visible && 'off' !== visible );
751
+ });
752
+ });
753
+ _.delay( function() {
754
+ api.czr_bottomInfosVisible( true );
755
+ }, 2000 );
756
+ });//api.czr_skopeReady.then()
757
  }
758
  });//$.extend()
759
  })( wp.customize , jQuery, _);
893
  api.CZR_Helpers.setupDOMListeners(
894
  [ {
895
  trigger : 'click keydown',
896
+ selector : '.czr-preview-note-close',
 
897
  actions : function() {
898
+ _hideAndDestroy().done( function() {
899
+ api.czr_topNoteVisible( false );
900
  if ( _.isFunction( noteParams.actions ) ) {
901
  noteParams.actions();
902
  }
908
  );
909
  });
910
  },
911
+ _hideAndDestroy = function() {
912
  var dfd = $.Deferred();
913
  $('body').removeClass('czr-top-note-open');
914
  if ( self.welcomeNote.length ) {
927
  if ( visible ) {
928
  _renderAndSetup();
929
  } else {
930
+ _hideAndDestroy().done( function() {
931
+ api.czr_topNoteVisible( false );//should be already false
932
+ });
933
  }
934
  _.delay( function() {
935
+ api.czr_topNoteVisible( false );
936
  },
937
  noteParams.selfCloseAfter || 20000
938
  );
961
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
962
  (function ( api, $, _ ) {
963
  $.extend( CZRSkopeBaseMths, {
964
+ /*****************************************************************************
965
+ * WORDPRESS API ACTIONS ON INIT
966
+ *****************************************************************************/
967
  bindAPISettings : function( requestedSetId ) {
968
  var self = this,
969
  _settingChangeReact = function( new_val, old_val, o ) {
1009
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1010
  ( function ( api, $, _ ) {
1011
  $.extend( CZRSkopeBaseMths, {
1012
+
1013
+ /*****************************************************************************
1014
+ * REACT ON SKOPE SYNCED
1015
+ *****************************************************************************/
1016
  reactWhenSkopeSyncedDone : function( server_params ) {
1017
  var self = this, dfd = $.Deferred();
1018
  if ( ! _.has( server_params, 'czr_skopes' ) || _.isEmpty( server_params.czr_skopes ) ) {
1066
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1067
  ( function ( api, $, _ ) {
1068
  $.extend( CZRSkopeBaseMths, {
1069
+
1070
+ /*****************************************************************************
1071
+ * REACT ON ACTIVE SECTION SETUP DONE
1072
+ *****************************************************************************/
1073
  _maybeSetupAssignedMenuLocations : function( active_section ) {
1074
  if ( _.isUndefined( active_section ) || _.isEmpty( active_section ) || ! api.section.has( active_section.id ) ) {
1075
  api.consoleLog( 'In _maybeSetupAssignedMenuLocations : no valid section_id provided.');
1083
  active_section.assignedLocations.bind( _assignedLocReact );
1084
  }
1085
  },
1086
+
1087
+
1088
+
1089
+ /*****************************************************************************
1090
+ * REACT TO ACTIVE SECTION EXPANSION
1091
+ *****************************************************************************/
1092
  activeSectionReact : function( active_sec_id , previous_sec_id ) {
1093
  if ( 'add_menu' != active_sec_id ) {
1094
  api.trigger('czr-paint', { active_section_id : active_sec_id } );
1186
  }
1187
  });
1188
  },
1189
+
1190
+
1191
+ /*****************************************************************************
1192
+ * REACT TO ACTIVE PANEL EXPANSION
1193
+ *****************************************************************************/
1194
  activePanelReact : function( active_panel_id , previous_panel_id ) {
1195
  var self = this;
1196
  api.czr_initialSkopeCollectionPopulated.then( function() {
1225
  }
1226
  });//$.extend()
1227
  })( wp.customize , jQuery, _ );
1228
+ /*****************************************************************************
1229
+ * THE SKOPE BASE OBJECT
1230
+ *****************************************************************************/
1231
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1232
  ( function ( api, $, _ ) {
1233
  $.extend( CZRSkopeBaseMths, {
1234
+
1235
+ /*****************************************************************************
1236
+ * PAINT AND WASH
1237
+ *****************************************************************************/
1238
  wash : function( params ) {
1239
  var self = this,
1240
  _do_wash = function( element ) {
1335
  });//$.extend()
1336
  })( wp.customize , jQuery, _ );
1337
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1338
+ (function ( api, $, _ ) {
1339
+ $.extend( CZRSkopeBaseMths, {
1340
+ toggleBottomInfos : function( visible, noteParams ) {
1341
+ noteParams = _.isObject( noteParams ) ? noteParams : {};
1342
+ var self = this,
1343
+ dfd = $.Deferred(),
1344
+ _defaultParams = {
1345
+ title : '',
1346
+ message : '',
1347
+ actions : '',
1348
+ selfCloseAfter : 20000
1349
+ },
1350
+ _skopeInfosSetId = api.CZR_Helpers.build_setId('show-skope-infos'),
1351
+ _renderAndSetup = function() {
1352
+ var _dfd = $.Deferred();
1353
+ $.when( self.renderBottomInfosTmpl( noteParams ) )
1354
+ .done( function( $_el ) {
1355
+ self.bottomInfosContainer = $_el;
1356
+ _.delay( function() {
1357
+ $('body').addClass('czr-bottom-infos-open');
1358
+ _dfd.resolve();
1359
+ }, 200 );
1360
+ api.CZR_Helpers.setupDOMListeners(
1361
+ [
1362
+ {
1363
+ trigger : 'click keydown',
1364
+ selector : '.czr-preview-note-close',
1365
+ actions : function() {
1366
+ _hideAndDestroy().done( function() {
1367
+ api.czr_bottomInfosVisible( false );
1368
+ if ( _.isFunction( noteParams.actions ) ) {
1369
+ noteParams.actions();
1370
+ }
1371
+ });
1372
+ }
1373
+ },
1374
+ {
1375
+ trigger : 'click keydown',
1376
+ selector : '.czr-skope-switch',
1377
+ actions : function( params ) {
1378
+ var _skopeIdToSwithTo = $( params.dom_event.currentTarget, params.dom_el ).attr('data-skope-id');
1379
+ if ( ! _.isEmpty( _skopeIdToSwithTo ) && api.czr_skope.has( _skopeIdToSwithTo ) )
1380
+ api.czr_activeSkopeId( _skopeIdToSwithTo );
1381
+ }
1382
+ },
1383
+ {
1384
+ trigger : 'click keydown',
1385
+ selector : '.czr-disable-bottom-infos',
1386
+ actions : function( params ) {
1387
+ if ( api.control.has( _skopeInfosSetId ) ) {
1388
+ api.control( _skopeInfosSetId ).focus();
1389
+ }
1390
+ }
1391
+ }
1392
+ ] ,
1393
+ { dom_el : self.bottomInfosContainer },
1394
+ self
1395
+ );
1396
+ })
1397
+ .fail( function() {
1398
+ _dfd.resolve();
1399
+ });
1400
+ return _dfd.promise();
1401
+ },
1402
+ _hideAndDestroy = function() {
1403
+ return $.Deferred( function() {
1404
+ var _dfd_ = this;
1405
+ $('body').removeClass('czr-bottom-infos-open');
1406
+ if ( self.bottomInfosContainer.length ) {
1407
+ _.delay( function() {
1408
+ self.bottomInfosContainer.remove();
1409
+ self.bottomInfosContainer = false;
1410
+ _dfd_.resolve();
1411
+ }, 300 );
1412
+ } else {
1413
+ _dfd_.resolve();
1414
+ }
1415
+ });
1416
+ };
1417
+
1418
+
1419
+ noteParams = $.extend( _defaultParams , noteParams);
1420
+
1421
+ if ( visible ) {
1422
+ _renderAndSetup().always( function() {
1423
+ dfd.resolve();
1424
+ });
1425
+ } else {
1426
+ _hideAndDestroy().done( function() {
1427
+ api.czr_bottomInfosVisible( false );//should be already false
1428
+ dfd.resolve();
1429
+ });
1430
+ }
1431
+ return dfd.promise();
1432
+ },
1433
+ renderBottomInfosTmpl : function( params ) {
1434
+ params = params || {};
1435
+ var self = this,
1436
+ _tmpl = '',
1437
+ _skope_id = api.czr_activeSkopeId();
1438
+ if ( ! api.czr_skope.has( _skope_id ) || ! _.isObject( api.czr_skope( _skope_id )() ) )
1439
+ return false;
1440
+
1441
+ var _skope_title = api.czr_skope( _skope_id )().long_title,
1442
+ _ctxTitle = api.czr_skope( _skope_id )().ctx_title;
1443
+
1444
+ _skope_title = _.isString( _skope_title ) ? _skope_title : '';
1445
+ _ctxTitle = _.isString( _ctxTitle ) ? _ctxTitle : '';
1446
+
1447
+ var _title = params.title || ['Customizing', _ctxTitle.toLowerCase() ].join(' '),
1448
+ _message = params.message || self._getSkopeInfosMessage( _skope_id ),
1449
+ _renderTmpl = function() {
1450
+ return $.Deferred( function() {
1451
+ var dfd = this;
1452
+ try {
1453
+ _tmpl = wp.template( 'czr-bottom-infos' )( { title : _title } );
1454
+ $('#customize-preview').after( $( _tmpl ) );
1455
+ dfd.resolve();
1456
+ } catch( er ) {
1457
+ api.errorLog( 'Error when parsing the the bottom infos template : ' + er );
1458
+ dfd.reject( er );
1459
+ }
1460
+ });
1461
+ };
1462
+ if ( _.isUndefined( this.bottomInfosContainer ) || 1 != this.bottomInfosContainer.length ) {
1463
+ _renderTmpl().done( function() {
1464
+ $('.czr-note-message', '#czr-bottom-infos').html( _message );
1465
+ });
1466
+ } else {
1467
+ $('.czr-note-content', self.bottomInfosContainer ).fadeOut({
1468
+ duration : 'fast',
1469
+ complete : function() {
1470
+ $( 'h2', self.bottomInfosContainer ).html( [ '&middot;', _title, '&middot;' ].join(' ') );
1471
+ $('.czr-note-message', self.bottomInfosContainer ).html( _message );
1472
+ $(this).fadeIn('fast');
1473
+ }
1474
+ });
1475
+
1476
+ }
1477
+ return ( this.bottomInfosContainer && 1 == this.bottomInfosContainer.length ) ? this.bottomInfosContainer : $( '#czr-bottom-infos' );
1478
+ },
1479
+ _getSkopeInfosMessage : function( skope_id ) {
1480
+ skope_id = skope_id || api.czr_activeSkopeId();
1481
+ var _localSkopeId = _.findWhere( api.czr_currentSkopesCollection(), { skope : 'local' } ).id;
1482
+ if ( ! api.czr_skope.has( skope_id ) || ! _.isObject( api.czr_skope( skope_id )() ) || _.isUndefined( _localSkopeId ) )
1483
+ return '';
1484
+
1485
+ var self = this,
1486
+ _skpLevel = api.czr_skope( skope_id )().skope,
1487
+ _inheritedFrom = self.getInheritedSkopeTitles(),
1488
+ _overrides = self.getOverridenSkopeTitles(),
1489
+ _localCtxTitle = api.czr_skope( _localSkopeId )().ctx_title,//<= the context title is always the one of the local skope
1490
+ current_title = api.czr_skope( skope_id )().long_title,//ex : Options for home
1491
+ _html;
1492
+
1493
+ switch( _skpLevel ) {
1494
+ case 'global' :
1495
+ _html = [
1496
+ serverControlParams.i18n.skope['The customizations made site wide are inherited by all other levels of customization.'],
1497
+ '<br/>',
1498
+ serverControlParams.i18n.skope['The current context'],
1499
+ ['(', _localCtxTitle, ')'].join(' '),
1500
+ serverControlParams.i18n.skope['can be customized more specifically at the following level'] + '(s)',
1501
+ ':',
1502
+ _overrides + '.'
1503
+ ].join(' ');
1504
+ break;
1505
+ case 'group' :
1506
+ _html = [
1507
+ serverControlParams.i18n.skope['The current customizations will be applied to'],
1508
+ api.czr_skope( skope_id )().ctx_title.toLowerCase() + '.',
1509
+ '<br/>',
1510
+ serverControlParams.i18n.skope['The options not customized at this level will inherit their value from'],
1511
+ _inheritedFrom,
1512
+ '.<br/>',
1513
+ serverControlParams.i18n.skope['The current context'],
1514
+ ['(', _localCtxTitle, ')'].join(' '),
1515
+ serverControlParams.i18n.skope['can be customized more specifically at the following level'],
1516
+ ':',
1517
+ _overrides + '.'
1518
+ ].join(' ');
1519
+ break;
1520
+ case 'local' :
1521
+ _html = [
1522
+ serverControlParams.i18n.skope['The current context'],
1523
+ ['(', _localCtxTitle, ')'].join(' '),
1524
+ serverControlParams.i18n.skope['can be customized with a specific set of options.'],
1525
+ '<br/>',
1526
+ serverControlParams.i18n.skope['The options not customized at this level will inherit their value from'],
1527
+ _inheritedFrom + '.'
1528
+ ].join(' ');
1529
+ break;
1530
+ }
1531
+
1532
+ return $.trim( [
1533
+ '<span class="czr-skope-bottom-infos">',
1534
+ _html,
1535
+ '</span>'
1536
+ ].join(' ') );
1537
+ }
1538
+ });//$.extend()
1539
+ })( wp.customize , jQuery, _);
1540
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1541
  ( function ( api, $, _ ) {
1542
  $.extend( CZRSkopeBaseMths, {
1543
+
1544
+ /*****************************************************************************
1545
+ * HELPERS
1546
+ *****************************************************************************/
1547
  isSkopeRegisteredInCollection : function( skope_id, collection ) {
1548
  var self = this;
1549
  collection = collection || api.czr_skopeCollection();
1585
  getActiveSkopeId : function( _current_skope_collection ) {
1586
  _current_skope_collection = _current_skope_collection || api.czr_currentSkopesCollection();
1587
 
1588
+ var _currentSkopeLevel, _newSkopeCandidate, _skpId;
1589
+ if ( ! _.isEmpty( api.czr_activeSkopeId() ) && api.czr_skope.has( api.czr_activeSkopeId() ) ) {
1590
+ _currentSkopeLevel = api.czr_skope( api.czr_activeSkopeId() )().skope;
1591
+ } else if ( serverControlParams.isLocalSkope ) {
1592
+ _currentSkopeLevel = 'local';
1593
+ } else {
1594
+ _currentSkopeLevel = 'global';
1595
+ }
1596
+
1597
+ _newSkopeCandidate = _.findWhere( _current_skope_collection, { skope : _currentSkopeLevel } );
1598
 
1599
  _skpId = ! _.isUndefined( _newSkopeCandidate ) ? _newSkopeCandidate.id : _.findWhere( _current_skope_collection, { skope : 'global' } ).id;
1600
 
1601
  if ( _.isUndefined( _skpId ) ) {
1602
+ throw new Error( 'No default skope was found in getActiveSkopeId ', _current_skope_collection );
1603
  }
1604
  return _skpId;
1605
  },
1753
  return self.isSettingSkopeEligible( setId );
1754
  } );
1755
  },
1756
+
1757
+ /**
1758
+ * @param {String} widgetId
1759
+ * @returns {Object}
1760
+ */
1761
  parseWidgetId : function( widgetId, prefixToRemove ) {
1762
  var matches, parsed = {
1763
  number: null,
1776
  parsed.id_base = parsed.id_base.replace( prefixToRemove , '');
1777
  return parsed;
1778
  },
1779
+
1780
+ /**
1781
+ * @param {String} widgetId
1782
+ * @returns {String} settingId
1783
+ */
1784
  widgetIdToSettingId: function( widgetId , prefixToRemove ) {
1785
  var parsed = this.parseWidgetId( widgetId, prefixToRemove ), settingId;
1786
 
2293
  var self = this, dfd = $.Deferred();
2294
  if ( ! _.isUndefined(from) && api.czr_skope.has(from) )
2295
  api.czr_skope(from).active(false);
2296
+ else if ( ! _.isUndefined( from ) )
2297
  throw new Error('listenToActiveSkope : previous scope does not exist in the collection', from );
2298
 
2299
  if ( ! _.isUndefined(to) && api.czr_skope.has(to) )
2370
  throw new Error( 'Fail to process silent updates in _debouncedProcessSilentUpdates');
2371
  })
2372
  .done( function( _updatedSetIds ) {
2373
+ if ( _.isUndefined( from ) && api.czr_skope.has( to ) && 'global' == api.czr_skope( to )().skope ) {
2374
+ dfd.resolve( _updatedSetIds );
2375
+ api.state( 'switching-skope' )( false );
2376
+ } else {
2377
+ api.previewer.refresh()
2378
+ .always( function() {
2379
+ dfd.resolve( _updatedSetIds );
2380
+ api.state( 'switching-skope' )( false );
2381
+ });
2382
+ }
2383
  });
2384
  };
2385
  if ( _.has(api, 'czr_isModuleExpanded') && false !== api.czr_isModuleExpanded() ) {
2448
  api.state( 'switching-skope' ).isBound = true;
2449
  }
2450
  });
2451
+ }//_writeCurrentSkopeTitle
2452
  });//$.extend
2453
  })( wp.customize , jQuery, _ );
2454
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2507
 
2508
  return dfd.promise();
2509
  },
2510
+
2511
+
2512
+
2513
+
2514
+ /*****************************************************************************
2515
+ * UPDATE SETTING VALUES
2516
+ *****************************************************************************/
2517
  silentlyUpdateSettings : function( _silentUpdateCands, refresh ) {
2518
  if ( ! api.state.has( 'silent-update-processing') )
2519
  api.state.create( 'silent-update-processing' )( false );
2624
 
2625
  return dfd.promise();
2626
  },//getSettingUpdatePromise()
2627
+
2628
+
2629
+
2630
+
2631
+ /*****************************************************************************
2632
+ * GET SILENT UPDATE CANDIDATE FROM A SECTION. FALLS BACK ON THE CURRENT ONE
2633
+ *****************************************************************************/
2634
  _getSilentUpdateCandidates : function( section_id, awake_if_not_active ) {
2635
  var self = this,
2636
  SilentUpdateCands = [];
2661
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2662
  ( function ( api, $, _ ) {
2663
  $.extend( CZRSkopeBaseMths, {
2664
+ /*****************************************************************************
2665
+ * SILENT ACTIONS for czr_module_type on skope switch
2666
+ * ?? @todo : can't we fire this earlier than in getPromises ?
2667
+ *****************************************************************************/
2668
  _processCzrModuleSilentActions : function( wpSetId, control_type, skope_id, _control_data) {
2669
  var _synced_control_id, _synced_control_val, _synced_control_data, _synced_control_constructor, _syncSektionModuleId,
2670
  _synced_short_id = _.has( api.control( wpSetId ).params, 'syncCollection' ) ? api.control( wpSetId ).params.syncCollection : '',
2695
  api.control( wpSetId ).czr_Module( _syncSektionModuleId ).fireSektionModule();
2696
  }
2697
  },
2698
+
2699
+
2700
+
2701
+
2702
+
2703
+ /*****************************************************************************
2704
+ * GET PROMISE FOR TYPE : czr_cropped_image
2705
+ *****************************************************************************/
2706
  _getCzrCroppedImagePromise : function( wpSetId, _control_data ) {
2707
  var _constructor = api.controlConstructor.czr_cropped_image, dfd = $.Deferred(),
2708
  val = api.has(wpSetId) ? api(wpSetId)() : null;
2722
  });
2723
  return dfd.promise();
2724
  },
2725
+
2726
+
2727
+
2728
+ /*****************************************************************************
2729
+ * HEADER IMAGE PROMISE
2730
+ *****************************************************************************/
2731
  _getHeaderImagePromise : function( wpSetId, skope_id ) {
2732
  var dfd = $.Deferred();
2733
  if ( ! _.has(api.settings.controls, 'header_image') || 'header_image' != wpSetId ) {
2778
  }
2779
  });//$.extend
2780
  })( wp.customize , jQuery, _ );
2781
+
2782
+ /*****************************************************************************
2783
+ * THE SKOPE BASE OBJECT
2784
+ *****************************************************************************/
2785
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2786
  ( function ( api, $, _ ) {
2787
  $.extend( CZRSkopeBaseMths, {
2788
+ /*****************************************************************************
2789
+ * SETUP CONTROL RESET ON SECTION EXPANSION + SKOPE SWITCH
2790
+ *****************************************************************************/
2791
  setupActiveSkopedControls : function( obj ) {
2792
  var self = this, section_id, controls, setupParams, eligibleCtrls, dfd = $.Deferred();
2793
  defaultSetupParams = {
2998
  }
2999
  });//$.extend()
3000
  })( wp.customize , jQuery, _ );
3001
+
3002
+ /*****************************************************************************
3003
+ * THE SKOPE BASE OBJECT
3004
+ *****************************************************************************/
3005
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
3006
  ( function ( api, $, _ ) {
3007
  $.extend( CZRSkopeBaseMths, {
3224
  }
3225
  });//$.extend()
3226
  })( wp.customize , jQuery, _ );
3227
+
3228
+ /*****************************************************************************
3229
+ * THE SKOPE BASE OBJECT
3230
+ *****************************************************************************/
3231
  var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
3232
  ( function ( api, $, _ ) {
3233
  $.extend( CZRSkopeBaseMths, {
3263
  _isSkoped = function( setId ) {
3264
  return setId && self.isSettingSkopeEligible( setId );
3265
  },//filter only eligible ctrlIds
3266
+
3267
  _generateControlNotice = function( setId, _localSkopeId ) {
3268
  var _currentSkopeId = api.czr_activeSkopeId(),
3269
  _inheritedFromSkopeId = self.getInheritedSkopeId( setId, _currentSkopeId ),
3270
  _overridedBySkopeId = self.getAppliedPrioritySkopeId( setId, _currentSkopeId ),
3271
  _html = [],
3272
  _isCustomized,
3273
+ _hasDBVal,
3274
+ _ctxTitle;
3275
  if ( ! _isSkoped( setId ) ) {
3276
  _html.push( [
3277
  serverControlParams.i18n.skope['This option is always customized sitewide and cannot be reset.']
3282
  _isCustomized = ! _.isUndefined( api.czr_skope( _currentSkopeId ).dirtyValues()[setId] );
3283
  _hasDBVal = ! _.isUndefined( api.czr_skope( _currentSkopeId ).dbValues()[setId] );
3284
 
3285
+ _ctxTitle = api.czr_skope( _inheritedFromSkopeId )().ctx_title;
3286
+
3287
+ _ctxTitle = ( _.isString( _ctxTitle ) ? _ctxTitle : '' ).toLowerCase();
3288
+
3289
  if ( _isCustomized ) {
3290
  if ( 'global' == api.czr_skope( _inheritedFromSkopeId )().skope ) {
3291
  _html.push( [
3294
  } else {
3295
  _html.push( [
3296
  serverControlParams.i18n.skope['Customized. Will be applied to'],
3297
+ '<strong>' + _ctxTitle + '</strong>',
3298
  serverControlParams.i18n.skope['once published.']
3299
  ].join(' ') );
3300
  }
3307
  } else {
3308
  _html.push( [
3309
  serverControlParams.i18n.skope['Customized and applied to'],
3310
+ '<strong>' + _ctxTitle + '.' + '</strong>'
3311
  ].join(' ') );
3312
  }
3313
  } else {
3318
  if ( _inheritedFromSkopeId !== _currentSkopeId && api.czr_skope.has( _inheritedFromSkopeId ) ) {
3319
  _isCustomized = ! _.isUndefined( api.czr_skope( _inheritedFromSkopeId ).dirtyValues()[setId] );
3320
  _hasDBVal = ! _.isUndefined( api.czr_skope( _inheritedFromSkopeId ).dbValues()[setId] );
3321
+
3322
+ _ctxTitle = api.czr_skope( _currentSkopeId )().ctx_title;
3323
+
3324
+ _ctxTitle = ( _.isString( _ctxTitle ) ? _ctxTitle : '' ).toLowerCase();
3325
+
3326
  if ( ! _isCustomized && ! _hasDBVal ) {
3327
  _html.push(
3328
  [
3329
  serverControlParams.i18n.skope['Default website value.'],
3330
  serverControlParams.i18n.skope['You can customize this specifically for'],
3331
+ '<strong>' + _ctxTitle + '.' + '</strong>'
3332
  ].join(' ')
3333
  );
3334
  } else {
3337
  serverControlParams.i18n.skope['Currently inherited from'],
3338
  self.buildSkopeLink( _inheritedFromSkopeId ) + '.',
3339
  serverControlParams.i18n.skope['You can customize this specifically for'],
3340
+ '<strong>' + _ctxTitle + '.' + '</strong>'
3341
  ].join(' ')
3342
  );
3343
  }
3345
  if ( _overridedBySkopeId !== _currentSkopeId && api.czr_skope.has( _overridedBySkopeId ) ) {
3346
  _isCustomized = ! _.isUndefined( api.czr_skope( _overridedBySkopeId ).dirtyValues()[setId] );
3347
 
3348
+ _ctxTitle = api.czr_skope( _localSkopeId )().ctx_title;
3349
+
3350
+ _ctxTitle = ( _.isString( _ctxTitle ) ? _ctxTitle : '' ).toLowerCase();
3351
+
3352
  _html.push( [
3353
  ! _isCustomized ? serverControlParams.i18n.skope['The value currently applied to'] : serverControlParams.i18n.skope['The value that will be applied to'],
3354
+ '<strong>' + _ctxTitle + '</strong>',
3355
  ! _isCustomized ? serverControlParams.i18n.skope['is set in'] : serverControlParams.i18n.skope['is customized in'],
3356
  self.buildSkopeLink( _overridedBySkopeId ),
3357
  serverControlParams.i18n.skope['which has a higher priority than the current option scope'],
3514
  api.state( 'changesetStatus' ).set( response.changeset_status );
3515
  if ( 'publish' === response.changeset_status ) {
3516
  api.each( function( setting ) {
3517
+ /*
3518
+ * Note that the setting revision will be undefined in the case of setting
3519
+ * values that are marked as dirty when the customizer is loaded, such as
3520
+ * when applying starter content. All other dirty settings will have an
3521
+ * associated revision due to their modification triggering a change event.
3522
+ */
3523
  if ( setting._dirty && ( _.isUndefined( api._latestSettingRevisions[ setting.id ] ) || api._latestSettingRevisions[ setting.id ] <= latestRevision ) ) {
3524
  setting._dirty = false;
3525
  }
3622
  opt_name : null
3623
  },
3624
  invalidSettings = [],
3625
+ settingInvalidities = [],
3626
  modifiedWhileSaving = {},
3627
  invalidControls,
3628
  submit_dfd = $.Deferred();
3636
  if ( _.isNull( params.the_dirties ) ) {
3637
  throw new Error( 'OVERRIDEN SAVE::submit : MISSING the_dirties');
3638
  }
3639
+
3640
+ /*
3641
+ * Block saving if there are any settings that are marked as
3642
+ * invalid from the client (not from the server). Focus on
3643
+ * the control.
3644
+ */
3645
  if ( _.has( api, 'Notification') ) {
3646
  api.each( function( setting ) {
3647
  setting.notifications.each( function( notification ) {
3675
  if ( api.czr_isChangeSetOn() ) {
3676
  $.extend( query_params, { excludeCustomizedSaved: false } );
3677
  }
3678
+
3679
+ /*
3680
+ * Note that excludeCustomizedSaved is intentionally false so that the entire
3681
+ * set of customized data will be included if bypassed changeset update.
3682
+ */
3683
  var query = $.extend( self.previewer.query( query_params ), {
3684
  nonce: self.previewer.nonce.save,
3685
  customize_changeset_status: self.changesetStatus,
3693
  query.customize_changeset_title = self.saveArgs.title;
3694
  }
3695
  }
3696
+
3697
+ /*
3698
+ * Note that the dirty customized values will have already been set in the
3699
+ * changeset and so technically query.customized could be deleted. However,
3700
+ * it is remaining here to make sure that any settings that got updated
3701
+ * quietly which may have not triggered an update request will also get
3702
+ * included in the values that get saved to the changeset. This will ensure
3703
+ * that values that get injected via the saved event will be included in
3704
+ * the changeset. This also ensures that setting values that were invalid
3705
+ * will get re-validated, perhaps in the case of settings that are invalid
3706
+ * due to dependencies on other settings.
3707
+ */
3708
  var request = wp.ajax.post(
3709
  'global' !== query.skope ? 'customize_skope_changeset_save' : 'customize_save',
3710
  query
4196
  var CZRSkopeMths = CZRSkopeMths || {};
4197
  ( function ( api, $, _ ) {
4198
  $.extend( CZRSkopeMths, {
4199
+ /*****************************************************************************
4200
+ * THE SKOPE MODEL
4201
+ *****************************************************************************/
4202
  initialize: function( skope_id, constructor_options ) {
4203
  var skope = this;
4204
  api.Value.prototype.initialize.call( skope, null, constructor_options );
4277
  }
4278
  });
4279
  },
4280
+
4281
+
4282
+
4283
+
4284
+ /*****************************************************************************
4285
+ * SKOPE API DIRTIES REACTIONS
4286
+ *****************************************************************************/
4287
  dirtyValuesReact : function( to, from ) {
4288
  var skope = this;
4289
  skope.dirtyness( ! _.isEmpty( to ) );
4307
  });
4308
  }
4309
  },
4310
+
4311
+
4312
+ /*****************************************************************************
4313
+ * SKOPE API CHANGESET REACTIONS
4314
+ *****************************************************************************/
4315
  changesetValuesReact : function( to, from ) {
4316
  var skope = this,
4317
  _currentServerDirties = $.extend( true, {}, skope.dirtyValues() );
4318
  skope.dirtyValues( $.extend( _currentServerDirties, to ) );
4319
  },
4320
+
4321
+
4322
+ /*****************************************************************************
4323
+ * SKOPE DB VALUES REACTIONS
4324
+ *****************************************************************************/
4325
  dbValuesReact : function( to, from ) {
4326
  var skope = this;
4327
  skope.hasDBValues(
4353
  });
4354
  }
4355
  },
4356
+
4357
+
4358
+ /*****************************************************************************
4359
+ * SKOPE MODEL CHANGES CALLBACKS
4360
+ *****************************************************************************/
4361
  skopeReact : function( to, from ) {
4362
  var skope = this,
4363
  _current_collection = [],
4378
  api.czr_skopeCollection( _new_collection );
4379
  }
4380
  },
4381
+
4382
+
4383
+
4384
+
4385
+
4386
+
4387
+
4388
+
4389
+ /*****************************************************************************
4390
+ * VALUES CALLBACKS WHEN SKOPE EMBEDDED AND READY
4391
+ * => The skope container exists at this stage
4392
+ *****************************************************************************/
4393
  setupObservableViewValuesCallbacks : function() {
4394
  var skope = this;
4395
  skope.visible.bind( function( is_visible ){
4486
  });
4487
  }
4488
  },
4489
+
4490
+
4491
+
4492
+
4493
+ /*****************************************************************************
4494
+ * HELPERS
4495
+ *****************************************************************************/
4496
  updateSkopeDirties : function( setId, new_val ) {
4497
  var skope = this,
4498
  shortSetId = api.CZR_Helpers.getOptionName( setId );
4548
  $('.czr-skopes-wrapper', '#customize-header-actions').append( $( _tmpl ) );
4549
  return $( '.' + skope.el , '.czr-skopes-wrapper' );
4550
  },
4551
+
4552
+
4553
+
4554
+ /*****************************************************************************
4555
+ * RESET
4556
+ *****************************************************************************/
4557
  renderResetWarningTmpl : function() {
4558
  var skope = this,
4559
  skope_model = $.extend( true, {}, skope() ),
4598
 
4599
  return $( '#czr-skope-pane' );
4600
  },
4601
+
4602
+
4603
+
4604
+
4605
+ /*****************************************************************************
4606
+ * HELPERS
4607
+ *****************************************************************************/
4608
  getEl : function() {
4609
  var skope = this;
4610
  return $( skope.el, '#customize-header-actions');
4615
  var CZRSkopeMths = CZRSkopeMths || {};
4616
  ( function ( api, $, _ ) {
4617
  $.extend( CZRSkopeMths, {
4618
+ /*****************************************************************************
4619
+ * RESET
4620
+ *****************************************************************************/
4621
  reactOnSkopeResetUserRequest : function() {
4622
  var skope = this,
4623
  _fireReaction = function() {
4777
  });//$.extend(
4778
  })( wp.customize , jQuery, _ );
4779
  ( function ( api, $, _ ) {
4780
+ /*****************************************************************************
4781
+ * A "CONTEXT AWARE" SET METHD
4782
+ *****************************************************************************/
4783
+ /**
4784
+ * OVERRIDES BASE api.Value method
4785
+ * => adds the o {} param, allowing to pass additional contextual informations.
4786
+ *
4787
+ * Set the value and trigger all bound callbacks.
4788
+ *
4789
+ * @param {object} to New value.
4790
+ */
4791
  api.Value.prototype.set = function( to, o ) {
4792
  var from = this._value, dfd = $.Deferred(), self = this, _promises = [];
4793
 
4844
  }
4845
  return this;
4846
  };
4847
+
4848
+ /*****************************************************************************
4849
+ * A SILENT SET METHOD :
4850
+ * => keep the dirtyness param unchanged
4851
+ * => stores the api state before callback calls, and reset it after
4852
+ * => add an object param to the callback to inform that this is a silent process
4853
+ * , this is typically used in the overridden api.Setting.preview method
4854
+ *****************************************************************************/
4855
  api.Setting.prototype.silent_set =function( to, dirtyness ) {
4856
  var from = this._value,
4857
  _save_state = api.state('saved')();
4871
  };
4872
  })( wp.customize , jQuery, _ );
4873
  ( function ( api, $, _ ) {
4874
+ /*****************************************************************************
4875
+ * A SKOPE AWARE PREVIEWER QUERY
4876
+ *****************************************************************************/
4877
  api.bind('ready', function() {
4878
  if ( ! serverControlParams.isSkopOn )
4879
  return;
4880
+
4881
+ /**
4882
+ * Build the query to send along with the Preview request.
4883
+ *
4884
+ * @return {object}
4885
+ */
4886
  var _coreQuery = api.previewer.query;
4887
  api.previewer.query = function( queryVars ) {
4888
  if ( ! serverControlParams.isSkopOn ) {
5023
  (function (api, $, _) {
5024
  if ( ! serverControlParams.isSkopOn )
5025
  return;
5026
+
5027
+ /*****************************************************************************
5028
+ * SYNCHRONIZER AUGMENTED
5029
+ *****************************************************************************/
5030
  api.Element.synchronizer.checkbox.update = function( to ) {
5031
  this.element.prop( 'checked', to );
5032
  this.element.iCheck('update');
5215
  czr_override_refresh_for_skope = function() {
5216
  if ( ! serverControlParams.isSkopOn )
5217
  return;
5218
+
5219
+
5220
+ /**
5221
+ * Refresh the preview.
5222
+ */
5223
  api.previewer.refresh = function( _params_ ) {
5224
  var dfd = $.Deferred();
5225
  var _refresh_ = function( params ) {
5253
  ( function ( api, $, _ ) {
5254
  if ( ! serverControlParams.isSkopOn )
5255
  return;
5256
+
5257
+ /**
5258
+ * Get the dirty setting values.
5259
+ * Overrides the default method introduced in 4.7
5260
+ * !! This method only returns the dirties of the global skope !!
5261
+ *
5262
+ * @param {object} [options] Options.
5263
+ * @param {boolean} [options.unsaved=false] Whether only values not saved yet into a changeset will be returned (differential changes).
5264
+ * @returns {object} Dirty setting values.
5265
+ */
5266
  api.dirtyValues = function dirtyValues( options ) {
5267
  return api.czr_skopeBase.getSkopeDirties( api.czr_skopeBase.getGlobalSkopeId(), options );
5268
  };
5272
  if ( ! serverControlParams.isSkopOn || ! api.czr_isChangeSetOn() )
5273
  return;
5274
  var _original_requestChangesetUpdate = api.requestChangesetUpdate;
5275
+
5276
+ /**
5277
+ * Request updates to the changeset.
5278
+ * Always calls the original method when the first promise (the skope changeset save) has been executed.
5279
+ * Returns the $ promise with the set of data from the original method
5280
+ *
5281
+ * @param {object} [changes] Mapping of setting IDs to setting params each normally including a value property, or mapping to null.
5282
+ * If not provided, then the changes will still be obtained from unsaved dirty settings.
5283
+ * @returns {jQuery.Promise}
5284
+ */
5285
  api.requestChangesetUpdate = function( changes ) {
5286
  var self = this,
5287
  dfd = $.Deferred(),
5504
  };//api.Setting.prototype.preview
5505
  })( wp.customize , jQuery, _ );
5506
  ( function ( api, $, _ ) {
5507
+ /* monkey patch for the content height set */
5508
  if ( 'function' == typeof api.Section ) {
5509
  var _original_section_initialize = api.Section.prototype.initialize;
5510
  api.Section.prototype.initialize = function( id, options ) {
5561
  '<span class="fa fa-question-circle-o"></span>'
5562
  ].join('');
5563
  },
5564
+
5565
+
5566
+ /*
5567
+ * @return string
5568
+ * simple helper to build the setting wp api ready id
5569
+ */
5570
  build_setId : function ( setId ) {
5571
  if ( _.contains( serverControlParams.wpBuiltinSettings, setId ) )
5572
  return setId;
5575
 
5576
  return -1 == setId.indexOf( serverControlParams.themeOptions ) ? [ serverControlParams.themeOptions +'[' , setId , ']' ].join('') : setId;
5577
  },
5578
+
5579
+ /*
5580
+ * @return string
5581
+ * simple helper to extract the option name from a setting id
5582
+ */
5583
  getOptionName : function(name) {
5584
  var self = this;
5585
  if ( -1 == name.indexOf(serverControlParams.themeOptions) )
5875
  api.czr_wpQueryDataReady = $.Deferred();
5876
  api.czr_wpQueryInfos = api.czr_wpQueryInfos || new api.Value();
5877
  api.czr_partials = api.czr_partials || new api.Value();
5878
+ /*****************************************************************************
5879
+ * CAPTURE PREVIEW INFORMATIONS ON REFRESH + REACT TO THEM
5880
+ *****************************************************************************/
5881
  api.bind( 'ready', function() {
5882
  api.previewer.bind('houston-widget-settings', function(data) {
5883
  var _candidates = _.filter( data.registeredSidebars, function( sb ) {
5905
  } );
5906
 
5907
  });
5908
+
5909
+ /* WP CONDITIONAL TAGS => stores and observes the WP conditional tags sent by the preview */
5910
  api.previewer.bind( 'czr-query-data-ready', function( data ) {
5911
  api.czr_wpQueryInfos( data );
5912
  if ( 'pending' == api.czr_wpQueryDataReady.state() ) {
5984
  input.container.stop( true, true ).slideUp( 200 );
5985
  });
5986
  });
5987
+ input.enabled = new api.Value( true );
5988
+ input.isReady.done( function() {
5989
+ input.enabled.bind( function( enabled ) {
5990
+ input.container.toggleClass( 'disabled', ! enabled );
5991
+ });
5992
+ });
5993
 
5994
  },
5995
  ready : function() {
6017
  syncElement.set( input() );
6018
  },
6019
  inputReact : function( to, from, data ) {
6020
+ var input = this,
6021
+ _current_input_parent = input.input_parent(),
6022
+ _new_model = _.clone( _current_input_parent ),//initialize it to the current value
6023
+ _isPreItemInput = input.is_preItemInput;
6024
+ if ( ! input.enabled() )
6025
+ return;
6026
+ _new_model = ( ! _.isObject(_new_model) || _.isEmpty(_new_model) ) ? {} : _new_model;
6027
+ _new_model[ input.id ] = to;
6028
+ input.input_parent.set( _new_model, {
6029
+ input_changed : input.id,
6030
+ input_transport : input.transport,
6031
+ not_preview_sent : 'postMessage' === input.transport//<= this parameter set to true will prevent the setting to be sent to the preview ( @see api.Setting.prototype.preview override ). This is useful to decide if a specific input should refresh or not the preview.
6032
+ } );
6033
+ if ( ! _isPreItemInput ) {
6034
+ input.input_parent.trigger( input.id + ':changed', to );
6035
+ if ( ! _.isEmpty( from ) || ! _.isUndefined( from ) && 'postMessage' === input.transport ) {
6036
+ input.module.sendInputToPreview( {
6037
+ input_id : input.id,
6038
+ input_parent_id : input.input_parent.id,
6039
+ to : to,
6040
+ from : from
6041
+ } );
6042
+ }
6043
+ }
6044
  },
6045
+
6046
+
6047
+ /*-----------------------------------------
6048
+ SOME DEFAULT CALLBACKS
6049
+ ------------------------------------------*/
6050
  setupColorPicker : function() {
6051
  var input = this;
6052
 
6170
  input.setupContentRendering(to,from);
6171
  });
6172
  },
6173
+ /**
6174
+ * Open the media modal.
6175
+ */
6176
  czrImgUploadOpenFrame: function( event ) {
6177
  if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
6178
  return;
6186
 
6187
  this.frame.open();
6188
  },
6189
+
6190
+ /**
6191
+ * Create a media modal select frame, and store it so the instance can be reused when needed.
6192
+ */
6193
  czrImgUploadInitFrame: function() {
6194
  var input = this,
6195
  button_labels = this.getUploaderLabels();
6209
  });
6210
  input.frame.on( 'select', input.czrImgUploadSelect );
6211
  },
6212
+
6213
+ /**
6214
+ * Called when the "Remove" link is clicked. Empties the setting.
6215
+ *
6216
+ * @param {object} event jQuery Event object
6217
+ */
6218
  czrImgUploadRemoveFile: function( event ) {
6219
  var input = this;
6220
 
6225
  input.attachment = {};
6226
  input.set('');
6227
  },
6228
+
6229
+
6230
+ /**
6231
+ * Callback handler for when an attachment is selected in the media modal.
6232
+ * Gets the selected image information, and sets it within the input.
6233
+ */
6234
  czrImgUploadSelect: function() {
6235
  var node,
6236
  input = this,
6297
  setupContentPicker: function( wpObjectTypes ) {
6298
  var input = this,
6299
  _event_map = [];
6300
+
6301
+ /* Dummy for the prototype purpose */
6302
  $.extend( {
6303
  post : '',
6304
  taxonomy : ''
6305
  }, _.isObject( wpObjectTypes ) ? wpObjectTypes : {} );
6306
 
6307
  input.wpObjectTypes = wpObjectTypes;
6308
+
6309
+ /* Methodize this or use a template */
6310
  input.container.find('.czr-input').append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>');
6311
  _event_map = [
6312
  {
6314
  selector : 'select[data-select-type]',
6315
  name : 'set_input_value',
6316
  actions : function( obj ){
6317
+ var $_changed_input = $( obj.dom_event.currentTarget, obj.dom_el ),
6318
  _raw_val = $( $_changed_input, obj.dom_el ).select2( 'data' ),
6319
  _val_candidate = {},
6320
  _default = {
6327
 
6328
  _raw_val = _.isArray( _raw_val ) ? _raw_val[0] : _raw_val;
6329
  if ( ! _.isObject( _raw_val ) || _.isEmpty( _raw_val ) ) {
6330
+ api.errorLog( 'Content Picker Input : the picked value should be an object not empty.');
6331
  return;
6332
  }
6333
  _.each( _default, function( val, k ){
6334
  if ( '_custom_' !== _raw_val.id ) {
6335
  if ( ! _.has( _raw_val, k ) || _.isEmpty( _raw_val[ k ] ) ) {
6336
+ api.errorLog( 'content_picker : missing input param : ' + k );
6337
  return;
6338
  }
6339
  }
6345
  ];
6346
 
6347
  input.setupDOMListeners( _event_map , { dom_el : input.container }, input );
6348
+ input.isReady.done( function() {
6349
+ input.setupContentSelecter();
6350
+ });
6351
 
6352
+ },
6353
  setupContentSelecter : function() {
6354
  var input = this;
6355
+ if ( ! _.isEmpty( input() ) ) {
6356
+ var _attributes = {
6357
+ value : input().id || '',
6358
+ title : input().title || '',
6359
+ selected : "selected"
6360
+ };
6361
+ input.container.find('select').append( $( '<option>', _attributes ) );
6362
+ }
6363
 
6364
+ input.container.find( 'select' ).select2( {
6365
  placeholder: {
6366
  id: '-1', // the value of the option
6367
  title: 'Select'
6374
  delay: 250,
6375
  debug: true,
6376
  data: function ( params ) {
6377
+ var page = params.page ? params.page : 0;
6378
  page = params.term ? params.page : page;
6379
  return {
6380
  action : params.term ? "search-available-content-items-customizer" : "load-available-content-items-customizer",
6385
  CZRCpNonce : serverControlParams.CZRCpNonce
6386
  };
6387
  },
6388
+ /* transport: function (params, success, failure) {
6389
+ var $request = $.ajax(params);
6390
+
6391
+ $request.then(success);
6392
+ $request.fail(failure);
6393
+
6394
+ return $request;
6395
+ },*/
6396
  processResults: function ( data, params ) {
6397
  input.defaultContentPickerOption = input.defaultContentPickerOption || [];
6398
 
6399
  if ( ! data.success )
6400
  return { results: input.defaultContentPickerOption };
6401
 
6402
+
6403
  var items = data.data.items,
6404
+ _results = [];
6405
 
6406
  _.each( items, function( item ) {
6407
  _results.push({
6414
  });
6415
  return {
6416
  results: _results,
6417
+ pagination: { more: data.data.items.length >= 10 }//<= the pagination boolean param can be tricky => here set to >= 10 because we query 10 + add a custom link item on the first query
6418
  };
6419
  },
6420
  },//ajax
6421
  templateSelection: input.czrFormatContentSelected,
6422
  templateResult: input.czrFormatContentSelected,
6423
+ escapeMarkup: function ( markup ) { return markup; },
6424
  });//select2 setup
6425
  },
6426
+ czrFormatContentSelected: function ( item ) {
 
 
6427
  if ( item.loading ) return item.text;
6428
  var markup = "<div class='content-picker-item clearfix'>" +
6429
  "<div class='content-item-bar'>" +
6430
+ "<span class='czr-picker-item-title'>" + item.title + "</span>";
6431
 
6432
  if ( item.type_label ) {
6433
+ markup += "<span class='czr-picker-item-type'>" + item.type_label + "</span>";
6434
  }
6435
 
6436
  markup += "</div></div>";
6509
  input.editorExpanded.bind( function (expanded) {
6510
 
6511
  api.consoleLog('in input.editorExpanded', expanded, input() );
6512
+ /*
6513
+ * Ensure only the latest input is bound
6514
+ */
6515
  if ( editor.locker && editor.locker !== input ) {
6516
  editor.locker.editorExpanded.set(false);
6517
  editor.locker = null;
6824
  _new_collection = _.without( _new_collection, _.findWhere( _new_collection, {id: item.id }) );
6825
  module.itemCollection.set( _new_collection );
6826
  module.trigger('pre_item_api_remove', item() );
6827
+
6828
+ var _item_ = $.extend( true, {}, item() );
6829
+ module.czr_Item.remove( item.id );
6830
+ module.trigger( 'item-removed', _item_ );
6831
  },
6832
  getModel : function(id) {
6833
  return this();
6873
  if ( item.module.isMultiItem() ) {
6874
  item.viewState.callbacks.add( function( to, from ) {
6875
  var _isExpanded = -1 !== to.indexOf( 'expanded' );
6876
+ if ( module.hasModOpt() && _isExpanded ) {
6877
+ api.czr_ModOptVisible( false );
6878
+ }
6879
+
6880
  if ( _isExpanded ) {
6881
  if ( _.isObject( item.contentContainer ) && false !== item.contentContainer.length ) {
6882
  item.toggleItemExpansion(to, from );
6996
  _title = _.has( _model, 'title')? api.CZR_Helpers.capitalize( _model.title ) : _model.id;
6997
 
6998
  _title = api.CZR_Helpers.truncate( _title, 20 );
6999
+ $( '.' + module.control.css_attr.item_title , item.container ).text( _title );
7000
  api.CZR_Helpers.doActions('after_writeViewTitle', item.container , _model, item );
7001
  },
7002
  setViewVisibility : function( obj, is_added_by_user ) {
7077
  var ctrl = modOpt.module.control;
7078
  modOpt.set( _initial_model );
7079
  api.czr_ModOptVisible = new api.Value( false );
7080
+ api.czr_ModOptVisible.bind( function( visible, from, args ) {
7081
+ args = args || {};
7082
  if ( visible ) {
7083
+ modOpt.module.closeRemoveDialogs().closeAllItems();
7084
 
7085
  modOpt.modOptWrapperViewSetup( _initial_model ).done( function( $_container ) {
7086
  modOpt.container = $_container;
7089
  } catch(e) {
7090
  api.consoleLog(e);
7091
  }
7092
+ if ( args.module && args.focus ) {
7093
+ _.delay( function() {
7094
+ if ( _.isNull( args.module.czr_ModOpt.container ) || ! args.module.czr_ModOpt.container.find('[data-tab-id="' + args.focus + '"] a').length )
7095
+ return;
7096
+ args.module.czr_ModOpt.container.find('[data-tab-id="' + args.focus + '"] a').trigger('click');
7097
+ }, 200 );
7098
+ }
7099
  });
7100
 
7101
  } else {
7266
 
7267
  } );
7268
  module.embedded = $.Deferred();
7269
+ module.itemsWrapper = '';//will store the $ item container
7270
  if ( ! module.isInSektion() ) {
7271
  module.container = $( module.control.selector );
7272
  module.embedded.resolve();
7279
  module.itemsWrapper = $_module_items_wrapper;
7280
  });
7281
  });
7282
+
7283
+ /*-----------------------------------------------
7284
+ * MODULE OPTIONS
7285
+ ------------------------------------------------*/
7286
  module.defaultAPImodOptModel = {
7287
  initial_modOpt_model : {},
7288
  defaultModOptModel : {},
7291
  };
7292
  module.defaultModOptModel = {};
7293
  module.modOptConstructor = api.CZRModOpt;
7294
+
7295
+ /*-----------------------------------------------
7296
+ * ITEMS
7297
+ ------------------------------------------------*/
7298
  module.itemCollection = new api.Value( [] );
7299
  module.defaultAPIitemModel = {
7300
  id : '',
7307
  module.defaultItemModel = { id : '', title : '' };
7308
  module.itemConstructor = api.CZRItem;
7309
  module.czr_Item = new api.Values();
7310
+
7311
+
7312
+ /*-----------------------------------------------
7313
+ * SET THE DEFAULT INPUT CONSTRUCTOR AND INPUT OPTIONS
7314
+ ------------------------------------------------*/
7315
  module.inputConstructor = api.CZRInput;//constructor for the items input
7316
  if ( module.hasModOpt() ) {
7317
  module.inputModOptConstructor = api.CZRInput;//constructor for the modOpt input
7318
  }
7319
  module.inputOptions = {};//<= can be set by each module specifically
7320
+
7321
+
7322
+ /*-----------------------------------------------
7323
+ * FIRE ON isReady
7324
+ ------------------------------------------------*/
7325
  module.isReady.done( function() {
7326
  module.isDirty = new api.Value( constructorOptions.dirty || false );
7327
  module.initializeModuleModel( constructorOptions )
7374
  moduleReact : function( to, from, data ) {
7375
  var module = this,
7376
  control = module.control,
7377
+ isItemUpdate = ( _.size( from.items ) == _.size( to.items ) ) && ! _.isEmpty( _.difference( to.items, from.items ) ),
7378
  isColumnUpdate = to.column_id != from.column_id,
7379
  refreshPreview = function() {
7380
  module.control.previewer.refresh();
7462
  module.control.previewer.send( 'czr_input', {
7463
  set_id : api.CZR_Helpers.getControlSettingId( module.control.id ),
7464
  module_id : module.id,//<= will allow us to target the right dom element on front end
7465
+ module : { items : $.extend( true, {}, module().items ) , modOpt : module.hasModOpt() ? $.extend( true, {}, module().modOpt ): {} },
7466
  input_parent_id : args.input_parent_id,//<= can be the mod opt or the item
7467
  input_id : args.input_id,
7468
+ value : args.to,
7469
+ isPartialRefresh : args.isPartialRefresh//<= let us know if it is a full wrapper refresh or a single input update ( true when fired from sendModuleInputsToPreview )
7470
  });
7471
  module.trigger( 'input_sent', { input : args.to , dom_el: module.container } );
7472
  },
7473
+ sendModuleInputsToPreview : function( args ) {
7474
  var module = this,
7475
  _sendInputData = function() {
7476
  var inputParent = this,//this is the input parent : item or modOpt
7482
  input_id : inputId,
7483
  input_parent_id : inputParent.id,
7484
  to : inputVal,
7485
+ from : null,
7486
+ isPartialRefresh : args.isPartialRefresh
7487
  });
7488
  });
7489
  };
7862
  }
7863
  );
7864
  },
7865
+
7866
+
7867
+
7868
+ /*-----------------------------------------------
7869
+ * TABS NAVIGATION IN ITEMS AND MODOPT
7870
+ ------------------------------------------------*/
7871
  toggleTabVisibility : function( args ) {
7872
  var inputParent = this,
7873
  tabs = $( inputParent.container ).find('li'),
7922
  $.extend( module, {
7923
  itemPreAddEl : ''//is specific for each crud module
7924
  } );
7925
+
7926
+ module.preItemsWrapper = '';//will store the pre items wrapper
7927
  module.itemAddedMessage = serverControlParams.i18n.successMessage;
7928
  module.userEventMap = new api.Value( [
7929
  {
7945
  module.setupDOMListeners( module.userEventMap() , { dom_el : module.container } );
7946
  module.preItem = new api.Value( module.getDefaultItemModel() );
7947
  module.preItemEmbedded = $.Deferred();//was module.czr_preItem.create('item_content');
7948
+ module.preItemEmbedded.done( function( $preWrapper ) {
7949
+ module.preItemsWrapper = $preWrapper;
7950
  module.setupPreItemInputCollection();
7951
  });
7952
  module.preItemExpanded = new api.Value(false);
7980
  collapsePreItem = function() {
7981
  module.preItemExpanded.set(false);
7982
  module._resetPreItemInputs();
7983
+ },
7984
+ dfd = $.Deferred();
7985
 
7986
  if ( _.isEmpty(item) || ! _.isObject(item) ) {
7987
+ api.errorLog( 'addItem : an item should be an object and not empty. In : ' + module.id +'. Aborted.' );
7988
+ return dfd.resolve().promise();
7989
  }
7990
+ collapsePreItem = _.debounce( collapsePreItem, 200 );
7991
  module.instantiateItem( item, true ).ready(); //true == Added by user
7992
+ ( function() {
7993
+ return $.Deferred( function() {
7994
+ var _dfd_ = this;
7995
+ module.czr_Item( item.id ).isReady.then( function() {
7996
+ collapsePreItem();
7997
+
7998
+ module.trigger('item-added', item );
7999
+ if ( 'postMessage' == api(module.control.id).transport && _.has( obj, 'dom_event') && ! _.has( obj.dom_event, 'isTrigger' ) && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
8000
+ module.control.previewer.refresh().done( function() {
8001
+ _dfd_.resolve();
8002
+ });
8003
+ } else {
8004
+ _dfd_.resolve();
8005
+ }
8006
+ });
8007
+ }).promise();
8008
+ })().done( function() {
8009
+ module.czr_Item( item.id ).viewState( 'expanded' );
8010
+ }).always( function() {
8011
+ dfd.resolve();
8012
  });
8013
+ return dfd.promise();
 
 
8014
  },
8015
 
8016
  _resetPreItemInputs : function() {
8041
 
8042
  var $_pre_add_el = $('.' + module.control.css_attr.pre_add_item_content, module.container );
8043
  $_pre_add_el.prepend( pre_add_template() );
8044
+ module.preItemEmbedded.resolve( $_pre_add_el );
8045
  },
8046
  _getPreItemView : function() {
8047
  var module = this;
8316
  }
8317
  }
8318
  },
8319
+
8320
+ /* Helpers */
8321
  getTitleFromIcon : function( icon ) {
8322
  return api.CZR_Helpers.capitalize( icon.replace('fa-', '').replace('envelope', 'email') );
8323
  },
8339
  module = input.module,
8340
  socialList = module.social_icons,
8341
  _model = item(),
8342
+ is_preItem = _.isEmpty( _model.id );
8343
  if ( is_preItem ) {
8344
  socialList = _.union( [ serverControlParams.i18n.selectSocialIcon ], socialList );
8345
  }
8497
  module.preItem_location_alert_view_state.callbacks.add( function( to, from ) {
8498
  module._toggleLocationAlertExpansion( module.container, to );
8499
  });
8500
+ module.bind( 'item-added', function( model ) {
8501
  module.addWidgetSidebar( model );
8502
  });
8503
 
9178
  if ( ! control.czr_Module( _mod_.id ) )
9179
  return;
9180
 
9181
+ control.czr_Module( _mod_.id ).sendModuleInputsToPreview( { isPartialRefresh : true } );
9182
  });
9183
  }
9184
  });
9577
  });
9578
  }
9579
  else {
9580
+ _new_collection.push( module_api_ready );
9581
  }
9582
  var _params = {};
9583
  if ( _.has( obj, 'data') ) {
9623
  if ( control.isMultiModuleControl() ) {
9624
  return _filtered_collection;
9625
  } else {
9626
+ if ( _.size( collection ) > 1 ) {
9627
  throw new Error('There should not be several modules in the collection of control : ' + control.id );
9628
  }
9629
+ if ( ! _.isArray( collection ) || _.isEmpty( collection ) || ! _.has( collection[0], 'items' ) ) {
9630
  throw new Error('The setting value could not be populated in control : ' + control.id );
9631
  }
9632
  var module_id = collection[0].id;
10056
  });//$.extend//CZRBaseControlMths
10057
  })( wp.customize , jQuery, _ );
10058
  var CZRMultiplePickerMths = CZRMultiplePickerMths || {};
10059
+ /* Multiple Picker */
10060
+ /**
10061
+ * @constructor
10062
+ * @augments wp.customize.Control
10063
+ * @augments wp.customize.Class
10064
+ */
10065
  ( function ( api, $, _ ) {
10066
  $.extend( CZRMultiplePickerMths , {
10067
  ready: function() {
10087
  var CZRCroppedImageMths = CZRCroppedImageMths || {};
10088
 
10089
  (function (api, $, _) {
10090
+ /* IMAGE UPLOADER CONTROL IN THE CUSTOMIZER */
10091
  if ( 'function' != typeof wp.media.controller.Cropper || 'function' != typeof api.CroppedImageControl )
10092
  return;
10093
+
10094
+
10095
+ /* CZRCustomizeImage Cropper */
10096
+ /**
10097
+ * Custom version of:
10098
+ * wp.media.controller.CustomizeImageCropper (wp-includes/js/media-views.js)
10099
+ *
10100
+ * In order to use image destination sizes different than the suggested ones
10101
+ *
10102
+ * A state for cropping an image.
10103
+ *
10104
+ * @class
10105
+ * @augments wp.media.controller.Cropper
10106
+ * @augments wp.media.controller.State
10107
+ * @augments Backbone.Model
10108
+ */
10109
  wp.media.controller.CZRCustomizeImageCropper = wp.media.controller.Cropper.extend({
10110
  doCrop: function( attachment ) {
10111
  var cropDetails = attachment.get( 'cropDetails' ),
10123
  } );
10124
  }
10125
  });
10126
+
10127
+
10128
+
10129
+ /* CZRCroppedImageControl */
10130
  $.extend( CZRCroppedImageMths , {
10131
+ /**
10132
+ * Create a media modal select frame, and store it so the instance can be reused when needed.
10133
+ * CZR: We don't want to crop svg (cropping fails), gif (animated gifs become static )
10134
+ * @Override
10135
+ * We need to override this in order to use our ImageCropper custom extension of wp.media.controller.Cropper
10136
+ *
10137
+ * See api.CroppedImageControl:initFrame() ( wp-admin/js/customize-controls.js )
10138
+ */
10139
  initFrame: function() {
10140
 
10141
  var l10n = _wpMediaViewsL10n;
10166
  this.frame.on( 'cropped', this.onCropped, this );
10167
  this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
10168
  },
10169
+
10170
+ /**
10171
+ * After an image is selected in the media modal, switch to the cropper
10172
+ * state if the image isn't the right size.
10173
+ *
10174
+ * CZR: We don't want to crop svg (cropping fails), gif (animated gifs become static )
10175
+ * @Override
10176
+ * See api.CroppedImageControl:onSelect() ( wp-admin/js/customize-controls.js )
10177
+ */
10178
  onSelect: function() {
10179
  var attachment = this.frame.state().get( 'selection' ).first().toJSON();
10180
  if ( ! ( attachment.mime && attachment.mime.indexOf("image") > -1 ) ){
10194
 
10195
  var CZRUploadMths = CZRUploadMths || {};
10196
  ( function ( api, $, _ ) {
10197
+ /**
10198
+ * @constructor
10199
+ * @augments wp.customize.Control
10200
+ * @augments wp.customize.Class
10201
+ */
10202
  $.extend( CZRUploadMths, {
10203
  ready: function() {
10204
  var control = this;
10536
  }
10537
  return dfd.promise();
10538
  },
10539
+
10540
+
10541
+ /*
10542
+ * @return void
10543
+ * show or hide setting according to the dependency + callback pair
10544
+ * @params setId = the short setting id, whitout the theme option prefix OR the WP built-in setting
10545
+ * @params o = { controls [], callback fn, onSectionExpand bool }
10546
+ */
10547
  _processDominusCallbacks : function( shortDominusId, dominusParams, refresh ) {
10548
  var self = this,
10549
  wpDominusId = api.CZR_Helpers.build_setId( shortDominusId ),
10633
  }
10634
 
10635
  },
10636
+
10637
+
10638
+
10639
+
10640
+
10641
+
10642
+
10643
+
10644
+
10645
+
10646
+ /*****************************************************************************
10647
+ * HELPERS
10648
+ *****************************************************************************/
10649
+ /*
10650
+ * Abstract
10651
+ * Will be provided by the theme
10652
+ * @return main control dependencies object
10653
+ */
10654
  _getControlDeps : function() {
10655
  return {};
10656
  },
10704
 
10705
  return _ready_params;
10706
  },
10707
+
10708
+
10709
+
10710
+ /*****************************************************************************
10711
+ * FAVICON SPECIFICS
10712
+ *****************************************************************************/
10713
+ /**
10714
+ * Fired on api ready
10715
+ * May change the site_icon description on load
10716
+ * May add a callback to site_icon
10717
+ * @return void()
10718
+ */
10719
  _handleFaviconNote : function() {
10720
  var self = this,
10721
  _fav_setId = api.CZR_Helpers.build_setId( serverControlParams.faviconOptionName );
10745
  ( function ( wp, $ ) {
10746
  $( function($) {
10747
  var api = wp.customize || api;
10748
+
10749
+ /* RECENTER CURRENT SECTIONS */
10750
  $('.accordion-section').not('.control-panel').click( function () {
10751
  _recenter_current_section($(this));
10752
  });
10759
  }, 700);
10760
  }
10761
  }//end of fn
10762
+
10763
+
10764
+ /* CHECKBOXES */
10765
  api.czrSetupCheckbox = function( controlId, refresh ) {
10766
  $('input[type=checkbox]', api.control(controlId).container ).each( function() {
10767
  if ( 0 === $(this).val() || '0' == $(this).val() || 'off' == $(this).val() || _.isEmpty($(this).val() ) ) {
10782
  });
10783
  });
10784
  };//api.czrSetupCheckbox()
10785
+
10786
+ /* SELECT INPUT */
10787
  api.czrSetupSelect = function(controlId, refresh) {
10788
  $('select[data-customize-setting-link]', api.control(controlId).container )
10789
  .not('.no-selecter-js')
10792
  });
10793
  });
10794
  };//api.czrSetupSelect()
10795
+
10796
+
10797
+ /* NUMBER INPUT */
10798
  api.czrSetupStepper = function( controlId, refresh ) {
10799
  $('input[type="number"]', api.control(controlId).container ).each( function() {
10800
  $(this).stepper();
addons/assets/czr/js/czr-control-base.min.js CHANGED
@@ -1,17 +1,17 @@
1
- /*! addEventListener Polyfill ie9- http://stackoverflow.com/a/27790212*/
2
- window.addEventListener=window.addEventListener||function(a,b){window.attachEvent("on"+a,b)},/*! Datenow Polyfill ie9- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now */
3
- Date.now||(Date.now=function(){return(new Date).getTime()}),/*! Object.create monkey patch ie8 http://stackoverflow.com/a/18020326 */
4
- Object.create||(Object.create=function(a,b){function c(){}if("undefined"!=typeof b)throw"The multiple-argument version of Object.create is not provided by this browser and cannot be shimmed.";return c.prototype=a,new c}),/*! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter */
5
- Array.prototype.filter||(Array.prototype.filter=function(a){"use strict";if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;f<c;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),/*! map was added to the ECMA-262 standard in the 5th edition */
6
- Array.prototype.map||(Array.prototype.map=function(a,b){var c,d,e;if(null===this)throw new TypeError(" this is null or not defined");var f=Object(this),g=f.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=new Array(g),e=0;e<g;){var h,i;e in f&&(h=f[e],i=a.call(c,h,e,f),d[e]=i),e++}return d}),/*! Array.from was added to the ECMA-262 standard in the 6th edition (ES2015) */
7
- Array.from||(Array.from=function(){var a=Object.prototype.toString,b=function(b){return"function"==typeof b||"[object Function]"===a.call(b)},c=function(a){var b=Number(a);return isNaN(b)?0:0!==b&&isFinite(b)?(b>0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k<i;)h=d[k],g?j[k]="undefined"==typeof f?g(h,k):g.call(f,h,k):j[k]=h,k+=1;return j.length=i,j}}()),/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
8
- "function"!=typeof jQuery.fn.iCheck&&!function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"!=b&&("keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):void("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A)))}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto),"function"!=typeof jQuery.fn.selecter&&!function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{var f=c.html();c.data("value"),b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window),"function"!=typeof jQuery.fn.stepper&&!function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0!==typeof e&&!isNaN(e)&&e,max:void 0!==typeof f&&!isNaN(f)&&f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this),/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group",a(h),this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){
9
- function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";
10
- return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}),/*! rangeslider.js - v2.3.0 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
11
- !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||a.open===!1)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){"undefined"!=typeof a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty("display","block","important"):d[i].style.cssText+=";display: block !important",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier="js-"+k+"-"+l++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return"number"==typeof a&&a!==a};var k="rangeslider",l=0,m=b(),n={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},o={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute("min"),0),this.max=h(this.$element[0].getAttribute("max"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute("step"),1)),this.handleDimension=g(this.$handle[0],"offset"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],"offset"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),!((" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=d+"px",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return"undefined"!=typeof a.originalEvent["client"+b]?d=a.originalEvent["client"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&"undefined"!=typeof a.originalEvent.touches[0]["client"+b]?d=a.originalEvent.touches[0]["client"+b]:a.currentPoint&&"undefined"!=typeof a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b,c;return b=(a-this.min)/(this.max-this.min),c=Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&""!==this.$element[0].value||this.$element.val(a).trigger("input",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data("plugin_"+k);e||d.data("plugin_"+k,e=new j(this,b)),"string"==typeof b&&e[b].apply(e,c)})},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"});var czr_debug={log:function(a){debug.queue.push(["log",arguments,debug.stack.slice(0)]),window.console&&"function"==typeof window.console.log&&window.console.log(a)},error:function(a){debug.queue.push(["error",arguments,debug.stack.slice(0)]),window.console&&"function"==typeof window.console.error&&window.console.error(a)},queue:[],stack:[]};!function(a,b,c){var d=function(a){var b={bgCol:"#5ed1f5",textCol:"#000",consoleArguments:[]};a=c.extend(b,a);var d=Array.from(a.consoleArguments),e=function(a){return c.isString(a)?a.length>150?a.substr(0,149):a:""};return d=c.isEmpty(c.filter(d,function(a){return!c.isString(a)}))?d.join(" "):JSON.stringify(d),["%c "+e(d),["background:"+a.bgCol,"color:"+a.textCol,"display: block;"].join(";")]};a.consoleLog=function(){serverControlParams.isDevMode&&(c.isUndefined(console)&&"function"!=typeof window.console.log||console.log.apply(console,d({consoleArguments:arguments})))},a.errorLog=function(){c.isUndefined(console)&&"function"!=typeof window.console.log||console.log.apply(console,d({bgCol:"#ffd5a0",textCol:"#000",consoleArguments:arguments}))},a.czr_isSkopOn=function(){return serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase")},a.czr_isChangeSetOn=function(){return serverControlParams.isChangeSetOn&&!0},a.czr_activeSectionId=new a.Value(""),a.czr_activePanelId=new a.Value(""),"function"==typeof a.Section&&a.control.bind("add",function(b){b.params.ubq_section&&b.params.ubq_section.section&&(b.params.original_priority=b.params.priority,b.params.original_section=b.params.section,a.section.when(b.params.ubq_section.section,function(a){a.expanded.bind(function(a){a?(b.params.ubq_section.priority&&b.priority(b.params.ubq_section.priority),b.section(b.params.ubq_section.section)):(b.priority(b.params.original_priority),b.section(b.params.original_section))})}))});var e=function(){c.has(a,"czr_ModOptVisible")&&a.czr_ModOptVisible(!1)};a.czr_activeSectionId.bind(e),a.czr_activePanelId.bind(e),a.bind("ready",function(){if("function"!=typeof a.Section)throw new Error("Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.");var b=function(b,c){a.czr_activeSectionId(b?c:"")};a.section.each(function(a){a.expanded.bind(function(c){b(c,a.id)})}),a.section.bind("add",function(c){a.trigger("czr-paint",{active_panel_id:c.panel()}),c.expanded.bind(function(a){b(a,c.id)})});var d=function(b,d){a.czr_activePanelId(b?d:""),c.isEmpty(a.czr_activePanelId())&&a.czr_activeSectionId("")};a.panel.each(function(a){a.expanded.bind(function(b){d(b,a.id)})}),a.panel.bind("add",function(a){a.expanded.bind(function(b){d(b,a.id)})})}),a.bind("ready",function(){var d=function(){a.section("themes").active.bind(function(d){c.has(serverControlParams,"isThemeSwitchOn")&&c.isEmpty(serverControlParams.isThemeSwitchOn)&&(a.section("themes").active(serverControlParams.isThemeSwitchOn),a.section("themes").active.callbacks=b.Callbacks())})};a.section.has("themes")?d():a.section.when("themes",function(a){d()})}),a.czr_skopeReady=b.Deferred(),a.bind("ready",function(){serverControlParams.isSkopOn&&(a.czr_isLoadingSkope=new a.Value((!1)),a.czr_isLoadingSkope.bind(function(a){f(a)}),a.czr_skopeBase=new a.CZR_skopeBase,a.czr_skopeSave=new a.CZR_skopeSave,a.czr_skopeReset=new a.CZR_skopeReset,a.trigger("czr-skope-started"),a.czr_skopeReady.done(function(){a.trigger("czr-skope-ready")}).fail(function(b){a.errorLog("Skope could not be instantiated : "+b),serverControlParams.isSkopOn=!1,a.czr_isLoadingSkope(!1)}),"rejected"!=a.czr_skopeReady.state()&&setTimeout(function(){"pending"==a.czr_skopeReady.state()&&(a.czr_skopeBase.toggleTopNote(!0,{title:serverControlParams.i18n.skope["There was a problem when trying to load the customizer."],message:[serverControlParams.i18n.skope["Please open your"],'<a href="http://docs.presscustomizr.com/article/272-inspect-your-webpages-in-your-browser-with-the-development-tools" target="_blank">',serverControlParams.i18n.skope["browser debug tool"],"</a>",",",serverControlParams.i18n.skope["and report any error message (in red) printed in the javascript console in the"],'<a href="https://wordpress.org/support/theme/hueman" target="_blank">',serverControlParams.i18n.skope["Hueman theme forum"],"</a>."].join(" "),selfCloseAfter:4e4}),a.czr_isLoadingSkope(!1))},3e4)),serverControlParams.isChangeSetOn&&(a.settings.timeouts.changesetAutoSave=1e4)}),c.has(a,"_latestRevision")||(a._latestRevision=0,a._latestSettingRevisions={},a.bind("change",function(b){a._latestRevision+=1,a._latestSettingRevisions[b.id]=a._latestRevision}),a.bind("ready",function(){a.bind("add",function(b){b._dirty&&(a._latestRevision+=1,a._latestSettingRevisions[b.id]=a._latestRevision)})}));var f=function(d){d=!!c.isUndefined(d)||d;var e,f=function(){var c=b.Deferred();try{_tmpl=wp.template("czr-skope-pane")({is_skope_loading:!0})}catch(d){a.errorLog("In toggleSkopeLoadPane : error when parsing the the reset skope template : "+d),c.resolve(!1)}return b.when(b("#customize-preview").after(b(_tmpl))).always(function(){c.resolve(b("#czr-skope-pane"))}),c.promise()},g=function(){c.delay(function(){b.when(b("body").removeClass("czr-skope-pane-open")).done(function(){c.delay(function(){b.when(b("body").removeClass("czr-skop-loading")).done(function(){!1!==b("#czr-skope-pane").length&&setTimeout(function(){b("#czr-skope-pane").remove()},400)})},200)})},50)};"pending"==a.czr_skopeReady.state()&&d&&(b("body").addClass("czr-skop-loading"),f().done(function(a){e=a}).then(function(){e.length&&c.delay(function(){var a=b("#customize-preview").height();e.css("line-height",a+"px").css("height",a+"px"),b("body").addClass("czr-skope-pane-open")},50)})),a.czr_skopeReady.done(function(){g()}),d||g()}}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{globalSettingVal:{},initialize:function(){var d=this;d.skope_colors={global:"rgb(255, 255, 255)",special_group:"rgba(173, 213, 247, 0.55)",group:"rgba(173, 213, 247, 0.55)",local:"rgba(78, 122, 199, 0.35)"},a.czr_isPreviewerSkopeAware=b.Deferred(),a.czr_initialSkopeCollectionPopulated=b.Deferred(),d.skopeWrapperEmbedded=b.Deferred(),a.czr_skope=new a.Values,a.czr_skopeCollection=new a.Value([]),a.czr_currentSkopesCollection=new a.Value([]),a.czr_activeSkopeId=new a.Value,a.czr_dirtyness=new a.Value((!1)),a.czr_isResettingSkope=new a.Value((!1)),a.state.create("switching-skope")(!1),a.czr_dirtyness.callbacks.add(function(){return d.apiDirtynessReact.apply(d,arguments)}),a.czr_isLoadingSkope(!0),d.bindAPISettings(),a.state.bind("change",function(){d.setSaveButtonStates()}),a.czr_skopeReady.then(function(){"pending"==d.skopeWrapperEmbedded.state()&&b.when(d.embedSkopeWrapper()).done(function(){d.skopeWrapperEmbedded.resolve()})}),a.previewer.bind("czr-skopes-synced",function(b){if(serverControlParams.isSkopOn&&"rejected"!=a.czr_skopeReady.state()){var e=this,f=a.czr_currentSkopesCollection();if(!c.has(b,"czr_skopes"))return void a.errorLog("On 'czr-skopes-synced' : missing skopes in the server data");try{a.czr_skopeBase.updateSkopeCollection(b.czr_skopes,e.channel())}catch(g){return void a.czr_skopeReady.reject(g)}a.czr_initialSkopeCollectionPopulated.then(function(){var e=c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{id:a.czr_activeSkopeId()}));a.czr_skopeBase.reactWhenSkopeSyncedDone(b).done(function(){if(e)try{a.czr_activeSkopeId(d.getActiveSkopeId()).done(function(){"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.resolve(d.getActiveSkopeId()),d._writeCurrentSkopeTitle()}).fail(function(){throw new Error("Error when trying to set the active skope after skope synced.")})}catch(g){a.errorLog("In reactWhenSkopeSyncedDone => api.czr_activeSkopeId() : "+g)}else if(!c.isEmpty(f)){var h=c.findWhere(f,{skope:"local"}).opt_name,i=c.findWhere(b.czr_skopes,{skope:"local"}).opt_name;i!==h&&"resolved"==a.czr_skopeReady.state()&&d._writeCurrentSkopeTitle()}})})}}),a.czr_currentSkopesCollection.bind(function(a,b){return d.currentSkopesCollectionReact(a,b)},{deferred:!0}),a.czr_initialSkopeCollectionPopulated.done(function(){a.czr_activeSkopeId.bind(function(b,e){return c.has(a,"czr_ModOptVisible")&&a.czr_ModOptVisible(!1),d.activeSkopeReact(b,e).then(function(c){a.trigger("skope-switched-done",{current_skope_id:b,previous_skope_id:e,updated_setting_ids:c||[]})})},{deferred:!0}),a.czr_activeSectionId.callbacks.add(function(){return d.activeSectionReact.apply(d,arguments)}),a.czr_activePanelId.callbacks.add(function(){return d.activePanelReact.apply(d,arguments)})}),a.bind("skope-switched-done",function(a){return a=c.extend({current_skope_id:"",previous_skope_id:"",updated_setting_ids:[]},a),d.skopeSwitchedDoneReact(a)}),a.czr_serverNotification=new a.Value({status:"success",message:"",expanded:!0}),a.czr_serverNotification.bind(function(a,b){d.toggleServerNotice(a)}),a.czr_topNoteVisible=new a.Value((!1)),a.czr_skopeReady.then(function(){a.czr_topNoteVisible.bind(function(c){var e={},f={title:"",message:"",actions:"",selfCloseAfter:2e4};e=b.extend(f,serverControlParams.topNoteParams),e.actions=function(){var c=b.extend(a.previewer.query(),{nonce:a.previewer.nonce.save});wp.ajax.post("czr_dismiss_top_note",c).always(function(){}).fail(function(b){a.consoleLog("czr_dismiss_top_note failed",c,b)}).done(function(a){})},d.toggleTopNote(c,e)}),c.delay(function(){a.czr_topNoteVisible(!c.isEmpty(serverControlParams.isTopNoteOn)||1==serverControlParams.isTopNoteOn)},2e3)}),d.scopeSwitcherEventMap=[{trigger:"click keydown",selector:".czr-dismiss-notification",name:"dismiss-notification",actions:function(){a.czr_serverNotification({expanded:!1})}},{trigger:"click keydown",selector:".czr-toggle-title-notice",name:"toggle-title-notice",actions:function(b){c.isUndefined(d.skopeTitleNoticeVisible)&&(d.skopeTitleNoticeVisible=new a.Value((!1)),d.skopeTitleNoticeVisible.bind(function(a){b.dom_el.find(".czr-skope-title").toggleClass("notice-visible",a)})),d.skopeTitleNoticeVisible(!d.skopeTitleNoticeVisible())}}],d.skopeWrapperEmbedded.then(function(){a.CZR_Helpers.setupDOMListeners(d.scopeSwitcherEventMap,{dom_el:b(".czr-scope-switcher")},d)}),d.refreshedControls=["czr_cropped_image"],d.initWidgetSidebarSpecifics(),a.bind("czr-paint",function(b){a.czr_skopeReady.then(function(){d.wash(b).paint(b)})})},embedSkopeWrapper:function(){var d=this;b("#customize-header-actions").append(b("<div/>",{"class":"czr-scope-switcher",html:'<div class="czr-skopes-wrapper"></div>'})),b("body").addClass("czr-skop-on");var e=[{trigger:"click keydown",selector:".czr-skope-switch",name:"control_skope_switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}}];a.CZR_Helpers.setupDOMListeners(e,{dom_el:b(".czr-scope-switcher")},d)},apiDirtynessReact:function(c){b("body").toggleClass("czr-api-dirty",c),a.state("saved")(!c)},setSaveButtonStates:function(){a.state.has("saving")||(a.state.create("saving"),a.state("saving").bind(function(a){b(document.body).toggleClass("saving",a)}));var c=b("#save"),d=b(".customize-controls-close"),e=a.state("saved"),f=a.state("saving"),g=a.state("activated"),h=a.state.has("changesetStatus")?a.state("changesetStatus")():"auto-draft";a.czr_dirtyness()||!e()?(c.val(a.l10n.save),d.find(".screen-reader-text").text(a.l10n.cancel)):(c.val(a.l10n.saved),d.find(".screen-reader-text").text(a.l10n.close));var i=!(f()||g()&&e()||"publish"===h);c.prop("disabled",!i)},skopeSwitchedDoneReact:function(d){var e=this,f=function(){a.czr_CrtlDependenciesReady.then(function(){if(!c.isUndefined(a.czr_activeSectionId())&&!c.isEmpty(a.czr_activeSectionId()))try{a.czr_ctrlDependencies.setServiDependencies(a.czr_activeSectionId(),null,!0)}catch(b){a.errorLog("On skope-switched-done : "+b)}}),e.updateCtrlSkpNot(a.CZR_Helpers.getSectionControlIds()),a.czr_skope.has(d.previous_skope_id)&&b("#customize-controls").removeClass(["czr-",a.czr_skope(d.previous_skope_id)().skope,"-skope-level"].join("")),a.czr_skope.has(d.current_skope_id)&&b("#customize-controls").addClass(["czr-",a.czr_skope(d.current_skope_id)().skope,"-skope-level"].join(""));var f=function(){if(!c.isUndefined(a.czr_activeSectionId())&&!c.isEmpty(a.czr_activeSectionId())){var b=a.CZR_Helpers.getSectionControlIds(a.czr_activeSectionId());c.each(b,function(b){a.control.when(b,function(){var d=a.control(b);c.has(d,"czr_states")&&d.deferred.embedded.then(function(){d.czr_states("noticeVisible")(e.isCtrlNoticeVisible(b)),d.czr_states("resetVisible")(!1)})})})}};c.delay(function(){f()},500)};a.czr_skopeReady.then(function(){f()})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleServerNotice:function(d){if(d=c.isObject(d)?d:{},d=c.extend({status:"success",expanded:!0,message:"",auto_collapse:!1},d),"changeset_already_published"!=d.message&&serverControlParams.isDevMode){this.serverNoticeEmbedded=this.serverNoticeEmbedded||b.Deferred();var e=this,f=function(){b(".czr-scope-switcher").prepend(b("<div/>",{"class":"czr-server-notice",html:'<span class="czr-server-message"></span><span class="fa fa-times-circle czr-dismiss-notification"></span>'}))},g=function(){var a,f,g=b(".czr-server-notice",".czr-scope-switcher"),h=b(".wp-full-overlay-header"),i=(b(".wp-full-overlay-sidebar .wp-full-overlay-sidebar-content"),function(a){return!0});e.skopeTitleNoticeVisible&&e.skopeTitleNoticeVisible(!1),d.expanded?(g.toggleClass("czr-server-error","error"==d.status),"error"==d.status?b(".czr-server-message",g).html(c.isEmpty(d.message)?"Server Problem.":d.message):b(".czr-server-message",g).html(c.isEmpty(d.message)?"Success.":d.message),f=b(".czr-server-notice",".czr-scope-switcher").outerHeight(),a=h.outerHeight()+f,setTimeout(function(){b.when(i(a)).done(function(){g.fadeIn({duration:200,complete:function(){b(this).css("height","auto")}})})},400)):(g.fadeOut({duration:200,complete:function(){}}),setTimeout(function(){i()},200))};"pending"==e.serverNoticeEmbedded.state()?b.when(f()).done(function(){setTimeout(function(){e.serverNoticeEmbedded.resolve(),g()},200)}):g(),c.delay(function(){a.czr_serverNotification({expanded:!1})},"success"==d.status||!1!==d.auto_collapse?4e3:5e3)}},buildServerResponse:function(a){var b=!1;if(c.isObject(a)&&(!c.has(a,"responseJSON")||c.isUndefined(a.responseJSON.data)||c.isEmpty(a.responseJSON.data)?c.has(a,"statusText")&&!c.isEmpty(a.statusText)&&(b=a.statusText):b=a.responseJSON.data),c.isObject(a)&&!b)try{JSON.stringify(a)}catch(d){b="Server Error"}else b?"-1"===a&&(b="Identification issue detected, please refresh your page."):b="0"===a?"Not logged in.":a;return b}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleTopNote:function(d,e){e=c.isObject(e)?e:{};var f=this,g={title:"",message:"",actions:"",selfCloseAfter:2e4},h=function(){b.when(f.renderTopNoteTmpl(e)).done(function(d){f.welcomeNote=d,c.delay(function(){b("body").addClass("czr-top-note-open")},200),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:".czr-top-note-close",name:"close-top-note",actions:function(){i().done(function(){c.isFunction(e.actions)&&e.actions()})}}],{dom_el:f.welcomeNote},f)})},i=function(){var a=b.Deferred();return b("body").removeClass("czr-top-note-open"),f.welcomeNote.length?c.delay(function(){f.welcomeNote.remove(),a.resolve()},300):a.resolve(),a.promise()};e=b.extend(g,e),d?h():i(),c.delay(function(){i()},e.selfCloseAfter||2e4)},renderTopNoteTmpl:function(c){if(b("#czr-top-note").length)return b("#czr-top-note");var d="",e=c.title||"",f=c.message||"";try{d=wp.template("czr-top-note")({title:e})}catch(g){return a.errorLog("Error when parsing the the top note template : "+g),!1}return b("#customize-preview").after(b(d)),b(".czr-note-message","#czr-top-note").html(f),b("#czr-top-note")}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{bindAPISettings:function(b){var d=this,e=function(b,e,f){var g,h=this.id;serverControlParams.isSkopOn&&(c.has(a,"czr_activeSkopeId")&&!c.isUndefined(a.czr_activeSkopeId())||a.errorLog("The api.czr_activeSkopeId() is undefined in the api.czr_skopeBase.bindAPISettings method."),a(h)._dirty&&(g=d.isSettingSkopeEligible(h)?a.czr_activeSkopeId():d.getGlobalSkopeId(),a.czr_skope(g).updateSkopeDirties(h,b)),c.has(a.control(h),"czr_states")&&!a.control(h).czr_states("isResetting")()&&a.control(h).czr_states("resetVisible")(!1),d.isSettingSkopeEligible(h)&&d.updateCtrlSkpNot(h))};c.isUndefined(b)?a.each(function(a){a.bind(e)}):a(b).bind(e);var f=function(a){a.callbacks.has(e)||a.bind(e)};a.topics.change.has(f)||a.bind("change",f)}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{reactWhenSkopeSyncedDone:function(d){var e=b.Deferred();if(!c.has(d,"czr_skopes")||c.isEmpty(d.czr_skopes))return a.errorLog("Missing skope data after refresh",d),e.resolve().promise();a.czr_dirtyness()||a.czr_dirtyness(!!c.isBoolean(d.isChangesetDirty)&&d.isChangesetDirty);var f=d.czr_skopes;return c.each(a.czr_skopeCollection(),function(b){var d=c.findWhere(f,{opt_name:b.opt_name});if(!c.isUndefined(d)){var e=c.isEmpty(d.changeset||{})?{}:d.changeset,g={};c.each(e,function(b,c){a.has(c)||a.consoleLog("In reactWhenSkopeSyncedDone : attempting to update the changeset with a non registered setting : "+c),g[c]=b}),a.czr_skope(b.id).changesetValues(g)}}),c.each(a.czr_skopeCollection(),function(d){var e=c.findWhere(f,{opt_name:d.opt_name});if(!c.isUndefined(e)){var g=b.extend(!0,{},a.czr_skope(d.id).dbValues()),h=b.extend(g,e.db||{}),i={};c.each(h,function(b,c){a.has(c)||a.consoleLog("In reactWhenSkopeSyncedDone : attempting to update the db values with a non registered setting : "+c),i[c]=b}),a.czr_skope(d.id).dbValues(i)}}),c.delay(function(){e.resolve()},500),e.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{_maybeSetupAssignedMenuLocations:function(b){(c.isUndefined(b)||c.isEmpty(b)||!a.section.has(b.id))&&a.consoleLog("In _maybeSetupAssignedMenuLocations : no valid section_id provided.");if(b.assignedLocations){var d=function(a){};b.assignedLocations.callbacks.has(d)||b.assignedLocations.bind(d)}},activeSectionReact:function(b,d){"add_menu"!=b&&a.trigger("czr-paint",{active_section_id:b});var e=this,f=function(b){var d=a.CZR_Helpers.getSectionControlIds(b);c.each(d,function(b){if(a.has(b)&&!c.isUndefined(a.control(b))){var d=a.control(b);c.has(d,"czr_states")&&d.czr_states("resetVisible")(!1)}})},g=function(b,d){e.setupActiveSkopedControls({section_id:d}),e.processSilentUpdates({section_id:d}).fail(function(){throw new Error("Fail to process silent updates after initial skope collection has been populated")}).done(function(){var b=function(){var b=a.CZR_Helpers.getSectionControlIds(d);c.each(b,function(b){if(a.has(b)&&!c.isUndefined(a.control(b))){var d=a.control(b);c.has(d,"czr_states")&&d.czr_states("noticeVisible")(e.isCtrlNoticeVisible(b))}})};c.delay(function(){b()},700),e.isExcludedSidebarsWidgets()||e.forceSidebarDirtyRefresh(d,a.czr_activeSkopeId())}),c.has(a.topics,"active-section-setup")||a.bind("active-section-setup",function(a){var b={controls:[],section_id:""};a=c.extend(b,a),e._maybeSetupAssignedMenuLocations(a)}),a.czr_skopeReady.then(function(){var b=function(b){a.czr_serverNotification({status:"success",message:[b,serverControlParams.i18n.skope["can only be customized sitewide."]].join(" ")}),a.czr_activeSkopeId(e.getGlobalSkopeId())};"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&(!e.isExcludedWPCustomCss()||"custom_css"!=d&&"admin_sec"!=d||b(a.section(d).params.title),"nav_menu["!=d.substring(0,"nav_menu[".length)&&"add_menu"!=d||a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Menus are created sitewide."]].join(" ")}))}),a.trigger("active-section-setup",b)};a.czr_initialSkopeCollectionPopulated.then(function(){a.section.when(b,function(c){c.deferred.embedded.then(function(){try{g(c,b)}catch(d){a.errorLog("activeSectionReact => _doReactActive : "+d)}})}),!c.isEmpty(d)&&a.section.has(d)&&f(d)})},activePanelReact:function(b,d){var e=this;a.czr_initialSkopeCollectionPopulated.then(function(){a.trigger("czr-paint",{active_panel_id:b});a.czr_skopeReady.then(function(){"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&e.isExcludedSidebarsWidgets()&&"widgets"==b&&a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Widgets are created sitewide."]].join(" ")})}),a.czr_skopeReady.then(function(){"nav_menus"==b&&c.each(a.panel(b).sections(),function(a){e.processSilentUpdates({section_id:a.id,awake_if_not_active:!0})})})})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{wash:function(d){var e=function(a){c.has(a,"el")&&a.el.length&&b.when(a.el.removeClass("czr-painted")).done(function(){b(this).css("background","").css("color","")})};return a.czr_skopeBase.paintedElements&&(c.each(a.czr_skopeBase.paintedElements(),function(a){e(a)}),a.czr_skopeBase.paintedElements([])),this},paint:function(d){var e="inherit",f={active_panel_id:a.czr_activePanelId(),active_section_id:a.czr_activeSectionId(),is_skope_switch:!1},g=[];d=b.extend(f,d),!c.isUndefined(a.czr_activeSkopeId())&&a.czr_skope.has(a.czr_activeSkopeId())&&(e=a.czr_skope(a.czr_activeSkopeId()).color);var h=function(f){c.has(f,"el")&&f.el.length&&(d.is_skope_switch?b.when(f.el.addClass("czr-painted")).done(function(){b(this).css("background",f.bgColor||e)}):f.el.css("background",f.bgColor||e),"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&f.el.css("color","#000"))};return a.czr_skopeBase.paintedElements=a.czr_skopeBase.paintedElements||new a.Value([]),c.isEmpty(d.active_panel_id)&&c.isEmpty(d.active_section_id)&&(g.push({el:b("#customize-info").find(".accordion-section-title").first()}),a.panel.each(function(a){g.push({el:a.container.find(".accordion-section-title").first()})}),a.section.each(function(a){c.isEmpty(a.panel())&&g.push({el:a.container.find(".accordion-section-title").first()})})),!c.isEmpty(d.active_panel_id)&&c.isEmpty(d.active_section_id)&&a.panel.when(d.active_panel_id,function(a){a.deferred.embedded.then(function(){g.push({el:a.container.find(".accordion-section-title, .customize-panel-back")})})}),c.isEmpty(d.active_section_id)||a.section.when(d.active_section_id,function(b){b.deferred.embedded.then(function(){g.push({el:b.container.find(".customize-section-title, .customize-section-back"),bgColor:"inherit"},{el:b.container}),a.czr_isChangeSetOn()||g.push({el:b.container.find(".accordion-section-content")})})}),c.each(g,function(a){h(a)}),a.czr_skopeBase.paintedElements(g),this}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{isSkopeRegisteredInCollection:function(b,d){return d=d||a.czr_skopeCollection(),!c.isUndefined(c.findWhere(d,{id:b}))},isSkopeRegisteredInCurrentCollection:function(b,d){return d=d||a.czr_currentSkopesCollection(),!c.isUndefined(c.findWhere(d,{id:b}))},isGlobalSkopeRegistered:function(){var b=c.findWhere(a.czr_currentSkopesCollection(),{skope:"global"});return c.isObject(b)&&c.has(b,"id")},getGlobalSkopeId:function(){if(!c.has(a,"czr_skope"))return"";var b="";return a.czr_skope.each(function(a){"global"==a().skope&&(b=a().id)}),b},getChangedGlobalDBSettingValues:function(b){var d={};return c.each(b,function(b,e){_wpSetId=a.CZR_Helpers.build_setId(e),c.has(a.settings.settings,_wpSetId)&&(c.isEqual(b,a.settings.settings[_wpSetId].value)||(d[e]=b))}),d},getActiveSkopeId:function(b){b=b||a.czr_currentSkopesCollection();var d=!c.isEmpty(a.czr_activeSkopeId())&&a.czr_skope.has(a.czr_activeSkopeId())?a.czr_skope(a.czr_activeSkopeId())().skope:serverControlParams.isLocalSkope?"local":"global",e=c.findWhere(b,{
12
- skope:d});if(_skpId=c.isUndefined(e)?c.findWhere(b,{skope:"global"}).id:e.id,c.isUndefined(_skpId))throw new Error("No default skope was found in getActiveSkopeId ",b);return _skpId},getActiveSkopeName:function(){return a.czr_skope.has(a.czr_activeSkopeId())?a.czr_skope(a.czr_activeSkopeId())().skope:"global"},isSettingSkopeEligible:function(b){var d=this,e=a.CZR_Helpers.getOptionName(b);return c.isUndefined(b)||!a.has(b)?(a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO SKOPE BECAUSE UNDEFINED OR NOT REGISTERED IN THE API."),!1):!d.isExcludedWPBuiltinSetting(b)&&(!c.contains(serverControlParams.skopeExcludedSettings,e)&&(d.isThemeSetting(b),!0))},isSettingResetEligible:function(b){var d=this;a.CZR_Helpers.getOptionName(b);if(c.isUndefined(b)||!a.has(b))return void a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO RESET BECAUSE UNDEFINED OR NOT REGISTERED IN THE API.");if(!d.isExcludedWPBuiltinSetting(b))return!(!d.isThemeSetting(b)&&!d.isWPAuthorizedSetting(b))||void a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO RESET BECAUSE NOT PART OF THE THEME OPTIONS AND NOT WP AUTHORIZED BUILT IN OPTIONS")},isThemeSetting:function(a){return c.isString(a)&&-1!==a.indexOf(serverControlParams.themeOptions)},isWPAuthorizedSetting:function(a){return c.isString(a)&&c.contains(serverControlParams.wpBuiltinSettings,a)},isExcludedWPBuiltinSetting:function(a){var b=this;if(c.isUndefined(a))return!0;if("active_theme"==a)return!0;if(c.contains(serverControlParams.wpBuiltinSettings,a))return!1;var d=["widget_","nav_menu","sidebars_","custom_css","nav_menu[","nav_menu_item","nav_menus_created_posts","nav_menu_locations"],e=!1;return c.each(d,function(c){switch(c){case"widget_":case"sidebars_":c==a.substring(0,c.length)&&(e=b.isExcludedSidebarsWidgets());break;case"nav_menu[":case"nav_menu_item":case"nav_menus_created_posts":c==a.substring(0,c.length)&&(e=!0);break;case"nav_menu_locations":c==a.substring(0,c.length)&&(e=b.isExcludedNavMenuLocations());break;case"custom_css":c==a.substring(0,c.length)&&(e=b.isExcludedWPCustomCss())}}),e},isExcludedSidebarsWidgets:function(){var a=serverControlParams.isSidebarsWigetsSkoped;return!(!c.isUndefined(a)&&!c.isEmpty(a)&&!1!==a)},isExcludedNavMenuLocations:function(){if(!a.czr_isChangeSetOn())return!0;var b=serverControlParams.isNavMenuLocationsSkoped;return!(!c.isUndefined(b)&&!c.isEmpty(b)&&!1!==b)},isExcludedWPCustomCss:function(){var a=serverControlParams.isWPCustomCssSkoped;return!(!c.isUndefined(a)&&!c.isEmpty(a)&&!1!==a)},_getDBSettingVal:function(b,d){var e=a.CZR_Helpers.getOptionName(b),f=a.CZR_Helpers.build_setId(b);return a.czr_skope.has(d)?c.has(a.czr_skope(d).dbValues(),f)?a.czr_skope(d).dbValues()[f]:c.has(a.czr_skope(d).dbValues(),e)?a.czr_skope(d).dbValues()[e]:"_no_db_val":(a.consoleLog("_getDBSettingVal : the requested skope id is not registered : "+d),"_no_db_val")},getSkopeDirties:function(b,d){if(!a.czr_skope.has(b))return{};d=d||{},d=c.extend({unsaved:!0},d);var e={};return c.each(a.czr_skope(b).dirtyValues(),function(b,f){var g;a.czr_isChangeSetOn()&&(g=a._latestSettingRevisions[f],a.state("changesetStatus").get()&&d&&d.unsaved&&(c.isUndefined(g)||g<=a._lastSavedRevision))||(e[f]=b)}),e},getSkopeExcludedDirties:function(){var b=this,d={};a.each(function(a,b){a._dirty&&(d[b]=a())});var e=b.getGlobalSkopeId();b.getSkopeDirties(e);return c.omit(d,function(a,c){return b.isSettingSkopeEligible(c)})},parseWidgetId:function(a,b){var d,e={number:null,id_base:null};return d=a.match(/^(.+)-(\d+)$/),d?(e.id_base=d[1],e.number=parseInt(d[2],10)):e.id_base=a,c.isUndefined(b)||(e.id_base=e.id_base.replace(b,"")),e},widgetIdToSettingId:function(a,b){var c,d=this.parseWidgetId(a,b);return c=d.id_base,d.number&&(c+="["+d.number+"]"),c},isWidgetRegisteredGlobally:function(a){var b=this;return registered=!1,c.each(_wpCustomizeWidgetsSettings.registeredWidgets,function(c,d){registered||"widget_"+b.widgetIdToSettingId(d)!=a||(registered=!0)}),registered}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{getAppliedPrioritySkopeId:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getAppliedPrioritySkopeId : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),d;if(!a.czr_skope.has(d))return a.errorLog("getAppliedPrioritySkopeId : the requested skope id is not registered : "+d),d;var e=this,f=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(c.isUndefined(f)||d==f)return d;var g=function(c){var f=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(c)();if(c==d)return d;if(a.czr_skope(c).getSkopeSettingAPIDirtyness(f))return i.id;if(a.czr_isChangeSetOn()&&a.czr_skope(c).getSkopeSettingChangesetDirtyness(f))return i.id;var j=e._getDBSettingVal(b,c);return"_no_db_val"!=j?i.id:"global"==i.skope?i.id:"___"!=h?i.title:g(e._getParentSkopeId(i))};return g(f)},getOverridenSkopeTitles:function(){var b=b||a.czr_activeSkopeId();if(!a.czr_skope.has(b))return a.errorLog("getInheritedSkopeTitles : the requested skope id is not registered : "+b),"";var d=this,e=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(c.isUndefined(e)||b==e)return"";var f=function(c,e){e=e||[];var g=a.czr_skope(c)();return c==b?e:(e.unshift(c),f(d._getParentSkopeId(g),e))};return c.map(f(e),function(a){return d.buildSkopeLink(a)}).join(" "+serverControlParams.i18n.skope.and+" ")},getInheritedSkopeId:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getInheritedSkopeId : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),d;if(!a.czr_skope.has(d))return a.errorLog("getInheritedSkopeId : the requested skope id is not registered : "+d),d;var e,f=this,g=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(d)();if(e=c.has(a.settings.settings,g)?a.settings.settings[g].value:null,a.czr_skope(d).getSkopeSettingAPIDirtyness(g))return d;if(a.czr_isChangeSetOn()&&a.czr_skope(d).getSkopeSettingChangesetDirtyness(g))return d;var j=f._getDBSettingVal(b,d);return"_no_db_val"!=j?d:"global"==i.skope?d:"___"!=h?d:f.getInheritedSkopeId(b,f._getParentSkopeId(i))},getInheritedSkopeTitles:function(b,d){if(b=b||a.czr_activeSkopeId(),!a.czr_skope.has(b))return a.errorLog("getInheritedSkopeTitles : the requested skope id is not registered : "+b),"";d=d||[];var e=this,f=a.czr_skope(b)();return b!==a.czr_activeSkopeId()&&d.unshift(b),"global"!==f.skope?e.getInheritedSkopeTitles(e._getParentSkopeId(f),d):c.map(d,function(a){return e.buildSkopeLink(a)}).join(" "+serverControlParams.i18n.skope.and+" ")},buildSkopeLink:function(b){if(!a.czr_skope.has(b))return a.errorLog("buildSkopeLink : the requested skope id is not registered : "+b),"";var c=[serverControlParams.i18n.skope["Switch to scope"],a.czr_skope(b)().title].join(" : ");return['<span class="czr-skope-switch" title=" '+c+'" data-skope-id="'+b+'">',a.czr_skope(b)().title,"</span>"].join("")},getSkopeSettingVal:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getSkopeSettingVal : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),null;if(!a.czr_skope.has(d))return a.errorLog("getSkopeSettingVal : the requested skope id is not registered : "+d),null;var e,f=this,g=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(d)();if(e=c.has(a.settings.settings,g)?a.settings.settings[g].value:null,a.czr_skope(d).getSkopeSettingAPIDirtyness(g))return a.czr_skope(d).dirtyValues()[g];if(a.czr_isChangeSetOn()&&a.czr_skope(d).getSkopeSettingChangesetDirtyness(g))return a.czr_skope(d).changesetValues()[g];var j=f._getDBSettingVal(b,d);return"_no_db_val"!=j?j:"global"==i.skope?"___"==h?e:h:"___"!=h?h:f.getSkopeSettingVal(b,f._getParentSkopeId(i))},applyDirtyCustomizedInheritance:function(b,d){d=d||a.czr_activeSkopeId()||a.czr_skopeBase.getGlobalSkopeId(),b=b||{};var e=this,f=a.czr_skope(d)();if("global"==f.skope)return b;var g=e._getParentSkopeId(f),h=a.czr_skope(g).dirtyValues();return c.each(h,function(d,e){var g=a.CZR_Helpers.getOptionName(e);c.isUndefined(b[e])&&c.isUndefined(a.czr_skope(f.id).dbValues()[g])&&(b[e]=d)}),"global"==a.czr_skope(g)().skope?b:e.applyDirtyCustomizedInheritance(b,g)},_getParentSkopeId:function(b,d){var e=this,f=["local","group","special_group","global"],g=d||1*(c.findIndex(f,function(a){return b.skope==a})+1),h=f[g];return c.isUndefined(h)?c.findWhere(a.czr_currentSkopesCollection(),{skope:"global"}).id:c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{skope:h}))?e._getParentSkopeId(b,g+1):c.findWhere(a.czr_currentSkopesCollection(),{skope:h}).id},_getChildSkopeId:function(b,d){var e=this,f=["local","group","special_group","global"],g=d||1*(c.findIndex(f,function(a){return b.skope==a})-1),h=f[g];return c.isUndefined(h)?c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id:c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{skope:h}))?e._getParentSkopeId(b,g-1):c.findWhere(a.czr_currentSkopesCollection(),{skope:h}).id}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{updateSkopeCollection:function(d,e){var f=this;if(_api_ready_collection=[],c.each(d,function(a,c){var d=b.extend(!0,{},a);_api_ready_collection.push(f.prepareSkopeForAPI(d))}),f.isGlobalSkopeRegistered()){var g=[],h=b.extend(!0,{},a.czr_skope(f.getGlobalSkopeId())());c.each(_api_ready_collection,function(a,b){"global"==a.skope?g.push(h):g.push(a)}),_api_ready_collection=g}a.czr_currentSkopesCollection(_api_ready_collection)},prepareSkopeForAPI:function(a){if(!c.isObject(a))throw new Error("prepareSkopeForAPI : a skope must be an object to be API ready");var b=this,d={};if(c.each(serverControlParams.defaultSkopeModel,function(b,e){var f=a[e];switch(e){case"title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope title property must a string");d[e]=f;break;case"long_title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope title property must a string");d[e]=f;break;case"ctx_title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope context title property must a string");d[e]=f;break;case"skope":if(!c.isString(f)||c.isEmpty(f))throw new Error('prepareSkopeForAPI : a skope "skope" property must a string not empty');d[e]=f;break;case"level":if(!c.isString(f)||c.isEmpty(f))throw new Error("prepareSkopeForAPI : a skope level must a string not empty for skope "+f.skope);d[e]=f;break;case"dyn_type":if(!c.isString(f)||!c.contains(serverControlParams.skopeDynTypes,f))throw new Error("prepareSkopeForAPI : missing or invalid dyn type for skope "+a);d[e]=f;break;case"opt_name":if(!c.isString(f)||c.isEmpty(f))throw new Error('prepareSkopeForAPI : invalid "opt_name" property for skope '+f.skope);d[e]=f;break;case"obj_id":if(!c.isString(f))throw new Error('prepareSkopeForAPI : invalid "obj_id" for skope '+f.skope);d[e]=f;break;case"is_winner":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "is_winner" must be a boolean');d[e]=f;break;case"is_forced":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "is_primary" must be a boolean');d[e]=f;break;case"db":if((c.isArray(f)||c.isEmpty(f))&&(f={}),c.isUndefined(f)||!c.isObject(f))throw new Error('prepareSkopeForAPI : skope property "db" must be an object');d[e]=f;break;case"changeset":if((c.isArray(f)||c.isEmpty(f))&&(f={}),c.isUndefined(f)||!c.isObject(f))throw new Error('prepareSkopeForAPI : skope property "changeset" must be an object');d[e]=f;break;case"has_db_val":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "has_db_val" must be a boolean');d[e]=f}}),d.color=b.skope_colors[d.skope]||"rgb(255, 255, 255)",d.id=d.skope+"_"+d.level,!c.isString(d.id)||c.isEmpty(d.id))throw new Error("prepareSkopeForAPI : a skope id must a string not empty");return c.isString(d.title)&&!c.isEmpty(d.title)||(d.title=id,d.long_title=id),d},currentSkopesCollectionReact:function(d,e){var f=this,g=b.extend(!0,[],d)||[],h=(b.extend(!0,[],e)||[],b.Deferred()),i=[];_to_remove=[],_to_update=[],_instantiateAndEmbed=function(d){c.each(d,function(c){c=b.extend(!0,{},c),a.czr_skope.add(c.id,new a.CZR_skope(c.id,c))}),c.each(d,function(b){if(!a.czr_skope.has(b.id))throw new Error("Skope id : "+b.id+" has not been instantiated.");"pending"==a.czr_skope(b.id).isReady.state()&&a.czr_skope(b.id).ready()})},c.each(g,function(b){a.czr_skope.has(b.id)||i.push(b)});try{_instantiateAndEmbed(i)}catch(j){return a.errorLog("currentSkopesCollectionReact : "+j),h.resolve().promise()}var k=function(){var d=c.size(g),e=function(a){var e=a.container.attr("class").split(" ");c.each(a.container.attr("class").split(" "),function(a){"width-"==a.substring(0,6)&&(e=c.without(e,a))}),b.when(a.container.attr("class",e.join(" "))).done(function(){a.container.addClass("width-"+Math.round(100/d))})};a.czr_skope.each(function(a){if(c.isUndefined(c.findWhere(g,{id:a().id})))a.visible(!1),a.isReady.then(function(){a.container.toggleClass("active-collection",!1)});else{a.visible(!0);var b=function(){e(a),a.container.toggleClass("active-collection",!0)};"pending"==a.isReady.state()?a.isReady.then(function(){b()}):b()}})};return f.skopeWrapperEmbedded.then(function(){k()}),c.isEmpty(e)&&!c.isEmpty(d)&&a.czr_initialSkopeCollectionPopulated.resolve(),f.maybeSynchronizeGlobalSkope(),h.resolve("changed").promise()},maybeSynchronizeGlobalSkope:function(d){if(d=d||{},!c.isObject(d))throw new Error("maybeSynchronizeGlobalSkope : args must be an object");var e,f,g,h=this,i=b.Deferred();c.extend({isGlobalReset:!1,isSetting:!1,settingIdToReset:"",isSkope:!1,skopeIdToReset:""},d);if(h.isGlobalSkopeRegistered()){var j=a.czr_skope(h.getGlobalSkopeId()).dbValues();if(c.each(j,function(b,d){a.has(d)&&!c.isEqual(a.settings.settings[d].value,b)&&(a.settings.settings[d].value=b)}),d.isGlobalReset&&d.isSetting){if(e=d.settingIdToReset,f=a.CZR_Helpers.getOptionName(e),g=serverControlParams.defaultOptionsValues[f],c.isUndefined(a.settings.settings[e])||c.isUndefined(g))return;g!=a.settings.settings[e].value&&(a.settings.settings[e].value=g)}d.isGlobalReset&&d.isSkope&&c.each(a.settings.settings,function(b,d){h.isThemeSetting(d)&&(f=a.CZR_Helpers.getOptionName(d),c.has(serverControlParams.defaultOptionsValues,f)&&(a.settings.settings[d].value=serverControlParams.defaultOptionsValues[f]))})}return i.resolve().promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{activeSkopeReact:function(d,e){var f=this,g=b.Deferred();if(!c.isUndefined(e)&&a.czr_skope.has(e))a.czr_skope(e).active(!1);else if(!c.isUndefined(e))throw new Error("listenToActiveSkope : previous scope does not exist in the collection",e);if(c.isUndefined(d)||!a.czr_skope.has(d))throw new Error("listenToActiveSkope : requested scope "+d+" does not exist in the collection");a.czr_skope(d).active(!0);var h=function(b){return a.czr_activeSkopeId(f.getGlobalSkopeId()),a.czr_serverNotification({status:"success",message:[b,"can only be customized sitewide."].join(" ")}),g.resolve().promise()};if(f.isExcludedSidebarsWidgets()&&"widgets"==a.czr_activePanelId()&&d!=f.getGlobalSkopeId()&&a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Widgets are created sitewide."]].join(" ")}),f.isExcludedWPCustomCss()&&"custom_css"==a.czr_activeSectionId()&&d!=f.getGlobalSkopeId())return h(a.section(a.czr_activeSectionId()).params.title);if("admin_sec"==a.czr_activeSectionId()&&d!=f.getGlobalSkopeId())return h(a.section(a.czr_activeSectionId()).params.title);if("nav_menu"!=a.czr_activeSectionId().substring(0,"nav_menu".length)&&"add_menu"!=a.czr_activeSectionId()||d==f.getGlobalSkopeId()||a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Menus are created sitewide."]].join(" ")}),"nav_menus"==a.czr_activePanelId()&&c.each(a.panel(a.czr_activePanelId()).sections(),function(a){f.processSilentUpdates({section_id:a.id,awake_if_not_active:!0})}),a.state("switching-skope")(!0),f._writeCurrentSkopeTitle(d),a.trigger("czr-paint",{is_skope_switch:!0}),c.isUndefined(a.czr_activeSectionId()))return a.state("switching-skope")(!1),a.previewer.refresh(),g.resolve().promise();c.has(a,"czrModulePanelState")&&a.czrModulePanelState(!1);var i=f._getSilentUpdateCandidates();c.isUndefined(e)||c.each(a.czr_skope(e).dirtyValues(),function(a,b){c.contains(i,b)||i.push(b)}),c.isUndefined(d)||c.each(a.czr_skope(d).dirtyValues(),function(a,b){c.contains(i,b)||i.push(b)});var j=function(){f.processSilentUpdates({candidates:i,section_id:null,refresh:!1}).fail(function(){throw g.reject(),a.state("switching-skope")(!1),new Error("Fail to process silent updates in _debouncedProcessSilentUpdates")}).done(function(b){a.previewer.refresh().always(function(){g.resolve(b),a.state("switching-skope")(!1)})})};return c.has(a,"czr_isModuleExpanded")&&!1!==a.czr_isModuleExpanded()?(a.czr_isModuleExpanded().setupModuleViewStateListeners(!1),(j=c.debounce(j,400))()):j(),g.promise()},_writeCurrentSkopeTitle:function(d){var e=this,f=a.czr_skope(d||a.czr_activeSkopeId())().long_title,g=function(){var g=e.getInheritedSkopeTitles(),h=e.getOverridenSkopeTitles();return b.trim(['<span class="czr-main-title"><span class="czr-toggle-title-notice fa fa-info-circle"></span>',"global"==a.czr_skope(d||a.czr_activeSkopeId())().skope?f:["Customizing",f].join(" "),"</span>",'<span class="czr-skope-inherits-from">',serverControlParams.i18n.skope["In this context :"],c.isEmpty(g)?" ":serverControlParams.i18n.skope["inherits from"],g,c.isEmpty(g)?"":c.isEmpty(h)?".":[",",serverControlParams.i18n.skope.and].join(" "),c.isEmpty(h)?" ":serverControlParams.i18n.skope["overridden by"],h,c.isEmpty(h)?"":".","</span>"].join(" "))},h=function(a){a?b(".czr-scope-switcher").find(".spinner").fadeIn():b(".czr-scope-switcher").find(".spinner").fadeOut()};e.skopeWrapperEmbedded.then(function(){b(".czr-scope-switcher").find(".czr-current-skope-title").length?b.when(b(".czr-scope-switcher").find(".czr-skope-title").fadeOut(200)).done(function(){b(this).html(g()).fadeIn(200)}):b(".czr-scope-switcher").prepend(b("<h2/>",{"class":"czr-current-skope-title",html:['<span class="czr-skope-title">','<span class="spinner">',g(),"</span>","</span>"].join("")})),c.isUndefined(a.state("switching-skope").isBound)&&(a.state("switching-skope").bind(h),a.state("switching-skope").isBound=!0)})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{processSilentUpdates:function(d){d=c.isString(d)?{candidates:[d]}:d||{};var e=this,f={candidates:[],section_id:a.czr_activeSectionId(),refresh:!0,awake_if_not_active:!1},g=b.Deferred();if(d=b.extend(f,d),c.isString(d.candidates)&&(d.candidates=[d.candidates]),c.isEmpty(d.candidates)&&(d.candidates=e._getSilentUpdateCandidates(d.section_id,d.awake_if_not_active)),!c.isArray(d.candidates))throw new Error("processSilentUpdates : the update candidates must be an array.");if(c.isEmpty(d.candidates))return g.resolve([]).promise();var h=function(){e.silentlyUpdateSettings(d.candidates,d.refresh).fail(function(){g.reject()}).done(function(a){c.delay(function(){e.setupActiveSkopedControls({section_id:d.section_id})},1e3),g.resolve(a)})};return"resolved"!=a.czr_skopeReady.state()?(g.resolve([]),a.czr_skopeReady.done(function(){h()})):h(),g.promise()},silentlyUpdateSettings:function(d,e){a.state.has("silent-update-processing")||a.state.create("silent-update-processing")(!1),a.state("silent-update-processing")(!0);var f=this,g={},h=b.Deferred();e=!!c.isUndefined(e)||e,(c.isUndefined(d)||c.isEmpty(d))&&(d=f._getSilentUpdateCandidates()),c.isString(d)&&(d=[d]),c.each(d,function(b){a.control.has(b)&&"czr_multi_module"==a.control(b).params.type||(g[b]=f.getSettingUpdatePromise(b))});var i=[],j=[];return c.each(g,function(b,d){b.done(function(b){var e=a.CZR_Helpers.build_setId(d),f=a.czr_skope(a.czr_activeSkopeId()).getSkopeSettingDirtyness(d);c.isEqual(a(e)(),b)||j.push(d),a(e).silent_set(b,f)}),i.push(b)}),b.when.apply(null,i).fail(function(){throw h.reject(),new Error("silentlyUpdateSettings FAILED. Candidates : "+d)}).always(function(){a.state("silent-update-processing")(!1)}).then(function(){c.each(i,function(a){if(c.isObject(a)&&"resolved"!==a.state())throw new Error("a silent update promise is unresolved : "+d)}),e&&!c.isEmpty(j)?a.previewer.refresh().always(function(){h.resolve(j)}):h.resolve(j)}),h.promise()},getSettingUpdatePromise:function(d){if(c.isUndefined(d))throw new Error("getSettingUpdatePromise : the provided setId is not defined");if(!a.has(a.CZR_Helpers.build_setId(d)))throw new Error("getSettingUpdatePromise : the provided wpSetId is not registered : "+a.CZR_Helpers.build_setId(d));var e=this,f=a.CZR_Helpers.build_setId(d),g=a(f)(),h=b.Deferred(),i=!1,j=a.czr_activeSkopeId(),k=a.czr_skopeBase.getSkopeSettingVal(d,j);if(c.isEqual(g,k))return h.resolve(k).promise();if(a.control.has(f)){var l=a.control(f).params.type,m=a.settings.controls[f];switch(l){case"czr_cropped_image":i=e._getCzrCroppedImagePromise(f,m);break;case"czr_module":e._processCzrModuleSilentActions(f,l,j,m)}}return c.has(a.settings.controls,"header_image")&&"header_image"==f&&(i=e._getHeaderImagePromise(f,j)),i&&c.isObject(i)?i.always(function(){h.resolve(k)}):h.resolve(k),h.promise()},_getSilentUpdateCandidates:function(b,d){var e=this,f=[];if(b=c.isUndefined(b)||c.isNull(b)?a.czr_activeSectionId():b,c.isEmpty(a.czr_activeSectionId())&&!d)return[];if(c.isUndefined(b))return a.consoleLog("_getSilentUpdateCandidates : No active section provided"),[];if(!a.section.has(b))throw new Error("_getSilentUpdateCandidates : The section "+b+" is not registered in the API.");var g=a.CZR_Helpers.getSectionSettingIds(b);return g=c.filter(g,function(a){return e.isSettingSkopeEligible(a)}),c.each(g,function(a){f.push(a)}),f}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{_processCzrModuleSilentActions:function(d,e,f,g){var h,i,j,k,l,m=c.has(a.control(d).params,"syncCollection")?a.control(d).params.syncCollection:"",n=a.CZR_Helpers.build_setId(d),o=a.czr_skopeBase.getSkopeSettingVal(n,f),p=a.czr_skope(a.czr_activeSkopeId());c.isEmpty(m)||c.isUndefined(m)||(h=a.CZR_Helpers.build_setId(m),i=a.czr_skopeBase.getSkopeSettingVal(h,f),j=a.settings.controls[h],k=a.controlConstructor.czr_multi_module,l=a.control(h).syncSektionModule()().id,a.control(h).container.remove(),a.control.remove(h),a(h).silent_set(i,p.getSkopeSettingDirtyness(h)),b.extend(j,{czr_skope:f}),a.control.add(h,new k(h,{params:j,previewer:a.previewer}))),_constructor=a.controlConstructor[e],a.control(d).container.remove(),a.control.remove(d),a(d).silent_set(o,p.getSkopeSettingDirtyness(n)),b.extend(g,{czr_skope:f}),a.control.add(d,new _constructor(d,{params:g,previewer:a.previewer})),c.isEmpty(m)||c.isUndefined(m)||(a.consoleLog("FIRE SEKTION MODULE?",l,a.control(d).czr_Module(l).isReady.state()),a.control(d).czr_Module(l).fireSektionModule())},_getCzrCroppedImagePromise:function(d,e){var f=a.controlConstructor.czr_cropped_image,g=b.Deferred(),h=a.has(d)?a(d)():null;return h=null===h?"":h,wp.media.attachment(h).fetch().done(function(){a.control(d).container.remove(),a.control.remove(d),e.attachment=this.attributes,a.control.add(d,new f(d,{params:e,previewer:a.previewer})),g.resolve()}).fail(function(){a.control(d).container.remove(),a.control.remove(d),e=c.omit(e,"attachment"),a.control.add(d,new f(d,{params:e,previewer:a.previewer})),g.reject()}),g.promise()},_getHeaderImagePromise:function(d,e){var f=b.Deferred();if(!c.has(a.settings.controls,"header_image")||"header_image"!=d)return f.resolve().promise();var g=a.controlConstructor.header,h=b.extend(!0,{},a.settings.controls.header_image);header_image_data=null===a.czr_skopeBase.getSkopeSettingVal("header_image_data",e)?"":a.czr_skopeBase.getSkopeSettingVal("header_image_data",e);var i,j=function(b){b=b||h,a.control("header_image").container.remove(),a.control.remove("header_image"),a.HeaderTool.UploadsList=a.czr_HeaderTool.UploadsList,a.HeaderTool.DefaultsList=a.czr_HeaderTool.DefaultsList,a.HeaderTool.CombinedList=a.czr_HeaderTool.CombinedList;var d=function(){a.control.add("header_image",new g("header_image",{params:b,previewer:a.previewer}))};(d=c.debounce(d,800))()};return c.has(header_image_data,"attachment_id")?(i=header_image_data.attachment_id,wp.media.attachment(i).fetch().done(function(){h.attachment=this.attributes,j(h),f.resolve()}).fail(function(){h=c.omit(h,"attachment"),a.control("header_image").container.remove(),a.control.remove("header_image"),a.HeaderTool.UploadsList=a.czr_HeaderTool.UploadsList,a.HeaderTool.DefaultsList=a.czr_HeaderTool.DefaultsList,a.HeaderTool.CombinedList=a.czr_HeaderTool.CombinedList,a.control.add("header_image",new g("header_image",{params:h,previewer:a.previewer})),f.reject()})):(j(),f.resolve()),f.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{setupActiveSkopedControls:function(d){var e,f,g,h,i=this,j=b.Deferred();if(defaultSetupParams={controls:[],section_id:a.czr_activeSectionId()},g=b.extend(defaultSetupParams,d),!c.isObject(g)||!c.has(g,"controls")||!c.has(g,"section_id"))throw new Error("setupActiveSkopedControls : the setupParams param must be an object with properties controls and section_id.");return e=g.section_id,f=g.controls,h=[],!c.isEmpty(e)&&c.isString(e)||(e=a.czr_activeSectionId()),c.isEmpty(f)&&(f=a.CZR_Helpers.getSectionControlIds(e)),f=c.isString(f)?[f]:f,h=c.filter(f,function(b){var c=a.CZR_Helpers.getControlSettingId(b);return c&&!i.isSettingSkopeEligible(c)&&a.control(b).container.addClass("czr-not-skoped"),c&&i.isWPAuthorizedSetting(c)&&a.control(b).container.addClass("is-wp-authorized-setting"),c&&i.isSettingSkopeEligible(c)}),"nav_menu["==e.substring(0,"nav_menu[".length)?j.resolve().promise():(c.isEmpty(f)||(a.czr_skopeReady.then(function(){b.when(i.renderControlsSingleReset(h)).done(function(){c.each(f,function(a){i.listenSkopedControl(a)}),j.resolve()})}),"rejected"==a.czr_skopeReady.state()&&j.resolve()),i.renderCtrlSkpNotIcon(f),j.promise())},listenSkopedControl:function(d){var e=this;if(a.has(d)&&!c.isUndefined(a.control(d))){var f=a.control(d),g=a.CZR_Helpers.getControlSettingId(d),h=(a.CZR_Helpers.getOptionName(g),{hasDBVal:!1,isDirty:!1,noticeVisible:!1,resetVisible:!1,isResetting:!1});if(!c.has(f,"czr_states")){f.czr_states=new a.Values,c.each(h,function(a,b){f.czr_states.create(b),f.czr_states(b)(a)});try{e.bindControlStates(f)}catch(i){a.errorLog("bindControlStates : "+i)}}f.czr_states("hasDBVal")(a.czr_skope(a.czr_activeSkopeId()).hasSkopeSettingDBValues(g)),f.czr_states("isDirty")(a.czr_skope(a.czr_activeSkopeId()).getSkopeSettingDirtyness(g)),c.has(f,"userEventMap")||(f.userEventMap=[{trigger:"click keydown",selector:".czr-setting-reset, .czr-cancel-button",name:"control_reset_warning",actions:function(){(f.czr_states("isDirty")()||f.czr_states("hasDBVal")())&&(c.each(c.without(a.CZR_Helpers.getSectionControlIds(f.section()),d),function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("resetVisible")(!1)}),f.czr_states("resetVisible")(!f.czr_states("resetVisible")()),f.czr_states("noticeVisible")(!f.czr_states("resetVisible")()))}},{trigger:"click keydown",selector:".czr-control-do-reset",name:"control_do_reset",actions:function(){e.doResetSetting(d)}},{trigger:"click keydown",selector:".czr-skope-switch",name:"control_skope_switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}},{trigger:"click keydown",selector:".czr-toggle-notice",name:"control_toggle_notice",actions:function(a){f.czr_states("noticeVisible")(!f.czr_states("noticeVisible")()),f.czr_states("noticeVisible")()&&f.czr_states("resetVisible")(!1)}}],a.CZR_Helpers.setupDOMListeners(f.userEventMap,{dom_el:f.container},e))}},bindControlStates:function(d){if(!a.control.has(d.id))throw new Error("in bindControlStates, the provided ctrl id is not registered in the api : "+d.id);var e=this;a.CZR_Helpers.getControlSettingId(d.id);d.czr_states("hasDBVal").bind(function(a){d.container.toggleClass("has-db-val",a),a?_title=serverControlParams.i18n.skope["Reset your customized ( and published ) value"]:d.czr_states("isDirty")()?_title=serverControlParams.i18n.skope["Reset your customized ( but not yet published ) value"]:_title=serverControlParams.i18n.skope["Not customized yet, nothing to reset"],d.container.find(".czr-setting-reset").attr("title",_title)}),d.czr_states("isDirty").bind(function(a){d.container.toggleClass("is-dirty",a);var b;b=a?serverControlParams.i18n.skope["Reset your customized ( but not yet published ) value"]:d.czr_states("hasDBVal")()?serverControlParams.i18n.skope["Reset your customized ( and published ) value"]:serverControlParams.i18n.skope["Not customized yet, nothing to reset"],d.container.find(".czr-setting-reset").attr("title",b)}),d.czr_states("noticeVisible").bind(function(a){d.container.toggleClass("czr-notice-visible",a);var c=d.getNotificationsContainerElement();!1!==c&&!1!==c.length&&(a?(e.updateCtrlSkpNot(d.id,!0),c.stop().slideDown("fast",null,function(){b(this).css("height","auto")})):b.when(c.stop().slideUp("fast",null,function(){b(this).css("height","auto")})).done(function(){e.removeCtrlSkpNot(d.id)}))}),d.czr_states("resetVisible").bind(function(f){d.section()||a.czr_activeSectionId();f?b.when(e.renderControlResetWarningTmpl(d.id)).done(function(a){c.isEmpty(a)||(d.czr_resetDialogContainer=a.container,a.container.slideToggle("fast"),a.is_authorized||c.delay(function(){b.when(d.czr_resetDialogContainer.slideToggle("fast")).done(function(){d.czr_resetDialogContainer.remove()})},3e3))}):c.has(d,"czr_resetDialogContainer")&&d.czr_resetDialogContainer.length&&b.when(d.czr_resetDialogContainer.slideToggle("fast")).done(function(){d.czr_resetDialogContainer.remove()})})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{renderControlsSingleReset:function(d){var e=this,f=b.Deferred();(c.isUndefined(d)||c.isEmpty(d))&&(d=a.CZR_Helpers.getSectionControlIds(a.czr_activeSectionId()),d=c.filter(d,function(b){var c=a.CZR_Helpers.getControlSettingId(b);return c&&e.isSettingSkopeEligible(c)}));var g=c.isArray(d)?d:[d],h=function(d){return c.isEmpty(d)?void f.resolve():void c.each(d,function(c){a.control.when(c,function(){var d=a.control(c);a.CZR_Helpers.getControlSettingId(c);return b(".czr-setting-reset",d.container).length?void f.resolve():void d.deferred.embedded.then(function(){b.when(d.container.find(".customize-control-title").first().prepend(b("<span/>",{"class":"czr-setting-reset fa fa-refresh",title:""}))).done(function(){d.container.addClass("czr-skoped"),b(".czr-setting-reset",d.container).fadeIn(400),f.resolve()})})})})};return h=c.debounce(h,200),h(g),f.promise()},renderControlResetWarningTmpl:function(d){if(!a.control.has(d))return{};var e,f,g=a.control(d),h=a.CZR_Helpers.getControlSettingId(d),i="",j=function(){return!!c.contains(serverControlParams.wpBuiltinSettings,a.CZR_Helpers.getOptionName(h))||!c.contains(serverControlParams.themeSettingList,a.CZR_Helpers.getOptionName(h))}(),k=a.czr_skope(a.czr_activeSkopeId())();g.czr_states("isDirty")()?(e=["global"==k.skope?serverControlParams.i18n.skope["Please confirm that you want to reset your current customizations for this option"]:serverControlParams.i18n.skope["Please confirm that you want to reset your current customizations for this option in"],"global"==k.skope?serverControlParams.i18n.skope.sitewide:k.ctx_title].join(" "),f=serverControlParams.i18n.skope["Your customizations have been reset"]):j&&"global"==k.skope?e=serverControlParams.i18n.skope["This WordPress setting can not be reset sitewide"]:(e=["global"==k.skope?serverControlParams.i18n.skope["Please confirm that you want to reset this option"]:serverControlParams.i18n.skope["Please confirm that you want to reset this option in"],"global"==k.skope?serverControlParams.i18n.skope.sitewide:k.ctx_title].join(" "),
13
- f=serverControlParams.i18n.skope["The option has been reset"]);var l=!(j&&"global"==a.czr_skope(a.czr_activeSkopeId())().skope&&!g.czr_states("isDirty")()),m={warning_message:e+".",success_message:f+".",is_authorized:l};try{i=wp.template("czr-reset-control")(m)}catch(n){return a.errorLog("Error when parsing the the reset control template : "+n),{container:!1,is_authorized:!1}}return b(".customize-control-title",g.container).first().after(b(i)),{container:b(".czr-ctrl-reset-warning",g.container),is_authorized:l}},doResetSetting:function(d){var e=this,f=a.CZR_Helpers.getControlSettingId(d),g=a.control(d),h=a.czr_activeSkopeId(),i=g.czr_states("isDirty")()?"_resetControlDirtyness":"_resetControlAPIVal",j=function(){var a=this;a.czr_states("resetVisible")(!1),a.czr_states("isResetting")(!1),a.container.removeClass("czr-resetting-control")},k=function(d){var g=function(){a.czr_skopeBase.processSilentUpdates({candidates:d,refresh:!1}).fail(function(){a.consoleLog("Silent update failed after resetting control : "+d)}).done(function(){a.control.when(d,function(){var f=a.control(d);b.when(b(".czr-crtl-reset-dialog",f.container).fadeOut("300")).done(function(){b.when(b(".czr-reset-success",f.container).fadeIn("300")).done(function(a){c.delay(function(){b.when(a.fadeOut("300")).done(function(){e.setupActiveSkopedControls({controls:[d]}).done(function(){f.czr_states&&(j.call(f),f.czr_states("noticeVisible")(e.isCtrlNoticeVisible(d)))})})},500)})})})})};e[i](d).done(function(){a.consoleLog("REFRESH AFTER A SETTING RESET"),a.previewer.refresh().fail(function(b){a.errorLog("Setting reset refresh failed.",b)}).done(function(b){if("global"==a.czr_skope(h)().skope&&"_resetControlAPIVal"==i){var d,e={},j=a.czr_skope(h)().opt_name;!c.isUndefined(b.skopesServerData)&&c.has(b.skopesServerData,"czr_skopes")&&(d=b.skopesServerData.czr_skopes,c.isUndefined(c.findWhere(d,{opt_name:j}))&&(e=c.findWhere(d,{opt_name:j}).db||{})),a.czr_skopeBase.maybeSynchronizeGlobalSkope({isGlobalReset:!0,isSetting:!0,settingIdToReset:f}).done(function(){g()})}else g()})})};g.czr_states("isResetting")(!0),g.container.addClass("czr-resetting-control"),a.czr_skopeReset[g.czr_states("isDirty")()?"resetChangeset":"resetPublished"]({skope_id:h,setId:f,is_setting:!0}).done(function(a){k(d)}).fail(function(f){a.errorLog("Reset failed",f),b.when(b(".czr-crtl-reset-dialog",g.container).fadeOut("300")).done(function(){b.when(b(".czr-reset-fail",g.container).fadeIn("300")).done(function(){b(".czr-reset-fail",g.container).append("<p>"+f+"</p>"),c.delay(function(){j.call(g),e.setupActiveSkopedControls({controls:[d]})},2e3)})})})},_resetControlDirtyness:function(d){var e=a.CZR_Helpers.getControlSettingId(d),f=a.czr_skope(a.czr_activeSkopeId()),g=b.extend(!0,{},f.dirtyValues()),h={},i=b.extend(!0,{},f.changesetValues()),j={},k=b.Deferred();return h=c.omit(g,e),j=c.omit(i,e),f.dirtyValues(h),f.changesetValues(h),k.resolve().promise()},_resetControlAPIVal:function(d){var e=a.CZR_Helpers.getControlSettingId(d),f=a.czr_skope(a.czr_activeSkopeId()).dbValues(),g=b.extend(!0,{},f),h=b.Deferred();return c.has(a.control(d),"czr_states")&&(a.control(d).czr_states("hasDBVal")(!1),a.czr_skope(a.czr_activeSkopeId()).dbValues(c.omit(g,e))),h.resolve().promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{renderCtrlSkpNotIcon:function(d){var e=c.isArray(d)?d:[d];c.each(e,function(c){a.control.when(c,function(){var d=a.control(c);d.deferred.embedded.then(function(){b(".czr-toggle-notice",d.container).length||b.when(d.container.find(".customize-control-title").first().append(b("<span/>",{"class":"czr-toggle-notice fa fa-info-circle",title:serverControlParams.i18n.skope["Display informations about the scope of this option."]}))).done(function(){b(".czr-toggle-notice",d.container).fadeIn(400)})})})})},updateCtrlSkpNot:function(d,e){var f=this,g=c.isArray(d)?d:[d],h=function(a){return a&&f.isSettingSkopeEligible(a)},i=function(b,d){var e,g,i=a.czr_activeSkopeId(),j=f.getInheritedSkopeId(b,i),k=f.getAppliedPrioritySkopeId(b,i),l=[];return h(b)?(j==k&&a.czr_skope.has(j)&&i==j&&(e=!c.isUndefined(a.czr_skope(i).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(i).dbValues()[b]),e?"global"==a.czr_skope(j)().skope?l.push([serverControlParams.i18n.skope["Customized. Will be applied sitewide once published."]].join(" ")):l.push([serverControlParams.i18n.skope["Customized. Will be applied to"],"<strong>"+a.czr_skope(j)().ctx_title+"</strong>",serverControlParams.i18n.skope["once published."]].join(" ")):g?"global"==a.czr_skope(j)().skope?l.push([serverControlParams.i18n.skope["Customized and applied sitewide."]].join(" ")):l.push([serverControlParams.i18n.skope["Customized and applied to"],"<strong>"+a.czr_skope(j)().ctx_title+".</strong>"].join(" ")):l.push(serverControlParams.i18n.skope["Default website value applied sitewide."])),j!==i&&a.czr_skope.has(j)&&(e=!c.isUndefined(a.czr_skope(j).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(j).dbValues()[b]),e||g?l.push([serverControlParams.i18n.skope["Currently inherited from"],f.buildSkopeLink(j)+".",serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+a.czr_skope(i)().ctx_title+".</strong>"].join(" ")):l.push([serverControlParams.i18n.skope["Default website value."],serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+a.czr_skope(i)().ctx_title+".</strong>"].join(" "))),k!==i&&a.czr_skope.has(k)&&(e=!c.isUndefined(a.czr_skope(k).dirtyValues()[b]),l.push([e?serverControlParams.i18n.skope["The value that will be applied to"]:serverControlParams.i18n.skope["The value currently applied to"],"<strong>"+a.czr_skope(d)().ctx_title+"</strong>",e?serverControlParams.i18n.skope["is customized in"]:serverControlParams.i18n.skope["is set in"],f.buildSkopeLink(k),serverControlParams.i18n.skope["which has a higher priority than the current option scope"],"<strong>( "+a.czr_skope(i)().title+" ).</strong>"].join(" "))),l.join(" | ")):(l.push([serverControlParams.i18n.skope["This option is always customized sitewide and cannot be reset."]].join(" ")),l.join(" | "))};c.each(g,function(d){a.control.when(d,function(){var f=a.control(d),g=a.CZR_Helpers.getControlSettingId(d),h=c.isUndefined(e)?f.czr_states&&f.czr_states("noticeVisible")():e;h&&f.deferred.embedded.then(function(){var d=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id,e=f.getNotificationsContainerElement();if(e&&e.length&&!c.isUndefined(d)){try{_html=i(g,d)}catch(h){a.errorLog("_generateControlNotice : "+h)}var j=b(".czr-skope-notice",e);j.length?j.html(_html):e.append(['<span class="czr-notice czr-skope-notice">',_html,"</span>"].join(""))}})})})},isCtrlNoticeVisible:function(b){if(!a.control.has(b))return!1;var c=this,d=a.CZR_Helpers.getControlSettingId(b),e=a.czr_activeSkopeId(),f=c.getAppliedPrioritySkopeId(d,e);return"global"!=a.czr_skope(e)().skope||!(f===e||!a.czr_skope.has(f))},removeCtrlSkpNot:function(d){var e=c.isArray(d)?d:[d];c.each(e,function(c){a.control.when(c,function(){var d=a.control(c);d.deferred.embedded.then(function(){var a=d.getNotificationsContainerElement();if(a&&a.length){var c=b(".czr-skope-notice",a);c.length&&c.remove()}})})})}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{initialize:function(){this.changesetStatus="publish",this.saveBtn=b("#save")},save:function(d){var e,f=this,g=a.state("processing"),h=new a.Messenger({url:a.settings.url.parent,channel:"loader"});f.globalSaveDeferred=b.Deferred(),f.previewer=a.previewer,f.globalSkopeId=a.czr_skopeBase.getGlobalSkopeId(),f.saveArgs=d,d&&d.status&&(f.changesetStatus=d.status),a.state("saving")()&&f.globalSaveDeferred.reject("already_saving");var i=function(b,d){a.state("saving")(!1),a.state("processing").set(0),f.saveBtn.prop("disabled",!1),!c.isUndefined(b)&&b.setting_validities&&a._handleSettingValidities({settingValidities:b.setting_validities,focusInvalidControl:!0}),"pending"==d&&a.czr_serverNotification({message:b,status:"error"})},j=function(d){var e,g=b.Deferred();return a.state("saving")(!0),f.fireAllSubmission(d).always(function(a){e=a.response,i(e,this.state())}).fail(function(b){e=b.response,a.consoleLog("ALL SUBMISSIONS FAILED",e),f.globalSaveDeferred.reject(e),a.trigger("error",e),g.resolve(b.hasNewMenu)}).done(function(b){e=b.response,a.previewer.refresh({waitSkopeSynced:!0}).fail(function(b){f.globalSaveDeferred.reject(f.previewer,[e]),a.consoleLog("SAVE REFRESH FAIL",b)}).done(function(d){if(a.previewer.send("saved",e),e=c.extend({changeset_status:"publish"},e||{}),a.czr_isChangeSetOn()){var i=a._latestRevision;a.state("changesetStatus").set(e.changeset_status),"publish"===e.changeset_status&&(a.each(function(b){b._dirty&&(c.isUndefined(a._latestSettingRevisions[b.id])||a._latestSettingRevisions[b.id]<=i)&&(b._dirty=!1)}),a.state("changesetStatus").set(""),a.settings.changeset.uuid=e.next_changeset_uuid,h.send("changeset-uuid",a.settings.changeset.uuid))}else a.each(function(a){a._dirty=!1});d=c.extend({previewer:d.previewer||f.previewer,skopesServerData:d.skopesServerData||{}},d),f.reactWhenSaveDone(d.skopesServerData),f.globalSaveDeferred.resolveWith(f.previewer,[e]),a.trigger("saved",e||{}),g.resolve(b.hasNewMenu)})}),g.promise()};return 0===g()?j().done(function(a){a&&j({saveGlobal:!1,saveSkopes:!0})}):(e=function(){0===g()&&(a.state.unbind("change",e),j())},a.state.bind("change",e)),f.globalSaveDeferred.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{getSubmitPromise:function(d){var e=this,f=b.Deferred(),g={};if(c.isEmpty(d)||!a.czr_skope.has(d))return a.consoleLog("getSubmitPromise : no skope id requested OR skope_id not registered : "+d),f.resolve().promise();var h=a.czr_skope(d)();return a.czr_skope(d).dirtyness()||d===e.globalSkopeId?(c.each(a.czr_skopeBase.getSkopeDirties(d),function(a,b){g[b]=c.extend({value:a})}),this.submit({skope_id:d,customize_changeset_data:g,dyn_type:h.dyn_type}).done(function(a){f.resolve(a)}).fail(function(b){a.consoleLog("GETSUBMIT FAILED PROMISE FOR SKOPE : ",d,b),f.reject(b)}),f.promise()):f.resolve().promise()},submit:function(d){var e,f=this,g={skope_id:null,the_dirties:{},customize_changeset_data:{},dyn_type:null,opt_name:null},h=[],i=b.Deferred();if(d=b.extend(g,d),c.isNull(d.skope_id))throw new Error("OVERRIDEN SAVE::submit : MISSING skope_id");if(c.isNull(d.the_dirties))throw new Error("OVERRIDEN SAVE::submit : MISSING the_dirties");if(c.has(a,"Notification")&&(a.each(function(b){b.notifications.each(function(c){"error"===c.type&&a.consoleLog("NOTIFICATION ERROR on SUBMIT SAVE",c),"error"!==c.type||c.data&&c.data.from_server||(h.push(b.id),settingInvalidities[b.id]||(settingInvalidities[b.id]={}),settingInvalidities[b.id][c.code]=c)})}),e=a.findControlsForSettings(h),!c.isEmpty(e)))return c.values(e)[0][0].focus(),i.rejectWith(f.previewer,[{setting_invalidities:settingInvalidities}]).promise();var j={skope_id:d.skope_id,action:"save",the_dirties:d.the_dirties,dyn_type:d.dyn_type,opt_name:d.opt_name};a.czr_isChangeSetOn()&&b.extend(j,{excludeCustomizedSaved:!1});var k=b.extend(f.previewer.query(j),{nonce:f.previewer.nonce.save,customize_changeset_status:f.changesetStatus,customize_changeset_data:JSON.stringify(d.customize_changeset_data)});a.czr_isChangeSetOn()&&(f.saveArgs&&f.saveArgs.date&&(k.customize_changeset_date=f.saveArgs.date),f.saveArgs&&f.saveArgs.title&&(k.customize_changeset_title=f.saveArgs.title));var l=wp.ajax.post("global"!==k.skope?"customize_skope_changeset_save":"customize_save",k);return f.saveBtn.prop("disabled",!0),a.trigger("save",l),l.fail(function(b){a.consoleLog("SUBMIT REQUEST FAIL",d.skope_id,b),"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?f.previewer.cheatin():"not_logged_in"===b&&(f.previewer.preview.iframe.hide(),f.previewer.login().done(function(){f.previewer.save(),f.previewer.preview.iframe.show()})),a.trigger("error",b),i.reject(b)}),l.done(function(a){i.resolve(a)}),i.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{fireAllSubmission:function(d){var e=this,f=b.Deferred(),g=[],h=b.Deferred(),i={},j=[],k=[],l={saveGlobal:!0,saveSkopes:!0};d=b.extend(l,d),c.each(a.czr_skopeCollection(),function(a){"global"!==a.skope&&g.push(a.id)});var m=function(d){if(c.isUndefined(g[d+1])&&j.length==g.length){if(c.isEmpty(k))h.resolve(i);else{var e=function(){var d=[];return c.each(k,function(b){d.push(a.czr_skopeBase.buildServerResponse(b))}),b.trim(d.join(" | "))};h.reject(e())}return!0}},n=function(d){return d=d||0,c.isUndefined(g[d])&&(a.consoleLog("Undefined Skope in Save recursive call ",d,_skopesToUpdate,_skopesToUpdate[d]),h.resolve(i)),e.getSubmitPromise(g[d]).always(function(){j.push(d)}).fail(function(b){k.push(b),a.consoleLog("RECURSIVE PUSH FAIL FOR SKOPE : ",g[d]),m(d)||n(d+1)}).done(function(a){a=a||{},i=c.isEmpty(i)?a||{}:b.extend(i,a),m(d)||n(d+1)}),h.promise()},o=!1;c.each(a.czr_skope("global__all_").dirtyValues(),function(a,b){"nav_menu["==b.substring(0,"nav_menu[".length)&&(o=!0)});var p=function(){e.getSubmitPromise(e.globalSkopeId).fail(function(b){a.consoleLog("GLOBAL SAVE SUBMIT FAIL",b),b=a.czr_skopeBase.buildServerResponse(b),f.reject(b)}).done(function(a){i=c.isEmpty(i)?a||{}:b.extend(i,a),f.resolve({response:i,hasNewMenu:o})})};return o&&d.saveGlobal?p():d.saveGlobal&&d.saveSkopes?n().fail(function(b){a.consoleLog("RECURSIVE SAVE CALL FAIL",b),f.reject(b)}).done(function(a){e.cleanSkopeChangesetMetas().always(function(){p()})}):d.saveGlobal&&!d.saveSkopes?p():!d.saveGlobal&&d.saveSkopes&&n().fail(function(b){a.consoleLog("RECURSIVE SAVE CALL FAIL",b),f.reject(b)}).done(function(a){i=c.isEmpty(i)?a||{}:b.extend(i,a),e.cleanSkopeChangesetMetas().always(function(){f.resolve({response:i,hasNewMenu:o})})}),f.promise()},cleanSkopeChangesetMetas:function(){var c=b.Deferred();return _query=b.extend(a.previewer.query(),{nonce:a.previewer.nonce.save}),wp.ajax.post("czr_clean_skope_changeset_metas_after_publish",_query).always(function(){c.resolve()}).fail(function(b){a.consoleLog("cleanSkopeChangesetMetas failed",_query,b)}).done(function(b){a.consoleLog("cleanSkopeChangesetMetas done",_query,b)}),c.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{reactWhenSaveDone:function(b){var d={};b=c.extend({czr_skopes:[],isChangesetDirty:!1},b),c.each(a.czr_skopeCollection(),function(b){d[b.opt_name]=a.czr_skopeBase.getSkopeDirties(b.id),a.czr_skope(b.id).dirtyValues({}),a.czr_skope(b.id).changesetValues({})});var e=[],f=b.czr_skopes;a.consoleLog("REACT WHEN SAVE DONE",d,f),c.each(d,function(b,d){c.each(b,function(b,g){if(!c.isUndefined(c.findWhere(f,{opt_name:d}))&&a.czr_skopeBase.isSettingSkopeEligible(g)){var h=c.findWhere(f,{opt_name:d}).db,i=c.findWhere(f,{opt_name:d}).skope,j=a.CZR_Helpers.build_setId(g),k=a.CZR_Helpers.getOptionName(g),l=h[j];c.isUndefined(l)&&"global"==i&&b===serverControlParams.defaultOptionsValues[k]||!c.isUndefined(l)&&c.isEqual(l,b)||e.push({opt_name:d,setId:j,server_val:l,api_val:b})}})}),c.isEmpty(e)?a.consoleLog("ALL RIGHT, SERVER AND API ARE SYNCHRONIZED AFTER SAVE"):a.consoleLog("SOME SETTINGS HAVE NOT BEEN PROPERLY SAVED : ",e),a.czr_skopeBase.maybeSynchronizeGlobalSkope(),a.czr_skopeBase.updateCtrlSkpNot(a.CZR_Helpers.getSectionControlIds())}})}(wp.customize,jQuery,_);var CZRSkopeResetMths=CZRSkopeResetMths||{};!function(a,b,c){b.extend(CZRSkopeResetMths,{initialize:function(){var c=this;c.previewer=a.previewer,a.state.create("czr-resetting")(!1),a.state("czr-resetting").bind(function(a){b(document.body).toggleClass("czr-resetting",!1!==a)})},resetChangeset:function(d){var e,f,g,h,i,j=b.Deferred(),k=this,l=a.state("processing"),m={is_setting:!1,is_skope:!1,skope_id:a.czr_activeSkopeId()||"",setId:""};d=c.extend(m,d);var n=d.skope_id,o=d.setId;return a.czr_isChangeSetOn()?(f=function(e,f){if(c.isUndefined(e))throw new Error("RESET: MISSING skope_id");if(a.state("czr-resetting")(!0),h={skope_id:e,action:"reset"},i=b.extend(k.previewer.query(h),{nonce:k.previewer.nonce.save}),d.is_setting)b.extend(i,{setting_id:f}),g="czr_changeset_setting_reset";else{if(!d.is_skope)return j.reject("reset_ajax_action_not_specified").promise();g="czr_changeset_skope_reset"}wp.ajax.post(g,i).always(function(){a.state("czr-resetting")(!1)}).fail(function(b){"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?k.previewer.cheatin():"not_logged_in"===b&&(k.previewer.preview.iframe.hide(),k.previewer.login().done(function(){k.resetChangeset(d),k.previewer.preview.iframe.show()})),a.consoleLog(g+" failed ",i,b),b=a.czr_skopeBase.buildServerResponse(b),a.trigger("error",b),a.czr_serverNotification({message:b,status:"error"}),j.reject(b)}).done(function(a){j.resolve(a)})},0===l()&&!1===a.state("czr-resetting")()?f(n,o):(e=function(){0===l()&&!1===a.state("czr-resetting")()&&(a.state.unbind("change",e),f(n,o))},a.state.bind("change",e)),j.promise()):j.resolve().promise()},resetPublished:function(d){var e,f,g,h,i,j=b.Deferred(),k=this,l=a.state("processing"),m={is_setting:!1,is_skope:!1,skope_id:a.czr_activeSkopeId()||"",setId:""};d=c.extend(m,d);var n=d.skope_id,o=d.setId;return f=function(e,f){if(c.isUndefined(e))throw new Error("RESET: MISSING skope_id");if(a.state("czr-resetting")(!0),h={skope_id:e,action:"reset"},i=b.extend(k.previewer.query(h),{nonce:k.previewer.nonce.save}),d.is_setting)b.extend(i,{setting_id:f}),g="czr_published_setting_reset";else{if(!d.is_skope)return j.reject("reset_ajax_action_not_specified").promise();g="czr_published_skope_reset"}a.consoleLog("in czr_reset submit : ",e,i),wp.ajax.post(g,i).always(function(){a.state("czr-resetting")(!1)}).fail(function(b){"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?k.previewer.cheatin():"not_logged_in"===b&&(k.previewer.preview.iframe.hide(),k.previewer.login().done(function(){k.resetChangeset(d),k.previewer.preview.iframe.show()})),a.consoleLog(g+" failed ",i,b),b=a.czr_skopeBase.buildServerResponse(b),a.trigger("error",b),a.czr_serverNotification({message:b,status:"error"}),j.reject(b)}).done(function(a){j.resolve(a)})},0===l()&&!1===a.state("czr-resetting")()?f(n,o):(e=function(){0===l()&&!1===a.state("czr-resetting")()&&(a.state.unbind("change",e),f(n,o))},a.state.bind("change",e)),j.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{initWidgetSidebarSpecifics:function(){var c=this;c.isExcludedSidebarsWidgets()||a.czr_activeSkopeId.bind(function(b){c.forceSidebarDirtyRefresh(a.czr_activeSectionId(),b)}),b(document).bind("widget-added",function(b,d){if(!c.isExcludedSidebarsWidgets()){var e=d.closest(".customize-control").attr("id"),f=a.czr_skopeBase.widgetIdToSettingId(e,"customize-control-");if(!a.has(f))throw new Error("AN ADDED WIDGET COULD NOT BE BOUND IN SKOPE. "+f);c.listenAPISettings(f)}})},forceSidebarDirtyRefresh:function(b,d){var e=this;if(!e.isExcludedSidebarsWidgets()){var f=a.state("saved")(),g=function(){if(a.section.has(b)&&"sidebar"==a.section(b).params.type){var c=c||a.czr_activeSkopeId(),d="sidebars_widgets["+a.section(b).params.sidebarId+"]",g=e.getSkopeSettingVal(d,c);a.czr_skope(c).updateSkopeDirties(d,g),a.previewer.refresh({the_dirties:a.czr_skope(c).dirtyValues()}).done(function(){a.state("saved")(f)})}};g=c.debounce(g,500),g()}}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{initialize:function(d,e){var f=this;a.Value.prototype.initialize.call(f,null,e),f.isReady=b.Deferred(),f.embedded=b.Deferred(),f.el="czr-scope-"+d,b.extend(f,e||{}),f.visible=new a.Value((!0)),f.winner=new a.Value((!1)),f.priority=new a.Value,f.active=new a.Value((!1)),f.dirtyness=new a.Value((!1)),f.skopeResetDialogVisibility=new a.Value((!1)),f.hasDBValues=new a.Value((!1)),f.dirtyValues=new a.Value({}),f.dbValues=new a.Value({}),f.changesetValues=new a.Value({}),f.userEventMap=new a.Value([{trigger:"click keydown",selector:".czr-scope-switch, .czr-skp-switch-link",name:"skope_switch",actions:function(){a.czr_activeSkopeId(f().id)}},{trigger:"click keydown",selector:".czr-scope-reset",name:"skope_reset_warning",actions:"reactOnSkopeResetUserRequest"}]),f.skopeResetDialogVisibility.bind(function(a,b){return f.skopeResetDialogReact(a)},{deferred:!0}),f.dirtyValues.callbacks.add(function(){return f.dirtyValuesReact.apply(f,arguments)}),f.changesetValues.callbacks.add(function(){return f.changesetValuesReact.apply(f,arguments)}),f.dbValues.callbacks.add(function(){return f.dbValuesReact.apply(f,arguments)}),f.callbacks.add(function(){return f.skopeReact.apply(f,arguments)}),f.set(c.omit(e,function(a,b){return c.contains(["db","changeset","has_db_val"],b)})),f.setupObservableViewValuesCallbacks(),f.dirtyness(!c.isEmpty(e.changeset)),f.hasDBValues(!c.isEmpty(e.db)),f.winner(e.is_winner),f.embedded.fail(function(){throw new Error("The container of skope "+f().id+" has not been embededd")}).done(function(){f.setupDOMListeners(f.userEventMap(),{dom_el:f.container}),f.isReady.resolve()})},ready:function(){var c=this;a.czr_skopeBase.skopeWrapperEmbedded.done(function(){try{b.when(c.embedSkopeDialogBox()).done(function(a){!1!==a.length?(a.css("background-color",c.color),c.container=a,c.embedded.resolve(a)):c.embedded.reject()})}catch(d){a.errorLog("In skope base : "+d),c.embedded.reject()}})},dirtyValuesReact:function(b,d){var e=this;e.dirtyness(!c.isEmpty(b)),a.czr_dirtyness(!c.isEmpty(b));var f=[];c.each(d,function(a,d){c.has(b,d)||f.push(d)}),e().id==a.czr_activeSkopeId()&&(c.each(f,function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("isDirty")(!1)}),c.each(b,function(b,d){c.has(a.control(d),"czr_states")&&a.control(d).czr_states("isDirty")(!0)}))},changesetValuesReact:function(a,c){var d=this,e=b.extend(!0,{},d.dirtyValues());d.dirtyValues(b.extend(e,a))},dbValuesReact:function(b,d){var e=this;e.hasDBValues(!c.isEmpty("global"!=e().skope?b:c.omit(b,function(b,c){return!a.czr_skopeBase.isThemeSetting(c)})));var f=[];c.each(d,function(a,d){c.has(b,d)||f.push(d)}),e().id==a.czr_activeSkopeId()&&(c.each(f,function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("hasDBVal")(!1)}),c.each(b,function(b,d){c.has(a.control(d),"czr_states")&&a.control(d).czr_states("hasDBVal")(!0)}))},skopeReact:function(d,e){var f=this,g=[],h=[];a.czr_skopeBase.isSkopeRegisteredInCollection(d.id)?(g=b.extend(!0,[],a.czr_skopeCollection()),h=g,c.each(g,function(a,b){a.id==f().id&&(h[b]=d)}),a.czr_skopeCollection(h)):(g=b.extend(!0,[],a.czr_skopeCollection()),g.push(d),a.czr_skopeCollection(g))},setupObservableViewValuesCallbacks:function(){var a=this;a.visible.bind(function(b){"pending"==a.embedded.state()?a.embedded.done(function(){a.container.toggle(b)}):a.container.toggle(b)}),a.active.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.activeStateReact.apply(a,arguments)}):a.activeStateReact.apply(a,arguments)}),a.dirtyness.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.dirtynessReact.apply(a,arguments)}):a.dirtynessReact.apply(a,arguments)}),a.hasDBValues.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.hasDBValuesReact.apply(a,arguments)}):a.hasDBValuesReact.apply(a,arguments)}),a.winner.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.winnerReact.apply(a,arguments)}):a.winnerReact.apply(a,arguments)})},activeStateReact:function(a,c){var d=this;d.container.toggleClass("inactive",!a).toggleClass("active",a),b(".czr-scope-switch",d.container).toggleClass("fa-toggle-on",a).toggleClass("fa-toggle-off",!a)},dirtynessReact:function(a,c){var d=this;b.when(this.container.toggleClass("dirty",a)).done(function(){a?b(".czr-scope-reset",d.container).fadeIn("slow").attr("title",[serverControlParams.i18n.skope["Reset the current customizations for"],d().title].join(" ")):d.hasDBValues()||b(".czr-scope-reset",d.container).fadeOut("fast")})},hasDBValuesReact:function(a,c){var d=this;b.when(d.container.toggleClass("has-db-val",a)).done(function(){a?b(".czr-scope-reset",d.container).fadeIn("slow").attr("title",["global"==d().skope?serverControlParams.i18n.skope["Reset the theme options published sitewide"]:serverControlParams.i18n.skope["Reset your website published options for"],"global"==d().skope?"":d().title].join(" ")):d.dirtyness()||b(".czr-scope-reset",d.container).fadeOut("fast")})},winnerReact:function(d){var e=this;this.container.toggleClass("is_winner",d),d&&c.each(a.czr_currentSkopesCollection(),function(c){if(c.id!=e().id){var d=b.extend(!0,{},c);b.extend(d,{is_winner:!1}),a.czr_skope(c.id)(d)}})},updateSkopeDirties:function(c,d){var e=this;a.CZR_Helpers.getOptionName(c);if(!a.czr_skopeBase.isSettingSkopeEligible(c)&&"global"!=e().skope)return a.czr_skope(a.czr_skopeBase.getGlobalSkopeId()).updateSkopeDirties(c,d);var f=b.extend(!0,{},e.dirtyValues()),g={};return g[c]=d,e.dirtyValues.set(b.extend(f,g)),e.dirtyValues()},getSkopeSettingDirtyness:function(a){var b=this;return b.getSkopeSettingAPIDirtyness(a)||b.getSkopeSettingChangesetDirtyness(a)},getSkopeSettingAPIDirtyness:function(b){var d=this;return c.has(d.dirtyValues(),a.CZR_Helpers.build_setId(b))},getSkopeSettingChangesetDirtyness:function(b){var d=this;return a.czr_isChangeSetOn()?c.has(d.changesetValues(),a.CZR_Helpers.build_setId(b)):d.getSkopeSettingAPIDirtyness(b)},hasSkopeSettingDBValues:function(b){var d=a.CZR_Helpers.build_setId(b);return!c.isUndefined(a.czr_skope(a.czr_activeSkopeId()).dbValues()[d])}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{embedSkopeDialogBox:function(){var d=this,e=b.extend(!0,{},d()),f="";if(!b("#customize-header-actions").find(".czr-scope-switcher").length)throw new Error("The skope switcher wrapper is not printed, the skope can not be embedded.");try{f=wp.template("czr-skope")(c.extend(e,{el:d.el}))}catch(g){return a.errorLog("Error when parsing the template of a skope"+g),!1}return b(".czr-skopes-wrapper","#customize-header-actions").append(b(f)),b("."+d.el,".czr-skopes-wrapper")},renderResetWarningTmpl:function(){var d,e,f=this,g=b.extend(!0,{},f()),h="";f.dirtyness()?(d=[serverControlParams.i18n.skope["Please confirm that you want to reset your current ( not published ) customizations for"],f().ctx_title].join(" "),e=[serverControlParams.i18n.skope["Your customizations have been reset for"],f().ctx_title].join(" ")):(d=["global"==f().skope?serverControlParams.i18n.skope["Please confirm that you want to reset your sitewide published customizations. Note : this will not reset the customizations made in other option scopes"]:serverControlParams.i18n.skope["Please confirm that you want to reset your published customizations for"],"global"==f().skope?"":f().ctx_title].join(" "),e=[serverControlParams.i18n.skope["Your published customizations have been reset for"],f().title].join(" "));try{h=wp.template("czr-skope-pane")(c.extend(g,{el:f.el,warning_message:d+".",success_message:e+"."}))}catch(i){return a.errorLog("Error when parsing the the reset skope template : "+i),!1}return b("#customize-preview").after(b(h)),b("#czr-skope-pane")},getEl:function(){var a=this;return b(a.el,"#customize-header-actions")}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{reactOnSkopeResetUserRequest:function(){var b=this,c=function(){a.state("czr-resetting")(!0),a.czr_activeSkopeId()!=b().id?a.czr_activeSkopeId(b().id).done(function(){b.skopeResetDialogVisibility(!b.skopeResetDialogVisibility()).done(function(){a.state("czr-resetting")(!1)})}):b.skopeResetDialogVisibility(!b.skopeResetDialogVisibility()).done(function(){a.state("czr-resetting")(!1)})};return a.state("czr-resetting")()||0!==a.state("processing")()?void a.czr_serverNotification({message:"Slow down, you move too fast !",status:"success",auto_collapse:!0}):void(a.czr_activeSkopeId()!=b().id&&a.czr_skope(a.czr_activeSkopeId()).skopeResetDialogVisibility()?a.czr_skope(a.czr_activeSkopeId()).skopeResetDialogVisibility(!1).done(function(){c()}):c())},skopeResetDialogReact:function(d){var e=this,f=b.Deferred();return e.userResetEventMap=e.userResetEventMap||new a.Value([{trigger:"click keydown",selector:".czr-scope-reset-cancel",name:"skope_reset_cancel",actions:function(){e.skopeResetDialogVisibility(!e.skopeResetDialogVisibility())}},{trigger:"click keydown",selector:".czr-scope-do-reset",name:"skope_do_reset",actions:"doResetSkopeValues"}]),d?(a.czr_isResettingSkope(e().id),b.when(e.renderResetWarningTmpl()).done(function(a){e.resetPanel=a,e.resetPanel.addClass(e.dirtyness()?"dirty-reset":"db-reset"),e.setupDOMListeners(e.userResetEventMap(),{dom_el:e.resetPanel})}).then(function(){setTimeout(function(){var a=b("#customize-preview").height();e.resetPanel.css("line-height",a+"px").css("height",a+"px"),b("body").addClass("czr-skope-pane-open")},50)})):b.when(b("body").removeClass("czr-skope-pane-open")).done(function(){c.has(e,"resetPanel")&&!1!==e.resetPanel.length&&setTimeout(function(){e.resetPanel.remove(),a.czr_isResettingSkope(!1)},300)}),c.delay(function(){f.resolve()},350),f.promise()},doResetSkopeValues:function(){var d=this,e=d().id,f=d.dirtyness()?"_resetSkopeDirties":"_resetSkopeAPIValues",g=function(){var g=function(){a.czr_skopeBase.processSilentUpdates({refresh:!1}).fail(function(){a.consoleLog("Silent update failed after resetting skope : "+e)}).done(function(){b.when(b(".czr-reset-warning",d.resetPanel).fadeOut("300")).done(function(){b.when(b(".czr-reset-success",d.resetPanel).fadeIn("300")).done(function(){c.delay(function(){a.czr_isResettingSkope(!1),d.skopeResetDialogVisibility(!1)},2e3)})})})};d[f]().done(function(){a.previewer.refresh().fail(function(b){a.consoleLog("SKOPE RESET REFRESH FAILED",b)}).done(function(b){if("global"==a.czr_skope(e)().skope&&"_resetSkopeAPIValues"==f){var d,h={},i=a.czr_skope(e)().opt_name;!c.isUndefined(b.skopesServerData)&&c.has(b.skopesServerData,"czr_skopes")&&(d=b.skopesServerData.czr_skopes,c.isUndefined(c.findWhere(d,{opt_name:i}))&&(h=c.findWhere(d,{opt_name:i}).db||{})),a.czr_skopeBase.maybeSynchronizeGlobalSkope({isGlobalReset:!0,isSkope:!0,skopeIdToReset:e}).done(function(){g()})}else g()})})};b("body").addClass("czr-resetting-skope"),a.czr_skopeReset[d.dirtyness()?"resetChangeset":"resetPublished"]({skope_id:d().id,is_skope:!0}).always(function(){b("body").removeClass("czr-resetting-skope")}).done(function(a){g()}).fail(function(b){d.skopeResetDialogVisibility(!1),a.consoleLog("Skope reset failed",b)})},_resetSkopeDirties:function(){var a=this,c=b.Deferred();return a.dirtyValues({}),a.changesetValues({}),c.resolve().promise()},_resetSkopeAPIValues:function(){var a=this,c=b.Deferred();return a.dbValues({}),c.resolve().promise()}})}(wp.customize,jQuery,_),function(a,b,c){a.Value.prototype.set=function(d,e){var f=this._value,g=b.Deferred(),h=this,i=[];return d=this._setter.apply(this,arguments),d=this.validate(d),args=c.extend({silent:!1},c.isObject(e)?e:{}),null===d||c.isEqual(f,d)?g.resolveWith(h,[d,f,e]).promise():(this._value=d,this._dirty=!0,!0===args.silent?g.resolveWith(h,[d,f,e]).promise():this._deferreds?(c.each(h._deferreds,function(a){i.push(a.apply(null,[d,f,e]))}),b.when.apply(null,i).fail(function(){a.errorLog("A deferred callback failed in api.Value::set()")}).then(function(){h.callbacks.fireWith(h,[d,f,e]),g.resolveWith(h,[d,f,e])}),g.promise(h)):(this.callbacks.fireWith(this,[d,f,e]),g.resolveWith(h,[d,f,e]).promise(h)))},a.Value.prototype.bind=function(){var a=this,d=!1,e=[];return b.each(arguments,function(a,b){d||(d=c.isObject(b)&&b.deferred),c.isFunction(b)&&e.push(b)}),d?(a._deferreds=a._deferreds||[],c.each(e,function(b){c.contains(b,a._deferreds)||a._deferreds.push(b)})):a.callbacks.add.apply(a.callbacks,arguments),
14
- this},a.Setting.prototype.silent_set=function(b,d){var e=this._value,f=a.state("saved")();return b=this._setter.apply(this,arguments),b=this.validate(b),null===b||c.isEqual(e,b)?this:(this._value=b,this._dirty=c.isUndefined(d)||!c.isBoolean(d)?this._dirty:d,this.callbacks.fireWith(this,[b,e,{silent:!0}]),a.state("saved")(f),this)}}(wp.customize,jQuery,_),function(a,b,c){a.bind("ready",function(){if(serverControlParams.isSkopOn){var d=a.previewer.query;a.previewer.query=function(e){if(!serverControlParams.isSkopOn)return d.apply(this);if(!c.has(a,"czr_skope"))return a.consoleLog("QUERY : SKOPE IS NOT FULLY READY YEY. FALLING BACK ON CORE QUERY"),d.apply(this);if("pending"==a.czr_initialSkopeCollectionPopulated.state())return a.consoleLog("QUERY : INITIAL SKOPE COLLECTION NOT POPULATED YET. FALLING BACK ON CORE QUERY"),d.apply(this);if("pending"==a.czr_isPreviewerSkopeAware.state()&&a.czr_isPreviewerSkopeAware.resolve(),!c.isObject(e)&&"resolved"==a.czr_initialSkopeCollectionPopulated.state()&&"resolved"==a.czr_initialSkopeCollectionPopulated.state())return d.apply(this);!c.isUndefined(e.skope_id)&&c.isString(e.skope_id)||(e.skope_id=a.czr_activeSkopeId()||a.czr_skopeBase.getGlobalSkopeId());var f,g={},h={},i={skope_id:null,action:null,the_dirties:{},dyn_type:null,opt_name:null};if(e=b.extend(i,e),!c.isObject(e.the_dirties))throw a.consoleLog("QUERY PARAMS : ",e),new Error("QUERY DIRTIES MUST BE AN OBJECT. Requested action : "+e.action);if("pending"!=a.czr_isPreviewerSkopeAware.state()&&c.isNull(e.skope_id))throw a.consoleLog("QUERY PARAMS : ",e),new Error("OVERRIDEN QUERY : NO SKOPE ID. FALLING BACK ON CORE QUERY. Requested action : "+e.action);if(!c.contains([null,"refresh","save","reset","changeset_update"],e.action))throw a.consoleLog("QUERY PARAMS : ",e),new Error("A REQUESTED QUERY HAS NO AUTHORIZED ACTION. Requested action : "+e.action);var j=function(){if("pending"==a.czr_initialSkopeCollectionPopulated.state())return{};var b={};return c.each(a.czr_currentSkopesCollection(),function(c){"global"!=c.skope&&(b[c.id]=a.czr_skopeBase.getSkopeDirties(c.id))}),b};switch(c.isNull(e.the_dirties)||c.isEmpty(e.the_dirties)?(g=a.dirtyValues({unsaved:e.excludeCustomizedSaved||!1}),h=j()):"global"==a.czr_skopeBase.getActiveSkopeName()?g=e.the_dirties:h[a.czr_activeSkopeId()]=e.the_dirties,e.action){case null:case"refresh":break;case"changeset_update":if(c.isUndefined(e.opt_name))throw new Error("Missing opt_name param in the changeset_update query for skope : "+e.skope_id);break;case"save":if(c.isNull(e.dyn_type)&&(e.dyn_type=a.czr_skope(e.skope_id)().dyn_type),c.isNull(e.dyn_type)||c.isUndefined(e.dyn_type))throw new Error("QUERY : A SAVE QUERY MUST HAVE A VALID DYN TYPE."+e.skope_id);break;case"reset":if(c.isNull(e.dyn_type)&&(e.dyn_type=a.czr_skope(e.skope_id)().dyn_type),c.isNull(e.dyn_type)||c.isUndefined(e.dyn_type))throw new Error("QUERY : A RESET QUERY MUST HAVE A VALID DYN TYPE."+e.skope_id)}var k={};return c.each(a.czr_currentSkopesCollection(),function(a){k[a.skope]={id:a.id,opt_name:a.opt_name}}),f={wp_customize:"on",customized:"{}"==JSON.stringify(g)?'{"__not_customized__"}':JSON.stringify(g),skopeCustomized:JSON.stringify(h),nonce:this.nonce.preview,skope:a.czr_skope(e.skope_id)().skope,level_id:a.czr_skope(e.skope_id)().level,skope_id:e.skope_id,dyn_type:e.dyn_type,opt_name:c.isNull(e.opt_name)?a.czr_skope(e.skope_id)().opt_name:e.opt_name,obj_id:a.czr_skope(e.skope_id)().obj_id,current_skopes:JSON.stringify(k)||{},channel:this.channel(),revisionIndex:a._latestRevision},f=a.czr_isChangeSetOn()?b.extend(f,{customize_theme:a.settings.theme.stylesheet,customize_changeset_uuid:a.settings.changeset.uuid}):b.extend(f,{theme:a.settings.theme.stylesheet})}}})}(wp.customize,jQuery,_),function(a,b,c){a.bind("czr-skope-started",function(){a.previewer.save=function(b){return a.czr_skopeSave.save()}})}(wp.customize,jQuery,_),function(a,b,c){if(serverControlParams.isSkopOn){a.Element.synchronizer.checkbox.update=function(a){this.element.prop("checked",a),this.element.iCheck("update")};var d=a.Element.synchronizer.val.update;a.Element.synchronizer.val.update=function(b){var c=this,e=function(){c.element.is("select")?c.element.val(b).trigger("change"):c.element.hasClass("wp-color-picker")?c.element.val(b).trigger("change"):c.element.val(b)};if(serverControlParams.isSkopOn){if("resolved"!=a.czr_skopeReady.state())return d.call(c,b);a.czr_skopeReady.then(function(){e()})}else e()},a.Element.synchronizer.val.refresh=function(){var a=this;return this.element.is("select")&&c.isNull(this.element.val())?c.isArray(a())?[]:c.isObject(a())?{}:"":this.element.val()}}}(wp.customize,jQuery,_),function(a,b,c){var d=a.Previewer.prototype.refresh,e=function(f){f=c.extend({waitSkopeSynced:!0,the_dirties:{}},f);var g=this,h=b.Deferred();if(!serverControlParams.isSkopOn)return h.resolve().promise();if(c.has(a,"czr_activeSkopeId")&&!c.isUndefined(a.czr_activeSkopeId())||a.consoleLog("The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method."),!c.has(a,"czr_activeSkopeId")&&"resolved"!=a.czr_skopeReady.state())return a.czr_skopeReady.done(function(){e.apply(a.previewer,f)}),d.apply(g),h.resolve().promise();g.send("loading-initiated"),g.abort();var i=a.czr_getSkopeQueryParams({skope_id:a.czr_activeSkopeId(),action:"refresh",the_dirties:f.the_dirties||{}});return g.loading=new a.PreviewFrame({url:g.url(),previewUrl:g.previewUrl(),query:g.query(i)||{},container:g.container,signature:"WP_CUSTOMIZER_SIGNATURE"}),g.settingsModifiedWhileLoading={},onSettingChange=function(a){g.settingsModifiedWhileLoading[a.id]=!0},a.bind("change",onSettingChange),g.loading.always(function(){a.unbind("change",onSettingChange)}),a.czr_isChangeSetOn()||(g._previousPreview=g._previousPreview||g.preview),g.loading.done(function(b){var c,d=this;g.preview=d,g.targetWindow(d.targetWindow()),g.channel(d.channel()),c=function(b){d.unbind("synced",c),d.unbind("czr-skopes-synced",c),g._previousPreview?g._previousPreview.destroy():g.preview&&g.preview.destroy(),g._previousPreview=g.preview,g.deferred.active.resolve(),delete g.loading,a.trigger("pre_refresh_done",{previewer:g,skopesServerData:b||{}}),h.resolve({previewer:g,skopesServerData:b||{}})},a.czr_isChangeSetOn()||g.send("sync",{scroll:g.scroll,settings:a.get()}),f.waitSkopeSynced?d.bind("czr-skopes-synced",c):d.bind("synced",c),g.trigger("ready",b)}),g.loading.fail(function(b,c){a.consoleLog("LOADING FAILED : ",arguments),g.send("loading-failed"),a.czr_isChangeSetOn()||"redirect"===b&&c&&g.previewUrl(c),"logged out"===b&&(g.preview&&(g.preview.destroy(),delete g.preview),g.login().done(g.refresh)),"cheatin"===b&&g.cheatin(),h.reject(b)}),h.promise()};a.bind("czr-skope-started",function(){czr_override_refresh_for_skope(),a.Previewer.prototype.refresh=e}),a.czr_getSkopeQueryParams=function(d){if(!a.czr_isChangeSetOn())return d;d=c.isObject(d)?d:{};var e=d.action||"refresh";switch(e){case"refresh":d=b.extend(d,{excludeCustomizedSaved:!0})}return d},czr_override_refresh_for_skope=function(){serverControlParams.isSkopOn&&(a.previewer.refresh=function(d){var f=b.Deferred(),g=function(b){var c,d=function(){return 0===a.state("processing").get()},g=function(){e.call(a.previewer,b).done(function(a){f.resolve(a)})};d()?g():(c=function(){d()&&(g(),a.state("processing").unbind(c))},a.state("processing").bind(c))};return g=c.debounce(g,a.previewer.refreshBuffer),g(d),f.promise()})}}(wp.customize,jQuery,_),function(a,b,c){serverControlParams.isSkopOn&&(a.dirtyValues=function(b){return a.czr_skopeBase.getSkopeDirties(a.czr_skopeBase.getGlobalSkopeId(),b)})}(wp.customize,jQuery,_),function(a,b,c){if(serverControlParams.isSkopOn&&a.czr_isChangeSetOn()){var d=a.requestChangesetUpdate;a.requestChangesetUpdate=function(e){var f=b.Deferred(),g=[],h=[],i=e||{},j=[],k=[],l=b.Deferred();if(!serverControlParams.isSkopOn)return d();(0===a._lastSavedRevision||c.isEmpty(a.state("changesetStatus")()))&&(i=c.extend(i,{blogname:{dummy_change:"dummy_change"}})),c.each(a.czr_currentSkopesCollection(),function(a){"global"!=a.skope&&g.push(a.id)});var m=function(d){if(c.isUndefined(g[d+1])&&h.length==g.length){if(c.isEmpty(j))l.resolve(k);else{var e=function(){var d=[];return c.each(j,function(b){d.push(a.czr_skopeBase.buildServerResponse(b))}),b.trim(d.join(" | "))};l.reject(e())}return!0}},n=function(b){return(c.isUndefined(b)||0==b)&&a.state("processing").set(1),b=b||0,c.isUndefined(g[b])?(a.consoleLog("Undefined Skope in changeset recursive call ",b,g,g[b]),l.resolve(k).promise()):(a._requestSkopeChangetsetUpdate(e,g[b]).always(function(){h.push(b)}).fail(function(c){j.push(c),a.consoleLog("CHANGESET UPDATE RECURSIVE FAIL FOR SKOPE : ",g[b]),m(b)||n(b+1)}).done(function(a){k.push(a),m(b)||n(b+1)}),l.promise())},o=a._lastSavedRevision;return d(i).fail(function(b){a.consoleLog("WP requestChangesetUpdateFail",b,a.czr_skopeBase.buildServerResponse(b)),a._lastSavedRevision=Math.max(a._latestRevision,a._lastSavedRevision),a.state("processing").set(0),f.reject(b),b=a.czr_skopeBase.buildServerResponse(b),a.czr_serverNotification({message:b,status:"error"})}).done(function(b){"pending"==a.czr_initialSkopeCollectionPopulated.state()&&f.resolve(b),a._lastSavedRevision=o,n().always(function(){a._lastSavedRevision=Math.max(a._latestRevision,a._lastSavedRevision),a.state("processing").set(0)}).fail(function(b){f.reject(b),a.consoleLog("CHANGESET UPDATE RECURSIVE PUSH FAIL",b,k),a.trigger("changeset-error",b),a.czr_serverNotification({message:b,status:"error"})}).done(function(){f.resolve(b)})}),f.promise()},a._requestSkopeChangetsetUpdate=function(d,e){if(c.isUndefined(e)||!a.czr_skope.has(e))throw new Error("In api._requestSkopeChangetsetUpdate() : a valid and registered skope_id must be provided");var f,g=new b.Deferred,h={};if(e=e||a.czr_activeSkopeId(),d&&c.extend(h,d),c.each(a.czr_skopeBase.getSkopeDirties(e),function(a,b){d&&null===d[b]||(h[b]=c.extend({},h[b]||{},{value:a}))}),c.isEmpty(h))return g.resolve({}),g.promise();if(a._latestRevision<=a._lastSavedRevision)return g.resolve({}),g.promise();a.trigger("skope-changeset-save",h);var i={skope_id:e,action:"changeset_update",opt_name:a.czr_skope(e).opt_name};return f=a.previewer.query(c.extend(i,{excludeCustomizedSaved:!0})),delete f.customized,c.extend(f,{nonce:a.settings.nonce.save,customize_changeset_data:JSON.stringify(h)}),wp.ajax.post("customize_skope_changeset_save",f).done(function(a){g.resolve(a)}).fail(function(b){a.consoleLog("SKOPE CHANGESET FAIL FOR SKOPE "+b.skope_id,b),g.reject(b)}).always(function(b){b.setting_validities&&a._handleSettingValidities({settingValidities:b.setting_validities})}),g.promise()}}}(wp.customize,jQuery,_),function(a,b,c){a.Setting.prototype.initialize=function(b,c,d){var e=this;a.Value.prototype.initialize.call(e,c,d),e.id=b,e.transport=e.transport||"refresh",e._dirty=d.dirty||!1,e.notifications=new a.Values({defaultConstructor:a.Notification}),e.bind(e.preview)},a.Setting.prototype.preview=function(d,e,f){var g,h=this,i=b.Deferred();return g=h.transport,serverControlParams.isSkopOn&&a.czr_isPreviewerSkopeAware&&"pending"==a.czr_isPreviewerSkopeAware.state()?(this.previewer.refresh(),i.resolve(arguments).promise()):c.isUndefined(e)||c.isEmpty(e)||c.isNull(e)||!c.isObject(f)||!0!==f.not_preview_sent?c.has(f,"silent")&&!1!==f.silent?i.resolve(arguments).promise():("postMessage"!==g||a.state("previewerAlive").get()||(g="refresh"),"postMessage"===g?(h.previewer.send("pre_setting",{set_id:h.id,data:f,value:d}),h.previewer.send("setting",[h.id,h()]),i.resolve(arguments)):"refresh"===g&&(serverControlParams.isSkopOn?h.previewer.refresh().always(function(){i.resolve(arguments)}):(h.previewer.refresh(),i.resolve(arguments))),i.promise()):i.resolve(arguments).promise()}}(wp.customize,jQuery,_),function(a,b,c){if("function"==typeof a.Section){var d=a.Section.prototype.initialize;a.Section.prototype.initialize=function(a,e){d.apply(this,[a,e]);var f=this;this.expanded.callbacks.add(function(a){if(a){var d=f.container.closest(".wp-full-overlay-sidebar-content"),e=f.container.find(".accordion-section-content");_resizeContentHeight=function(){e.css("height",d.innerHeight())},_resizeContentHeight(),b(window).on("resize.customizer-section",c.debounce(_resizeContentHeight,110))}})}}}(wp.customize,jQuery,_),function(a,b,c){a.CZR_Helpers=a.CZR_Helpers||{},a.CZR_Helpers=b.extend(a.CZR_Helpers,{getControlSettingId:function(b,d){return d="default",a.control.has(b)?!c.has(a.control(b),"settings")||c.isEmpty(a.control(b).settings)?b:c.has(a.control(b).settings,d)?c.isUndefined(a.control(b).settings[d].id)?(a.consoleLog("getControlSettingId : The requested control_id has no setting id assigned : "+b),b):a.control(b).settings[d].id:(a.consoleLog("getControlSettingId : The requested control_id does not have the requested setting type : "+b+" , "+d),b):(a.consoleLog("getControlSettingId : The requested control_id is not registered in the api yet : "+b),b)},getDocSearchLink:function(a){a=c.isString(a)?a:"";var b=a.replace(/ /g,"+"),d=[serverControlParams.docURL,"search?query=",b].join("");return['<a href="'+d+'" title="'+serverControlParams.i18n.readDocumentation+'" target="_blank">'," ",'<span class="fa fa-question-circle-o"></span>'].join("")},build_setId:function(a){return c.contains(serverControlParams.wpBuiltinSettings,a)?a:c.contains(serverControlParams.themeSettingList,a)&&-1==a.indexOf(serverControlParams.themeOptions)?[serverControlParams.themeOptions+"[",a,"]"].join(""):a},getOptionName:function(a){return-1==a.indexOf(serverControlParams.themeOptions)?a:a.replace(/\[|\]/g,"").replace(serverControlParams.themeOptions,"")},hasPartRefresh:function(b){if(c.has(a,"czr_partials"))return c.contains(c.map(a.czr_partials(),function(a,d){return c.contains(a.settings,b)}),!0)},getSectionControlIds:function(b){return b=b||a.czr_activeSectionId(),a.section.has(b)?c.map(a.section(b).controls(),function(a){return a.id}):[]},getSectionSettingIds:function(b){if(b=b||a.czr_activeSectionId(),a.section.has(b)){var d=this,e=[],f=d.getSectionControlIds(b);return c.each(f,function(b){c.each(a.control(b).settings,function(a,b){e.push(a.id)})}),e}},capitalize:function(a){return c.isString(a)?a.charAt(0).toUpperCase()+a.slice(1):a},truncate:function(a,b,d){if(!c.isString(a))return"";b=b||20;var e=a.length>b,f=e?a.substr(0,b-1):a;return f=d&&e?f.substr(0,f.lastIndexOf(" ")):f,e?f+"...":f},isMultiItemModule:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].crud||a.czrModuleMap[b].multi_item||!1}},isCrudModule:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].crud||!1}},hasModuleModOpt:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].has_mod_opt||!1}},setupInputCollectionFromDOM:function(){var d=this;if(!c.isFunction(d))throw new Error("setupInputCollectionFromDOM : inputParentInst is not valid.");var e=d.module,f=c.has(d(),"is_mod_opt");if(!c.has(d,"czr_Input")||c.isEmpty(d.inputCollection())){d.czr_Input=new a.Values,d.inputConstructor=f?e.inputModOptConstructor:e.inputConstructor;var g=f?d.defaultModOptModel:d.defaultItemModel;if(c.isEmpty(g)||c.isUndefined(g))throw new Error("No default model found in item or mod opt "+d.id+".");var h=b.extend(!0,{},d());h=c.isObject(h)?b.extend(g,h):g;var i={};return b("."+e.control.css_attr.sub_set_wrapper,d.container).each(function(g){var j=b(this).find("[data-type]").attr("data-type"),k=c.has(h,j)?h[j]:"";if(c.isUndefined(j)||c.isEmpty(j))return void a.consoleLog("setupInputCollectionFromDOM : missing data-type for "+e.id);if(!c.has(h,j))throw new Error("The item or mod opt property : "+j+" has been found in the DOM but not in the item or mod opt model : "+d.id+". The input can not be instantiated.");var l=b(this).attr("data-input-type"),m=b(this).attr("data-transport")||"inherit",n=c.has(e.inputOptions,l)?e.inputOptions[l]:{};d.czr_Input.add(j,new d.inputConstructor(j,{id:j,type:l,transport:m,input_value:k,input_options:n,container:b(this),input_parent:d,is_mod_opt:f,module:e})),d.czr_Input(j).ready(),i[j]=k}),d.inputCollection(i),d}},removeInputCollection:function(){var a=this;if(!c.isFunction(a))throw new Error("removeInputCollection : inputParentInst is not valid.");c.has(a,"czr_Input")&&(a.czr_Input.each(function(b){a.czr_Input.remove(b.id)}),a.inputCollection({}))},refreshModuleControl:function(c){var d=a.controlConstructor.czr_module,e=(a.control(c).params.type,a.settings.controls[c]);b.when(a.control(c).container.remove()).done(function(){a.control.remove(c),a.control.add(c,new d(c,{params:e,previewer:a.previewer}))})},hexToRgb:function(b){var c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;try{b=b.replace(c,function(a,b,c,d){return b+b+c+c+d+d})}catch(d){return a.errorLog("Error in Helpers::hexToRgb : "+d),b}var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b);return e=e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[],"rgb("+e.join(",")+")"},rgbToHex:function(a,b,c){var d=function(a){var b=a.toString(16);return 1==b.length?"0"+b:b};return"#"+d(a)+d(b)+d(c)}})}(wp.customize,jQuery,_),function(a,b,c){a.CZR_Helpers=a.CZR_Helpers||{},a.CZR_Helpers=b.extend(a.CZR_Helpers,{addActions:function(a,b,d){var e=this;d=d||e,d[a]=d[a]||[],new_event_map=c.clone(d[a]),d[a]=c.union(new_event_map,c.isArray(b)?b:[b])},doActions:function(a,b,c){b.trigger(a,c)},setupDOMListeners:function(d,e,f){var g=this,h={model:{},dom_el:{}};return f=f||g,c.isArray(d)?c.isObject(e)?(e=c.extend(h,e),!e.dom_el instanceof jQuery||1!=e.dom_el.length?void a.errorLog("setupDomListeners : dom element should be an existing dom element",e):void c.map(d,function(d){return!c.isString(d.selector)||c.isEmpty(d.selector)?void a.errorLog("setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : "+d.actions.join(",")):!c.isString(d.selector)||c.isEmpty(d.selector)?void a.errorLog("setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : "+d.actions.join(",")):void e.dom_el.on(d.trigger,d.selector,function(h,i){if(h.stopPropagation(),!a.utils.isKeydownButNotEnterEvent(h)){h.preventDefault();var j=b.extend(!0,{},e);if(c.has(j,"model")&&c.has(j.model,"id")&&(c.has(f,"get")?j.model=f():j.model=f.getModel(j.model.id)),b.extend(j,{event:d,dom_event:h}),b.extend(j,i),!c.has(j,"event")||!c.has(j.event,"actions"))return void a.errorLog("executeEventActionChain : missing obj.event or obj.event.actions");try{g.executeEventActionChain(j,f)}catch(k){a.errorLog("In setupDOMListeners : problem when trying to fire actions : "+j.event.actions),a.errorLog("Error : "+k)}}})})):void a.errorLog("setupDomListeners : args should be an object",d):void a.errorLog("setupDomListeners : event_map should be an array",e)},executeEventActionChain:function(a,b){var d=this;if("function"==typeof a.event.actions)return a.event.actions.call(b,a);c.isArray(a.event.actions)||(a.event.actions=[a.event.actions]);var e=!1;c.map(a.event.actions,function(f){if(!e){if("function"!=typeof b[f])throw new Error("executeEventActionChain : the action : "+f+" has not been found when firing event : "+a.event.selector);var g=c.has(a,"dom_el")&&-1!=a.dom_el.length?a.dom_el:d.container;g.trigger("before_"+f,c.omit(a,"event"));var h=b[f].call(b,a);!1===h&&(e=!0),g.trigger("after_"+f,c.omit(a,"event"))}})}})}(wp.customize,jQuery,_),function(a,b,c){a.czr_wpQueryDataReady=b.Deferred(),a.czr_wpQueryInfos=a.czr_wpQueryInfos||new a.Value,a.czr_partials=a.czr_partials||new a.Value,a.bind("ready",function(){a.previewer.bind("houston-widget-settings",function(b){var d=c.filter(b.registeredSidebars,function(a){return!c.findWhere(_wpCustomizeWidgetsSettings.registeredSidebars,{id:a.id})}),e=c.filter(b.registeredSidebars,function(a){return!c.has(b.renderedSidebars,a.id)});e=c.map(e,function(a){return a.id});var f=c.map(b.registeredSidebars,function(a){return a.id});a.czr_widgetZoneSettings=a.czr_widgetZoneSettings||new a.Value,a.czr_widgetZoneSettings.set({actives:b.renderedSidebars,inactives:e,registered:f,candidates:d,available_locations:b.availableWidgetLocations})}),a.previewer.bind("czr-query-data-ready",function(b){a.czr_wpQueryInfos(b),"pending"==a.czr_wpQueryDataReady.state()&&a.czr_wpQueryDataReady.resolve(b)}),a.previewer.bind("czr-partial-refresh-data",function(b){a.czr_partials.set(b)}),a.previewer.bind("czr-partial-refresh-done",function(b){if(c.has(b,"set_id")){var d=a.CZR_Helpers.build_setId(b.set_id);if(a.has(d)){var e=a.CZR_Helpers.getControlSettingId(d);a.control.has(e)&&a.control(e).trigger("czr-partial-refresh-done")}}})})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{initialize:function(d,e){if(c.isUndefined(e.input_parent)||c.isEmpty(e.input_parent))throw new Error("No input_parent assigned to input "+e.id+". Aborting");if(c.isUndefined(e.module))throw new Error("No module assigned to input "+e.id+". Aborting");a.Value.prototype.initialize.call(this,null,e);var f=this;if(b.extend(f,e||{}),f.isReady=b.Deferred(),c.isUndefined(e.input_value)||f.set(e.input_value),a.czrInputMap&&c.has(a.czrInputMap,f.type)){var g=a.czrInputMap[f.type];c.isFunction(f[g])&&f[g](e.input_options||null)}else a.consoleLog("Warning an input : "+f.id+" has no corresponding method defined in api.czrInputMap.");var h={text:"keyup",textarea:"keyup",password:"keyup",color:"colorpickerchange",range:"input propertychange"};f.input_event_map=[{trigger:b.trim(["change",h[f.type]||""].join(" ")),selector:"input[data-type], select[data-type], textarea[data-type]",name:"set_input_value",actions:function(a){if(!c.has(f.input_parent,"syncElements")||!c.has(f.input_parent.syncElements,f.id))throw new Error("WARNING : THE INPUT "+f.id+" HAS NO SYNCED ELEMENT.")}}],f.visible=new a.Value((!0)),f.isReady.done(function(){f.visible.bind(function(a){a?f.container.stop(!0,!0).slideDown(200):f.container.stop(!0,!0).slideUp(200)})})},ready:function(){var a=this;a.setupDOMListeners(a.input_event_map,{dom_el:a.container},a),a.callbacks.add(function(){return a.inputReact.apply(a,arguments)}),b.when(a.setupSynchronizer()).done(function(){a.isReady.resolve(a)})},setupSynchronizer:function(){var b=this,c=b.input_parent,d=b.container.find("[data-type]"),e=b.container.find("[data-type]").is("textarea");if(e)throw new Error("TO DO : THE TEXTAREA INPUT ARE NOT READY IN THE SYNCHRONIZER!");var f=new a.Element(d);c.syncElements=c.syncElements||{},c.syncElements[b.id]=f,f.sync(b),f.set(b())},inputReact:function(a,b,d){var e=this,f=e.input_parent(),g=c.clone(f),h=e.is_preItemInput;g=!c.isObject(g)||c.isEmpty(g)?{}:g,g[e.id]=a,e.input_parent.set(g,{input_changed:e.id,input_transport:e.transport,not_preview_sent:"postMessage"===e.transport}),h||(e.input_parent.trigger(e.id+":changed",a),c.isEmpty(b)&&(c.isUndefined(b)||"postMessage"!==e.transport)||e.module.sendInputToPreview({input_id:e.id,input_parent_id:e.input_parent.id,to:a,from:b}))},setupColorPicker:function(){var a=this;a.container.find("input").iris({palettes:!0,hide:!1,change:function(a,c){b(this).val(c.color.toString()).trigger("colorpickerchange").trigger("change")}})},setupSelect:function(){var a=this;b("select",a.container).not(".no-selecter-js").each(function(){b(this).selecter({})})},setupIcheck:function(a){var c=this;b("input[type=checkbox]",c.container).each(function(a){0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",checkedClass:"checked",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},setupStepper:function(a){var c=this;b('input[type="number"]',c.container).each(function(a){b(this).stepper()})},setupRangeSlider:function(a){var c,d=this,e=function(a,b){a.textContent=b+"%"};b(d.container).find("input").rangeslider({polyfill:!1,rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",onInit:function(){c=b(".rangeslider__handle",this.$range),b(".rangeslider__handle",this.$range),e(c[0],this.value)}}).on("input",function(){e(c[0],this.value)})}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupImageUploader:function(){var a=this,c=a();return a.attachment={},a.container?(this.tmplRendered=b.Deferred(),this.setupContentRendering(c,{}),void this.tmplRendered.done(function(){a.czrImgUploaderBinding()})):this},setupContentRendering:function(a,b){var d,e=this;e.attachment.id!=a&&b!==a?(a||(e.attachment={},e.renderImageUploaderTemplate()),d=wp.media.attachment(a),c.isObject(d)&&c.has(d,"attributes")&&c.has(d.attributes,"sizes")?(e.attachment=d.attributes,e.renderImageUploaderTemplate()):wp.media.attachment(a).fetch().done(function(){e.attachment=this.attributes,e.renderImageUploaderTemplate()})):e.attachment.id&&e.attachment.id!==a||e.renderImageUploaderTemplate()},czrImgUploaderBinding:function(){var a=this;c.bindAll(a,"czrImgUploadRemoveFile","czrImgUploadOpenFrame","czrImgUploadSelect"),a.container.on("click keydown",".upload-button",a.czrImgUploadOpenFrame),a.container.on("click keydown",".thumbnail-image img",a.czrImgUploadOpenFrame),a.container.on("click keydown",".remove-button",a.czrImgUploadRemoveFile),a.bind(a.id+":changed",function(c,d){a.tmplRendered=b.Deferred(),a.setupContentRendering(c,d)})},czrImgUploadOpenFrame:function(b){a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),this.frame||this.czrImgUploadInitFrame(),this.frame.open())},czrImgUploadInitFrame:function(){var a=this,b=this.getUploaderLabels();a.frame=wp.media({button:{text:b.frame_button},states:[new wp.media.controller.Library({title:b.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1})]}),a.frame.on("select",a.czrImgUploadSelect)},czrImgUploadRemoveFile:function(b){var c=this;a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),c.attachment={},c.set(""))},czrImgUploadSelect:function(){var a=this,b=a.frame.state().get("selection").first().toJSON();window._wpmejsSettings||{};a.attachment=b,a.set(b.id)},renderImageUploaderTemplate:function(){var a=this;if(0!==b("#tmpl-czr-input-img-uploader-view-content").length){var c=wp.template("czr-input-img-uploader-view-content");if(c&&a.container){var d=a.container.find("."+a.module.control.css_attr.img_upload_container);if(d.length){var e={button_labels:a.getUploaderLabels(),settings:a.id,attachment:a.attachment,canUpload:!0};return d.html(c(e)),a.tmplRendered.resolve(),a.container.trigger(a.id+":content_rendered"),!0}}}},getUploaderLabels:function(){var b=serverControlParams.i18n,d={select:b.select_image,change:b.change_image,remove:b.remove_image,"default":b.default_image,placeholder:b.placeholder_image,frame_title:b.frame_title_image,frame_button:b.frame_button_image};return c.each(d,function(b,d){if(c.isUndefined(b)){var e=this;return a.errorLog("A translated string is missing ( "+d+" ) for the image uploader input in module : "+e.module.id),""}}),d}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupContentPicker:function(d){var e=this,f=[];b.extend({post:"",taxonomy:""},c.isObject(d)?d:{}),e.wpObjectTypes=d,e.container.find(".czr-input").append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>'),f=[{trigger:"change",selector:"select[data-select-type]",name:"set_input_value",actions:function(d){var f=b(d.dom_event.currentTarget,d.dom_el),g=b(f,d.dom_el).select2("data"),h={},i={id:"",type_label:"",title:"",object_type:"",url:""};return g=c.isArray(g)?g[0]:g,!c.isObject(g)||c.isEmpty(g)?void a.consoleLog("Content Picker Input : the picked value should be an object not empty."):(c.each(i,function(b,d){return"_custom_"===g.id||c.has(g,d)&&!c.isEmpty(g[d])?void(h[d]=g[d]):void a.consoleLog("content_picker : missing input param : "+d)}),void e.set(h))}}],e.setupDOMListeners(f,{dom_el:e.container},e),e.setupContentSelecter()},setupContentSelecter:function(){var a=this;a.container.find("select").select2({placeholder:{id:"-1",title:"Select"},data:a.setupSelectedContents(),ajax:{url:serverControlParams.AjaxUrl,type:"POST",dataType:"json",delay:250,debug:!0,data:function(b){var c=b.page?b.page-1:0;return c=b.term?b.page:c,{action:b.term?"search-available-content-items-customizer":"load-available-content-items-customizer",search:b.term,wp_customize:"on",page:c,wp_object_types:JSON.stringify(a.wpObjectTypes),CZRCpNonce:serverControlParams.CZRCpNonce}},processResults:function(b,d){if(a.defaultContentPickerOption=a.defaultContentPickerOption||[],!b.success)return{results:a.defaultContentPickerOption};var e=b.data.items,f=c.clone(a.defaultContentPickerOption);return c.each(e,function(a){f.push({id:a.id,title:a.title,type_label:a.type_label,object_type:a.object,url:a.url})}),{results:f,pagination:{more:10==b.data.items.length}}}},templateSelection:a.czrFormatContentSelected,templateResult:a.czrFormatContentSelected,escapeMarkup:function(a){return a}})},czrFormatContentSelected:function(a){if(a.loading)return a.text;var b="<div class='content-picker-item clearfix'><div class='content-item-bar'><span class='item-title'>"+a.title+"</span>";return a.type_label&&(b+="<span class='item-type'>"+a.type_label+"</span>"),b+="</div></div>"},setupSelectedContents:function(){var a=this,b=a();return b}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupTextEditor:function(){var c=this;c();if(!c.container)throw new Error("The input container is not set for WP text editor in module."+c.module.id);c.czrRenderInputTextEditorTemplate()&&(c.editor=tinyMCE("czr-customize-content_editor"),c.textarea=b("#czr-customize-content_editor"),c.editorPane=b("#czr-customize-content_editor-pane"),c.dragbar=b("#czr-customize-content_editor-dragbar"),c.editorFrame=b("#czr-customize-content_editor_ifr"),c.mceTools=b("#wp-czr-customize-content_editor-tools"),c.mceToolbar=c.editorPane.find(".mce-toolbar-grp"),c.mceStatusbar=c.editorPane.find(".mce-statusbar"),c.preview=b("#customize-preview"),c.collapse=b(".collapse-sidebar"),c.textpreview=c.container.find("textarea"),c.toggleButton=c.container.find("button.text_editor-button"),c.editorExpanded=new a.Value((!1)),c.czrUpdateTextPreview(),c.czrSetToggleButtonText(c.editorExpanded()),c.czrTextEditorBinding(),c.czrResizeEditorOnUserRequest())},czrTextEditorBinding:function(){var d=this,e=d.editor,f=d.textarea,g=d.toggleButton,h=(d.editorExpanded,d.editorPane);d.bind(d.id+":changed",d.czrUpdateTextPreview),c.bindAll(d,"czrOnVisualEditorChange","czrOnTextEditorChange","czrResizeEditorOnWindowResize"),g.on("click",function(){d.editorExpanded.set(!d.editorExpanded()),d.editorExpanded()&&e.focus()}),d.module.czr_ModuleState.bind(function(a){"expanded"!=a&&d.editorExpanded.set(!1)}),d.editorExpanded.bind(function(c){a.consoleLog("in input.editorExpanded",c,d()),e.locker&&e.locker!==d&&(e.locker.editorExpanded.set(!1),e.locker=null),e.locker&&e.locker!==d||(b(document.body).toggleClass("czr-customize-content_editor-pane-open",c),e.locker=d),d.czrSetToggleButtonText(c),c?(e.setContent(wp.editor.autop(d())),e.on("input change keyup",d.czrOnVisualEditorChange),f.on("input",d.czrOnTextEditorChange),d.czrResizeEditor(window.innerHeight-h.height()),b(window).on("resize",d.czrResizeEditorOnWindowResize)):(e.off("input change keyup",d.czrOnVisualEditorChange),f.off("input",d.czrOnTextEditorChange),b(window).off("resize",d.czrResizeEditorOnWindowResize),d.czrResizeReset())})},czrOnVisualEditorChange:function(){
15
- var a,b=this,c=b.editor;a=wp.editor.removep(c.getContent()),b.set(a)},czrOnTextEditorChange:function(){var a,b=this,c=b.textarea;a=c.val(),b.set(a)},czrUpdateTextPreview:function(){var a,b=this,c=b();a=c.replace(/(<([^>]+)>)/gi,""),a.length>30&&(a=a.substring(0,34)+"..."),b.textpreview.val(a)},czrRenderInputTextEditorTemplate:function(){var c=this;if(0===b("#tmpl-czr-input-text_editor-view-content").length)throw new Error("Missing js template for text editor input in module : "+c.module.id);var d=wp.template("czr-input-text_editor-view-content"),e=c.container.find("input");if(d&&c.container)return a.consoleLog("Model injected in text editor tmpl : ",c()),e.after(d(c())),!0},czrIsEditorExpanded:function(){return b(document.body).hasClass("czr-customize-content_editor-pane-open")},czrResizeReset:function(){var a=this,b=a.preview,c=a.collapse,d=a.container.closest("ul.accordion-section-content");d.css("padding-bottom",""),b.css("bottom",""),c.css("bottom","")},czrResizeEditor:function(a){var b=window.innerHeight,d=window.innerWidth,e=40,f=1,g=782,h=56,i=8,j=4,k={},l=this,m=l.container.closest("ul.accordion-section-content"),n=l.mceTools,o=l.mceToolbar,p=l.mceStatusbar,q=l.preview,r=l.collapse,s=l.editorPane,t=l.editorFrame;l.editorExpanded()&&(c.isNaN(a)||(resizeHeight=b-a),k.height=resizeHeight,k.components=n.outerHeight()+o.outerHeight()+p.outerHeight(),resizeHeight<e&&(k.height=e),resizeHeight>b-f&&(k.height=b-f),b<s.outerHeight()&&(k.height=b),q.css("bottom",k.height),s.css("height",k.height),t.css("height",k.height-k.components),r.css("bottom",k.height+i),h>b-k.height&&r.css("bottom",p.outerHeight()+j),d<=g?m.css("padding-bottom",k.height):m.css("padding-bottom",""))},czrResizeEditorOnWindowResize:function(){var a=this,b=50,d=a.editorPane;a.editorExpanded()&&c.delay(function(){a.czrResizeEditor(window.innerHeight-d.height())},b)},czrResizeEditorOnUserRequest:function(){var a=this,c=a.dragbar,d=a.editorFrame;c.on("mousedown",function(){a.editorExpanded()&&b(document).on("mousemove.czr-customize-content_editor",function(c){c.preventDefault(),b(document.body).addClass("czr-customize-content_editor-pane-resize"),d.css("pointer-events","none"),a.czrResizeEditor(c.pageY)})}),c.on("mouseup",function(){a.editorExpanded()&&(b(document).off("mousemove.czr-customize-content_editor"),b(document.body).removeClass("czr-customize-content_editor-pane-resize"),d.css("pointer-events",""))})},czrSetToggleButtonText:function(a){var b=this;b.toggleButton.text(serverControlParams.i18n.mods.textEditor[a?"Close Editor":"Edit"])}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{initialize:function(d,e){if(c.isUndefined(e.module)||c.isEmpty(e.module))throw new Error("No module assigned to item "+d+". Aborting");var f=this;a.Value.prototype.initialize.call(f,null,e),f.isReady=b.Deferred(),f.embedded=b.Deferred(),f.container=null,f.contentContainer=null,f.inputCollection=new a.Value({}),f.viewState=new a.Value("closed"),f.removeDialogVisible=new a.Value((!1)),b.extend(f,e||{}),f.defaultItemModel=c.clone(e.defaultItemModel)||{id:"",title:""};var g=b.extend(f.defaultItemModel,e.initial_item_model);f.set(g),f.userEventMap=new a.Value([{trigger:"click keydown",selector:["."+f.module.control.css_attr.display_alert_btn,"."+f.module.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:function(){var a=this.removeDialogVisible();this.module.closeRemoveDialogs(),this.removeDialogVisible(!a)}},{trigger:"click keydown",selector:"."+f.module.control.css_attr.remove_view_btn,name:"remove_item",actions:["removeItem"]},{trigger:"click keydown",selector:["."+f.module.control.css_attr.edit_view_btn,"."+f.module.control.css_attr.item_title].join(","),name:"edit_view",actions:["setViewVisibility"]},{trigger:"click keydown",selector:".tabs nav li",name:"tab_nav",actions:function(a){this.module.toggleTabVisibility.call(this,a)}}]),f.isReady.done(function(){f.module.updateItemsCollection({item:f()}),f.callbacks.add(function(){return f.itemReact.apply(f,arguments)}),f.bind("contentRendered",function(){if(!c.has(f,"czr_Input")||c.isEmpty(f.inputCollection()))try{a.CZR_Helpers.setupInputCollectionFromDOM.call(f),f.module.setupTabNav.call(f)}catch(b){a.errorLog("In item.isReady.done : "+b)}}),f.bind("contentRemoved",function(){c.has(f,"czr_Input")&&a.CZR_Helpers.removeInputCollection.call(f)}),f.mayBeRenderItemWrapper(),f.embedded.done(function(){f.itemWrapperViewSetup(g)})})},ready:function(){this.isReady.resolve()},itemReact:function(a,b,c){var d=this,e=d.module;c=c||{},e.updateItemsCollection({item:a,data:c}).done(function(){d.writeItemViewTitle(a,c)})}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{_sendItem:function(a,b){var d=this,e=d.module,f=[];c.each(b,function(b,c){b!=a[c]&&f.push(c)}),c.each(f,function(b){e.control.previewer.send("sub_setting",{set_id:e.control.id,id:a.id,changed_prop:b,value:a[b]}),e.trigger("item_sent",{item:a,dom_el:d.container,changed_prop:b})})},removeItem:function(){var a=this,b=this.module,d=c.clone(b.itemCollection());b.trigger("pre_item_dom_remove",a()),a._destroyView(),d=c.without(d,c.findWhere(d,{id:a.id})),b.itemCollection.set(d),b.trigger("pre_item_api_remove",a()),b.czr_Item.remove(a.id)},getModel:function(a){return this()}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{mayBeRenderItemWrapper:function(){var a=this;"pending"==a.embedded.state()&&b.when(a.renderItemWrapper()).done(function(b){if(a.container=b,c.isUndefined(a.container)||!a.container.length)throw new Error("In mayBeRenderItemWrapper the Item view has not been rendered : "+a.id);a.embedded.resolve()})},itemWrapperViewSetup:function(d){var e=this,f=this.module;d=e()||e.initial_item_model,e.writeItemViewTitle();var g=function(a,b,d){if(c.isUndefined(a)||!1===a.length)throw new Error("Module : "+e.module.id+", the item content has not been rendered for "+e.id);e.trigger("contentRendered"),e.contentContainer=a,e.toggleItemExpansion(b,d)};e.module.isMultiItem()?e.viewState.callbacks.add(function(a,d){var h=-1!==a.indexOf("expanded");h?c.isObject(e.contentContainer)&&!1!==e.contentContainer.length?e.toggleItemExpansion(a,d):b.when(e.renderItemContent(e()||e.initial_item_model)).done(function(b){(g=c.debounce(g,50))(b,a,d)}):e.toggleItemExpansion(a,d).done(function(){c.isObject(e.contentContainer)&&!1!==e.contentContainer.length&&(e.trigger("beforeContenRemoved"),b("."+f.control.css_attr.item_content,e.container).children().each(function(){b(this).remove()}),b("."+f.control.css_attr.item_content,e.container).html(""),e.contentContainer=null,e.trigger("contentRemoved"))})}):(e.viewState.callbacks.add(function(a,b){e.toggleItemExpansion.apply(e,arguments)}),b.when(e.renderItemContent(d)).done(function(a){g(a,!0)})),a.CZR_Helpers.setupDOMListeners(e.userEventMap(),{model:d,dom_el:e.container},e),e.removeDialogVisible.bind(function(d){var f=e.module,g=b("."+f.control.css_attr.remove_alert_wrapper,e.container).first();if(d&&f.closeAllItems(),d&&f.hasModOpt()&&a.czr_ModOptVisible(!1),d&&c.has(f,"preItem")&&f.preItemExpanded(!1),b("."+f.control.css_attr.remove_alert_wrapper,e.container).not(g).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+f.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),d){if(!wp.template(f.AlertPart)||!e.container)return void a.consoleLog("No removal alert template available for items in module :"+f.id);g.html(wp.template(f.AlertPart)({title:e().title||e.id}))}var h=function(a){g.toggleClass("open",a),e.container.find("."+f.control.css_attr.display_alert_btn).toggleClass("active",a),a&&f._adjustScrollExpandedBlock(e.container)};d?g.stop(!0,!0).slideDown(200,function(){h(d)}):g.stop(!0,!0).slideUp(200,function(){h(d)})})},renderItemWrapper:function(a){var c=this,d=c.module;if(a=a||c(),$_view_el=b("<li>",{"class":d.control.css_attr.single_item,"data-id":a.id,id:a.id}),d.itemsWrapper.append($_view_el),d.isMultiItem()){var e=d.getTemplateEl("rudItemPart",a);if(0===b("#tmpl-"+e).length)throw new Error("Missing template for item "+c.id+". The provided template script has no been found : #tmpl-"+d.getTemplateEl("rudItemPart",a));$_view_el.append(b(wp.template(e)(a)))}return $_view_el.append(b("<div/>",{"class":d.control.css_attr.item_content})),$_view_el},renderItemContent:function(a){var c=this,d=this.module;if(a=a||c(),0===b("#tmpl-"+d.getTemplateEl("itemInputList",a)).length)throw new Error("No item content template defined for module "+d.id+". The template script id should be : #tmpl-"+d.getTemplateEl("itemInputList",a));var e=wp.template(d.getTemplateEl("itemInputList",a));return e?(b(e(a)).appendTo(b("."+d.control.css_attr.item_content,c.container)),b(b(e(a)),c.container)):this},writeItemViewTitle:function(d){var e=this,f=e.module,g=d||e(),h=c.has(g,"title")?a.CZR_Helpers.capitalize(g.title):g.id;h=a.CZR_Helpers.truncate(h,20),b("."+f.control.css_attr.item_title,e.container).text(h),a.CZR_Helpers.doActions("after_writeViewTitle",e.container,g,e)},setViewVisibility:function(a,b){var d=this,e=this.module;b?d.viewState.set("expanded_noscroll"):(e.closeAllItems(d.id),c.has(e,"preItem")&&e.preItemExpanded.set(!1),d.viewState.set("expanded"==d._getViewState()?"closed":"expanded"))},_getViewState:function(){return-1==this.viewState().indexOf("expanded")?"closed":"expanded"},toggleItemExpansion:function(a,c,d){var e="closed"!=a,f=this,g=this.module,h=b("."+g.control.css_attr.item_content,f.container).first(),i=b.Deferred(),j=function(b){f.container.toggleClass("open",b),b&&g.closeRemoveDialogs();var c=h.siblings().find("."+g.control.css_attr.edit_view_btn);c.toggleClass("active",b),b?c.removeClass("fa-pencil").addClass("fa-minus-square").attr("title",serverControlParams.i18n.close):c.removeClass("fa-minus-square").addClass("fa-pencil").attr("title",serverControlParams.i18n.edit),"expanded"==a&&g._adjustScrollExpandedBlock(f.container),i.resolve()};return e?h.stop(!0,!0).slideDown(d||200,function(){j(e)}):h.stop(!0,!0).slideUp(200,function(){j(e)}),i.promise()},_destroyView:function(a){this.container.fadeOut({duration:a||400,done:function(){b(this).remove()}})}})}(wp.customize,jQuery,_);var CZRModOptMths=CZRModOptMths||{};!function(a,b,c){b.extend(CZRModOptMths,{initialize:function(d){if(c.isUndefined(d.module)||c.isEmpty(d.module))throw new Error("No module assigned to modOpt.");var e=this;a.Value.prototype.initialize.call(e,null,d),e.isReady=b.Deferred(),e.container=null,e.inputCollection=new a.Value({}),b.extend(e,d||{}),e.defaultModOptModel=c.clone(d.defaultModOptModel)||{is_mod_opt:!0};var f=b.extend(e.defaultModOptModel,d.initial_modOpt_model),g=e.module.control;e.set(f),a.czr_ModOptVisible=new a.Value((!1)),a.czr_ModOptVisible.bind(function(c){c?(e.module.closeRemoveDialogs(),e.modOptWrapperViewSetup(f).done(function(b){e.container=b;try{a.CZR_Helpers.setupInputCollectionFromDOM.call(e).toggleModPanelView(c)}catch(d){a.consoleLog(d)}})):e.toggleModPanelView(c).done(function(){!1!==e.container.length?b.when(e.container.remove()).done(function(){a.CZR_Helpers.removeInputCollection.call(e)}):a.CZR_Helpers.removeInputCollection.call(e),e.container=null})}),e.isReady.done(function(){b("."+g.css_attr.edit_modopt_icon,g.container).length||b.when(g.container.find(".customize-control-title").first().append(b("<span/>",{"class":[g.css_attr.edit_modopt_icon,"fa fa-cog"].join(" "),title:serverControlParams.i18n.Settings}))).done(function(){b("."+g.css_attr.edit_modopt_icon,g.container).fadeIn(400)}),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:"."+g.css_attr.edit_modopt_icon,name:"toggle_mod_option",actions:function(){a.czr_ModOptVisible(!a.czr_ModOptVisible())}}],{dom_el:g.container},e)})},ready:function(){this.isReady.resolve()}})}(wp.customize,jQuery,_);var CZRModOptMths=CZRModOptMths||{};!function(a,b,c){b.extend(CZRModOptMths,{modOptWrapperViewSetup:function(d){var e=this,f=this.module,g=b.Deferred(),h=function(b){a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:"."+f.control.css_attr.close_modopt_icon,name:"close_mod_option",actions:function(){a.czr_ModOptVisible(!1)}},{trigger:"click keydown",selector:".tabs nav li",name:"tab_nav",actions:function(a){this.module.toggleTabVisibility.call(this,a)}}],{dom_el:b},e)};return d=e()||e.initial_modOpt_model,b.when(e.renderModOptContent(d)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module : "+e.module.id+", the modOpt content has not been rendered");h(a),g.resolve(a)}).then(function(){e.module.setupTabNav.call(e)}),g.promise()},renderModOptContent:function(c){var d=this,e=this.module;if(c=c||d(),0===b("#tmpl-"+e.getTemplateEl("modOptInputList",c)).length)return void a.errorLog("renderModOptContent : No modOpt content template defined for module "+e.id+". The template script id should be : #tmpl-"+e.getTemplateEl("modOptInputList",c));var f=wp.template(e.getTemplateEl("modOptInputList",c));if(!f)return this;var g="";try{g=[serverControlParams.i18n["Options for"],e.control.params.label].join(" ")}catch(h){a.errorLog("In renderModOptContent : "+h),g=serverControlParams.i18n.Settings}return b("#widgets-left").after(b("<div/>",{"class":e.control.css_attr.mod_opt_wrapper,html:[['<h2 class="mod-opt-title">',g,"</h2>"].join(""),'<span class="fa fa-times '+e.control.css_attr.close_modopt_icon+'" title="close"></span>'].join("")})),b("."+e.control.css_attr.mod_opt_wrapper).append(b(f(c))),b("."+e.control.css_attr.mod_opt_wrapper)},toggleModPanelView:function(a){var d=this.module,e=(d.control,b.Deferred());return d.control.container.toggleClass("czr-modopt-visible",a),b("body").toggleClass("czr-editing-modopt",a),c.delay(function(){e.resolve()},200),e.promise()}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{initialize:function(d,e){if(c.isUndefined(e.control)||c.isEmpty(e.control))throw new Error("No control assigned to module "+d);var f=this;a.Value.prototype.initialize.call(this,null,e),f.isReady=b.Deferred(),b.extend(f,e||{}),b.extend(f,{crudModulePart:"czr-crud-module-part",rudItemPart:"czr-rud-item-part",ruItemPart:"czr-ru-item-part",itemInputList:"",modOptInputList:"",AlertPart:"czr-rud-item-alert-part"}),f.embedded=b.Deferred(),f.isInSektion()||(f.container=b(f.control.selector),f.embedded.resolve()),f.embedded.done(function(){b.when(f.renderModuleParts()).done(function(a){if(!1===a.length)throw new Error("The items wrapper has not been rendered for module : "+f.id);f.itemsWrapper=a})}),f.defaultAPImodOptModel={initial_modOpt_model:{},defaultModOptModel:{},control:{},module:{}},f.defaultModOptModel={},f.modOptConstructor=a.CZRModOpt,f.itemCollection=new a.Value([]),f.defaultAPIitemModel={id:"",initial_item_model:{},defaultItemModel:{},control:{},module:{},is_added_by_user:!1},f.defaultItemModel={id:"",title:""},f.itemConstructor=a.CZRItem,f.czr_Item=new a.Values,f.inputConstructor=a.CZRInput,f.hasModOpt()&&(f.inputModOptConstructor=a.CZRInput),f.inputOptions={},f.isReady.done(function(){f.isDirty=new a.Value(e.dirty||!1),f.initializeModuleModel(e).done(function(a){f.set(a)}).fail(function(b){a.consoleLog("Module : "+f.id+" initialize module model failed : ",b)}).always(function(a){f.callbacks.add(function(){return f.moduleReact.apply(f,arguments)}),f.control.isModuleRegistered(f.id)||f.control.updateModulesCollection({module:e,is_registered:!1}),f.bind("items-collection-populated",function(a){f.itemCollection.callbacks.add(function(){return f.itemCollectionReact.apply(f,arguments)}),f.isMultiItem()&&f._makeItemsSortable()}),f.isInSektion()||f.populateSavedItemCollection(),f.hasModOpt()&&f.instantiateModOpt()})})},ready:function(){var a=this;a.isReady.resolve()},initializeModuleModel:function(a){var d=this,e=b.Deferred();if(!d.isMultiItem()&&!d.isCrud()&&c.isEmpty(a.items)){var f=c.clone(d.defaultItemModel);a.items=[b.extend(f,{id:d.id})]}return e.resolve(a).promise()},itemCollectionReact:function(a,c,d){var e=this,f=e(),g=b.extend(!0,{},f);g.items=a,e.isDirty.set(!0),e.set(g,d||{})},moduleReact:function(a,d,e){var f=this,g=f.control;c.size(d.items)==c.size(a.items)&&!c.isEmpty(c.difference(a.items,d.items)),a.column_id!=d.column_id;g.updateModulesCollection({module:b.extend(!0,{},a),data:e})},getModuleSection:function(){return this.section},isInSektion:function(){var a=this;return c.has(a,"sektion_id")},isMultiItem:function(){return a.CZR_Helpers.isMultiItemModule(null,this)},isCrud:function(){return a.CZR_Helpers.isCrudModule(null,this)},hasModOpt:function(){return a.CZR_Helpers.hasModuleModOpt(null,this)},instantiateModOpt:function(){var a=this,c=a.prepareModOptForAPI(a().modOpt||{});a.czr_ModOpt=new a.modOptConstructor(c),a.czr_ModOpt.ready(),a.czr_ModOpt.callbacks.add(function(c,d,e){var f=a(),g=b.extend(!0,{},f);g.modOpt=c,a.isDirty(!0),a(g,e)})},prepareModOptForAPI:function(a){var b=this,d={};return a=c.isObject(a)?a:{},c.each(b.defaultAPImodOptModel,function(e,f){a[f];switch(f){case"initial_modOpt_model":c.each(b.getDefaultModOptModel(),function(b,d){c.has(a,d)||(a[d]=b)}),d[f]=a;break;case"defaultModOptModel":d[f]=c.clone(b.defaultModOptModel);break;case"control":d[f]=b.control;break;case"module":d[f]=b}}),d},getDefaultModOptModel:function(a){var d=this;return b.extend(c.clone(d.defaultModOptModel),{is_mod_opt:!0})},sendInputToPreview:function(d){var e=this;d=c.extend({input_id:"",input_parent_id:"",to:null,from:null},d),c.isEqual(d.to,d.from)||(e.control.previewer.send("czr_input",{set_id:a.CZR_Helpers.getControlSettingId(e.control.id),module_id:e.id,module:{items:b.extend(!0,{},e().items),modOpt:e.hasModOpt()?b.extend(!0,{},e().modOpt):{}},input_parent_id:d.input_parent_id,input_id:d.input_id,value:d.to}),e.trigger("input_sent",{input:d.to,dom_el:e.container}))},sendModuleInputsToPreview:function(){var a=this,d=function(){var d=this,e=b.extend(!0,{},d());e=c.omit(e,"id"),c.each(e,function(b,c){a.sendInputToPreview({input_id:c,input_parent_id:d.id,to:b,from:null})})};a.czr_Item.each(function(a){d.call(a)}),a.hasModOpt()&&d.call(a.czr_ModOpt)}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{populateSavedItemCollection:function(){var b=this,d=[];return c.isArray(b().items)?(c.each(b().items,function(a,b){c.has(a,"id")&&!c.has(a,"is_mod_opt")&&d.push(a)}),c.each(d,function(c,d){try{b.instantiateItem(c).ready()}catch(e){a.errorLog("populateSavedItemCollection : "+e)}}),c.each(d,function(a){if(c.isUndefined(c.findWhere(b.itemCollection(),a.id)))throw new Error("populateSavedItemCollection : The saved items have not been properly populated in module : "+b.id)}),void b.trigger("items-collection-populated")):void a.errorLog("populateSavedItemCollection : The saved items collection must be an array in module :"+b.id)},instantiateItem:function(a,b){var d=this;if(item_candidate=d.prepareItemForAPI(a),!c.has(item_candidate,"id"))throw new Error("CZRModule::instantiateItem() : an item has no id and could not be added in the collection of : "+this.id);if(d.czr_Item.has(item_candidate.id))throw new Error("CZRModule::instantiateItem() : the following item id "+item_candidate.id+" already exists in module.czr_Item() for module "+this.id);if(d.czr_Item.add(item_candidate.id,new d.itemConstructor(item_candidate.id,item_candidate)),!d.czr_Item.has(item_candidate.id))throw new Error("CZRModule::instantiateItem() : instantiation failed for item id "+item_candidate.id+" for module "+this.id);return d.czr_Item(item_candidate.id)},prepareItemForAPI:function(a){var b=this,d={};return a=c.isObject(a)?a:{},c.each(b.defaultAPIitemModel,function(e,f){var g=a[f];switch(f){case"id":c.isEmpty(g)?d[f]=b.generateItemId(b.module_type):d[f]=g;break;case"initial_item_model":c.each(b.getDefaultItemModel(),function(b,d){c.has(a,d)||(a[d]=b)}),d[f]=a;break;case"defaultItemModel":d[f]=c.clone(b.defaultItemModel);break;case"control":d[f]=b.control;break;case"module":d[f]=b;break;case"is_added_by_user":d[f]=!!c.isBoolean(g)&&g}}),c.has(d,"id")||(d.id=b.generateItemId(b.module_type)),d.initial_item_model.id=d.id,d},generateItemId:function(a,b,d){if(d=d||1,d>100)throw new Error("Infinite loop when generating of a module id.");var e=this;b=b||e._getNextItemKeyInCollection();var f=a+"_"+b;if(!c.has(e,"itemCollection")||!c.isArray(e.itemCollection()))throw new Error("The item collection does not exist or is not properly set in module : "+e.id);return e.isItemRegistered(f)?(b++,d++,e.generateItemId(a,b,d)):f},_getNextItemKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.itemCollection())?d:(b=c.isArray(a.itemCollection())&&1===c.size(a.itemCollection())?a.itemCollection()[0]:c.max(a.itemCollection(),function(a){return c.isNumber(a.id.replace(/[^\/\d]/g,""))?parseInt(a.id.replace(/[^\/\d]/g,""),10):0}),!c.isUndefined(b)&&c.isNumber(b.id.replace(/[^\/\d]/g,""))&&(d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d)},isItemRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.itemCollection(),{id:a}))},updateItemsCollection:function(a){var d=this,e=d.itemCollection(),f=c.clone(e),g=b.Deferred();if(c.has(a,"collection"))return void d.itemCollection.set(a.collection);if(!c.has(a,"item"))throw new Error("updateItemsCollection, no item provided "+d.control.id+". Aborting");a=c.extend({data:{}},a);var h=c.clone(a.item);return c.findWhere(f,{id:h.id})?c.each(e,function(a,b){a.id==h.id&&(f[b]=h)}):f.push(h),d.itemCollection.set(f,a.data),g.resolve({collection:f,data:a.data}).promise()},_getSortedDOMItemCollection:function(){var a=this,d=c.clone(a.itemCollection()),e=[],f=b.Deferred();if(b("."+a.control.css_attr.single_item,a.container).each(function(a){var f=c.findWhere(d,{id:b(this).attr("data-id")});f&&(e[a]=f)}),d.length!=e.length)throw new Error("There was a problem when re-building the item collection from the DOM in module : "+a.id);return f.resolve(e).promise()},refreshItemCollection:function(){var c=this;c.czr_Item.each(function(a){b.when(c.czr_Item(a.id).container.remove()).done(function(){c.czr_Item.remove(a.id)})}),c.itemCollection=new a.Value([]),c.populateSavedItemCollection()}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{getDefaultItemModel:function(a){var d=this;return b.extend(c.clone(d.defaultItemModel),{id:a||""})},_initNewItem:function(a,d){var e,f=this,g={id:""};return d="undefined"!=typeof d?d:c.size(f.itemCollection()),c.isNumber(d)?e=f.module_type+"_"+d:(e=d,d=0),g=a&&!c.isEmpty(a)?b.extend(a,{id:e}):this.getDefaultItemModel(e),c.has(g,"id")&&f._isItemIdPossible(e)?(c.map(f.getDefaultItemModel(),function(a,b){c.has(g,b)||(g[b]=a)}),g):f._initNewItem(g,d+1)}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{renderModuleParts:function(){var a=this,c=a.isInSektion()?b(a.container).find(".czr-mod-content"):b(a.container);if(a.isCrud()){if(0===b("#tmpl-"+a.crudModulePart).length)throw new Error("No crud Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.crudModulePart);c.append(b(wp.template(a.crudModulePart)({})))}var d=b("<ul/>",{"class":[a.control.css_attr.items_wrapper,a.module_type,a.isMultiItem()?"multi-item-mod":"mono-item-mod",a.isCrud()?"crud-mod":"not-crud-mod"].join(" ")});return c.append(d),b(d,c)},getTemplateEl:function(a,b){var d,e=this;switch(a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"modOptInputList":d=e.modOptInputList;break;case"itemInputList":d=e.itemInputList}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl() "+e.id+". Aborting");return d},getViewEl:function(a){var c=this;return b('[data-id = "'+a+'"]',c.container)},closeAllItems:function(a){var b=this,d=c.clone(b.itemCollection()),e=c.filter(d,function(b){return b.id!=a});return c.each(e,function(a){b.czr_Item.has(a.id)&&"expanded"==b.czr_Item(a.id)._getViewState(a.id)&&b.czr_Item(a.id).viewState.set("closed")}),this},_adjustScrollExpandedBlock:function(a,d){if(a.length&&!c.isUndefined(this.getModuleSection())){var e,f=this,g=b(".accordion-section-content",f.section.container),h=g.scrollTop(),i=d||90;setTimeout(function(){a.offset().top+a.height()+i>b(window.top).height()&&(e=a.offset().top+a.height()+i-b(window.top).height(),e>0&&g.animate({scrollTop:h+e},500))},50)}},closeRemoveDialogs:function(){var a=this;if(c.isArray(a.itemCollection()))return a.czr_Item.each(function(a){a.removeDialogVisible(!1)}),this},_makeItemsSortable:function(d){if(!wp.media.isTouchDevice&&b.fn.sortable){var e=this;b("."+e.control.css_attr.items_wrapper,e.container).sortable({handle:"."+e.control.css_attr.item_sort_handle,start:function(){c.has(a,"czrModulePanelState")&&a.czrModulePanelState.set(!1),c.has(a,"czrSekSettingsPanelState")&&a.czrSekSettingsPanelState.set(!1)},update:function(b,d){var f=function(){c.has(e,"preItem")&&e.preItemExpanded.set(!1),e.closeAllItems().closeRemoveDialogs();var b=function(){a.previewer.refresh()};"postMessage"!=a(e.control.id).transport||a.CZR_Helpers.hasPartRefresh(e.control.id)||(b=c.debounce(b,500))(),e.trigger("item-collection-sorted")};e._getSortedDOMItemCollection().done(function(a){e.itemCollection.set(a)}).then(function(){f()})}})}},toggleTabVisibility:function(a){var c=this,d=(b(c.container).find("li"),b(c.container).find("section"),b(a.dom_event.currentTarget,a.dom_el).attr("data-tab-id"));b(".tabs nav li",c.container).each(function(){b(this).removeClass("tab-current").addClass("tab-inactive")}),b(c.container).find('li[data-tab-id="'+d+'"]').addClass("tab-current").removeClass("tab-inactive"),b("section",c.container).each(function(){b(this).removeClass("content-current")}),b(c.container).find('section[id="'+d+'"]').addClass("content-current")},setupTabNav:function(){var a=this,c=function(){var c=b.Deferred(),d=b(".tabs nav li",a.container);d.each(function(){b(this).removeClass("tab-current").addClass("tab-inactive")}),d.first().addClass("tab-current").removeClass("tab-inactive"),b("section",a.container).first().addClass("content-current");var e=d.length;return d.each(function(){b(this).addClass(e>0?"cols-"+e:"")}),c.resolve().promise()};setTimeout(function(){c().done(function(){b(".tabs",a.container).fadeIn(450)})},20)}})}(wp.customize,jQuery,_);var CZRDynModuleMths=CZRDynModuleMths||{};!function(a,b,c){b.extend(CZRDynModuleMths,{initialize:function(c,d){var e=this;a.CZRModule.prototype.initialize.call(e,c,d),b.extend(e,{itemPreAddEl:""}),e.itemAddedMessage=serverControlParams.i18n.successMessage,e.userEventMap=new a.Value([{trigger:"click keydown",selector:["."+e.control.css_attr.open_pre_add_btn,"."+e.control.css_attr.cancel_pre_add_btn].join(","),name:"pre_add_item",actions:["closeAllItems","closeRemoveDialogs","renderPreItemView","setPreItemViewVisibility"]},{trigger:"click keydown",selector:"."+e.control.css_attr.add_new_btn,name:"add_item",actions:["closeRemoveDialogs","closeAllItems","addItem"]}])},ready:function(){var c=this;c.setupDOMListeners(c.userEventMap(),{dom_el:c.container}),c.preItem=new a.Value(c.getDefaultItemModel()),c.preItemEmbedded=b.Deferred(),c.preItemEmbedded.done(function(){c.setupPreItemInputCollection()}),c.preItemExpanded=new a.Value((!1)),c.preItemExpanded.callbacks.add(function(a,b){c._togglePreItemViewExpansion(a)}),a.CZRModule.prototype.ready.call(c)},setupPreItemInputCollection:function(){var c=this;c.preItem.czr_Input=new a.Values,b("."+c.control.css_attr.pre_add_wrapper,c.container).find("."+c.control.css_attr.sub_set_wrapper).each(function(a){var d=b(this).find("[data-type]").attr("data-type")||"sub_set_"+a;c.preItem.czr_Input.add(d,new c.inputConstructor(d,{id:d,type:b(this).attr("data-input-type"),container:b(this),input_parent:c.preItem,module:c,is_preItemInput:!0})),c.preItem.czr_Input(d).ready()})},addItem:function(b){var d=this,e=d.preItem(),f=function(){d.preItemExpanded.set(!1),d._resetPreItemInputs(),d.toggleSuccessMessage("off")};if(c.isEmpty(e)||!c.isObject(e))throw new Error("addItem : an item should be an object and not empty. In : "+d.id+". Aborted.");f=c.debounce(f,2e3),d.instantiateItem(e,!0).ready(),d.czr_Item(e.id).isReady.then(function(){d.toggleSuccessMessage("on"),f(),d.trigger("item_added",e),"postMessage"!=a(d.control.id).transport||!c.has(b,"dom_event")||c.has(b.dom_event,"isTrigger")||a.CZR_Helpers.hasPartRefresh(d.control.id)||d.control.previewer.refresh()})},_resetPreItemInputs:function(){var a=this;a.preItem.set(a.getDefaultItemModel()),a.preItem.czr_Input.each(function(b){var d=b.id;c.has(a.getDefaultItemModel(),d)&&b.set(a.getDefaultItemModel()._input_id)})}})}(wp.customize,jQuery,_);var CZRDynModuleMths=CZRDynModuleMths||{};!function(a,b,c){b.extend(CZRDynModuleMths,{renderPreItemView:function(a){var d=this;if("pending"==d.preItemEmbedded.state()){if(!c.has(d,"itemPreAddEl")||0===b("#tmpl-"+d.itemPreAddEl).length)return this;var e=wp.template(d.itemPreAddEl);if(!e||!d.container)return this;var f=b("."+d.control.css_attr.pre_add_item_content,d.container);f.prepend(e()),d.preItemEmbedded.resolve()}},_getPreItemView:function(){var a=this;return b("."+a.control.css_attr.pre_add_item_content,a.container)},setPreItemViewVisibility:function(a){var b=this;b.preItemExpanded.set(!b.preItemExpanded())},_togglePreItemViewExpansion:function(a){var c=this,d=b("."+c.control.css_attr.pre_add_item_content,c.container);d.slideToggle({duration:200,done:function(){var d=b("."+c.control.css_attr.open_pre_add_btn,c.container);b(this).toggleClass("open",a),a?d.find(".fa").removeClass("fa-plus-square").addClass("fa-minus-square"):d.find(".fa").removeClass("fa-minus-square").addClass("fa-plus-square"),d.toggleClass("active",a),b(c.container).toggleClass(c.control.css_attr.adding_new,a),c._adjustScrollExpandedBlock(b(this),120)}})},toggleSuccessMessage:function(a){var c=this,d=c.itemAddedMessage,e=b("."+c.control.css_attr.pre_add_wrapper,c.container);return $_success_wrapper=b("."+c.control.css_attr.pre_add_success,c.container),"on"==a?($_success_wrapper.find("p").text(d),$_success_wrapper.css("z-index",1000001).css("height",e.height()+"px").css("line-height",e.height()+"px")):$_success_wrapper.attr("style",""),c.container.toggleClass("czr-model-added","on"==a),this}})}(wp.customize,jQuery,_);var CZRSocialModuleMths=CZRSocialModuleMths||{};!function(a,b,c){b.extend(CZRSocialModuleMths,{initialize:function(d,e){var f=this;a.CZRDynModule.prototype.initialize.call(f,d,e),b.extend(f,{itemPreAddEl:"czr-module-social-pre-add-view-content",itemInputList:"czr-module-social-item-content",modOptInputList:"czr-module-social-mod-opt"}),this.social_icons=["500px","adn","amazon","android","angellist","apple","behance","behance-square","bitbucket","bitbucket-square","black-tie","btc","buysellads","chrome","codepen","codiepie","connectdevelop","contao","dashcube","delicious","deviantart","digg","dribbble","dropbox","drupal","edge","empire","envelope","envelope-o","envelope-square","expeditedssl","facebook","facebook-f (alias)","facebook-official","facebook-square","firefox","flickr","fonticons","fort-awesome","forumbee","foursquare","get-pocket","gg","gg-circle","git","github","github-alt","github-square","gitlab","git-square","google","google-plus","google-plus-circle","google-plus-official","google-plus-square","google-wallet","gratipay","hacker-news","houzz","instagram","internet-explorer","ioxhost","joomla","jsfiddle","lastfm","lastfm-square","leanpub","linkedin","linkedin-square","linux","maxcdn","meanpath","medium","mixcloud","mobile","modx","odnoklassniki","odnoklassniki-square","opencart","openid","opera","optin-monster","pagelines","paypal","phone","phone-square","pied-piper","pied-piper-alt","pinterest","pinterest-p","pinterest-square","product-hunt","qq","rebel","reddit","reddit-alien","reddit-square","renren","rss","rss-square","safari","scribd","sellsy","share-alt","share-alt-square","shirtsinbulk","simplybuilt","skyatlas","skype","slack","slideshare","snapchat","soundcloud","spotify","stack-exchange","stack-overflow","steam","steam-square","stumbleupon","stumbleupon-circle","telegram","tencent-weibo","trello","tripadvisor","tumblr","tumblr-square","twitch","twitter","twitter-square","usb","viacoin","vimeo","vimeo-square","vine","vk","weibo","weixin","whatsapp","wikipedia-w","windows","wordpress","xing","xing-square","yahoo","y-combinator","yelp","youtube","youtube-play","youtube-square"],
16
- f.inputConstructor=a.CZRInput.extend(f.CZRSocialsInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZRSocialsItem||{}),this.defaultModOptModel={is_mod_opt:!0,module_id:f.id,"social-size":serverControlParams.social_el_params.defaultSocialSize||14},this.defaultItemModel={id:"",title:"","social-icon":"","social-link":"","social-color":serverControlParams.social_el_params.defaultSocialColor,"social-target":1},this.itemAddedMessage=serverControlParams.i18n.socialLinkAdded,c.has(a,"czr_activeSectionId")&&f.control.section()==a.czr_activeSectionId()&&"resolved"!=f.isReady.state()&&f.ready(),a.section(f.control.section()).expanded.bind(function(a){"resolved"!=f.isReady.state()&&f.ready()}),f.isReady.then(function(){f.preItem.bind(function(a,b){c.has(a,"social-icon")&&(c.isEqual(a["social-icon"],b["social-icon"])||f.updateItemModel(f.preItem,!0))})})},updateItemModel:function(a,d){var e=a;if(d=d||!1,c.has(e(),"social-icon")&&!c.isEmpty(e()["social-icon"])){var f,g,h;f=b.extend(!0,{},e()),g=this.getTitleFromIcon(f["social-icon"]),h=serverControlParams.social_el_params.defaultSocialColor,!d&&e.czr_Input.has("social-color")&&(h=e.czr_Input("social-color")()),g=[serverControlParams.i18n.followUs,g].join(" "),d?(f=b.extend(f,{title:g,"social-color":h}),e.set(f)):(e.czr_Input("title").set(g),e.czr_Input("social-color")&&e.czr_Input("social-color").set(h))}},getTitleFromIcon:function(b){return a.CZR_Helpers.capitalize(b.replace("fa-","").replace("envelope","email"))},getIconFromTitle:function(a){return"fa-".title.toLowerCase().replace("envelope","email")},CZRSocialsInputMths:{setupSelect:function(){function a(a){if(!a.id)return a.text;var c=b('<span class="fa '+a.element.value.toLowerCase()+'">&nbsp;&nbsp;'+a.text+"</span>");return c}var d=this,e=d.input_parent,f=d.module,g=f.social_icons,h=e(),i=c.isEmpty(h.id);i&&(g=c.union([serverControlParams.i18n.selectSocialIcon],g)),c.each(g,function(a,c){var e=i&&0===c?"":"fa-"+a.toLowerCase(),g={value:e,html:f.getTitleFromIcon(a)};e==h["social-icon"]&&b.extend(g,{selected:"selected"}),b('select[data-type="social-icon"]',d.container).append(b("<option>",g))}),b('select[data-type="social-icon"]',d.container).select2({templateResult:a,templateSelection:a})},setupColorPicker:function(a){var d=this,e=(d.input_parent,d.module),f=b('input[data-type="social-color"]',d.container);f.iris({palettes:!0,hide:!1,defaultColor:serverControlParams.social_el_params.defaultSocialColor||"rgba(255,255,255,0.7)",change:function(a,d){c.has(d,"color")&&16777215==d.color._color?b(this).val(serverControlParams.social_el_params.defaultSocialColor||"rgba(255,255,255,0.7)"):b(this).val(d.color.toString()),b(this).trigger("colorpickerchange").trigger("change")}}),f.closest("div").on("click keydown",function(){e._adjustScrollExpandedBlock(d.container)})}},CZRSocialsItem:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.bind("social-icon:changed",function(){b.module.updateItemModel(b)})},_buildTitle:function(b,c,d){var e=this,f=e.module;return b=b||("string"==typeof c?a.CZR_Helpers.capitalize(c.replace("fa-","")):""),b=a.CZR_Helpers.truncate(b,20),c=c||"fa-"+f.social_icons[0],d=d||serverControlParams.social_el_params.defaultSocialColor,'<div><span class="fa '+c+'" style="color:'+d+'"></span> '+b+"</div>"},writeItemViewTitle:function(a){var c=this,d=c.module,e=a||c(),f=d.getTitleFromIcon(e["social-icon"]);b("."+d.control.css_attr.item_title,c.container).html(c._buildTitle(f,e["social-icon"],e["social-color"]))}}})}(wp.customize,jQuery,_);var CZRWidgetAreaModuleMths=CZRWidgetAreaModuleMths||{};!function(a,b,c){b.extend(CZRWidgetAreaModuleMths,{initialize:function(d,e){var f=this;a.CZRDynModule.prototype.initialize.call(this,d,e),b.extend(f,{itemPreAddEl:"czr-module-widgets-pre-add-view-content",itemInputList:"czr-module-widgets-item-input-list",itemInputListReduced:"czr-module-widgets-item-input-list-reduced",ruItemPart:"czr-module-widgets-ru-item-part"}),f.inputConstructor=a.CZRInput.extend(f.CZRWZonesInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZRWZonesItem||{}),f.serverParams=serverControlParams.widget_area_el_params||{},f.contexts=c.has(f.serverParams,"sidebar_contexts")?f.serverParams.sidebar_contexts:{},f.context_match_map={is_404:"404",is_category:"archive-category",is_home:"home",is_page:"page",is_search:"search",is_single:"single"},f.locations=c.has(f.serverParams,"sidebar_locations")?f.serverParams.sidebar_locations:{},f.defaultItemModel={id:"",title:serverControlParams.i18n.widgetZone,contexts:c.without(c.keys(f.contexts),"_all_"),locations:[f.serverParams.defaultWidgetLocation],description:""},this.itemAddedMessage=serverControlParams.i18n.widgetZoneAdded,c.has(a,"sidebar_insights")||(a.sidebar_insights=new a.Values,a.sidebar_insights.create("candidates"),a.sidebar_insights.create("actives"),a.sidebar_insights.create("inactives"),a.sidebar_insights.create("registered"),a.sidebar_insights.create("available_locations")),this.listenToSidebarInsights(),a.czr_widgetZoneSettings=a.czr_widgetZoneSettings||new a.Value,a.czr_widgetZoneSettings.bind(function(b,d){f.isReady.then(function(){c.each(b,function(b,c){a.sidebar_insights(c).set(b)})})}),f.preItem_location_alert_view_state=new a.Value("closed"),f.preItem_location_alert_view_state.callbacks.add(function(a,b){f._toggleLocationAlertExpansion(f.container,a)}),f.bind("item_added",function(a){f.addWidgetSidebar(a)}),f.bind("pre_item_api_remove",function(a){f.removeWidgetSidebar(a)});var g=new a.Values;g.create("fixed_for_current_session"),g.create("value"),a.section(f.serverParams.dynWidgetSection).fixTopMargin=g,a.section(f.serverParams.dynWidgetSection).fixTopMargin("fixed_for_current_session").set(!1),a.panel("widgets").expanded.callbacks.add(function(a,b){f.widgetPanelReact(),"resolved"!=f.isReady.state()&&f.ready()})},ready:function(){var b=this;a.CZRDynModule.prototype.ready.call(b),b.preItemExpanded.callbacks.add(function(a,c){a&&(b.preItem.czr_Input("locations")._setupLocationSelect(!0),b.preItem.czr_Input("locations").mayBeDisplayModelAlert())})},initializeModuleModel:function(a){var d=this,e=b.Deferred();return a.items=c.union(c.has(d.serverParams,"default_zones")?d.serverParams.default_zones:[],a.items),e.resolve(a).promise()},CZRWZonesInputMths:{ready:function(){var b=this;b.bind("locations:changed",function(){b.mayBeDisplayModelAlert()}),a.CZRInput.prototype.ready.call(b)},setupSelect:function(){"locations"==this.id&&this._setupLocationSelect(),"contexts"==this.id&&this._setupContextSelect()},_setupContextSelect:function(){var a=this,d=a(),e=(a.input_parent,a.module);c.each(e.contexts,function(e,f){var g={value:f,html:e};(f==d||c.contains(d,f))&&b.extend(g,{selected:"selected"}),b('select[data-type="contexts"]',a.container).append(b("<option>",g))}),b('select[data-type="contexts"]',a.container).select2()},_setupLocationSelect:function(d){function e(a){if(!a.id)return a.text;if(c.contains(i,a.element.value))return a.text;var d=b('<span class="czr-unavailable-location fa fa-ban" title="'+serverControlParams.i18n.unavailableLocation+'">&nbsp;&nbsp;'+a.text+"</span>");return d}var f=this,g=f(),h=(f.input_parent,f.module),i=a.sidebar_insights("available_locations")();b('select[data-type="locations"]',f.container).children().length||c.each(h.locations,function(a,d){var e={value:d,html:a};(d==g||c.contains(g,d))&&b.extend(e,{selected:"selected"}),b('select[data-type="locations"]',f.container).append(b("<option>",e))}),d&&b('select[data-type="locations"]',f.container).select2("destroy"),b('select[data-type="locations"]',f.container).select2({templateResult:e,templateSelection:e})},mayBeDisplayModelAlert:function(){var d=this,e=d.input_parent,f=d.module;if(c.has(e(),"locations")&&!c.isEmpty(e().locations)){var g=b('select[data-type="locations"]',d.container).val(),h=a.sidebar_insights("available_locations")(),i=c.filter(g,function(a){return!c.contains(h,a)});!c.has(e(),"id")||c.isEmpty(e().id)?f.preItem_location_alert_view_state.set(c.isEmpty(i)?"closed":"expanded"):e.czr_itemLocationAlert.set(c.isEmpty(i)?"closed":"expanded")}}},CZRWZonesItem:{initialize:function(b,c){var d=this;d.module;d.czr_itemLocationAlert=new a.Value,a.CZRItem.prototype.initialize.call(d,null,c)},itemWrapperViewSetup:function(){var b=this,c=b.module;a.CZRItem.prototype.itemWrapperViewSetup.call(b),b.czr_itemLocationAlert.set("closed"),b.czr_itemLocationAlert.callbacks.add(function(a,d){c._toggleLocationAlertExpansion(b.container,a)}),b.writeSubtitleInfos(b()),b.viewState.callbacks.add(function(a,c){-1!=a.indexOf("expanded")&&b.bind("contentRendered",function(){b.czr_Input("locations")._setupLocationSelect(!0),b.czr_Input("locations").mayBeDisplayModelAlert()})})},itemReact:function(b,c){var d=this;a.CZRItem.prototype.itemReact.call(d,b,c),d.writeSubtitleInfos(b),d.updateSectionTitle(b).setModelUpdateTimer()},writeSubtitleInfos:function(a){var d=this,e=d.module,f=c.clone(a||d()),g=[],h=[],i="";if(!d.container.length)return this;f.locations=c.isString(f.locations)?[f.locations]:f.locations,c.each(f.locations,function(a){c.has(e.locations,a)?g.push(e.locations[a]):g.push(a)}),f.contexts=c.isString(f.contexts)?[f.contexts]:f.contexts,d._hasModelAllContexts(a)?h.push(e.contexts._all_):c.each(f.contexts,function(a){c.has(e.contexts,a)?h.push(e.contexts[a]):h.push(a)});var j=serverControlParams.i18n.locations,k=serverControlParams.i18n.contexts,l=serverControlParams.i18n.notset;if(g=c.isEmpty(g)?'<span style="font-weight: bold;">'+l+"</span>":g.join(", "),h=c.isEmpty(h)?'<span style="font-weight: bold;">'+l+"</span>":h.join(", "),i="<u>"+j+"</u> : "+g+" <strong>|</strong> <u>"+k+"</u> : "+h,b(".czr-zone-infos",d.container).length)b(".czr-zone-infos",d.container).html(i);else{var m=b("<div/>",{"class":["czr-zone-infos",e.control.css_attr.item_sort_handle].join(" "),html:i});b("."+e.control.css_attr.item_btns,d.container).after(m)}return this},updateSectionTitle:function(c){var d="sidebar-widgets-"+c.id,e=c.title;return a.section.has(d)?(b(".accordion-section-title",a.section(d).container).text(e),b(".customize-section-title h3",a.section(d).container).html('<span class="customize-action">'+a.section(d).params.customizeAction+"</span>"+e),this):this},setModelUpdateTimer:function(){var a=this,c=a.module;clearTimeout(b.data(this,"modelUpdateTimer")),b.data(this,"modelUpdateTimer",setTimeout(function(){c.control.refreshPreview()},1e3))},_hasModelAllContexts:function(a){var b=this,d=b.module,e=c.keys(d.contexts);if(a=a||this(),c.has(a,"contexts"))return!!c.contains(a.contexts,"_all_")||c.isEmpty(c.difference(c.without(e,"_all_"),a.contexts))},_getMatchingContexts:function(b){var d=this,e=a.czr_wpQueryInfos().conditional_tags||{},f=c.filter(d.context_match_map,function(a,b){return!0===e[b]});return c.isEmpty(f)?b:f}},addWidgetSidebar:function(d,e){if(!c.isObject(d)&&c.isEmpty(e))throw new Error("No valid input were provided to add a new Widget Zone.");var f=this,g=c.isEmpty(d)?e:c.clone(d),h=c.isEmpty(d)?e:b.extend(c.clone(c.findWhere(a.Widgets.data.registeredSidebars,{id:f.serverParams.defaultWidgetSidebar})),{name:g.title,id:g.id});a.Widgets.registeredSidebars.add(h);var i=b.extend(c.clone(a.section("sidebar-widgets-"+f.serverParams.defaultWidgetSidebar).params),{id:"sidebar-widgets-"+g.id,instanceNumber:c.max(a.settings.sections,function(a){return a.instanceNumber}).instanceNumber+1,sidebarId:h.id,title:h.name,description:"undefined"!=typeof e?e.description:a.section("sidebar-widgets-"+f.serverParams.defaultWidgetSidebar).params.description,priority:c.max(c.omit(a.settings.sections,f.serverParams.dynWidgetSection),function(a){return a.instanceNumber}).priority+1});a.section.add(i.id,new a.sectionConstructor[i.type](i.id,{params:i})),a.settings.sections[i.id]=i.id;var j="sidebars_widgets["+g.id+"]",k=b.extend(c.clone(a.settings.settings["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{value:[]});a.settings.settings[j]=k,a.create(j,j,k.value,{transport:k.transport,previewer:a.previewer,dirty:!1});var l=b.extend(c.clone(a.settings.controls["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{settings:{"default":j}}),m={};c.each(l,function(a,b){"string"==typeof a&&(a=a.replace(f.serverParams.defaultWidgetSidebar,g.id)),m[b]=a}),m.instanceNumber=c.max(a.settings.controls,function(a){return a.instanceNumber}).instanceNumber+1,a.settings.controls[j]=m,a.control.add(j,new a.controlConstructor[m.type](j,{params:m,previewer:a.previewer})),c.has(this,"container")&&this.container.trigger("widget_zone_created",{model:g,section_id:"sidebar-widgets-"+g.id,setting_id:j})},removeWidgetSidebar:function(d){var e=this;if(!c.isObject(d)||c.isEmpty(d))throw new Error("No valid data were provided to remove a Widget Zone.");a.Widgets.registeredSidebars.remove(d.id),a.section.has("sidebar-widgets-"+d.id)&&(a.section("sidebar-widgets-"+d.id).container.remove(),a.section.remove("sidebar-widgets-"+d.id),delete a.settings.sections["sidebar-widgets-"+d.id]),a.has("sidebars_widgets["+d.id+"]")&&(a.remove("sidebars_widgets["+d.id+"]"),delete a.settings.settings["sidebars_widgets["+d.id+"]"]),a.control.has("sidebars_widgets["+d.id+"]")&&(a.control("sidebars_widgets["+d.id+"]").container.remove(),a.control.remove("sidebars_widgets["+d.id+"]"),delete a.settings.controls["sidebars_widgets["+d.id+"]"]);var f=function(){a.previewer.refresh()};f=c.debounce(f,500),b.when(f()).done(function(){e.trigger("widget_zone_removed",{model:d,section_id:"sidebar-widgets-"+d.id,setting_id:"sidebars_widgets["+d.id+"]"})})},widgetPanelReact:function(){var b=this,d=a.panel("widgets").container.find(".control-panel-content").css("margin-top");a.section(b.serverParams.dynWidgetSection).fixTopMargin("value").set(d);var e=a.section(b.serverParams.dynWidgetSection).container.find(".accordion-section-content"),f=a.panel("widgets").container.find(".control-panel-content"),g=function(){e.css("margin-top",""),f.css("margin-top",a.section(b.serverParams.dynWidgetSection).fixTopMargin("value")())};a.bind("pane-contents-reflowed",c.debounce(function(){g()},150)),b.closeAllItems().closeRemoveDialogs(),c.has(b,"preItemExpanded")&&b.preItemExpanded.set(!1)},widgetSectionReact:function(c,d){var e=this,f=a.section(e.serverParams.dynWidgetSection),g=f.container.closest(".wp-full-overlay-sidebar-content"),h=f.container.find(".accordion-section-content"),i=f.container.closest(".wp-full-overlay"),j=(f.container.find(".customize-section-back"),f.container.find(".accordion-section-title").first());b("#customize-header-actions").height();c&&(i.removeClass("section-open"),h.css("height","auto"),j.attr("tabindex","0"),h.css("margin-top",""),g.scrollTop(0)),e.closeAllItems().closeRemoveDialogs(),h.slideToggle()},listenToSidebarInsights:function(){var d=this;a.sidebar_insights("registered").callbacks.add(function(a){var b=c.clone(d.itemCollection());c.each(b,function(b){d.getViewEl(b.id).length&&d.getViewEl(b.id).css("display",c.contains(a,b.id)?"block":"none")})}),a.sidebar_insights("inactives").callbacks.add(function(a){var e=c.clone(d.itemCollection());c.each(e,function(e){d.getViewEl(e.id).length&&(c.contains(a,e.id)?(d.getViewEl(e.id).addClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length||d.getViewEl(e.id).find(".czr-item-title").append(b("<span/>",{"class":"czr-inactive-alert",html:" [ "+serverControlParams.i18n.inactiveWidgetZone+" ]"}))):(d.getViewEl(e.id).removeClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length&&d.getViewEl(e.id).find(".czr-inactive-alert").remove()))})}),a.sidebar_insights("candidates").callbacks.add(function(b){c.isArray(b)&&c.each(b,function(b){c.isObject(b)&&(a.section.has("sidebar-widgets-"+b.id)||(d.addWidgetSidebar({},b),c.has(a.sidebar_insights("actives")(),b.id)&&a.section.has("sidebar-widgets-"+b.id)&&a.section("sidebar-widgets-"+b.id).activate()))})})},_adjustScrollExpandedBlock:function(a,c){if(a.length){var d,e=b(".wp-full-overlay-sidebar-content").scrollTop(),f=c||90;setTimeout(function(){a.offset().top+a.height()+f>b(window.top).height()&&(d=a.offset().top+a.height()+f-b(window.top).height(),b(".wp-full-overlay-sidebar-content").animate({scrollTop:e+d},600))},50)}},getDefaultItemModel:function(a){var d=this,e=d.itemCollection(),f=c.clone(d.defaultItemModel);f.contexts;return b.extend(f,{title:"Widget Zone "+(1*c.size(e)+1)})},getTemplateEl:function(a,b){var d,e=this;switch("rudItemPart"==a?a=c.has(b,"is_builtin")&&b.is_builtin?"ruItemPart":a:"itemInputList"==a&&(a=c.has(b,"is_builtin")&&b.is_builtin?"itemInputListReduced":a),a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"itemInputList":d=e.itemInputList;break;case"itemInputListReduced":d=e.itemInputListReduced}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl()");return d},_toggleLocationAlertExpansion:function(c,d){var e=c.find(".czr-location-alert");if(!e.length){var f=["<span>"+serverControlParams.i18n.locationWarning+"</span>",a.CZR_Helpers.getDocSearchLink(serverControlParams.i18n.locationWarning)].join("");e=b("<div/>",{"class":"czr-location-alert",html:f,style:"display:none"}),b('select[data-type="locations"]',c).closest("div").after(e)}e.toggle("expanded"==d)}})}(wp.customize,jQuery,_);var CZRBodyBgModuleMths=CZRBodyBgModuleMths||{};!function(a,b,c){b.extend(CZRBodyBgModuleMths,{initialize:function(d,e){var f=this;a.CZRModule.prototype.initialize.call(f,d,e),b.extend(f,{itemInputList:"czr-module-bodybg-item-content"}),f.inputConstructor=a.CZRInput.extend(f.CZRBodyBgInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZBodyBgItemMths||{}),f.defaultItemModel={"background-color":"#eaeaea","background-image":"","background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center center","background-size":"cover"},a.consoleLog("New module instantiated : ",f.id),c.has(a,"czr_activeSectionId")&&f.control.section()==a.czr_activeSectionId()&&"resolved"!=f.isReady.state()&&f.ready(),a.section(f.control.section()).expanded.bind(function(a){"resolved"!=f.isReady.state()&&f.ready()})},CZRBodyBgInputMths:{setupSelect:function(){var a=this,d={"background-repeat":"bg_repeat_options","background-attachment":"bg_attachment_options","background-position":"bg_position_options"},e=(a.input_parent,serverControlParams.body_bg_module_params),f={};a.module;c.has(d,a.id)&&(c.isUndefined(e)||c.isUndefined(e[d[a.id]])||(f=e[d[a.id]],c.isEmpty(f)||(c.each(f,function(d,e){var f={value:e,html:d};(e==a()||c.contains(a(),e))&&b.extend(f,{selected:"selected"}),b("select[data-type]",a.container).append(b("<option>",f))}),b("select[data-type]",a.container).select2())))}},CZBodyBgItemMths:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.inputCollection.bind(function(a){!c.isEmpty(_col)&&b.czr_Input&&b.czr_Input.has("background-image")&&b.czr_Input("background-image").isReady.done(function(a){var d=function(a){var d=!c.isEmpty(a)||c.isNumber(a);c.each(["background-repeat","background-attachment","background-position","background-size"],function(a){b.czr_Input(a).container.toggle(d||!1)})};d(a()),b.bind("background-image:changed",function(){d(b.czr_Input("background-image")())})})})}}})}(wp.customize,jQuery,_),function(a,b,c){a.czrModuleMap=a.czrModuleMap||{},b.extend(a.czrModuleMap,{czr_widget_areas_module:{mthds:CZRWidgetAreaModuleMths,crud:!0,sektion_allowed:!1,name:"Widget Areas"},czr_social_module:{mthds:CZRSocialModuleMths,crud:!0,name:"Social Icons",has_mod_opt:!0},czr_background:{mthds:CZRBodyBgModuleMths,crud:!1,multi_item:!1,name:"Slider"}})}(wp.customize,jQuery,_);var CZRBaseControlMths=CZRBaseControlMths||{};!function(a,b,c){b.extend(CZRBaseControlMths,{initialize:function(b,d){var e=this;e.css_attr=c.has(serverControlParams,"css_attr")?serverControlParams.css_attr:{},a.Control.prototype.initialize.call(e,b,d),e.bind("czr-partial-refresh-done",function(){c.has(e,"czr_moduleCollection")&&c.each(e.czr_moduleCollection(),function(a){e.czr_Module(a.id)&&e.czr_Module(a.id).sendModuleInputsToPreview()})})},refreshPreview:function(a){this.previewer.refresh()}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{initialize:function(d,e){var f=this;f.czr_Module=new a.Values,f.czr_moduleCollection=new a.Value,f.czr_moduleCollection.set([]),f.moduleCollectionReady=b.Deferred(),f.moduleCollectionReady.done(function(a){!f.isMultiModuleControl(e.params),f.czr_moduleCollection.callbacks.add(function(){return f.moduleCollectionReact.apply(f,arguments)})}),f.isMultiModuleControl(e.params)&&(f.syncSektionModule=new a.Value),a.CZRBaseControl.prototype.initialize.call(f,d,e),a.section(f.section()).expanded.bind(function(a){f.czr_Module.each(function(a){a.closeAllItems().closeRemoveDialogs(),c.has(a,"preItem")&&a.preItemExpanded(!1)})})},ready:function(){var b=this;if(b.isMultiModuleControl())b.syncSektionModule.bind(function(a,c){"resolved"!=b.moduleCollectionReady.state()&&(b.registerModulesOnInit(a),b.moduleCollectionReady.resolve())});else{var d={};c.each(b.getSavedModules(),function(c,e){d=c;try{b.instantiateModule(c,{})}catch(f){return void a.errorLog("Failed to instantiate module "+c.id+" "+f)}b.container.attr("data-module",c.id)}),b.moduleCollectionReady.resolve(d)}b.bind("user-module-candidate",function(c){var d;try{d=b.instantiateModule(c,{})}catch(e){return void a.errorLog("Failed to instantiate module "+c.id+" "+e)}d.ready(c.is_added_by_user)})},getDefaultModuleApiModel:function(){var a={id:"",module_type:"",modOpt:{},items:[],crud:!1,multi_item:!1,sortable:!1,control:{}};return this.isMultiModuleControl()?b.extend(a,{column_id:"",sektion:{},sektion_id:"",is_added_by_user:!1,dirty:!1}):b.extend(a,{section:""})},getDefaultModuleDBModel:function(){var a={items:[]};return this.isMultiModuleControl()?b.extend(a,{id:"",module_type:"",column_id:"",sektion_id:"",dirty:!1}):a},isMultiModuleControl:function(a){return"czr_multi_module"==(a||this.params).type},getSyncCollectionControl:function(){var b=this;if(c.isUndefined(b.params.syncCollection))throw new Error("Control "+b.id+" has no synchronized sektion control defined.");return a.control(a.CZR_Helpers.build_setId(b.params.syncCollection))},getSavedModules:function(){var d=this,e=[],f=d.params.module_type,g=[],h=[],i={};return d.isMultiModuleControl()?e=b.extend(!0,[],a(d.id)()):(!a.CZR_Helpers.isMultiItemModule(f)||c.isEmpty(a(d.id)())||c.isObject(a(d.id)())||a.consoleLog("Module Control Init for "+d.id+" : a mono item module control value should be an object if not empty."),g=c.isArray(a(d.id)())?a(d.id)():[a(d.id)()],c.each(g,function(b,e){a.CZR_Helpers.hasModuleModOpt(f)&&0===e&&(c.has(b,"id")?a.consoleLog("getSavedModules : the module "+f+" in control "+d.id+" has no mod_opt defined while it should."):i=b),c.has(b,"id")&&!c.has(b,"is_mod_opt")&&h.push(b)}),e.push({id:a.CZR_Helpers.getOptionName(d.id)+"_"+d.params.type,module_type:d.params.module_type,section:d.section(),modOpt:b.extend(!0,{},i),items:b.extend(!0,[],h)})),e},isModuleRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.czr_moduleCollection(),{id:a}))}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{instantiateModule:function(a,b){if(!c.has(a,"id"))throw new Error("CZRModule::instantiateModule() : a module has no id and could not be added in the collection of : "+this.id+". Aborted.");var d=this;if((c.isUndefined(b)||c.isEmpty(b))&&(b=d.getModuleConstructor(a)),!c.isEmpty(a.id)&&d.czr_Module.has(a.id))throw new Error("The module id already exists in the collection in control : "+d.id);var e=d.prepareModuleForAPI(a);if(d.czr_Module.add(e.id,new b(e.id,e)),!d.czr_Module.has(e.id))throw new Error("instantiateModule() : instantiation failed for module id "+e.id+" in control "+d.id);return d.czr_Module(e.id)},getModuleConstructor:function(b){var d=this,e={},f={};if(!c.has(b,"module_type"))throw new Error("CZRModule::getModuleConstructor : no module type found for module "+b.id);if(!c.has(a.czrModuleMap,b.module_type))throw new Error("Module type "+b.module_type+" is not listed in the module map api.czrModuleMap.");var g=a.czrModuleMap[b.module_type].mthds,h=a.czrModuleMap[b.module_type].crud,i=h?a.CZRDynModule:a.CZRModule;if(c.isEmpty(b.sektion_id)?f=i.extend(g):(e=i.extend(g),f=e.extend(d.getMultiModuleExtender(e))),c.isUndefined(f)||c.isEmpty(f)||!f)throw new Error("CZRModule::getModuleConstructor : no constructor found for module type : "+b.module_type+".");return f},prepareModuleForAPI:function(b){if(!c.isObject(b))throw new Error("prepareModuleForAPI : a module must be an object to be instantiated.");var d=this,e={};return c.each(d.getDefaultModuleApiModel(),function(f,g){var h=b[g];switch(g){case"id":c.isEmpty(h)?e[g]=d.generateModuleId(b.module_type):e[g]=h;break;case"module_type":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module type must a string not empty");e[g]=h;break;case"items":if(!c.isArray(h))throw new Error("prepareModuleForAPI : a module item list must be an array");e[g]=h;break;case"modOpt":if(!c.isObject(h))throw new Error("prepareModuleForAPI : a module modOpt property must be an object");e[g]=h;break;case"crud":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "crud" must be a boolean');e[g]=h||!1;break;case"multi_item":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "multi_item" must be a boolean');e[g]=h||!1;break;case"sortable":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].sortable||a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "sortable" must be a boolean');e[g]=h||!1;break;case"control":e[g]=d;break;case"section":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module section must be a string not empty");e[g]=h;break;case"column_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module column id must a string not empty");e[g]=h;break;case"sektion":if(!c.isObject(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion must be an object not empty");e[g]=h;break;case"sektion_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion id must be a string not empty");e[g]=h;break;case"is_added_by_user":if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "is_added_by_user" must be a boolean');e[g]=h||!1;break;case"dirty":e[g]=h||!1}}),e},generateModuleId:function(a,b,d){if(d=d||1,d>100)throw new Error("Infinite loop when generating of a module id.");var e=this;b=b||e._getNextModuleKeyInCollection();var f=a+"_"+b;if(!c.has(e,"czr_moduleCollection")||!c.isArray(e.czr_moduleCollection()))throw new Error("The module collection does not exist or is not properly set in control : "+e.id);return e.isModuleRegistered(f)?(b++,d++,e.generateModuleId(a,b,d)):f},_getNextModuleKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.czr_moduleCollection())||(b=c.max(a.czr_moduleCollection(),function(a){return parseInt(a.id.replace(/[^\/\d]/g,""),10)}),d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{registerModulesOnInit:function(d){var e=this,f=[];c.each(e.getSavedModules(),function(g,h){if(!d.czr_Item.has(g.sektion_id))return a.errorLog("Warning Module "+g.id+" is orphan : it has no sektion to be embedded to. It Must be removed."),void f.push(g);var i=d.czr_Item(g.sektion_id);if(c.isUndefined(i))throw new Error("sektion instance missing. Impossible to instantiate module : "+g.id);b.extend(g,{sektion:i}),e.updateModulesCollection({module:g})}),e.moduleCollectionReady.then(function(){c.isEmpty(f)||e.moduleCollectionReact(e.czr_moduleCollection(),[],{orphans_module_removal:f})})},updateModulesCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);if(c.has(a,"collection"))return void d.czr_moduleCollection.set(a.collection,a.data||{});if(!c.has(a,"module"))throw new Error("updateModulesCollection, no module provided "+d.id+". Aborting");var g=d.prepareModuleForAPI(c.clone(a.module));c.findWhere(f,{id:g.id})?c.each(e,function(a,b){a.id==g.id&&(f[b]=g)}):f.push(g);var h={};c.has(a,"data")&&(h=b.extend(!0,{},a.data),b.extend(h,{module:g})),d.czr_moduleCollection.set(f,h)},moduleCollectionReact:function(d,e,f){var g=this,h=c.size(d)>c.size(e),i=c.size(e)>c.size(d);c.size(e)==c.size(d);if(is_collection_sorted=!1,i){var j=c.filter(e,function(a){return c.isUndefined(c.findWhere(d,{id:a.id}))});j=j[0],g.czr_Module.remove(j.id)}c.isObject(f)&&c.has(f,"module")&&(f.module_id=f.module.id,f.module=g.prepareModuleForDB(b.extend(!0,{},f.module))),!g.isMultiModuleControl()&&h||a(this.id).set(g.filterModuleCollectionBeforeAjax(d),f)},filterModuleCollectionBeforeAjax:function(a){var d,e=this,f=b.extend(!0,[],a);if(c.each(a,function(a,c){var d=b.extend(!0,{},a);f[c]=e.prepareModuleForDB(d)}),e.isMultiModuleControl())return f;if(c.size(a)>1)throw new Error("There should not be several modules in the collection of control : "+e.id);if(!c.isArray(a)||c.isEmpty(a)||!c.has(a[0],"items"))throw new Error("The setting value could not be populated in control : "+e.id);var g=a[0].id;if(!e.czr_Module.has(g))throw new Error("The single module control ("+e.id+") has no module registered with the id "+g);var h=e.czr_Module(g);if(!c.isArray(h().items))throw new Error("The module "+g+" should be an array in control : "+e.id);return d=h.isMultiItem()?h().items:h().items[0]||[],h.hasModOpt()?c.union([h().modOpt],d):d},prepareModuleForDB:function(a){if(!c.isObject(a))throw new Error("MultiModule Control::prepareModuleForDB : a module must be an object. Aborting.");var b=this,d={};return c.each(b.getDefaultModuleDBModel(),function(e,f){if(!c.has(a,f))throw new Error("MultiModule Control::prepareModuleForDB : a module is missing the property : "+f+" . Aborting.");var g=a[f];switch(f){case"items":if(!c.isArray(g))throw new Error("prepareModuleForDB : a module item list must be an array");d[f]=g;break;case"id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module id must a string not empty");d[f]=g;break;case"module_type":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module type must a string not empty");d[f]=g;break;case"column_id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module column id must a string not empty");d[f]=g;break;case"sektion_id":if(!c.isObject(a.sektion)||!c.has(a.sektion,"id"))throw new Error("prepareModuleForDB : a module sektion must be an object with an id.");d[f]=a.sektion.id;break;case"dirty":if(b.czr_Module.has(a.id)?d[f]=b.czr_Module(a.id).isDirty():d[f]=g,!c.isBoolean(d[f]))throw new Error("prepareModuleForDB : a module dirty state must be a boolean.")}}),d}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{initialize:function(b,c){var d=this;a.consoleLog("IN MULTI MODULE INITIALIZE ? ",c),a(b).callbacks.add(function(){return d.syncColumn.apply(d,arguments)}),a.CZRBaseModuleControl.prototype.initialize.call(d,b,c)},ready:function(){var b=this;a.consoleLog("MODULE-COLLECTION CONTROL READY",this.id),a.CZRBaseModuleControl.prototype.ready.apply(b,arguments)},syncColumn:function(d,e,f){if(a.consoleLog("IN SYNC COLUMN",d,e,f),(c.isUndefined(f)||!f.silent)&&(a.consoleLog("IN SYNXXX",a.control("hu_theme_options[module-collection]").syncSektionModule()(),this.syncSektionModule()(),this.id),
17
- !c.has(f,"orphans_module_removal"))){var g=a.control(this.id),h=c.filter(d,function(a,b){return!c.findWhere(e,{id:a.id})});c.isEmpty(h)||(a.consoleLog("ADDED MODULE?",h),c.each(h,function(a){g.syncSektionModule().czr_Column(a.column_id).updateColumnModuleCollection({module:a})}));var i=c.filter(e,function(a,b){return!c.findWhere(d,{id:a.id})});c.isEmpty(i)||c.each(i,function(a){g.syncSektionModule().czr_Column(a.column_id).removeModuleFromColumnCollection(a)}),c.size(e)==c.size(d)&&c.has(f,"module")&&c.has(f,"source_column")&&c.has(f,"target_column")&&b.when(g.syncSektionModule().moveModuleFromTo(f.module,f.source_column,f.target_column)).done(function(){g.syncSektionModule().control.trigger("module-moved",{module:f.module,source_column:f.source_column,target_column:f.target_column})}),g.trigger("columns-synchronized",d)}},removeModule:function(a){var b=this;b.czr_Module.has(a.id)&&"resolved"==b.czr_Module(a.id).embedded.state()&&b.czr_Module(a.id).container.remove(),b.removeModuleFromCollection(a)},removeModuleFromCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);f=c.filter(f,function(b){return b.id!=a.id}),d.czr_moduleCollection.set(f)}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{getMultiModuleExtender:function(d){var e=this;return b.extend(e.CZRModuleExtended,{initialize:function(c,e){var f=this;d.prototype.initialize.call(f,c,e),a.consoleLog("MODULE INSTANTIATED : ",f.id),b.extend(f,{singleModuleWrapper:"czr-single-module-wrapper",sektionModuleTitle:"czr-module-sektion-title-part",ruModuleEl:"czr-ru-module-sektion-content"}),f.czr_ModuleState=new a.Value((!1)),f.isReady.done(function(){f.setupModuleView()}),f.moduleTitleEmbedded=b.Deferred(),f.modColumn=new a.Value,f.modColumn.set(e.column_id),f.modColumn.bind(function(c,d){a.consoleLog("MODULE "+f.id+" HAS BEEN MOVED TO COLUMN",c,f());var e=f(),g=b.extend(!0,{},e);g.column_id=c,f.set(g,{target_column:c,source_column:d})})},ready:function(e){var f=this;a.consoleLog("MODULE READY IN EXTENDED MODULE CLASS : ",f.id),b.when(f.renderModuleWrapper(e)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module container has not been embedded for module :"+f.id);f.container=a,f.embedded.resolve()}),d.prototype.ready.call(f)}}),e.CZRModuleExtended},CZRModuleExtended:{renderModuleWrapper:function(a){var c=this;if("resolved"==c.embedded.state())return c.container;if(0===b("#tmpl-"+c.singleModuleWrapper).length)throw new Error("No template for module "+c.id+". The template script id should be : #tmpl-"+c.singleModuleWrapper);var d=wp.template(c.singleModuleWrapper),e={id:c.id,type:c.module_type},f=b(d(e));return a?b.when(b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").after(f)).done(function(){b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").remove()}):b(".czr-module-collection-wrapper",c._getColumn().container).append(f),f},setupModuleView:function(){var b=this;b.view_event_map=[{trigger:"click keydown",selector:[".czr-remove-mod","."+b.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:["toggleModuleRemoveAlert"]},{trigger:"click keydown",selector:"."+b.control.css_attr.remove_view_btn,name:"remove_module",actions:["removeModule"]},{trigger:"click keydown",selector:".czr-edit-mod",name:"edit_module",actions:["setModuleViewVisibility","sendEditModule"]},{trigger:"click keydown",selector:".czr-module-back",name:"back_to_column",actions:["setModuleViewVisibility"]},{trigger:"mouseenter",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("start_hovering_module",{id:b.id})}},{trigger:"mouseleave",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("stop_hovering_module",{id:b.id})}}],b.embedded.done(function(){b.czr_ModuleState.callbacks.add(function(){return b.setupModuleViewStateListeners.apply(b,arguments)}),a.CZR_Helpers.setupDOMListeners(b.view_event_map,{module:{id:b.id},dom_el:b.container},b)})},setModuleViewVisibility:function(c,d){var e=this;e.czr_ModuleState(!e.czr_ModuleState()),a.czrModulePanelState.set(!1),a.czrSekSettingsPanelState.set(!1),e.control.syncSektionModule().closeAllOtherSektions(b(c.dom_event.currentTarget,c.dom_el))},sendEditModule:function(a){var b=this;b.control.previewer.send("edit_module",{id:b.id})},setupModuleViewStateListeners:function(c){var d=this;a.czr_isModuleExpanded=a.czr_isModuleExpanded||new a.Value,c?a.czr_isModuleExpanded(d):a.czr_isModuleExpanded(!1),b.when(d.toggleModuleViewExpansion(c)).done(function(){c?(d.renderModuleTitle(),d.populateSavedItemCollection()):d.czr_Item.each(function(a){a.viewState.set("closed"),a._destroyView(0),d.czr_Item.remove(a.id)})})},renderModuleTitle:function(){var a=this;if("resolved"!=a.moduleTitleEmbedded.state()){if(0===b("#tmpl-"+a.sektionModuleTitle).length)throw new Error("No sektion title Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.sektionModuleTitle);b.when(b(a.container).find(".czr-mod-content").prepend(b(wp.template(a.sektionModuleTitle)({id:a.id})))).done(function(){a.moduleTitleEmbedded.resolve()})}},toggleModuleViewExpansion:function(a,c){var d=this;b(".czr-mod-content",d.container).slideToggle({duration:c||200,done:function(){var b=d.container.closest(".wp-full-overlay"),c=d.container.find(".czr-module-back"),e=d.container.find(".czr-module-title");d.container.toggleClass("open",a),b.toggleClass("czr-module-open",a),e.attr("tabindex",a?"-1":"0"),c.attr("tabindex",a?"0":"-1"),a?c.focus():e.focus(),a&&d._adjustScrollExpandedBlock(d.container)}})},toggleModuleRemoveAlert:function(a){var d=this,e=this.control,f=b("."+d.control.css_attr.remove_alert_wrapper,d.container).first(),g=(a.dom_event,e.syncSektionModule().czr_Column(d.column_id).container);if(c.has(d,"preItem")&&e.syncSektionModule().preItemExpanded.set(!1),b("."+d.control.css_attr.remove_alert_wrapper,g).not(f).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+d.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),!wp.template(d.AlertPart)||!d.container)throw new Error("No removal alert template available for module :"+d.id);f.html(wp.template(d.AlertPart)({title:d().title||d.id})),f.slideToggle({duration:200,done:function(){var c=!b(this).hasClass("open")&&b(this).is(":visible");b(this).toggleClass("open",c),b(a.dom_el).find("."+d.control.css_attr.display_alert_btn).toggleClass("active",c),c&&d._adjustScrollExpandedBlock(d.container)}})},removeModule:function(a){this.control.removeModule(a.module)},_getColumn:function(){var a=this;return a.control.syncSektionModule().czr_Column(a.modColumn())},_getSektion:function(){}}})}(wp.customize,jQuery,_);var CZRMultiplePickerMths=CZRMultiplePickerMths||{};!function(a,b,c){b.extend(CZRMultiplePickerMths,{ready:function(){function a(a){return a.text.replace(/\u2013|\u2014/g,"")}var c=this,d=this.container.find("select");d.select2({closeOnSelect:!1,templateSelection:a}),d.on("change",function(a){0===b(this).find("option:selected").length&&c.setting.set([])})}})}(wp.customize,jQuery,_);var CZRCroppedImageMths=CZRCroppedImageMths||{};!function(a,b,c){"function"==typeof wp.media.controller.Cropper&&"function"==typeof a.CroppedImageControl&&(wp.media.controller.CZRCustomizeImageCropper=wp.media.controller.Cropper.extend({doCrop:function(a){var b=a.get("cropDetails"),c=this.get("control");return b.dst_width=c.params.dst_width,b.dst_height=c.params.dst_height,wp.ajax.post("crop-image",{wp_customize:"on",nonce:a.get("nonces").edit,id:a.get("id"),context:c.id,cropDetails:b})}}),b.extend(CZRCroppedImageMths,{initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CZRCustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON();return a.mime&&a.mime.indexOf("image")>-1?void(c.contains(["image/svg+xml","image/gif"],a.mime)||this.params.width===a.width&&this.params.height===a.height&&!this.params.flex_width&&!this.params.flex_height?(this.setImageFromAttachment(a),this.frame.close()):this.frame.setState("cropper")):void this.frame.trigger("content:error")}}))}(wp.customize,jQuery,_);var CZRUploadMths=CZRUploadMths||{};!function(a,b,c){b.extend(CZRUploadMths,{ready:function(){var c=this;this.params.removed=this.params.removed||"",this.success=b.proxy(this.success,this),this.uploader=b.extend({container:this.container,browser:this.container.find(".czr-upload"),success:this.success,plupload:{},params:{}},this.uploader||{}),c.params.extensions&&(c.uploader.plupload.filters=[{title:a.l10n.allowedFiles,extensions:c.params.extensions}]),c.params.context&&(c.uploader.params["post_data[context]"]=this.params.context),a.settings.theme.stylesheet&&(c.uploader.params["post_data[theme]"]=a.settings.theme.stylesheet),this.uploader=new wp.Uploader(this.uploader),this.remover=this.container.find(".remove"),this.remover.on("click keydown",function(a){"keydown"===a.type&&13!==a.which||(c.setting.set(c.params.removed),a.preventDefault())}),this.removerVisibility=b.proxy(this.removerVisibility,this),this.setting.bind(this.removerVisibility),this.removerVisibility(this.setting())},success:function(a){this.setting.set(a.get("id"))},removerVisibility:function(a){this.remover.toggle(a!=this.params.removed)}})}(wp.customize,jQuery,_);var CZRLayoutSelectMths=CZRLayoutSelectMths||{};!function(a,b,c){b.extend(CZRLayoutSelectMths,{ready:function(){this.setupSelect()},setupSelect:function(a){function d(a){if(!a.id)return a.text;if(c.has(e.params.layouts,a.element.value)){var d=e.params.layouts[a.element.value],f=d.src,g=d.label,h=b('<img src="'+f+'" class="czr-layout-img" title="'+g+'" /><span class="czr-layout-title">'+g+"</span>");return h}}var e=this;$_select=this.container.find("select"),$_select.select2({templateResult:d,templateSelection:d,minimumResultsForSearch:1/0})}})}(wp.customize,jQuery,_),function(a,b,c){b.extend(CZRBaseControlMths,a.Events),b.extend(a.Control.prototype,a.Events),b.extend(CZRModuleMths,a.Events),b.extend(CZRItemMths,a.Events),b.extend(CZRModOptMths,a.Events),b.extend(CZRSkopeBaseMths,a.Events),b.extend(CZRSkopeMths,a.Events),b.extend(CZRBaseControlMths,a.CZR_Helpers),b.extend(CZRInputMths,a.CZR_Helpers),b.extend(CZRModuleMths,a.CZR_Helpers),b.extend(CZRSkopeMths,a.CZR_Helpers),a.CZR_skopeBase=a.Class.extend(CZRSkopeBaseMths),a.CZR_skopeSave=a.Class.extend(CZRSkopeSaveMths),a.CZR_skopeReset=a.Class.extend(CZRSkopeResetMths),a.CZR_skope=a.Value.extend(CZRSkopeMths),c.has(a,"HeaderTool")&&(a.czr_HeaderTool=b.extend(!0,{},a.HeaderTool)),a.CZRInput=a.Value.extend(CZRInputMths),a.CZRItem=a.Value.extend(CZRItemMths),a.CZRModOpt=a.Value.extend(CZRModOptMths),a.CZRModule=a.Value.extend(CZRModuleMths),a.CZRDynModule=a.CZRModule.extend(CZRDynModuleMths),c.isUndefined(window.CZRColumnMths)||(a.CZRColumn=a.Value.extend(CZRColumnMths)),a.CZRBaseControl=a.Control.extend(CZRBaseControlMths),a.CZRBaseModuleControl=a.CZRBaseControl.extend(CZRBaseModuleControlMths),a.CZRMultiModuleControl=a.CZRBaseModuleControl.extend(CZRMultiModuleControlMths),a.CZRUploadControl=a.Control.extend(CZRUploadMths),a.CZRLayoutControl=a.Control.extend(CZRLayoutSelectMths),a.CZRMultiplePickerControl=a.Control.extend(CZRMultiplePickerMths),b.extend(a.controlConstructor,{czr_upload:a.CZRUploadControl,czr_module:a.CZRBaseModuleControl,czr_multi_module:a.CZRMultiModuleControl,czr_multiple_picker:a.CZRMultiplePickerControl,czr_layouts:a.CZRLayoutControl}),"function"==typeof a.CroppedImageControl&&(a.CZRCroppedImageControl=a.CroppedImageControl.extend(CZRCroppedImageMths),b.extend(a.controlConstructor,{czr_cropped_image:a.CZRCroppedImageControl})),a.czrInputMap=a.czrInputMap||{},b.extend(a.czrInputMap,{text:"",textarea:"",check:"setupIcheck",select:"setupSelect",number:"setupStepper",upload:"setupImageUploader",color:"setupColorPicker",content_picker:"setupContentPicker",text_editor:"setupTextEditor",password:"",range_slider:"setupRangeSlider"})}(wp.customize,jQuery,_),function(a,b,c){var d=serverControlParams.i18n||{};a.czr_CrtlDependenciesReady=b.Deferred(),a.bind("ready",function(){c.has(a,"czr_ctrlDependencies")||(serverControlParams.isSkopOn?"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.done(function(){a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()}):(a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()))}),a.CZR_ctrlDependencies=a.Class.extend({dominiDeps:[],initialize:function(){var b=this;if(this.defaultDominusParams={dominus:"",servi:[],visibility:null,actions:null,onSectionExpand:!0},this.dominiDeps=c.extend(this.dominiDeps,this._getControlDeps()),!c.isArray(b.dominiDeps))throw new Error("Visibilities : the dominos dependency array is not an array.");a.czr_activeSectionId.bind(function(d){if(!c.isEmpty(d)&&a.section.has(d))try{b.setServiDependencies(d)}catch(e){a.errorLog("In api.CZR_ctrlDependencies : "+e)}}),a.bind("awaken-section",function(d){if(serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase"))a.czr_skopeBase.processSilentUpdates({candidates:{},section_id:d.target,refresh:!1}).then(function(){try{b.setServiDependencies(d.target,d.source)}catch(c){a.errorLog("On awaken-section, ctrl deps : "+c)}});else try{b.setServiDependencies(d.target,d.source)}catch(e){a.errorLog("On awaken-section, ctrl deps : "+e)}}),this._handleFaviconNote()},setServiDependencies:function(d,e,f){var g=this,h=b.Deferred();if(f=f||!1,c.isUndefined(d)||!a.section.has(d))throw new Error("Control Dependencies : the targetSectionId is missing or not registered : "+d);if(a.section(d).czr_ctrlDependenciesReady=a.section(d).czr_ctrlDependenciesReady||b.Deferred(),!f&&"resolved"==a.section(d).czr_ctrlDependenciesReady.state())return h.resolve().promise();c.each(g.dominiDeps,function(b){if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))throw new Error("Control Dependencies : a dominus control id must be a not empty string.");var e=a.CZR_Helpers.build_setId(b.dominus);a.control.has(e)&&a.control(e).section()==d&&(b=g._prepareDominusParams(b),c.isEmpty(b)||g._processDominusCallbacks(b.dominus,b,f).fail(function(){a.consoleLog("self._processDominusCallbacks fail for section "+d),h.reject()}).done(function(){h.resolve()}))});var i=a.CZR_Helpers.getSectionControlIds(d),j=function(b){var d=[];return c.each(g.dominiDeps,function(e){if(!c.has(e,"servi")||!c.isArray(e.servi)||!c.has(e,"dominus")||c.isEmpty(e.dominus))return void a.errorLog("Control Dependencies : wrong params in _getServusDomini.");if(c.contains(e.servi,b)&&!c.contains(d,e.dominus)){if(e=g._prepareDominusParams(e),c.isEmpty(e))return;d.push(e.dominus)}}),c.isArray(d)?d:[]},k=[];return c.each(i,function(a){c.isEmpty(j(a))||(k=c.union(k,j(a)))}),c.each(k,function(b){var c=a.CZR_Helpers.build_setId(b);a.control(c).section()!=d&&e!=a.control(c).section()&&a.trigger("awaken-section",{target:a.control(c).section(),source:d})}),h.always(function(){a.section(d).czr_ctrlDependenciesReady.resolve()}),h.promise()},_deferCallbackForControl:function(d,e,f){var g=b.Deferred();if(c.isEmpty(d)||!c.isString(d))throw new Error("_deferCallbackForControl : the control id is missing.");if(!c.isFunction(e))throw new Error("_deferCallbackForControl : callback must be a funtion.");return f=c.isUndefined(f)||!c.isArray(f)?[]:f,a.control.has(d)?"resolved"==a.control(d).deferred.embedded.state()?b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()}):a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})}):a.control.when(d,function(){a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})})}),g.promise()},_processDominusCallbacks:function(d,e,f){var g=this,h=a.CZR_Helpers.build_setId(d),i=a(h),j=b.Deferred(),k=!1;return c.each(e.servi,function(b){if(a.control.has(a.CZR_Helpers.build_setId(b))){var d=function(a,b,d,e){var f=arguments;c.each(d,function(a,b){switch(b){case"visibility":g._setVisibility.apply(null,f);break;case"actions":c.isFunction(a)&&a.apply(null,f)}})},f=function(c){c=c||i();var f=a.CZR_Helpers.build_setId(b);g._deferCallbackForControl(f,d,[c,b,e]).always(function(){k=!0}).fail(function(){j.reject()}).done(function(){j.resolve()})};f(),c.has(i,"czr_visibilityServi")||(i.czr_visibilityServi=new a.Value([]));var h=i.czr_visibilityServi();c.contains(h,b)||(i.bind(function(a){f(a)}),i.czr_visibilityServi(c.union(h,[b])))}}),k?j.promise():j.resolve().promise()},_setVisibility:function(b,d,e,f){var g=a.CZR_Helpers.build_setId(d),h=e.visibility(b,d,e.dominus);if(f=f||!1,c.isBoolean(h)&&("unchanged"!=h||f)){var i=function(){a.state.has("silent-update-processing")&&a.state("silent-update-processing")()||(a.control(g,function(a){var b={duration:"fast",completeCallback:function(){},unchanged:!1};c.has(a,"active")&&(h=h&&a.active()),c.has(a,"defaultActiveArguments")&&(b=control.defaultActiveArguments),a.onChangeActive(h,a.defaultActiveArguments)}),a.state.has("silent-update-processing")&&a.state("silent-update-processing").unbind(i))};a.state.has("silent-update-processing")&&a.state("silent-update-processing")()?a.state("silent-update-processing").bind(i):i()}},_getControlDeps:function(){return{}},_prepareDominusParams:function(b){var d=this,e={};if(!c.isObject(b))return a.errorLog("Visibilities : a dominus param definition must be an object."),e;if(!c.has(b,"visibility")&&!c.has(b,"actions"))return a.errorLog("Visibilities : a dominus definition must include a visibility or an actions callback."),e;if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))return a.errorLog("Visibilities : a dominus control id must be a not empty string."),e;var f=a.CZR_Helpers.build_setId(b.dominus);return a.control.has(f)?!c.has(b,"servi")||c.isUndefined(b.servi)||!c.isArray(b.servi)||c.isEmpty(b.servi)?(a.errorLog("Visibilities : servi must be set as an array not empty."),e):(c.each(d.defaultDominusParams,function(a,d){var f=b[d];switch(d){case"visibility":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus visibility callback must be a function : "+b.dominus);break;case"actions":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus actions callback must be a function : "+b.dominus);break;case"onSectionExpand":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isBoolean(f))throw new Error("Visibilities : a dominus onSectionExpand param must be a boolean : "+b.dominus)}e[d]=f}),e):(a.errorLog("Visibilities : a dominus control id is not registered : "+f),e)},_handleFaviconNote:function(){var b=this,c=a.CZR_Helpers.build_setId(serverControlParams.faviconOptionName);if(!(!a.has("site_icon")||!a.control("site_icon")||a.has(c)&&0===+a(c)()||+a("site_icon")()>0)){var e=a.control("site_icon").params.description;_newDes=["<strong>",d.faviconNote||"","</strong><br/><br/>"].join("")+e,b._printFaviconNote(_newDes),a("site_icon").callbacks.add(function(d){+d>0?(a.control("site_icon").container.find(".description").text(e),a.has(c)&&a(c).set("")):b._printFaviconNote(_newDes)})}},_printFaviconNote:function(b){a.control("site_icon").container.find(".description").html(b)}})}(wp.customize,jQuery,_),function(a,b){b(function(b){function c(a){var c=a.siblings(".open");0!==c.length&&c.offset().top<0&&b(".wp-full-overlay-sidebar-content").animate({scrollTop:-b("#customize-theme-controls").offset().top-c.height()+a.offset().top+b(".wp-full-overlay-sidebar-content").offset().top},700)}var d=a.customize||d;b(".accordion-section").not(".control-panel").click(function(){c(b(this))}),d.czrSetupCheckbox=function(a,c){b("input[type=checkbox]",d.control(a).container).each(function(){0===b(this).val()||"0"==b(this).val()||"off"==b(this).val()||_.isEmpty(b(this).val())?b(this).prop("checked",!1):b(this).prop("checked",!0),0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},d.czrSetupSelect=function(a,c){b("select[data-customize-setting-link]",d.control(a).container).not(".no-selecter-js").each(function(){b(this).selecter({})})},d.czrSetupStepper=function(a,c){b('input[type="number"]',d.control(a).container).each(function(){b(this).stepper()})},d.control.each(function(a){_.has(a,"id")&&("widget_"!=a.id.substring(0,"widget_".length)&&"nav_menu"!=a.id.substring(0,"nav_menu".length)&&d.czrSetupCheckbox(a.id),"nav_menu_locations"!=a.id.substring(0,"nav_menu_locations".length)&&d.czrSetupSelect(a.id),d.czrSetupStepper(a.id))});var e=function(){var a=b("<span/>",{"class":"customize-controls-home fa fa-home",html:'<span class="screen-reader-text">Home</span>'});b.when(b("#customize-header-actions").append(a)).done(function(){a.keydown(function(a){9!==a.which&&(13===a.which&&this.click(),a.preventDefault())}).on("click.customize-controls-home",function(){d.section.has(d.czr_activeSectionId())?d.section(d.czr_activeSectionId()).expanded(!1):d.section.each(function(a){a.expanded(!1)}),d.panel.each(function(a){a.expanded(!1)})})})};e()})}(wp,jQuery);
1
+ /*! addEventListener Polyfill ie9- http://stackoverflow.com/a/27790212*/
2
+ window.addEventListener=window.addEventListener||function(a,b){window.attachEvent("on"+a,b)},/*! Datenow Polyfill ie9- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now */
3
+ Date.now||(Date.now=function(){return(new Date).getTime()}),/*! Object.create monkey patch ie8 http://stackoverflow.com/a/18020326 */
4
+ Object.create||(Object.create=function(a,b){function c(){}if("undefined"!=typeof b)throw"The multiple-argument version of Object.create is not provided by this browser and cannot be shimmed.";return c.prototype=a,new c}),/*! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter */
5
+ Array.prototype.filter||(Array.prototype.filter=function(a){"use strict";if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;f<c;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),/*! map was added to the ECMA-262 standard in the 5th edition */
6
+ Array.prototype.map||(Array.prototype.map=function(a,b){var c,d,e;if(null===this)throw new TypeError(" this is null or not defined");var f=Object(this),g=f.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=new Array(g),e=0;e<g;){var h,i;e in f&&(h=f[e],i=a.call(c,h,e,f),d[e]=i),e++}return d}),/*! Array.from was added to the ECMA-262 standard in the 6th edition (ES2015) */
7
+ Array.from||(Array.from=function(){var a=Object.prototype.toString,b=function(b){return"function"==typeof b||"[object Function]"===a.call(b)},c=function(a){var b=Number(a);return isNaN(b)?0:0!==b&&isFinite(b)?(b>0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k<i;)h=d[k],g?j[k]="undefined"==typeof f?g(h,k):g.call(f,h,k):j[k]=h,k+=1;return j.length=i,j}}()),/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
8
+ "function"!=typeof jQuery.fn.iCheck&&!function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"!=b&&("keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):void("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A)))}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto),"function"!=typeof jQuery.fn.selecter&&!function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{var f=c.html();c.data("value"),b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window),"function"!=typeof jQuery.fn.stepper&&!function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0!==typeof e&&!isNaN(e)&&e,max:void 0!==typeof f&&!isNaN(f)&&f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this),/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group",a(h),this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){
9
+ function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";
10
+ return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}),/*! rangeslider.js - v2.3.0 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
11
+ !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||a.open===!1)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){"undefined"!=typeof a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty("display","block","important"):d[i].style.cssText+=";display: block !important",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier="js-"+k+"-"+l++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return"number"==typeof a&&a!==a};var k="rangeslider",l=0,m=b(),n={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},o={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute("min"),0),this.max=h(this.$element[0].getAttribute("max"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute("step"),1)),this.handleDimension=g(this.$handle[0],"offset"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],"offset"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),!((" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=d+"px",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return"undefined"!=typeof a.originalEvent["client"+b]?d=a.originalEvent["client"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&"undefined"!=typeof a.originalEvent.touches[0]["client"+b]?d=a.originalEvent.touches[0]["client"+b]:a.currentPoint&&"undefined"!=typeof a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b,c;return b=(a-this.min)/(this.max-this.min),c=Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&""!==this.$element[0].value||this.$element.val(a).trigger("input",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data("plugin_"+k);e||d.data("plugin_"+k,e=new j(this,b)),"string"==typeof b&&e[b].apply(e,c)})},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"});var czr_debug={log:function(a){debug.queue.push(["log",arguments,debug.stack.slice(0)]),window.console&&"function"==typeof window.console.log&&window.console.log(a)},error:function(a){debug.queue.push(["error",arguments,debug.stack.slice(0)]),window.console&&"function"==typeof window.console.error&&window.console.error(a)},queue:[],stack:[]};!function(a,b,c){var d=function(a){var b={bgCol:"#5ed1f5",textCol:"#000",consoleArguments:[]};a=c.extend(b,a);var d=Array.from(a.consoleArguments),e=function(a){return c.isString(a)?a.length>150?a.substr(0,149):a:""};return d=c.isEmpty(c.filter(d,function(a){return!c.isString(a)}))?d.join(" "):JSON.stringify(d.join(" ")),["%c "+e(d),["background:"+a.bgCol,"color:"+a.textCol,"display: block;"].join(";")]};a.consoleLog=function(){serverControlParams.isDevMode&&(c.isUndefined(console)&&"function"!=typeof window.console.log||console.log.apply(console,d({consoleArguments:arguments})))},a.errorLog=function(){c.isUndefined(console)&&"function"!=typeof window.console.log||console.log.apply(console,d({bgCol:"#ffd5a0",textCol:"#000",consoleArguments:arguments}))},a.czr_isSkopOn=function(){return serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase")},a.czr_isChangeSetOn=function(){return serverControlParams.isChangeSetOn&&!0},a.czr_activeSectionId=new a.Value(""),a.czr_activePanelId=new a.Value(""),"function"==typeof a.Section&&a.control.bind("add",function(b){b.params.ubq_section&&b.params.ubq_section.section&&(b.params.original_priority=b.params.priority,b.params.original_section=b.params.section,a.section.when(b.params.ubq_section.section,function(a){a.expanded.bind(function(a){a?(b.params.ubq_section.priority&&b.priority(b.params.ubq_section.priority),b.section(b.params.ubq_section.section)):(b.priority(b.params.original_priority),b.section(b.params.original_section))})}))});var e=function(){c.has(a,"czr_ModOptVisible")&&a.czr_ModOptVisible(!1)};a.czr_activeSectionId.bind(e),a.czr_activePanelId.bind(e),a.bind("ready",function(){if("function"!=typeof a.Section)throw new Error("Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.");var b=function(b,c){a.czr_activeSectionId(b?c:"")};a.section.each(function(a){a.expanded.bind(function(c){b(c,a.id)})}),a.section.bind("add",function(c){a.trigger("czr-paint",{active_panel_id:c.panel()}),c.expanded.bind(function(a){b(a,c.id)})});var d=function(b,d){a.czr_activePanelId(b?d:""),c.isEmpty(a.czr_activePanelId())&&a.czr_activeSectionId("")};a.panel.each(function(a){a.expanded.bind(function(b){d(b,a.id)})}),a.panel.bind("add",function(a){a.expanded.bind(function(b){d(b,a.id)})})}),a.bind("ready",function(){var d=function(){a.section("themes").active.bind(function(d){c.has(serverControlParams,"isThemeSwitchOn")&&c.isEmpty(serverControlParams.isThemeSwitchOn)&&(a.section("themes").active(serverControlParams.isThemeSwitchOn),a.section("themes").active.callbacks=b.Callbacks())})};a.section.has("themes")?d():a.section.when("themes",function(a){d()})}),a.czr_skopeReady=b.Deferred(),a.bind("ready",function(){if(serverControlParams.isSkopOn){a.czr_isLoadingSkope=new a.Value((!1)),a.czr_isLoadingSkope.bind(function(a){f(a)}),a.czr_skopeBase=new a.CZR_skopeBase,a.czr_skopeSave=new a.CZR_skopeSave,a.czr_skopeReset=new a.CZR_skopeReset,a.trigger("czr-skope-started");var b=function(){a.czr_skopeBase.toggleTopNote(!0,{title:serverControlParams.i18n.skope["There was a problem when trying to load the customizer."],message:[serverControlParams.i18n.skope["Please refer to"],'<a href="http://docs.presscustomizr.com/article/285-there-was-a-problem-when-trying-to-load-the-customizer" target="_blank">',serverControlParams.i18n.skope["this documentation page"],"</a>",serverControlParams.i18n.skope["to understand how to fix the problem."]].join(" "),selfCloseAfter:4e4})};a.czr_skopeReady.done(function(){a.trigger("czr-skope-ready")}).fail(function(c){a.errorLog("Skope could not be instantiated : "+c),b(),serverControlParams.isSkopOn=!1}).always(function(){a.czr_isLoadingSkope(!1)}),"rejected"!=a.czr_skopeReady.state()&&setTimeout(function(){"pending"==a.czr_skopeReady.state()&&(b(),a.czr_isLoadingSkope(!1))},4e4)}serverControlParams.isChangeSetOn&&(a.settings.timeouts.changesetAutoSave=1e4)}),c.has(a,"_latestRevision")||(a._latestRevision=0,a._latestSettingRevisions={},a.bind("change",function(b){a._latestRevision+=1,a._latestSettingRevisions[b.id]=a._latestRevision}),a.bind("ready",function(){a.bind("add",function(b){b._dirty&&(a._latestRevision+=1,a._latestSettingRevisions[b.id]=a._latestRevision)})}));var f=function(d){d=!!c.isUndefined(d)||d;var e,f=function(){var c=b.Deferred();try{_tmpl=wp.template("czr-skope-pane")({is_skope_loading:!0})}catch(d){a.errorLog("In toggleSkopeLoadPane : error when parsing the the reset skope template : "+d),c.resolve(!1)}return b.when(b("#customize-preview").after(b(_tmpl))).always(function(){c.resolve(b("#czr-skope-pane"))}),c.promise()},g=function(){c.delay(function(){b.when(b("body").removeClass("czr-skope-pane-open")).done(function(){c.delay(function(){b.when(b("body").removeClass("czr-skop-loading")).done(function(){!1!==b("#czr-skope-pane").length&&setTimeout(function(){b("#czr-skope-pane").remove()},400)})},200)})},50)};"pending"==a.czr_skopeReady.state()&&d&&(b("body").addClass("czr-skop-loading"),f().done(function(a){e=a}).then(function(){e.length&&c.delay(function(){var a=b("#customize-preview").height();e.css("line-height",a+"px").css("height",a+"px"),b("body").addClass("czr-skope-pane-open")},50)})),a.czr_skopeReady.done(function(){g()}),d||g()};a.bind("ready",function(){a.previewedDevice&&a.previewedDevice.bind(function(b){a.previewer.send("previewed-device",b)})}),serverControlParams.isPro&&(c.each(["tc_font_customizer_settings","header_image_sec","content_blog_sec","static_front_page"],function(b){c.delay(function(){a.section.when(b,function(a){1>=a.headContainer.length&&a.headContainer.find(".accordion-section-title").prepend('<span class="pro-title-block">Pro</span>')})},1e3)}),c.each(["hu-header-panel","hu-content-panel"],function(b){a.panel.when(b,function(a){1>=a.headContainer.length&&a.headContainer.find(".accordion-section-title").prepend('<span class="pro-title-block">Pro</span>')})})),!serverControlParams.isPro&&c.isFunction(a.Section)&&(proSectionConstructor=a.Section.extend({active:!0,attachEvents:function(){},isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}}),b.extend(a.sectionConstructor,{"czr-customize-section-pro":proSectionConstructor}))}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{globalSettingVal:{},initialize:function(){var d=this;d.skope_colors={global:"rgb(255, 255, 255)",special_group:"rgba(173, 213, 247, 0.55)",group:"rgba(39, 59, 88, 0.12)",local:"rgba(39, 59, 88, 0.28)"},a.czr_isPreviewerSkopeAware=b.Deferred(),a.czr_initialSkopeCollectionPopulated=b.Deferred(),d.skopeWrapperEmbedded=b.Deferred(),a.czr_skope=new a.Values,a.czr_skopeCollection=new a.Value([]),a.czr_currentSkopesCollection=new a.Value([]),a.czr_activeSkopeId=new a.Value,a.czr_dirtyness=new a.Value((!1)),a.czr_isResettingSkope=new a.Value((!1)),a.state.create("switching-skope")(!1),a.czr_dirtyness.callbacks.add(function(){return d.apiDirtynessReact.apply(d,arguments)}),a.czr_isLoadingSkope(!0),d.bindAPISettings(),a.state.bind("change",function(){d.setSaveButtonStates()}),a.czr_skopeReady.then(function(){"pending"==d.skopeWrapperEmbedded.state()&&b.when(d.embedSkopeWrapper()).done(function(){d.skopeWrapperEmbedded.resolve()})}),a.previewer.bind("czr-skopes-synced",function(b){if(serverControlParams.isSkopOn&&"rejected"!=a.czr_skopeReady.state()){var e=this,f=a.czr_currentSkopesCollection();if(!c.has(b,"czr_skopes"))return"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.reject(),void a.errorLog("On 'czr-skopes-synced' : missing skopes in the server data");try{a.czr_skopeBase.updateSkopeCollection(b.czr_skopes,e.channel())}catch(g){return void a.czr_skopeReady.reject(g)}var h=function(){d._writeCurrentSkopeTitle(),a.czr_bottomInfosVisible()?d.renderBottomInfosTmpl():a.czr_bottomInfosVisible(!0)};a.czr_initialSkopeCollectionPopulated.then(function(){var e=c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{id:a.czr_activeSkopeId()}));a.czr_skopeBase.reactWhenSkopeSyncedDone(b).done(function(){if(e)try{a.czr_activeSkopeId(d.getActiveSkopeId()).done(function(){"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.resolve(d.getActiveSkopeId()),h()}).fail(function(){throw new Error("Error when trying to set the active skope after skope synced.")})}catch(g){a.errorLog("In reactWhenSkopeSyncedDone => api.czr_activeSkopeId() : "+g)}else if(!c.isEmpty(f)){var i=c.findWhere(f,{skope:"local"}).opt_name,j=c.findWhere(b.czr_skopes,{skope:"local"}).opt_name;j!==i&&"resolved"==a.czr_skopeReady.state()&&h()}})})}}),a.czr_currentSkopesCollection.bind(function(a,b){return d.currentSkopesCollectionReact(a,b)},{deferred:!0}),a.czr_initialSkopeCollectionPopulated.done(function(){a.czr_activeSkopeId.bind(function(b,e){return c.has(a,"czr_ModOptVisible")&&a.czr_ModOptVisible(!1),d.activeSkopeReact(b,e).then(function(c){a.trigger("skope-switched-done",{current_skope_id:b,previous_skope_id:e,updated_setting_ids:c||[]})})},{deferred:!0}),a.czr_activeSectionId.callbacks.add(function(){return d.activeSectionReact.apply(d,arguments)}),a.czr_activePanelId.callbacks.add(function(){return d.activePanelReact.apply(d,arguments)})}),a.bind("skope-switched-done",function(a){return a=c.extend({current_skope_id:"",previous_skope_id:"",updated_setting_ids:[]},a),d.skopeSwitchedDoneReact(a)}),a.czr_serverNotification=new a.Value({status:"success",message:"",expanded:!0}),a.czr_serverNotification.bind(function(a,b){d.toggleServerNotice(a)}),d._setupPreviewNotificationsBlocks(),d.scopeSwitcherEventMap=[{trigger:"click keydown",selector:".czr-dismiss-notification",name:"dismiss-notification",actions:function(){a.czr_serverNotification({expanded:!1})}},{trigger:"click keydown",selector:".czr-toggle-title-notice",name:"toggle-title-notice",actions:function(b){c.isUndefined(d.skopeTitleNoticeVisible)&&(d.skopeTitleNoticeVisible=new a.Value((!1)),d.skopeTitleNoticeVisible.bind(function(a){b.dom_el.find(".czr-skope-title").toggleClass("notice-visible",a)})),d.skopeTitleNoticeVisible(!d.skopeTitleNoticeVisible())}}],d.skopeWrapperEmbedded.then(function(){a.CZR_Helpers.setupDOMListeners(d.scopeSwitcherEventMap,{dom_el:b(".czr-scope-switcher")},d)}),d.refreshedControls=["czr_cropped_image"],d.initWidgetSidebarSpecifics(),a.bind("czr-paint",function(b){a.czr_skopeReady.then(function(){d.wash(b).paint(b)})})},embedSkopeWrapper:function(){var d=this;b("#customize-header-actions").append(b("<div/>",{"class":"czr-scope-switcher",html:'<div class="czr-skopes-wrapper"></div>'})),b("body").addClass("czr-skop-on");var e=[{trigger:"click keydown",selector:".czr-skope-switch",name:"control_skope_switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}}];a.CZR_Helpers.setupDOMListeners(e,{dom_el:b(".czr-scope-switcher")},d)},apiDirtynessReact:function(c){b("body").toggleClass("czr-api-dirty",c),a.state("saved")(!c)},setSaveButtonStates:function(){a.state.has("saving")||(a.state.create("saving"),a.state("saving").bind(function(a){b(document.body).toggleClass("saving",a)}));var c=b("#save"),d=b(".customize-controls-close"),e=a.state("saved"),f=a.state("saving"),g=a.state("activated"),h=a.state.has("changesetStatus")?a.state("changesetStatus")():"auto-draft";a.czr_dirtyness()||!e()?(c.val(a.l10n.save),d.find(".screen-reader-text").text(a.l10n.cancel)):(c.val(a.l10n.saved),d.find(".screen-reader-text").text(a.l10n.close));var i=!(f()||g()&&e()||"publish"===h);c.prop("disabled",!i)},skopeSwitchedDoneReact:function(d){var e=this,f=function(){a.czr_CrtlDependenciesReady.then(function(){if(!c.isUndefined(a.czr_activeSectionId())&&!c.isEmpty(a.czr_activeSectionId()))try{a.czr_ctrlDependencies.setServiDependencies(a.czr_activeSectionId(),null,!0)}catch(b){a.errorLog("On skope-switched-done : "+b)}}),e.updateCtrlSkpNot(a.CZR_Helpers.getSectionControlIds()),a.czr_skope.has(d.previous_skope_id)&&b("#customize-controls").removeClass(["czr-",a.czr_skope(d.previous_skope_id)().skope,"-skope-level"].join("")),a.czr_skope.has(d.current_skope_id)&&b("#customize-controls").addClass(["czr-",a.czr_skope(d.current_skope_id)().skope,"-skope-level"].join(""));var f=function(){if(!c.isUndefined(a.czr_activeSectionId())&&!c.isEmpty(a.czr_activeSectionId())){var b=a.CZR_Helpers.getSectionControlIds(a.czr_activeSectionId());c.each(b,function(b){a.control.when(b,function(){var d=a.control(b);c.has(d,"czr_states")&&d.deferred.embedded.then(function(){d.czr_states("noticeVisible")(e.isCtrlNoticeVisible(b)),d.czr_states("resetVisible")(!1)})})})}};a.czr_bottomInfosVisible()?e.renderBottomInfosTmpl():a.czr_bottomInfosVisible(!0),c.delay(function(){f()},500)};a.czr_skopeReady.then(function(){f()})},_setupPreviewNotificationsBlocks:function(){var d=this;a.czr_topNoteVisible=new a.Value((!1)),a.czr_skopeReady.then(function(){a.czr_topNoteVisible.bind(function(c){var e={},f={title:"",message:"",actions:"",selfCloseAfter:2e4};e=b.extend(f,serverControlParams.topNoteParams),e.actions=function(){var c=b.extend(a.previewer.query(),{nonce:a.previewer.nonce.save});wp.ajax.post("czr_dismiss_top_note",c).always(function(){}).fail(function(b){a.consoleLog("czr_dismiss_top_note failed",c,b)}).done(function(a){})},d.toggleTopNote(c,e)}),c.delay(function(){a.czr_topNoteVisible(!c.isEmpty(serverControlParams.isTopNoteOn)||1==serverControlParams.isTopNoteOn)},2e3)}),a.czr_bottomInfosVisible=new a.Value((!1)),a.czr_skopeReady.then(function(){a.czr_bottomInfosVisible.bind(function(a){var c={},e={title:"",message:"",actions:"",selfCloseAfter:2e4};return c=b.extend(e,{}),d.toggleBottomInfos(a,c)},{deferred:!0});var e=a.CZR_Helpers.build_setId("show-skope-infos");a.when(e,function(b){a.czr_bottomInfosVisible.validate=function(a){var c=b(),d=0!==c&&"0"!==c&&!1!==c&&"off"!==c;return!!d&&a},b.bind(function(b){a.czr_bottomInfosVisible(0!==b&&"0"!==b&&!1!==b&&"off"!==b)})}),c.delay(function(){a.czr_bottomInfosVisible(!0)},2e3)})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleServerNotice:function(d){if(d=c.isObject(d)?d:{},d=c.extend({status:"success",expanded:!0,message:"",auto_collapse:!1},d),"changeset_already_published"!=d.message&&serverControlParams.isDevMode){this.serverNoticeEmbedded=this.serverNoticeEmbedded||b.Deferred();var e=this,f=function(){b(".czr-scope-switcher").prepend(b("<div/>",{"class":"czr-server-notice",html:'<span class="czr-server-message"></span><span class="fa fa-times-circle czr-dismiss-notification"></span>'}))},g=function(){var a,f,g=b(".czr-server-notice",".czr-scope-switcher"),h=b(".wp-full-overlay-header"),i=(b(".wp-full-overlay-sidebar .wp-full-overlay-sidebar-content"),function(a){return!0});e.skopeTitleNoticeVisible&&e.skopeTitleNoticeVisible(!1),d.expanded?(g.toggleClass("czr-server-error","error"==d.status),"error"==d.status?b(".czr-server-message",g).html(c.isEmpty(d.message)?"Server Problem.":d.message):b(".czr-server-message",g).html(c.isEmpty(d.message)?"Success.":d.message),f=b(".czr-server-notice",".czr-scope-switcher").outerHeight(),a=h.outerHeight()+f,setTimeout(function(){b.when(i(a)).done(function(){g.fadeIn({duration:200,complete:function(){b(this).css("height","auto")}})})},400)):(g.fadeOut({duration:200,complete:function(){}}),setTimeout(function(){i()},200))};"pending"==e.serverNoticeEmbedded.state()?b.when(f()).done(function(){setTimeout(function(){e.serverNoticeEmbedded.resolve(),g()},200)}):g(),c.delay(function(){a.czr_serverNotification({expanded:!1})},"success"==d.status||!1!==d.auto_collapse?4e3:5e3)}},buildServerResponse:function(a){var b=!1;if(c.isObject(a)&&(!c.has(a,"responseJSON")||c.isUndefined(a.responseJSON.data)||c.isEmpty(a.responseJSON.data)?c.has(a,"statusText")&&!c.isEmpty(a.statusText)&&(b=a.statusText):b=a.responseJSON.data),c.isObject(a)&&!b)try{JSON.stringify(a)}catch(d){b="Server Error"}else b?"-1"===a&&(b="Identification issue detected, please refresh your page."):b="0"===a?"Not logged in.":a;return b}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleTopNote:function(d,e){e=c.isObject(e)?e:{};var f=this,g={title:"",message:"",actions:"",selfCloseAfter:2e4},h=function(){b.when(f.renderTopNoteTmpl(e)).done(function(d){f.welcomeNote=d,c.delay(function(){b("body").addClass("czr-top-note-open")},200),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:".czr-preview-note-close",actions:function(){i().done(function(){a.czr_topNoteVisible(!1),c.isFunction(e.actions)&&e.actions()})}}],{dom_el:f.welcomeNote},f)})},i=function(){var a=b.Deferred();return b("body").removeClass("czr-top-note-open"),f.welcomeNote.length?c.delay(function(){f.welcomeNote.remove(),a.resolve()},300):a.resolve(),a.promise()};e=b.extend(g,e),d?h():i().done(function(){a.czr_topNoteVisible(!1)}),c.delay(function(){a.czr_topNoteVisible(!1)},e.selfCloseAfter||2e4)},renderTopNoteTmpl:function(c){if(b("#czr-top-note").length)return b("#czr-top-note");var d="",e=c.title||"",f=c.message||"";try{d=wp.template("czr-top-note")({title:e})}catch(g){return a.errorLog("Error when parsing the the top note template : "+g),!1}return b("#customize-preview").after(b(d)),b(".czr-note-message","#czr-top-note").html(f),b("#czr-top-note")}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{bindAPISettings:function(b){var d=this,e=function(b,e,f){var g,h=this.id;serverControlParams.isSkopOn&&(c.has(a,"czr_activeSkopeId")&&!c.isUndefined(a.czr_activeSkopeId())||a.errorLog("The api.czr_activeSkopeId() is undefined in the api.czr_skopeBase.bindAPISettings method."),a(h)._dirty&&(g=d.isSettingSkopeEligible(h)?a.czr_activeSkopeId():d.getGlobalSkopeId(),a.czr_skope(g).updateSkopeDirties(h,b)),c.has(a.control(h),"czr_states")&&!a.control(h).czr_states("isResetting")()&&a.control(h).czr_states("resetVisible")(!1),d.isSettingSkopeEligible(h)&&d.updateCtrlSkpNot(h))};c.isUndefined(b)?a.each(function(a){a.bind(e)}):a(b).bind(e);var f=function(a){a.callbacks.has(e)||a.bind(e)};a.topics.change.has(f)||a.bind("change",f)}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{reactWhenSkopeSyncedDone:function(d){var e=b.Deferred();if(!c.has(d,"czr_skopes")||c.isEmpty(d.czr_skopes))return a.errorLog("Missing skope data after refresh",d),e.resolve().promise();a.czr_dirtyness()||a.czr_dirtyness(!!c.isBoolean(d.isChangesetDirty)&&d.isChangesetDirty);var f=d.czr_skopes;return c.each(a.czr_skopeCollection(),function(b){var d=c.findWhere(f,{opt_name:b.opt_name});if(!c.isUndefined(d)){var e=c.isEmpty(d.changeset||{})?{}:d.changeset,g={};c.each(e,function(b,c){a.has(c)||a.consoleLog("In reactWhenSkopeSyncedDone : attempting to update the changeset with a non registered setting : "+c),g[c]=b}),a.czr_skope(b.id).changesetValues(g)}}),c.each(a.czr_skopeCollection(),function(d){var e=c.findWhere(f,{opt_name:d.opt_name});if(!c.isUndefined(e)){var g=b.extend(!0,{},a.czr_skope(d.id).dbValues()),h=b.extend(g,e.db||{}),i={};c.each(h,function(b,c){a.has(c)||a.consoleLog("In reactWhenSkopeSyncedDone : attempting to update the db values with a non registered setting : "+c),i[c]=b}),a.czr_skope(d.id).dbValues(i)}}),c.delay(function(){e.resolve()},500),e.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{_maybeSetupAssignedMenuLocations:function(b){(c.isUndefined(b)||c.isEmpty(b)||!a.section.has(b.id))&&a.consoleLog("In _maybeSetupAssignedMenuLocations : no valid section_id provided.");if(b.assignedLocations){var d=function(a){};b.assignedLocations.callbacks.has(d)||b.assignedLocations.bind(d)}},activeSectionReact:function(b,d){"add_menu"!=b&&a.trigger("czr-paint",{active_section_id:b});var e=this,f=function(b){var d=a.CZR_Helpers.getSectionControlIds(b);c.each(d,function(b){if(a.has(b)&&!c.isUndefined(a.control(b))){var d=a.control(b);c.has(d,"czr_states")&&d.czr_states("resetVisible")(!1)}})},g=function(b,d){e.setupActiveSkopedControls({section_id:d}),e.processSilentUpdates({section_id:d}).fail(function(){throw new Error("Fail to process silent updates after initial skope collection has been populated")}).done(function(){var b=function(){var b=a.CZR_Helpers.getSectionControlIds(d);c.each(b,function(b){if(a.has(b)&&!c.isUndefined(a.control(b))){var d=a.control(b);c.has(d,"czr_states")&&d.czr_states("noticeVisible")(e.isCtrlNoticeVisible(b))}})};c.delay(function(){b()},700),e.isExcludedSidebarsWidgets()||e.forceSidebarDirtyRefresh(d,a.czr_activeSkopeId())}),c.has(a.topics,"active-section-setup")||a.bind("active-section-setup",function(a){var b={controls:[],section_id:""};a=c.extend(b,a),e._maybeSetupAssignedMenuLocations(a)}),a.czr_skopeReady.then(function(){var b=function(b){a.czr_serverNotification({status:"success",message:[b,serverControlParams.i18n.skope["can only be customized sitewide."]].join(" ")}),a.czr_activeSkopeId(e.getGlobalSkopeId())};"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&(!e.isExcludedWPCustomCss()||"custom_css"!=d&&"admin_sec"!=d||b(a.section(d).params.title),"nav_menu["!=d.substring(0,"nav_menu[".length)&&"add_menu"!=d||a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Menus are created sitewide."]].join(" ")}))}),a.trigger("active-section-setup",b)};a.czr_initialSkopeCollectionPopulated.then(function(){a.section.when(b,function(c){c.deferred.embedded.then(function(){try{g(c,b)}catch(d){a.errorLog("activeSectionReact => _doReactActive : "+d)}})}),!c.isEmpty(d)&&a.section.has(d)&&f(d)})},activePanelReact:function(b,d){var e=this;a.czr_initialSkopeCollectionPopulated.then(function(){a.trigger("czr-paint",{active_panel_id:b});a.czr_skopeReady.then(function(){"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&e.isExcludedSidebarsWidgets()&&"widgets"==b&&a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Widgets are created sitewide."]].join(" ")})}),a.czr_skopeReady.then(function(){"nav_menus"==b&&c.each(a.panel(b).sections(),function(a){e.processSilentUpdates({section_id:a.id,awake_if_not_active:!0})})})})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{wash:function(d){var e=function(a){c.has(a,"el")&&a.el.length&&b.when(a.el.removeClass("czr-painted")).done(function(){b(this).css("background","").css("color","")})};return a.czr_skopeBase.paintedElements&&(c.each(a.czr_skopeBase.paintedElements(),function(a){e(a)}),a.czr_skopeBase.paintedElements([])),this},paint:function(d){var e="inherit",f={active_panel_id:a.czr_activePanelId(),active_section_id:a.czr_activeSectionId(),is_skope_switch:!1},g=[];d=b.extend(f,d),!c.isUndefined(a.czr_activeSkopeId())&&a.czr_skope.has(a.czr_activeSkopeId())&&(e=a.czr_skope(a.czr_activeSkopeId()).color);var h=function(f){c.has(f,"el")&&f.el.length&&(d.is_skope_switch?b.when(f.el.addClass("czr-painted")).done(function(){b(this).css("background",f.bgColor||e)}):f.el.css("background",f.bgColor||e),"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&f.el.css("color","#000"))};return a.czr_skopeBase.paintedElements=a.czr_skopeBase.paintedElements||new a.Value([]),c.isEmpty(d.active_panel_id)&&c.isEmpty(d.active_section_id)&&(g.push({el:b("#customize-info").find(".accordion-section-title").first()}),a.panel.each(function(a){g.push({el:a.container.find(".accordion-section-title").first()})}),a.section.each(function(a){c.isEmpty(a.panel())&&g.push({
12
+ el:a.container.find(".accordion-section-title").first()})})),!c.isEmpty(d.active_panel_id)&&c.isEmpty(d.active_section_id)&&a.panel.when(d.active_panel_id,function(a){a.deferred.embedded.then(function(){g.push({el:a.container.find(".accordion-section-title, .customize-panel-back")})})}),c.isEmpty(d.active_section_id)||a.section.when(d.active_section_id,function(b){b.deferred.embedded.then(function(){g.push({el:b.container.find(".customize-section-title, .customize-section-back"),bgColor:"inherit"},{el:b.container}),a.czr_isChangeSetOn()||g.push({el:b.container.find(".accordion-section-content")})})}),c.each(g,function(a){h(a)}),a.czr_skopeBase.paintedElements(g),this}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleBottomInfos:function(d,e){e=c.isObject(e)?e:{};var f=this,g=b.Deferred(),h={title:"",message:"",actions:"",selfCloseAfter:2e4},i=a.CZR_Helpers.build_setId("show-skope-infos"),j=function(){var d=b.Deferred();return b.when(f.renderBottomInfosTmpl(e)).done(function(g){f.bottomInfosContainer=g,c.delay(function(){b("body").addClass("czr-bottom-infos-open"),d.resolve()},200),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:".czr-preview-note-close",actions:function(){k().done(function(){a.czr_bottomInfosVisible(!1),c.isFunction(e.actions)&&e.actions()})}},{trigger:"click keydown",selector:".czr-skope-switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}},{trigger:"click keydown",selector:".czr-disable-bottom-infos",actions:function(b){a.control.has(i)&&a.control(i).focus()}}],{dom_el:f.bottomInfosContainer},f)}).fail(function(){d.resolve()}),d.promise()},k=function(){return b.Deferred(function(){var a=this;b("body").removeClass("czr-bottom-infos-open"),f.bottomInfosContainer.length?c.delay(function(){f.bottomInfosContainer.remove(),f.bottomInfosContainer=!1,a.resolve()},300):a.resolve()})};return e=b.extend(h,e),d?j().always(function(){g.resolve()}):k().done(function(){a.czr_bottomInfosVisible(!1),g.resolve()}),g.promise()},renderBottomInfosTmpl:function(d){d=d||{};var e=this,f="",g=a.czr_activeSkopeId();if(!a.czr_skope.has(g)||!c.isObject(a.czr_skope(g)()))return!1;var h=a.czr_skope(g)().long_title,i=a.czr_skope(g)().ctx_title;h=c.isString(h)?h:"",i=c.isString(i)?i:"";var j=d.title||["Customizing",i.toLowerCase()].join(" "),k=d.message||e._getSkopeInfosMessage(g),l=function(){return b.Deferred(function(){var c=this;try{f=wp.template("czr-bottom-infos")({title:j}),b("#customize-preview").after(b(f)),c.resolve()}catch(d){a.errorLog("Error when parsing the the bottom infos template : "+d),c.reject(d)}})};return c.isUndefined(this.bottomInfosContainer)||1!=this.bottomInfosContainer.length?l().done(function(){b(".czr-note-message","#czr-bottom-infos").html(k)}):b(".czr-note-content",e.bottomInfosContainer).fadeOut({duration:"fast",complete:function(){b("h2",e.bottomInfosContainer).html(["&middot;",j,"&middot;"].join(" ")),b(".czr-note-message",e.bottomInfosContainer).html(k),b(this).fadeIn("fast")}}),this.bottomInfosContainer&&1==this.bottomInfosContainer.length?this.bottomInfosContainer:b("#czr-bottom-infos")},_getSkopeInfosMessage:function(d){d=d||a.czr_activeSkopeId();var e=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(!a.czr_skope.has(d)||!c.isObject(a.czr_skope(d)())||c.isUndefined(e))return"";var f,g=this,h=a.czr_skope(d)().skope,i=g.getInheritedSkopeTitles(),j=g.getOverridenSkopeTitles(),k=a.czr_skope(e)().ctx_title;a.czr_skope(d)().long_title;switch(h){case"global":f=[serverControlParams.i18n.skope["The customizations made site wide are inherited by all other levels of customization."],"<br/>",serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized more specifically at the following level"]+"(s)",":",j+"."].join(" ");break;case"group":f=[serverControlParams.i18n.skope["The current customizations will be applied to"],a.czr_skope(d)().ctx_title.toLowerCase()+".","<br/>",serverControlParams.i18n.skope["The options not customized at this level will inherit their value from"],i,".<br/>",serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized more specifically at the following level"],":",j+"."].join(" ");break;case"local":f=[serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized with a specific set of options."],"<br/>",serverControlParams.i18n.skope["The options not customized at this level will inherit their value from"],i+"."].join(" ")}return b.trim(['<span class="czr-skope-bottom-infos">',f,"</span>"].join(" "))}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{isSkopeRegisteredInCollection:function(b,d){return d=d||a.czr_skopeCollection(),!c.isUndefined(c.findWhere(d,{id:b}))},isSkopeRegisteredInCurrentCollection:function(b,d){return d=d||a.czr_currentSkopesCollection(),!c.isUndefined(c.findWhere(d,{id:b}))},isGlobalSkopeRegistered:function(){var b=c.findWhere(a.czr_currentSkopesCollection(),{skope:"global"});return c.isObject(b)&&c.has(b,"id")},getGlobalSkopeId:function(){if(!c.has(a,"czr_skope"))return"";var b="";return a.czr_skope.each(function(a){"global"==a().skope&&(b=a().id)}),b},getChangedGlobalDBSettingValues:function(b){var d={};return c.each(b,function(b,e){_wpSetId=a.CZR_Helpers.build_setId(e),c.has(a.settings.settings,_wpSetId)&&(c.isEqual(b,a.settings.settings[_wpSetId].value)||(d[e]=b))}),d},getActiveSkopeId:function(b){b=b||a.czr_currentSkopesCollection();var d,e,f;if(d=!c.isEmpty(a.czr_activeSkopeId())&&a.czr_skope.has(a.czr_activeSkopeId())?a.czr_skope(a.czr_activeSkopeId())().skope:serverControlParams.isLocalSkope?"local":"global",e=c.findWhere(b,{skope:d}),f=c.isUndefined(e)?c.findWhere(b,{skope:"global"}).id:e.id,c.isUndefined(f))throw new Error("No default skope was found in getActiveSkopeId ",b);return f},getActiveSkopeName:function(){return a.czr_skope.has(a.czr_activeSkopeId())?a.czr_skope(a.czr_activeSkopeId())().skope:"global"},isSettingSkopeEligible:function(b){var d=this,e=a.CZR_Helpers.getOptionName(b);return c.isUndefined(b)||!a.has(b)?(a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO SKOPE BECAUSE UNDEFINED OR NOT REGISTERED IN THE API."),!1):!d.isExcludedWPBuiltinSetting(b)&&(!c.contains(serverControlParams.skopeExcludedSettings,e)&&(d.isThemeSetting(b),!0))},isSettingResetEligible:function(b){var d=this;a.CZR_Helpers.getOptionName(b);if(c.isUndefined(b)||!a.has(b))return void a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO RESET BECAUSE UNDEFINED OR NOT REGISTERED IN THE API.");if(!d.isExcludedWPBuiltinSetting(b))return!(!d.isThemeSetting(b)&&!d.isWPAuthorizedSetting(b))||void a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO RESET BECAUSE NOT PART OF THE THEME OPTIONS AND NOT WP AUTHORIZED BUILT IN OPTIONS")},isThemeSetting:function(a){return c.isString(a)&&-1!==a.indexOf(serverControlParams.themeOptions)},isWPAuthorizedSetting:function(a){return c.isString(a)&&c.contains(serverControlParams.wpBuiltinSettings,a)},isExcludedWPBuiltinSetting:function(a){var b=this;if(c.isUndefined(a))return!0;if("active_theme"==a)return!0;if(c.contains(serverControlParams.wpBuiltinSettings,a))return!1;var d=["widget_","nav_menu","sidebars_","custom_css","nav_menu[","nav_menu_item","nav_menus_created_posts","nav_menu_locations"],e=!1;return c.each(d,function(c){switch(c){case"widget_":case"sidebars_":c==a.substring(0,c.length)&&(e=b.isExcludedSidebarsWidgets());break;case"nav_menu[":case"nav_menu_item":case"nav_menus_created_posts":c==a.substring(0,c.length)&&(e=!0);break;case"nav_menu_locations":c==a.substring(0,c.length)&&(e=b.isExcludedNavMenuLocations());break;case"custom_css":c==a.substring(0,c.length)&&(e=b.isExcludedWPCustomCss())}}),e},isExcludedSidebarsWidgets:function(){var a=serverControlParams.isSidebarsWigetsSkoped;return!(!c.isUndefined(a)&&!c.isEmpty(a)&&!1!==a)},isExcludedNavMenuLocations:function(){if(!a.czr_isChangeSetOn())return!0;var b=serverControlParams.isNavMenuLocationsSkoped;return!(!c.isUndefined(b)&&!c.isEmpty(b)&&!1!==b)},isExcludedWPCustomCss:function(){var a=serverControlParams.isWPCustomCssSkoped;return!(!c.isUndefined(a)&&!c.isEmpty(a)&&!1!==a)},_getDBSettingVal:function(b,d){var e=a.CZR_Helpers.getOptionName(b),f=a.CZR_Helpers.build_setId(b);return a.czr_skope.has(d)?c.has(a.czr_skope(d).dbValues(),f)?a.czr_skope(d).dbValues()[f]:c.has(a.czr_skope(d).dbValues(),e)?a.czr_skope(d).dbValues()[e]:"_no_db_val":(a.consoleLog("_getDBSettingVal : the requested skope id is not registered : "+d),"_no_db_val")},getSkopeDirties:function(b,d){if(!a.czr_skope.has(b))return{};d=d||{},d=c.extend({unsaved:!0},d);var e={};return c.each(a.czr_skope(b).dirtyValues(),function(b,f){var g;a.czr_isChangeSetOn()&&(g=a._latestSettingRevisions[f],a.state("changesetStatus").get()&&d&&d.unsaved&&(c.isUndefined(g)||g<=a._lastSavedRevision))||(e[f]=b)}),e},getSkopeExcludedDirties:function(){var b=this,d={};a.each(function(a,b){a._dirty&&(d[b]=a())});var e=b.getGlobalSkopeId();b.getSkopeDirties(e);return c.omit(d,function(a,c){return b.isSettingSkopeEligible(c)})},parseWidgetId:function(a,b){var d,e={number:null,id_base:null};return d=a.match(/^(.+)-(\d+)$/),d?(e.id_base=d[1],e.number=parseInt(d[2],10)):e.id_base=a,c.isUndefined(b)||(e.id_base=e.id_base.replace(b,"")),e},widgetIdToSettingId:function(a,b){var c,d=this.parseWidgetId(a,b);return c=d.id_base,d.number&&(c+="["+d.number+"]"),c},isWidgetRegisteredGlobally:function(a){var b=this;return registered=!1,c.each(_wpCustomizeWidgetsSettings.registeredWidgets,function(c,d){registered||"widget_"+b.widgetIdToSettingId(d)!=a||(registered=!0)}),registered}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{getAppliedPrioritySkopeId:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getAppliedPrioritySkopeId : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),d;if(!a.czr_skope.has(d))return a.errorLog("getAppliedPrioritySkopeId : the requested skope id is not registered : "+d),d;var e=this,f=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(c.isUndefined(f)||d==f)return d;var g=function(c){var f=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(c)();if(c==d)return d;if(a.czr_skope(c).getSkopeSettingAPIDirtyness(f))return i.id;if(a.czr_isChangeSetOn()&&a.czr_skope(c).getSkopeSettingChangesetDirtyness(f))return i.id;var j=e._getDBSettingVal(b,c);return"_no_db_val"!=j?i.id:"global"==i.skope?i.id:"___"!=h?i.title:g(e._getParentSkopeId(i))};return g(f)},getOverridenSkopeTitles:function(){var b=b||a.czr_activeSkopeId();if(!a.czr_skope.has(b))return a.errorLog("getInheritedSkopeTitles : the requested skope id is not registered : "+b),"";var d=this,e=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(c.isUndefined(e)||b==e)return"";var f=function(c,e){e=e||[];var g=a.czr_skope(c)();return c==b?e:(e.unshift(c),f(d._getParentSkopeId(g),e))};return c.map(f(e),function(a){return d.buildSkopeLink(a)}).join(" "+serverControlParams.i18n.skope.and+" ")},getInheritedSkopeId:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getInheritedSkopeId : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),d;if(!a.czr_skope.has(d))return a.errorLog("getInheritedSkopeId : the requested skope id is not registered : "+d),d;var e,f=this,g=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(d)();if(e=c.has(a.settings.settings,g)?a.settings.settings[g].value:null,a.czr_skope(d).getSkopeSettingAPIDirtyness(g))return d;if(a.czr_isChangeSetOn()&&a.czr_skope(d).getSkopeSettingChangesetDirtyness(g))return d;var j=f._getDBSettingVal(b,d);return"_no_db_val"!=j?d:"global"==i.skope?d:"___"!=h?d:f.getInheritedSkopeId(b,f._getParentSkopeId(i))},getInheritedSkopeTitles:function(b,d){if(b=b||a.czr_activeSkopeId(),!a.czr_skope.has(b))return a.errorLog("getInheritedSkopeTitles : the requested skope id is not registered : "+b),"";d=d||[];var e=this,f=a.czr_skope(b)();return b!==a.czr_activeSkopeId()&&d.unshift(b),"global"!==f.skope?e.getInheritedSkopeTitles(e._getParentSkopeId(f),d):c.map(d,function(a){return e.buildSkopeLink(a)}).join(" "+serverControlParams.i18n.skope.and+" ")},buildSkopeLink:function(b){if(!a.czr_skope.has(b))return a.errorLog("buildSkopeLink : the requested skope id is not registered : "+b),"";var c=[serverControlParams.i18n.skope["Switch to scope"],a.czr_skope(b)().title].join(" : ");return['<span class="czr-skope-switch" title=" '+c+'" data-skope-id="'+b+'">',a.czr_skope(b)().title,"</span>"].join("")},getSkopeSettingVal:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getSkopeSettingVal : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),null;if(!a.czr_skope.has(d))return a.errorLog("getSkopeSettingVal : the requested skope id is not registered : "+d),null;var e,f=this,g=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(d)();if(e=c.has(a.settings.settings,g)?a.settings.settings[g].value:null,a.czr_skope(d).getSkopeSettingAPIDirtyness(g))return a.czr_skope(d).dirtyValues()[g];if(a.czr_isChangeSetOn()&&a.czr_skope(d).getSkopeSettingChangesetDirtyness(g))return a.czr_skope(d).changesetValues()[g];var j=f._getDBSettingVal(b,d);return"_no_db_val"!=j?j:"global"==i.skope?"___"==h?e:h:"___"!=h?h:f.getSkopeSettingVal(b,f._getParentSkopeId(i))},applyDirtyCustomizedInheritance:function(b,d){d=d||a.czr_activeSkopeId()||a.czr_skopeBase.getGlobalSkopeId(),b=b||{};var e=this,f=a.czr_skope(d)();if("global"==f.skope)return b;var g=e._getParentSkopeId(f),h=a.czr_skope(g).dirtyValues();return c.each(h,function(d,e){var g=a.CZR_Helpers.getOptionName(e);c.isUndefined(b[e])&&c.isUndefined(a.czr_skope(f.id).dbValues()[g])&&(b[e]=d)}),"global"==a.czr_skope(g)().skope?b:e.applyDirtyCustomizedInheritance(b,g)},_getParentSkopeId:function(b,d){var e=this,f=["local","group","special_group","global"],g=d||1*(c.findIndex(f,function(a){return b.skope==a})+1),h=f[g];return c.isUndefined(h)?c.findWhere(a.czr_currentSkopesCollection(),{skope:"global"}).id:c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{skope:h}))?e._getParentSkopeId(b,g+1):c.findWhere(a.czr_currentSkopesCollection(),{skope:h}).id},_getChildSkopeId:function(b,d){var e=this,f=["local","group","special_group","global"],g=d||1*(c.findIndex(f,function(a){return b.skope==a})-1),h=f[g];return c.isUndefined(h)?c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id:c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{skope:h}))?e._getParentSkopeId(b,g-1):c.findWhere(a.czr_currentSkopesCollection(),{skope:h}).id}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{updateSkopeCollection:function(d,e){var f=this;if(_api_ready_collection=[],c.each(d,function(a,c){var d=b.extend(!0,{},a);_api_ready_collection.push(f.prepareSkopeForAPI(d))}),f.isGlobalSkopeRegistered()){var g=[],h=b.extend(!0,{},a.czr_skope(f.getGlobalSkopeId())());c.each(_api_ready_collection,function(a,b){"global"==a.skope?g.push(h):g.push(a)}),_api_ready_collection=g}a.czr_currentSkopesCollection(_api_ready_collection)},prepareSkopeForAPI:function(a){if(!c.isObject(a))throw new Error("prepareSkopeForAPI : a skope must be an object to be API ready");var b=this,d={};if(c.each(serverControlParams.defaultSkopeModel,function(b,e){var f=a[e];switch(e){case"title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope title property must a string");d[e]=f;break;case"long_title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope title property must a string");d[e]=f;break;case"ctx_title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope context title property must a string");d[e]=f;break;case"skope":if(!c.isString(f)||c.isEmpty(f))throw new Error('prepareSkopeForAPI : a skope "skope" property must a string not empty');d[e]=f;break;case"level":if(!c.isString(f)||c.isEmpty(f))throw new Error("prepareSkopeForAPI : a skope level must a string not empty for skope "+f.skope);d[e]=f;break;case"dyn_type":if(!c.isString(f)||!c.contains(serverControlParams.skopeDynTypes,f))throw new Error("prepareSkopeForAPI : missing or invalid dyn type for skope "+a);d[e]=f;break;case"opt_name":if(!c.isString(f)||c.isEmpty(f))throw new Error('prepareSkopeForAPI : invalid "opt_name" property for skope '+f.skope);d[e]=f;break;case"obj_id":if(!c.isString(f))throw new Error('prepareSkopeForAPI : invalid "obj_id" for skope '+f.skope);d[e]=f;break;case"is_winner":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "is_winner" must be a boolean');d[e]=f;break;case"is_forced":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "is_primary" must be a boolean');d[e]=f;break;case"db":if((c.isArray(f)||c.isEmpty(f))&&(f={}),c.isUndefined(f)||!c.isObject(f))throw new Error('prepareSkopeForAPI : skope property "db" must be an object');d[e]=f;break;case"changeset":if((c.isArray(f)||c.isEmpty(f))&&(f={}),c.isUndefined(f)||!c.isObject(f))throw new Error('prepareSkopeForAPI : skope property "changeset" must be an object');d[e]=f;break;case"has_db_val":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "has_db_val" must be a boolean');d[e]=f}}),d.color=b.skope_colors[d.skope]||"rgb(255, 255, 255)",d.id=d.skope+"_"+d.level,!c.isString(d.id)||c.isEmpty(d.id))throw new Error("prepareSkopeForAPI : a skope id must a string not empty");return c.isString(d.title)&&!c.isEmpty(d.title)||(d.title=id,d.long_title=id),d},currentSkopesCollectionReact:function(d,e){var f=this,g=b.extend(!0,[],d)||[],h=(b.extend(!0,[],e)||[],b.Deferred()),i=[];_to_remove=[],_to_update=[],_instantiateAndEmbed=function(d){c.each(d,function(c){c=b.extend(!0,{},c),a.czr_skope.add(c.id,new a.CZR_skope(c.id,c))}),c.each(d,function(b){if(!a.czr_skope.has(b.id))throw new Error("Skope id : "+b.id+" has not been instantiated.");"pending"==a.czr_skope(b.id).isReady.state()&&a.czr_skope(b.id).ready()})},c.each(g,function(b){a.czr_skope.has(b.id)||i.push(b)});try{_instantiateAndEmbed(i)}catch(j){return a.errorLog("currentSkopesCollectionReact : "+j),h.resolve().promise()}var k=function(){var d=c.size(g),e=function(a){var e=a.container.attr("class").split(" ");c.each(a.container.attr("class").split(" "),function(a){"width-"==a.substring(0,6)&&(e=c.without(e,a))}),b.when(a.container.attr("class",e.join(" "))).done(function(){a.container.addClass("width-"+Math.round(100/d))})};a.czr_skope.each(function(a){if(c.isUndefined(c.findWhere(g,{id:a().id})))a.visible(!1),a.isReady.then(function(){a.container.toggleClass("active-collection",!1)});else{a.visible(!0);var b=function(){e(a),a.container.toggleClass("active-collection",!0)};"pending"==a.isReady.state()?a.isReady.then(function(){b()}):b()}})};return f.skopeWrapperEmbedded.then(function(){k()}),c.isEmpty(e)&&!c.isEmpty(d)&&a.czr_initialSkopeCollectionPopulated.resolve(),f.maybeSynchronizeGlobalSkope(),h.resolve("changed").promise()},maybeSynchronizeGlobalSkope:function(d){if(d=d||{},!c.isObject(d))throw new Error("maybeSynchronizeGlobalSkope : args must be an object");var e,f,g,h=this,i=b.Deferred();c.extend({isGlobalReset:!1,isSetting:!1,settingIdToReset:"",isSkope:!1,skopeIdToReset:""},d);if(h.isGlobalSkopeRegistered()){var j=a.czr_skope(h.getGlobalSkopeId()).dbValues();if(c.each(j,function(b,d){a.has(d)&&!c.isEqual(a.settings.settings[d].value,b)&&(a.settings.settings[d].value=b)}),d.isGlobalReset&&d.isSetting){if(e=d.settingIdToReset,f=a.CZR_Helpers.getOptionName(e),g=serverControlParams.defaultOptionsValues[f],c.isUndefined(a.settings.settings[e])||c.isUndefined(g))return;g!=a.settings.settings[e].value&&(a.settings.settings[e].value=g)}d.isGlobalReset&&d.isSkope&&c.each(a.settings.settings,function(b,d){h.isThemeSetting(d)&&(f=a.CZR_Helpers.getOptionName(d),c.has(serverControlParams.defaultOptionsValues,f)&&(a.settings.settings[d].value=serverControlParams.defaultOptionsValues[f]))})}return i.resolve().promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{activeSkopeReact:function(d,e){var f=this,g=b.Deferred();if(!c.isUndefined(e)&&a.czr_skope.has(e))a.czr_skope(e).active(!1);else if(!c.isUndefined(e))throw new Error("listenToActiveSkope : previous scope does not exist in the collection",e);if(c.isUndefined(d)||!a.czr_skope.has(d))throw new Error("listenToActiveSkope : requested scope "+d+" does not exist in the collection");a.czr_skope(d).active(!0);var h=function(b){return a.czr_activeSkopeId(f.getGlobalSkopeId()),a.czr_serverNotification({status:"success",message:[b,"can only be customized sitewide."].join(" ")}),g.resolve().promise()};if(f.isExcludedSidebarsWidgets()&&"widgets"==a.czr_activePanelId()&&d!=f.getGlobalSkopeId()&&a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Widgets are created sitewide."]].join(" ")}),f.isExcludedWPCustomCss()&&"custom_css"==a.czr_activeSectionId()&&d!=f.getGlobalSkopeId())return h(a.section(a.czr_activeSectionId()).params.title);if("admin_sec"==a.czr_activeSectionId()&&d!=f.getGlobalSkopeId())return h(a.section(a.czr_activeSectionId()).params.title);if("nav_menu"!=a.czr_activeSectionId().substring(0,"nav_menu".length)&&"add_menu"!=a.czr_activeSectionId()||d==f.getGlobalSkopeId()||a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Menus are created sitewide."]].join(" ")}),"nav_menus"==a.czr_activePanelId()&&c.each(a.panel(a.czr_activePanelId()).sections(),function(a){f.processSilentUpdates({section_id:a.id,awake_if_not_active:!0})}),a.state("switching-skope")(!0),f._writeCurrentSkopeTitle(d),a.trigger("czr-paint",{is_skope_switch:!0}),c.isUndefined(a.czr_activeSectionId()))return a.state("switching-skope")(!1),a.previewer.refresh(),g.resolve().promise();c.has(a,"czrModulePanelState")&&a.czrModulePanelState(!1);var i=f._getSilentUpdateCandidates();c.isUndefined(e)||c.each(a.czr_skope(e).dirtyValues(),function(a,b){c.contains(i,b)||i.push(b)}),c.isUndefined(d)||c.each(a.czr_skope(d).dirtyValues(),function(a,b){c.contains(i,b)||i.push(b)});var j=function(){f.processSilentUpdates({candidates:i,section_id:null,refresh:!1}).fail(function(){throw g.reject(),a.state("switching-skope")(!1),new Error("Fail to process silent updates in _debouncedProcessSilentUpdates")}).done(function(b){c.isUndefined(e)&&a.czr_skope.has(d)&&"global"==a.czr_skope(d)().skope?(g.resolve(b),a.state("switching-skope")(!1)):a.previewer.refresh().always(function(){g.resolve(b),a.state("switching-skope")(!1)})})};return c.has(a,"czr_isModuleExpanded")&&!1!==a.czr_isModuleExpanded()?(a.czr_isModuleExpanded().setupModuleViewStateListeners(!1),(j=c.debounce(j,400))()):j(),g.promise()},_writeCurrentSkopeTitle:function(d){var e=this,f=a.czr_skope(d||a.czr_activeSkopeId())().long_title,g=function(){var g=e.getInheritedSkopeTitles(),h=e.getOverridenSkopeTitles();return b.trim(['<span class="czr-main-title"><span class="czr-toggle-title-notice fa fa-info-circle"></span>',"global"==a.czr_skope(d||a.czr_activeSkopeId())().skope?f:["Customizing",f].join(" "),"</span>",'<span class="czr-skope-inherits-from">',serverControlParams.i18n.skope["In this context :"],c.isEmpty(g)?" ":serverControlParams.i18n.skope["inherits from"],g,c.isEmpty(g)?"":c.isEmpty(h)?".":[",",serverControlParams.i18n.skope.and].join(" "),c.isEmpty(h)?" ":serverControlParams.i18n.skope["overridden by"],h,c.isEmpty(h)?"":".","</span>"].join(" "))},h=function(a){a?b(".czr-scope-switcher").find(".spinner").fadeIn():b(".czr-scope-switcher").find(".spinner").fadeOut()};e.skopeWrapperEmbedded.then(function(){b(".czr-scope-switcher").find(".czr-current-skope-title").length?b.when(b(".czr-scope-switcher").find(".czr-skope-title").fadeOut(200)).done(function(){b(this).html(g()).fadeIn(200)}):b(".czr-scope-switcher").prepend(b("<h2/>",{"class":"czr-current-skope-title",html:['<span class="czr-skope-title">','<span class="spinner">',g(),"</span>","</span>"].join("")})),c.isUndefined(a.state("switching-skope").isBound)&&(a.state("switching-skope").bind(h),a.state("switching-skope").isBound=!0)})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{processSilentUpdates:function(d){d=c.isString(d)?{candidates:[d]}:d||{};var e=this,f={candidates:[],section_id:a.czr_activeSectionId(),refresh:!0,awake_if_not_active:!1},g=b.Deferred();if(d=b.extend(f,d),c.isString(d.candidates)&&(d.candidates=[d.candidates]),c.isEmpty(d.candidates)&&(d.candidates=e._getSilentUpdateCandidates(d.section_id,d.awake_if_not_active)),!c.isArray(d.candidates))throw new Error("processSilentUpdates : the update candidates must be an array.");if(c.isEmpty(d.candidates))return g.resolve([]).promise();var h=function(){e.silentlyUpdateSettings(d.candidates,d.refresh).fail(function(){g.reject()}).done(function(a){c.delay(function(){e.setupActiveSkopedControls({section_id:d.section_id})},1e3),g.resolve(a)})};return"resolved"!=a.czr_skopeReady.state()?(g.resolve([]),a.czr_skopeReady.done(function(){h()})):h(),g.promise()},silentlyUpdateSettings:function(d,e){a.state.has("silent-update-processing")||a.state.create("silent-update-processing")(!1),a.state("silent-update-processing")(!0);var f=this,g={},h=b.Deferred();e=!!c.isUndefined(e)||e,(c.isUndefined(d)||c.isEmpty(d))&&(d=f._getSilentUpdateCandidates()),c.isString(d)&&(d=[d]),c.each(d,function(b){a.control.has(b)&&"czr_multi_module"==a.control(b).params.type||(g[b]=f.getSettingUpdatePromise(b))});var i=[],j=[];return c.each(g,function(b,d){b.done(function(b){var e=a.CZR_Helpers.build_setId(d),f=a.czr_skope(a.czr_activeSkopeId()).getSkopeSettingDirtyness(d);c.isEqual(a(e)(),b)||j.push(d),a(e).silent_set(b,f)}),i.push(b)}),b.when.apply(null,i).fail(function(){throw h.reject(),new Error("silentlyUpdateSettings FAILED. Candidates : "+d)}).always(function(){a.state("silent-update-processing")(!1)}).then(function(){c.each(i,function(a){if(c.isObject(a)&&"resolved"!==a.state())throw new Error("a silent update promise is unresolved : "+d)}),e&&!c.isEmpty(j)?a.previewer.refresh().always(function(){h.resolve(j)}):h.resolve(j)}),h.promise()},getSettingUpdatePromise:function(d){if(c.isUndefined(d))throw new Error("getSettingUpdatePromise : the provided setId is not defined");if(!a.has(a.CZR_Helpers.build_setId(d)))throw new Error("getSettingUpdatePromise : the provided wpSetId is not registered : "+a.CZR_Helpers.build_setId(d));var e=this,f=a.CZR_Helpers.build_setId(d),g=a(f)(),h=b.Deferred(),i=!1,j=a.czr_activeSkopeId(),k=a.czr_skopeBase.getSkopeSettingVal(d,j);if(c.isEqual(g,k))return h.resolve(k).promise();if(a.control.has(f)){var l=a.control(f).params.type,m=a.settings.controls[f];switch(l){case"czr_cropped_image":i=e._getCzrCroppedImagePromise(f,m);break;case"czr_module":e._processCzrModuleSilentActions(f,l,j,m)}}return c.has(a.settings.controls,"header_image")&&"header_image"==f&&(i=e._getHeaderImagePromise(f,j)),i&&c.isObject(i)?i.always(function(){h.resolve(k)}):h.resolve(k),h.promise()},_getSilentUpdateCandidates:function(b,d){var e=this,f=[];if(b=c.isUndefined(b)||c.isNull(b)?a.czr_activeSectionId():b,c.isEmpty(a.czr_activeSectionId())&&!d)return[];if(c.isUndefined(b))return a.consoleLog("_getSilentUpdateCandidates : No active section provided"),[];if(!a.section.has(b))throw new Error("_getSilentUpdateCandidates : The section "+b+" is not registered in the API.");var g=a.CZR_Helpers.getSectionSettingIds(b);return g=c.filter(g,function(a){return e.isSettingSkopeEligible(a)}),c.each(g,function(a){f.push(a)}),f}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{_processCzrModuleSilentActions:function(d,e,f,g){var h,i,j,k,l,m=c.has(a.control(d).params,"syncCollection")?a.control(d).params.syncCollection:"",n=a.CZR_Helpers.build_setId(d),o=a.czr_skopeBase.getSkopeSettingVal(n,f),p=a.czr_skope(a.czr_activeSkopeId());c.isEmpty(m)||c.isUndefined(m)||(h=a.CZR_Helpers.build_setId(m),i=a.czr_skopeBase.getSkopeSettingVal(h,f),j=a.settings.controls[h],k=a.controlConstructor.czr_multi_module,l=a.control(h).syncSektionModule()().id,a.control(h).container.remove(),a.control.remove(h),a(h).silent_set(i,p.getSkopeSettingDirtyness(h)),b.extend(j,{czr_skope:f}),a.control.add(h,new k(h,{params:j,previewer:a.previewer}))),_constructor=a.controlConstructor[e],a.control(d).container.remove(),a.control.remove(d),a(d).silent_set(o,p.getSkopeSettingDirtyness(n)),b.extend(g,{czr_skope:f}),a.control.add(d,new _constructor(d,{params:g,previewer:a.previewer})),c.isEmpty(m)||c.isUndefined(m)||(a.consoleLog("FIRE SEKTION MODULE?",l,a.control(d).czr_Module(l).isReady.state()),a.control(d).czr_Module(l).fireSektionModule())},_getCzrCroppedImagePromise:function(d,e){var f=a.controlConstructor.czr_cropped_image,g=b.Deferred(),h=a.has(d)?a(d)():null;return h=null===h?"":h,wp.media.attachment(h).fetch().done(function(){a.control(d).container.remove(),a.control.remove(d),e.attachment=this.attributes,a.control.add(d,new f(d,{params:e,previewer:a.previewer})),g.resolve()}).fail(function(){a.control(d).container.remove(),a.control.remove(d),e=c.omit(e,"attachment"),a.control.add(d,new f(d,{params:e,previewer:a.previewer})),g.reject()}),g.promise()},_getHeaderImagePromise:function(d,e){var f=b.Deferred();if(!c.has(a.settings.controls,"header_image")||"header_image"!=d)return f.resolve().promise();var g=a.controlConstructor.header,h=b.extend(!0,{},a.settings.controls.header_image);header_image_data=null===a.czr_skopeBase.getSkopeSettingVal("header_image_data",e)?"":a.czr_skopeBase.getSkopeSettingVal("header_image_data",e);var i,j=function(b){b=b||h,a.control("header_image").container.remove(),a.control.remove("header_image"),a.HeaderTool.UploadsList=a.czr_HeaderTool.UploadsList,a.HeaderTool.DefaultsList=a.czr_HeaderTool.DefaultsList,a.HeaderTool.CombinedList=a.czr_HeaderTool.CombinedList;var d=function(){a.control.add("header_image",new g("header_image",{params:b,previewer:a.previewer}))};(d=c.debounce(d,800))()};return c.has(header_image_data,"attachment_id")?(i=header_image_data.attachment_id,wp.media.attachment(i).fetch().done(function(){h.attachment=this.attributes,j(h),f.resolve()}).fail(function(){h=c.omit(h,"attachment"),a.control("header_image").container.remove(),a.control.remove("header_image"),a.HeaderTool.UploadsList=a.czr_HeaderTool.UploadsList,a.HeaderTool.DefaultsList=a.czr_HeaderTool.DefaultsList,a.HeaderTool.CombinedList=a.czr_HeaderTool.CombinedList,a.control.add("header_image",new g("header_image",{params:h,previewer:a.previewer})),f.reject()})):(j(),f.resolve()),f.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{setupActiveSkopedControls:function(d){var e,f,g,h,i=this,j=b.Deferred();if(defaultSetupParams={controls:[],section_id:a.czr_activeSectionId()},g=b.extend(defaultSetupParams,d),!c.isObject(g)||!c.has(g,"controls")||!c.has(g,"section_id"))throw new Error("setupActiveSkopedControls : the setupParams param must be an object with properties controls and section_id.");return e=g.section_id,f=g.controls,h=[],!c.isEmpty(e)&&c.isString(e)||(e=a.czr_activeSectionId()),c.isEmpty(f)&&(f=a.CZR_Helpers.getSectionControlIds(e)),f=c.isString(f)?[f]:f,h=c.filter(f,function(b){var c=a.CZR_Helpers.getControlSettingId(b);return c&&!i.isSettingSkopeEligible(c)&&a.control(b).container.addClass("czr-not-skoped"),c&&i.isWPAuthorizedSetting(c)&&a.control(b).container.addClass("is-wp-authorized-setting"),c&&i.isSettingSkopeEligible(c)}),"nav_menu["==e.substring(0,"nav_menu[".length)?j.resolve().promise():(c.isEmpty(f)||(a.czr_skopeReady.then(function(){
13
+ b.when(i.renderControlsSingleReset(h)).done(function(){c.each(f,function(a){i.listenSkopedControl(a)}),j.resolve()})}),"rejected"==a.czr_skopeReady.state()&&j.resolve()),i.renderCtrlSkpNotIcon(f),j.promise())},listenSkopedControl:function(d){var e=this;if(a.has(d)&&!c.isUndefined(a.control(d))){var f=a.control(d),g=a.CZR_Helpers.getControlSettingId(d),h=(a.CZR_Helpers.getOptionName(g),{hasDBVal:!1,isDirty:!1,noticeVisible:!1,resetVisible:!1,isResetting:!1});if(!c.has(f,"czr_states")){f.czr_states=new a.Values,c.each(h,function(a,b){f.czr_states.create(b),f.czr_states(b)(a)});try{e.bindControlStates(f)}catch(i){a.errorLog("bindControlStates : "+i)}}f.czr_states("hasDBVal")(a.czr_skope(a.czr_activeSkopeId()).hasSkopeSettingDBValues(g)),f.czr_states("isDirty")(a.czr_skope(a.czr_activeSkopeId()).getSkopeSettingDirtyness(g)),c.has(f,"userEventMap")||(f.userEventMap=[{trigger:"click keydown",selector:".czr-setting-reset, .czr-cancel-button",name:"control_reset_warning",actions:function(){(f.czr_states("isDirty")()||f.czr_states("hasDBVal")())&&(c.each(c.without(a.CZR_Helpers.getSectionControlIds(f.section()),d),function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("resetVisible")(!1)}),f.czr_states("resetVisible")(!f.czr_states("resetVisible")()),f.czr_states("noticeVisible")(!f.czr_states("resetVisible")()))}},{trigger:"click keydown",selector:".czr-control-do-reset",name:"control_do_reset",actions:function(){e.doResetSetting(d)}},{trigger:"click keydown",selector:".czr-skope-switch",name:"control_skope_switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}},{trigger:"click keydown",selector:".czr-toggle-notice",name:"control_toggle_notice",actions:function(a){f.czr_states("noticeVisible")(!f.czr_states("noticeVisible")()),f.czr_states("noticeVisible")()&&f.czr_states("resetVisible")(!1)}}],a.CZR_Helpers.setupDOMListeners(f.userEventMap,{dom_el:f.container},e))}},bindControlStates:function(d){if(!a.control.has(d.id))throw new Error("in bindControlStates, the provided ctrl id is not registered in the api : "+d.id);var e=this;a.CZR_Helpers.getControlSettingId(d.id);d.czr_states("hasDBVal").bind(function(a){d.container.toggleClass("has-db-val",a),a?_title=serverControlParams.i18n.skope["Reset your customized ( and published ) value"]:d.czr_states("isDirty")()?_title=serverControlParams.i18n.skope["Reset your customized ( but not yet published ) value"]:_title=serverControlParams.i18n.skope["Not customized yet, nothing to reset"],d.container.find(".czr-setting-reset").attr("title",_title)}),d.czr_states("isDirty").bind(function(a){d.container.toggleClass("is-dirty",a);var b;b=a?serverControlParams.i18n.skope["Reset your customized ( but not yet published ) value"]:d.czr_states("hasDBVal")()?serverControlParams.i18n.skope["Reset your customized ( and published ) value"]:serverControlParams.i18n.skope["Not customized yet, nothing to reset"],d.container.find(".czr-setting-reset").attr("title",b)}),d.czr_states("noticeVisible").bind(function(a){d.container.toggleClass("czr-notice-visible",a);var c=d.getNotificationsContainerElement();!1!==c&&!1!==c.length&&(a?(e.updateCtrlSkpNot(d.id,!0),c.stop().slideDown("fast",null,function(){b(this).css("height","auto")})):b.when(c.stop().slideUp("fast",null,function(){b(this).css("height","auto")})).done(function(){e.removeCtrlSkpNot(d.id)}))}),d.czr_states("resetVisible").bind(function(f){d.section()||a.czr_activeSectionId();f?b.when(e.renderControlResetWarningTmpl(d.id)).done(function(a){c.isEmpty(a)||(d.czr_resetDialogContainer=a.container,a.container.slideToggle("fast"),a.is_authorized||c.delay(function(){b.when(d.czr_resetDialogContainer.slideToggle("fast")).done(function(){d.czr_resetDialogContainer.remove()})},3e3))}):c.has(d,"czr_resetDialogContainer")&&d.czr_resetDialogContainer.length&&b.when(d.czr_resetDialogContainer.slideToggle("fast")).done(function(){d.czr_resetDialogContainer.remove()})})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{renderControlsSingleReset:function(d){var e=this,f=b.Deferred();(c.isUndefined(d)||c.isEmpty(d))&&(d=a.CZR_Helpers.getSectionControlIds(a.czr_activeSectionId()),d=c.filter(d,function(b){var c=a.CZR_Helpers.getControlSettingId(b);return c&&e.isSettingSkopeEligible(c)}));var g=c.isArray(d)?d:[d],h=function(d){return c.isEmpty(d)?void f.resolve():void c.each(d,function(c){a.control.when(c,function(){var d=a.control(c);a.CZR_Helpers.getControlSettingId(c);return b(".czr-setting-reset",d.container).length?void f.resolve():void d.deferred.embedded.then(function(){b.when(d.container.find(".customize-control-title").first().prepend(b("<span/>",{"class":"czr-setting-reset fa fa-refresh",title:""}))).done(function(){d.container.addClass("czr-skoped"),b(".czr-setting-reset",d.container).fadeIn(400),f.resolve()})})})})};return h=c.debounce(h,200),h(g),f.promise()},renderControlResetWarningTmpl:function(d){if(!a.control.has(d))return{};var e,f,g=a.control(d),h=a.CZR_Helpers.getControlSettingId(d),i="",j=function(){return!!c.contains(serverControlParams.wpBuiltinSettings,a.CZR_Helpers.getOptionName(h))||!c.contains(serverControlParams.themeSettingList,a.CZR_Helpers.getOptionName(h))}(),k=a.czr_skope(a.czr_activeSkopeId())();g.czr_states("isDirty")()?(e=["global"==k.skope?serverControlParams.i18n.skope["Please confirm that you want to reset your current customizations for this option"]:serverControlParams.i18n.skope["Please confirm that you want to reset your current customizations for this option in"],"global"==k.skope?serverControlParams.i18n.skope.sitewide:k.ctx_title].join(" "),f=serverControlParams.i18n.skope["Your customizations have been reset"]):j&&"global"==k.skope?e=serverControlParams.i18n.skope["This WordPress setting can not be reset sitewide"]:(e=["global"==k.skope?serverControlParams.i18n.skope["Please confirm that you want to reset this option"]:serverControlParams.i18n.skope["Please confirm that you want to reset this option in"],"global"==k.skope?serverControlParams.i18n.skope.sitewide:k.ctx_title].join(" "),f=serverControlParams.i18n.skope["The option has been reset"]);var l=!(j&&"global"==a.czr_skope(a.czr_activeSkopeId())().skope&&!g.czr_states("isDirty")()),m={warning_message:e+".",success_message:f+".",is_authorized:l};try{i=wp.template("czr-reset-control")(m)}catch(n){return a.errorLog("Error when parsing the the reset control template : "+n),{container:!1,is_authorized:!1}}return b(".customize-control-title",g.container).first().after(b(i)),{container:b(".czr-ctrl-reset-warning",g.container),is_authorized:l}},doResetSetting:function(d){var e=this,f=a.CZR_Helpers.getControlSettingId(d),g=a.control(d),h=a.czr_activeSkopeId(),i=g.czr_states("isDirty")()?"_resetControlDirtyness":"_resetControlAPIVal",j=function(){var a=this;a.czr_states("resetVisible")(!1),a.czr_states("isResetting")(!1),a.container.removeClass("czr-resetting-control")},k=function(d){var g=function(){a.czr_skopeBase.processSilentUpdates({candidates:d,refresh:!1}).fail(function(){a.consoleLog("Silent update failed after resetting control : "+d)}).done(function(){a.control.when(d,function(){var f=a.control(d);b.when(b(".czr-crtl-reset-dialog",f.container).fadeOut("300")).done(function(){b.when(b(".czr-reset-success",f.container).fadeIn("300")).done(function(a){c.delay(function(){b.when(a.fadeOut("300")).done(function(){e.setupActiveSkopedControls({controls:[d]}).done(function(){f.czr_states&&(j.call(f),f.czr_states("noticeVisible")(e.isCtrlNoticeVisible(d)))})})},500)})})})})};e[i](d).done(function(){a.consoleLog("REFRESH AFTER A SETTING RESET"),a.previewer.refresh().fail(function(b){a.errorLog("Setting reset refresh failed.",b)}).done(function(b){if("global"==a.czr_skope(h)().skope&&"_resetControlAPIVal"==i){var d,e={},j=a.czr_skope(h)().opt_name;!c.isUndefined(b.skopesServerData)&&c.has(b.skopesServerData,"czr_skopes")&&(d=b.skopesServerData.czr_skopes,c.isUndefined(c.findWhere(d,{opt_name:j}))&&(e=c.findWhere(d,{opt_name:j}).db||{})),a.czr_skopeBase.maybeSynchronizeGlobalSkope({isGlobalReset:!0,isSetting:!0,settingIdToReset:f}).done(function(){g()})}else g()})})};g.czr_states("isResetting")(!0),g.container.addClass("czr-resetting-control"),a.czr_skopeReset[g.czr_states("isDirty")()?"resetChangeset":"resetPublished"]({skope_id:h,setId:f,is_setting:!0}).done(function(a){k(d)}).fail(function(f){a.errorLog("Reset failed",f),b.when(b(".czr-crtl-reset-dialog",g.container).fadeOut("300")).done(function(){b.when(b(".czr-reset-fail",g.container).fadeIn("300")).done(function(){b(".czr-reset-fail",g.container).append("<p>"+f+"</p>"),c.delay(function(){j.call(g),e.setupActiveSkopedControls({controls:[d]})},2e3)})})})},_resetControlDirtyness:function(d){var e=a.CZR_Helpers.getControlSettingId(d),f=a.czr_skope(a.czr_activeSkopeId()),g=b.extend(!0,{},f.dirtyValues()),h={},i=b.extend(!0,{},f.changesetValues()),j={},k=b.Deferred();return h=c.omit(g,e),j=c.omit(i,e),f.dirtyValues(h),f.changesetValues(h),k.resolve().promise()},_resetControlAPIVal:function(d){var e=a.CZR_Helpers.getControlSettingId(d),f=a.czr_skope(a.czr_activeSkopeId()).dbValues(),g=b.extend(!0,{},f),h=b.Deferred();return c.has(a.control(d),"czr_states")&&(a.control(d).czr_states("hasDBVal")(!1),a.czr_skope(a.czr_activeSkopeId()).dbValues(c.omit(g,e))),h.resolve().promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{renderCtrlSkpNotIcon:function(d){var e=c.isArray(d)?d:[d];c.each(e,function(c){a.control.when(c,function(){var d=a.control(c);d.deferred.embedded.then(function(){b(".czr-toggle-notice",d.container).length||b.when(d.container.find(".customize-control-title").first().append(b("<span/>",{"class":"czr-toggle-notice fa fa-info-circle",title:serverControlParams.i18n.skope["Display informations about the scope of this option."]}))).done(function(){b(".czr-toggle-notice",d.container).fadeIn(400)})})})})},updateCtrlSkpNot:function(d,e){var f=this,g=c.isArray(d)?d:[d],h=function(a){return a&&f.isSettingSkopeEligible(a)},i=function(b,d){var e,g,i,j=a.czr_activeSkopeId(),k=f.getInheritedSkopeId(b,j),l=f.getAppliedPrioritySkopeId(b,j),m=[];return h(b)?(k==l&&a.czr_skope.has(k)&&j==k&&(e=!c.isUndefined(a.czr_skope(j).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(j).dbValues()[b]),i=a.czr_skope(k)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),e?"global"==a.czr_skope(k)().skope?m.push([serverControlParams.i18n.skope["Customized. Will be applied sitewide once published."]].join(" ")):m.push([serverControlParams.i18n.skope["Customized. Will be applied to"],"<strong>"+i+"</strong>",serverControlParams.i18n.skope["once published."]].join(" ")):g?"global"==a.czr_skope(k)().skope?m.push([serverControlParams.i18n.skope["Customized and applied sitewide."]].join(" ")):m.push([serverControlParams.i18n.skope["Customized and applied to"],"<strong>"+i+".</strong>"].join(" ")):m.push(serverControlParams.i18n.skope["Default website value applied sitewide."])),k!==j&&a.czr_skope.has(k)&&(e=!c.isUndefined(a.czr_skope(k).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(k).dbValues()[b]),i=a.czr_skope(j)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),e||g?m.push([serverControlParams.i18n.skope["Currently inherited from"],f.buildSkopeLink(k)+".",serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+i+".</strong>"].join(" ")):m.push([serverControlParams.i18n.skope["Default website value."],serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+i+".</strong>"].join(" "))),l!==j&&a.czr_skope.has(l)&&(e=!c.isUndefined(a.czr_skope(l).dirtyValues()[b]),i=a.czr_skope(d)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),m.push([e?serverControlParams.i18n.skope["The value that will be applied to"]:serverControlParams.i18n.skope["The value currently applied to"],"<strong>"+i+"</strong>",e?serverControlParams.i18n.skope["is customized in"]:serverControlParams.i18n.skope["is set in"],f.buildSkopeLink(l),serverControlParams.i18n.skope["which has a higher priority than the current option scope"],"<strong>( "+a.czr_skope(j)().title+" ).</strong>"].join(" "))),m.join(" | ")):(m.push([serverControlParams.i18n.skope["This option is always customized sitewide and cannot be reset."]].join(" ")),m.join(" | "))};c.each(g,function(d){a.control.when(d,function(){var f=a.control(d),g=a.CZR_Helpers.getControlSettingId(d),h=c.isUndefined(e)?f.czr_states&&f.czr_states("noticeVisible")():e;h&&f.deferred.embedded.then(function(){var d=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id,e=f.getNotificationsContainerElement();if(e&&e.length&&!c.isUndefined(d)){try{_html=i(g,d)}catch(h){a.errorLog("_generateControlNotice : "+h)}var j=b(".czr-skope-notice",e);j.length?j.html(_html):e.append(['<span class="czr-notice czr-skope-notice">',_html,"</span>"].join(""))}})})})},isCtrlNoticeVisible:function(b){if(!a.control.has(b))return!1;var c=this,d=a.CZR_Helpers.getControlSettingId(b),e=a.czr_activeSkopeId(),f=c.getAppliedPrioritySkopeId(d,e);return"global"!=a.czr_skope(e)().skope||!(f===e||!a.czr_skope.has(f))},removeCtrlSkpNot:function(d){var e=c.isArray(d)?d:[d];c.each(e,function(c){a.control.when(c,function(){var d=a.control(c);d.deferred.embedded.then(function(){var a=d.getNotificationsContainerElement();if(a&&a.length){var c=b(".czr-skope-notice",a);c.length&&c.remove()}})})})}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{initialize:function(){this.changesetStatus="publish",this.saveBtn=b("#save")},save:function(d){var e,f=this,g=a.state("processing"),h=new a.Messenger({url:a.settings.url.parent,channel:"loader"});f.globalSaveDeferred=b.Deferred(),f.previewer=a.previewer,f.globalSkopeId=a.czr_skopeBase.getGlobalSkopeId(),f.saveArgs=d,d&&d.status&&(f.changesetStatus=d.status),a.state("saving")()&&f.globalSaveDeferred.reject("already_saving");var i=function(b,d){a.state("saving")(!1),a.state("processing").set(0),f.saveBtn.prop("disabled",!1),!c.isUndefined(b)&&b.setting_validities&&a._handleSettingValidities({settingValidities:b.setting_validities,focusInvalidControl:!0}),"pending"==d&&a.czr_serverNotification({message:b,status:"error"})},j=function(d){var e,g=b.Deferred();return a.state("saving")(!0),f.fireAllSubmission(d).always(function(a){e=a.response,i(e,this.state())}).fail(function(b){e=b.response,a.consoleLog("ALL SUBMISSIONS FAILED",e),f.globalSaveDeferred.reject(e),a.trigger("error",e),g.resolve(b.hasNewMenu)}).done(function(b){e=b.response,a.previewer.refresh({waitSkopeSynced:!0}).fail(function(b){f.globalSaveDeferred.reject(f.previewer,[e]),a.consoleLog("SAVE REFRESH FAIL",b)}).done(function(d){if(a.previewer.send("saved",e),e=c.extend({changeset_status:"publish"},e||{}),a.czr_isChangeSetOn()){var i=a._latestRevision;a.state("changesetStatus").set(e.changeset_status),"publish"===e.changeset_status&&(a.each(function(b){b._dirty&&(c.isUndefined(a._latestSettingRevisions[b.id])||a._latestSettingRevisions[b.id]<=i)&&(b._dirty=!1)}),a.state("changesetStatus").set(""),a.settings.changeset.uuid=e.next_changeset_uuid,h.send("changeset-uuid",a.settings.changeset.uuid))}else a.each(function(a){a._dirty=!1});d=c.extend({previewer:d.previewer||f.previewer,skopesServerData:d.skopesServerData||{}},d),f.reactWhenSaveDone(d.skopesServerData),f.globalSaveDeferred.resolveWith(f.previewer,[e]),a.trigger("saved",e||{}),g.resolve(b.hasNewMenu)})}),g.promise()};return 0===g()?j().done(function(a){a&&j({saveGlobal:!1,saveSkopes:!0})}):(e=function(){0===g()&&(a.state.unbind("change",e),j())},a.state.bind("change",e)),f.globalSaveDeferred.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{getSubmitPromise:function(d){var e=this,f=b.Deferred(),g={};if(c.isEmpty(d)||!a.czr_skope.has(d))return a.consoleLog("getSubmitPromise : no skope id requested OR skope_id not registered : "+d),f.resolve().promise();var h=a.czr_skope(d)();return a.czr_skope(d).dirtyness()||d===e.globalSkopeId?(c.each(a.czr_skopeBase.getSkopeDirties(d),function(a,b){g[b]=c.extend({value:a})}),this.submit({skope_id:d,customize_changeset_data:g,dyn_type:h.dyn_type}).done(function(a){f.resolve(a)}).fail(function(b){a.consoleLog("GETSUBMIT FAILED PROMISE FOR SKOPE : ",d,b),f.reject(b)}),f.promise()):f.resolve().promise()},submit:function(d){var e,f=this,g={skope_id:null,the_dirties:{},customize_changeset_data:{},dyn_type:null,opt_name:null},h=[],i=[],j=b.Deferred();if(d=b.extend(g,d),c.isNull(d.skope_id))throw new Error("OVERRIDEN SAVE::submit : MISSING skope_id");if(c.isNull(d.the_dirties))throw new Error("OVERRIDEN SAVE::submit : MISSING the_dirties");if(c.has(a,"Notification")&&(a.each(function(b){b.notifications.each(function(c){"error"===c.type&&a.consoleLog("NOTIFICATION ERROR on SUBMIT SAVE",c),"error"!==c.type||c.data&&c.data.from_server||(h.push(b.id),i[b.id]||(i[b.id]={}),i[b.id][c.code]=c)})}),e=a.findControlsForSettings(h),!c.isEmpty(e)))return c.values(e)[0][0].focus(),j.rejectWith(f.previewer,[{setting_invalidities:i}]).promise();var k={skope_id:d.skope_id,action:"save",the_dirties:d.the_dirties,dyn_type:d.dyn_type,opt_name:d.opt_name};a.czr_isChangeSetOn()&&b.extend(k,{excludeCustomizedSaved:!1});var l=b.extend(f.previewer.query(k),{nonce:f.previewer.nonce.save,customize_changeset_status:f.changesetStatus,customize_changeset_data:JSON.stringify(d.customize_changeset_data)});a.czr_isChangeSetOn()&&(f.saveArgs&&f.saveArgs.date&&(l.customize_changeset_date=f.saveArgs.date),f.saveArgs&&f.saveArgs.title&&(l.customize_changeset_title=f.saveArgs.title));var m=wp.ajax.post("global"!==l.skope?"customize_skope_changeset_save":"customize_save",l);return f.saveBtn.prop("disabled",!0),a.trigger("save",m),m.fail(function(b){a.consoleLog("SUBMIT REQUEST FAIL",d.skope_id,b),"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?f.previewer.cheatin():"not_logged_in"===b&&(f.previewer.preview.iframe.hide(),f.previewer.login().done(function(){f.previewer.save(),f.previewer.preview.iframe.show()})),a.trigger("error",b),j.reject(b)}),m.done(function(a){j.resolve(a)}),j.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{fireAllSubmission:function(d){var e=this,f=b.Deferred(),g=[],h=b.Deferred(),i={},j=[],k=[],l={saveGlobal:!0,saveSkopes:!0};d=b.extend(l,d),c.each(a.czr_skopeCollection(),function(a){"global"!==a.skope&&g.push(a.id)});var m=function(d){if(c.isUndefined(g[d+1])&&j.length==g.length){if(c.isEmpty(k))h.resolve(i);else{var e=function(){var d=[];return c.each(k,function(b){d.push(a.czr_skopeBase.buildServerResponse(b))}),b.trim(d.join(" | "))};h.reject(e())}return!0}},n=function(d){return d=d||0,c.isUndefined(g[d])&&(a.consoleLog("Undefined Skope in Save recursive call ",d,_skopesToUpdate,_skopesToUpdate[d]),h.resolve(i)),e.getSubmitPromise(g[d]).always(function(){j.push(d)}).fail(function(b){k.push(b),a.consoleLog("RECURSIVE PUSH FAIL FOR SKOPE : ",g[d]),m(d)||n(d+1)}).done(function(a){a=a||{},i=c.isEmpty(i)?a||{}:b.extend(i,a),m(d)||n(d+1)}),h.promise()},o=!1;c.each(a.czr_skope("global__all_").dirtyValues(),function(a,b){"nav_menu["==b.substring(0,"nav_menu[".length)&&(o=!0)});var p=function(){e.getSubmitPromise(e.globalSkopeId).fail(function(b){a.consoleLog("GLOBAL SAVE SUBMIT FAIL",b),b=a.czr_skopeBase.buildServerResponse(b),f.reject(b)}).done(function(a){i=c.isEmpty(i)?a||{}:b.extend(i,a),f.resolve({response:i,hasNewMenu:o})})};return o&&d.saveGlobal?p():d.saveGlobal&&d.saveSkopes?n().fail(function(b){a.consoleLog("RECURSIVE SAVE CALL FAIL",b),f.reject(b)}).done(function(a){e.cleanSkopeChangesetMetas().always(function(){p()})}):d.saveGlobal&&!d.saveSkopes?p():!d.saveGlobal&&d.saveSkopes&&n().fail(function(b){a.consoleLog("RECURSIVE SAVE CALL FAIL",b),f.reject(b)}).done(function(a){i=c.isEmpty(i)?a||{}:b.extend(i,a),e.cleanSkopeChangesetMetas().always(function(){f.resolve({response:i,hasNewMenu:o})})}),f.promise()},cleanSkopeChangesetMetas:function(){var c=b.Deferred();return _query=b.extend(a.previewer.query(),{nonce:a.previewer.nonce.save}),wp.ajax.post("czr_clean_skope_changeset_metas_after_publish",_query).always(function(){c.resolve()}).fail(function(b){a.consoleLog("cleanSkopeChangesetMetas failed",_query,b)}).done(function(b){a.consoleLog("cleanSkopeChangesetMetas done",_query,b)}),c.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{reactWhenSaveDone:function(b){var d={};b=c.extend({czr_skopes:[],isChangesetDirty:!1},b),c.each(a.czr_skopeCollection(),function(b){d[b.opt_name]=a.czr_skopeBase.getSkopeDirties(b.id),a.czr_skope(b.id).dirtyValues({}),a.czr_skope(b.id).changesetValues({})});var e=[],f=b.czr_skopes;a.consoleLog("REACT WHEN SAVE DONE",d,f),c.each(d,function(b,d){c.each(b,function(b,g){if(!c.isUndefined(c.findWhere(f,{opt_name:d}))&&a.czr_skopeBase.isSettingSkopeEligible(g)){var h=c.findWhere(f,{opt_name:d}).db,i=c.findWhere(f,{opt_name:d}).skope,j=a.CZR_Helpers.build_setId(g),k=a.CZR_Helpers.getOptionName(g),l=h[j];c.isUndefined(l)&&"global"==i&&b===serverControlParams.defaultOptionsValues[k]||!c.isUndefined(l)&&c.isEqual(l,b)||e.push({opt_name:d,setId:j,server_val:l,api_val:b})}})}),c.isEmpty(e)?a.consoleLog("ALL RIGHT, SERVER AND API ARE SYNCHRONIZED AFTER SAVE"):a.consoleLog("SOME SETTINGS HAVE NOT BEEN PROPERLY SAVED : ",e),a.czr_skopeBase.maybeSynchronizeGlobalSkope(),a.czr_skopeBase.updateCtrlSkpNot(a.CZR_Helpers.getSectionControlIds())}})}(wp.customize,jQuery,_);var CZRSkopeResetMths=CZRSkopeResetMths||{};!function(a,b,c){b.extend(CZRSkopeResetMths,{initialize:function(){var c=this;c.previewer=a.previewer,a.state.create("czr-resetting")(!1),a.state("czr-resetting").bind(function(a){b(document.body).toggleClass("czr-resetting",!1!==a)})},resetChangeset:function(d){var e,f,g,h,i,j=b.Deferred(),k=this,l=a.state("processing"),m={is_setting:!1,is_skope:!1,skope_id:a.czr_activeSkopeId()||"",setId:""};d=c.extend(m,d);var n=d.skope_id,o=d.setId;return a.czr_isChangeSetOn()?(f=function(e,f){if(c.isUndefined(e))throw new Error("RESET: MISSING skope_id");if(a.state("czr-resetting")(!0),h={skope_id:e,action:"reset"},i=b.extend(k.previewer.query(h),{nonce:k.previewer.nonce.save}),d.is_setting)b.extend(i,{setting_id:f}),g="czr_changeset_setting_reset";else{if(!d.is_skope)return j.reject("reset_ajax_action_not_specified").promise();g="czr_changeset_skope_reset"}wp.ajax.post(g,i).always(function(){a.state("czr-resetting")(!1)}).fail(function(b){"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?k.previewer.cheatin():"not_logged_in"===b&&(k.previewer.preview.iframe.hide(),k.previewer.login().done(function(){k.resetChangeset(d),k.previewer.preview.iframe.show()})),a.consoleLog(g+" failed ",i,b),b=a.czr_skopeBase.buildServerResponse(b),a.trigger("error",b),a.czr_serverNotification({message:b,status:"error"}),j.reject(b)}).done(function(a){j.resolve(a)})},0===l()&&!1===a.state("czr-resetting")()?f(n,o):(e=function(){0===l()&&!1===a.state("czr-resetting")()&&(a.state.unbind("change",e),f(n,o))},a.state.bind("change",e)),j.promise()):j.resolve().promise()},resetPublished:function(d){var e,f,g,h,i,j=b.Deferred(),k=this,l=a.state("processing"),m={is_setting:!1,is_skope:!1,skope_id:a.czr_activeSkopeId()||"",setId:""};d=c.extend(m,d);var n=d.skope_id,o=d.setId;return f=function(e,f){if(c.isUndefined(e))throw new Error("RESET: MISSING skope_id");if(a.state("czr-resetting")(!0),h={skope_id:e,action:"reset"},i=b.extend(k.previewer.query(h),{nonce:k.previewer.nonce.save}),d.is_setting)b.extend(i,{setting_id:f}),g="czr_published_setting_reset";else{if(!d.is_skope)return j.reject("reset_ajax_action_not_specified").promise();g="czr_published_skope_reset"}a.consoleLog("in czr_reset submit : ",e,i),wp.ajax.post(g,i).always(function(){a.state("czr-resetting")(!1)}).fail(function(b){"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?k.previewer.cheatin():"not_logged_in"===b&&(k.previewer.preview.iframe.hide(),k.previewer.login().done(function(){k.resetChangeset(d),k.previewer.preview.iframe.show()})),a.consoleLog(g+" failed ",i,b),b=a.czr_skopeBase.buildServerResponse(b),a.trigger("error",b),a.czr_serverNotification({message:b,status:"error"}),j.reject(b)}).done(function(a){j.resolve(a)})},0===l()&&!1===a.state("czr-resetting")()?f(n,o):(e=function(){0===l()&&!1===a.state("czr-resetting")()&&(a.state.unbind("change",e),f(n,o))},a.state.bind("change",e)),j.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{initWidgetSidebarSpecifics:function(){var c=this;c.isExcludedSidebarsWidgets()||a.czr_activeSkopeId.bind(function(b){c.forceSidebarDirtyRefresh(a.czr_activeSectionId(),b)}),b(document).bind("widget-added",function(b,d){if(!c.isExcludedSidebarsWidgets()){var e=d.closest(".customize-control").attr("id"),f=a.czr_skopeBase.widgetIdToSettingId(e,"customize-control-");if(!a.has(f))throw new Error("AN ADDED WIDGET COULD NOT BE BOUND IN SKOPE. "+f);c.listenAPISettings(f)}})},forceSidebarDirtyRefresh:function(b,d){var e=this;if(!e.isExcludedSidebarsWidgets()){var f=a.state("saved")(),g=function(){if(a.section.has(b)&&"sidebar"==a.section(b).params.type){var c=c||a.czr_activeSkopeId(),d="sidebars_widgets["+a.section(b).params.sidebarId+"]",g=e.getSkopeSettingVal(d,c);a.czr_skope(c).updateSkopeDirties(d,g),a.previewer.refresh({the_dirties:a.czr_skope(c).dirtyValues()}).done(function(){a.state("saved")(f)})}};g=c.debounce(g,500),g()}}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{initialize:function(d,e){var f=this;a.Value.prototype.initialize.call(f,null,e),f.isReady=b.Deferred(),f.embedded=b.Deferred(),f.el="czr-scope-"+d,b.extend(f,e||{}),f.visible=new a.Value((!0)),f.winner=new a.Value((!1)),f.priority=new a.Value,f.active=new a.Value((!1)),f.dirtyness=new a.Value((!1)),f.skopeResetDialogVisibility=new a.Value((!1)),f.hasDBValues=new a.Value((!1)),f.dirtyValues=new a.Value({}),f.dbValues=new a.Value({}),f.changesetValues=new a.Value({}),f.userEventMap=new a.Value([{trigger:"click keydown",selector:".czr-scope-switch, .czr-skp-switch-link",name:"skope_switch",actions:function(){a.czr_activeSkopeId(f().id)}},{trigger:"click keydown",selector:".czr-scope-reset",name:"skope_reset_warning",actions:"reactOnSkopeResetUserRequest"}]),f.skopeResetDialogVisibility.bind(function(a,b){return f.skopeResetDialogReact(a)},{deferred:!0}),f.dirtyValues.callbacks.add(function(){return f.dirtyValuesReact.apply(f,arguments)}),f.changesetValues.callbacks.add(function(){return f.changesetValuesReact.apply(f,arguments)}),f.dbValues.callbacks.add(function(){return f.dbValuesReact.apply(f,arguments)}),f.callbacks.add(function(){return f.skopeReact.apply(f,arguments)}),f.set(c.omit(e,function(a,b){return c.contains(["db","changeset","has_db_val"],b)})),f.setupObservableViewValuesCallbacks(),f.dirtyness(!c.isEmpty(e.changeset)),f.hasDBValues(!c.isEmpty(e.db)),f.winner(e.is_winner),f.embedded.fail(function(){throw new Error("The container of skope "+f().id+" has not been embededd")}).done(function(){f.setupDOMListeners(f.userEventMap(),{dom_el:f.container}),f.isReady.resolve()})},ready:function(){var c=this;a.czr_skopeBase.skopeWrapperEmbedded.done(function(){try{b.when(c.embedSkopeDialogBox()).done(function(a){!1!==a.length?(a.css("background-color",c.color),c.container=a,c.embedded.resolve(a)):c.embedded.reject()})}catch(d){a.errorLog("In skope base : "+d),c.embedded.reject()}})},dirtyValuesReact:function(b,d){var e=this;e.dirtyness(!c.isEmpty(b)),a.czr_dirtyness(!c.isEmpty(b));var f=[];c.each(d,function(a,d){c.has(b,d)||f.push(d)}),e().id==a.czr_activeSkopeId()&&(c.each(f,function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("isDirty")(!1)}),c.each(b,function(b,d){c.has(a.control(d),"czr_states")&&a.control(d).czr_states("isDirty")(!0)}))},changesetValuesReact:function(a,c){var d=this,e=b.extend(!0,{},d.dirtyValues());d.dirtyValues(b.extend(e,a))},dbValuesReact:function(b,d){var e=this;e.hasDBValues(!c.isEmpty("global"!=e().skope?b:c.omit(b,function(b,c){return!a.czr_skopeBase.isThemeSetting(c)})));var f=[];c.each(d,function(a,d){c.has(b,d)||f.push(d)}),e().id==a.czr_activeSkopeId()&&(c.each(f,function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("hasDBVal")(!1)}),c.each(b,function(b,d){c.has(a.control(d),"czr_states")&&a.control(d).czr_states("hasDBVal")(!0)}))},skopeReact:function(d,e){var f=this,g=[],h=[];a.czr_skopeBase.isSkopeRegisteredInCollection(d.id)?(g=b.extend(!0,[],a.czr_skopeCollection()),h=g,c.each(g,function(a,b){a.id==f().id&&(h[b]=d)}),a.czr_skopeCollection(h)):(g=b.extend(!0,[],a.czr_skopeCollection()),g.push(d),a.czr_skopeCollection(g))},setupObservableViewValuesCallbacks:function(){var a=this;a.visible.bind(function(b){"pending"==a.embedded.state()?a.embedded.done(function(){a.container.toggle(b)}):a.container.toggle(b)}),a.active.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.activeStateReact.apply(a,arguments)}):a.activeStateReact.apply(a,arguments)}),a.dirtyness.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.dirtynessReact.apply(a,arguments)}):a.dirtynessReact.apply(a,arguments)}),a.hasDBValues.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.hasDBValuesReact.apply(a,arguments)}):a.hasDBValuesReact.apply(a,arguments)}),a.winner.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.winnerReact.apply(a,arguments)}):a.winnerReact.apply(a,arguments)})},activeStateReact:function(a,c){var d=this;d.container.toggleClass("inactive",!a).toggleClass("active",a),b(".czr-scope-switch",d.container).toggleClass("fa-toggle-on",a).toggleClass("fa-toggle-off",!a)},dirtynessReact:function(a,c){var d=this;b.when(this.container.toggleClass("dirty",a)).done(function(){a?b(".czr-scope-reset",d.container).fadeIn("slow").attr("title",[serverControlParams.i18n.skope["Reset the current customizations for"],d().title].join(" ")):d.hasDBValues()||b(".czr-scope-reset",d.container).fadeOut("fast")})},hasDBValuesReact:function(a,c){var d=this;b.when(d.container.toggleClass("has-db-val",a)).done(function(){a?b(".czr-scope-reset",d.container).fadeIn("slow").attr("title",["global"==d().skope?serverControlParams.i18n.skope["Reset the theme options published sitewide"]:serverControlParams.i18n.skope["Reset your website published options for"],"global"==d().skope?"":d().title].join(" ")):d.dirtyness()||b(".czr-scope-reset",d.container).fadeOut("fast")})},winnerReact:function(d){var e=this;this.container.toggleClass("is_winner",d),d&&c.each(a.czr_currentSkopesCollection(),function(c){if(c.id!=e().id){var d=b.extend(!0,{},c);b.extend(d,{is_winner:!1}),a.czr_skope(c.id)(d)}})},updateSkopeDirties:function(c,d){var e=this;a.CZR_Helpers.getOptionName(c);if(!a.czr_skopeBase.isSettingSkopeEligible(c)&&"global"!=e().skope)return a.czr_skope(a.czr_skopeBase.getGlobalSkopeId()).updateSkopeDirties(c,d);var f=b.extend(!0,{},e.dirtyValues()),g={};return g[c]=d,e.dirtyValues.set(b.extend(f,g)),e.dirtyValues()},getSkopeSettingDirtyness:function(a){var b=this;return b.getSkopeSettingAPIDirtyness(a)||b.getSkopeSettingChangesetDirtyness(a)},getSkopeSettingAPIDirtyness:function(b){var d=this;return c.has(d.dirtyValues(),a.CZR_Helpers.build_setId(b))},getSkopeSettingChangesetDirtyness:function(b){var d=this;return a.czr_isChangeSetOn()?c.has(d.changesetValues(),a.CZR_Helpers.build_setId(b)):d.getSkopeSettingAPIDirtyness(b)},hasSkopeSettingDBValues:function(b){var d=a.CZR_Helpers.build_setId(b);return!c.isUndefined(a.czr_skope(a.czr_activeSkopeId()).dbValues()[d])}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{
14
+ embedSkopeDialogBox:function(){var d=this,e=b.extend(!0,{},d()),f="";if(!b("#customize-header-actions").find(".czr-scope-switcher").length)throw new Error("The skope switcher wrapper is not printed, the skope can not be embedded.");try{f=wp.template("czr-skope")(c.extend(e,{el:d.el}))}catch(g){return a.errorLog("Error when parsing the template of a skope"+g),!1}return b(".czr-skopes-wrapper","#customize-header-actions").append(b(f)),b("."+d.el,".czr-skopes-wrapper")},renderResetWarningTmpl:function(){var d,e,f=this,g=b.extend(!0,{},f()),h="";f.dirtyness()?(d=[serverControlParams.i18n.skope["Please confirm that you want to reset your current ( not published ) customizations for"],f().ctx_title].join(" "),e=[serverControlParams.i18n.skope["Your customizations have been reset for"],f().ctx_title].join(" ")):(d=["global"==f().skope?serverControlParams.i18n.skope["Please confirm that you want to reset your sitewide published customizations. Note : this will not reset the customizations made in other option scopes"]:serverControlParams.i18n.skope["Please confirm that you want to reset your published customizations for"],"global"==f().skope?"":f().ctx_title].join(" "),e=[serverControlParams.i18n.skope["Your published customizations have been reset for"],f().title].join(" "));try{h=wp.template("czr-skope-pane")(c.extend(g,{el:f.el,warning_message:d+".",success_message:e+"."}))}catch(i){return a.errorLog("Error when parsing the the reset skope template : "+i),!1}return b("#customize-preview").after(b(h)),b("#czr-skope-pane")},getEl:function(){var a=this;return b(a.el,"#customize-header-actions")}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{reactOnSkopeResetUserRequest:function(){var b=this,c=function(){a.state("czr-resetting")(!0),a.czr_activeSkopeId()!=b().id?a.czr_activeSkopeId(b().id).done(function(){b.skopeResetDialogVisibility(!b.skopeResetDialogVisibility()).done(function(){a.state("czr-resetting")(!1)})}):b.skopeResetDialogVisibility(!b.skopeResetDialogVisibility()).done(function(){a.state("czr-resetting")(!1)})};return a.state("czr-resetting")()||0!==a.state("processing")()?void a.czr_serverNotification({message:"Slow down, you move too fast !",status:"success",auto_collapse:!0}):void(a.czr_activeSkopeId()!=b().id&&a.czr_skope(a.czr_activeSkopeId()).skopeResetDialogVisibility()?a.czr_skope(a.czr_activeSkopeId()).skopeResetDialogVisibility(!1).done(function(){c()}):c())},skopeResetDialogReact:function(d){var e=this,f=b.Deferred();return e.userResetEventMap=e.userResetEventMap||new a.Value([{trigger:"click keydown",selector:".czr-scope-reset-cancel",name:"skope_reset_cancel",actions:function(){e.skopeResetDialogVisibility(!e.skopeResetDialogVisibility())}},{trigger:"click keydown",selector:".czr-scope-do-reset",name:"skope_do_reset",actions:"doResetSkopeValues"}]),d?(a.czr_isResettingSkope(e().id),b.when(e.renderResetWarningTmpl()).done(function(a){e.resetPanel=a,e.resetPanel.addClass(e.dirtyness()?"dirty-reset":"db-reset"),e.setupDOMListeners(e.userResetEventMap(),{dom_el:e.resetPanel})}).then(function(){setTimeout(function(){var a=b("#customize-preview").height();e.resetPanel.css("line-height",a+"px").css("height",a+"px"),b("body").addClass("czr-skope-pane-open")},50)})):b.when(b("body").removeClass("czr-skope-pane-open")).done(function(){c.has(e,"resetPanel")&&!1!==e.resetPanel.length&&setTimeout(function(){e.resetPanel.remove(),a.czr_isResettingSkope(!1)},300)}),c.delay(function(){f.resolve()},350),f.promise()},doResetSkopeValues:function(){var d=this,e=d().id,f=d.dirtyness()?"_resetSkopeDirties":"_resetSkopeAPIValues",g=function(){var g=function(){a.czr_skopeBase.processSilentUpdates({refresh:!1}).fail(function(){a.consoleLog("Silent update failed after resetting skope : "+e)}).done(function(){b.when(b(".czr-reset-warning",d.resetPanel).fadeOut("300")).done(function(){b.when(b(".czr-reset-success",d.resetPanel).fadeIn("300")).done(function(){c.delay(function(){a.czr_isResettingSkope(!1),d.skopeResetDialogVisibility(!1)},2e3)})})})};d[f]().done(function(){a.previewer.refresh().fail(function(b){a.consoleLog("SKOPE RESET REFRESH FAILED",b)}).done(function(b){if("global"==a.czr_skope(e)().skope&&"_resetSkopeAPIValues"==f){var d,h={},i=a.czr_skope(e)().opt_name;!c.isUndefined(b.skopesServerData)&&c.has(b.skopesServerData,"czr_skopes")&&(d=b.skopesServerData.czr_skopes,c.isUndefined(c.findWhere(d,{opt_name:i}))&&(h=c.findWhere(d,{opt_name:i}).db||{})),a.czr_skopeBase.maybeSynchronizeGlobalSkope({isGlobalReset:!0,isSkope:!0,skopeIdToReset:e}).done(function(){g()})}else g()})})};b("body").addClass("czr-resetting-skope"),a.czr_skopeReset[d.dirtyness()?"resetChangeset":"resetPublished"]({skope_id:d().id,is_skope:!0}).always(function(){b("body").removeClass("czr-resetting-skope")}).done(function(a){g()}).fail(function(b){d.skopeResetDialogVisibility(!1),a.consoleLog("Skope reset failed",b)})},_resetSkopeDirties:function(){var a=this,c=b.Deferred();return a.dirtyValues({}),a.changesetValues({}),c.resolve().promise()},_resetSkopeAPIValues:function(){var a=this,c=b.Deferred();return a.dbValues({}),c.resolve().promise()}})}(wp.customize,jQuery,_),function(a,b,c){a.Value.prototype.set=function(d,e){var f=this._value,g=b.Deferred(),h=this,i=[];return d=this._setter.apply(this,arguments),d=this.validate(d),args=c.extend({silent:!1},c.isObject(e)?e:{}),null===d||c.isEqual(f,d)?g.resolveWith(h,[d,f,e]).promise():(this._value=d,this._dirty=!0,!0===args.silent?g.resolveWith(h,[d,f,e]).promise():this._deferreds?(c.each(h._deferreds,function(a){i.push(a.apply(null,[d,f,e]))}),b.when.apply(null,i).fail(function(){a.errorLog("A deferred callback failed in api.Value::set()")}).then(function(){h.callbacks.fireWith(h,[d,f,e]),g.resolveWith(h,[d,f,e])}),g.promise(h)):(this.callbacks.fireWith(this,[d,f,e]),g.resolveWith(h,[d,f,e]).promise(h)))},a.Value.prototype.bind=function(){var a=this,d=!1,e=[];return b.each(arguments,function(a,b){d||(d=c.isObject(b)&&b.deferred),c.isFunction(b)&&e.push(b)}),d?(a._deferreds=a._deferreds||[],c.each(e,function(b){c.contains(b,a._deferreds)||a._deferreds.push(b)})):a.callbacks.add.apply(a.callbacks,arguments),this},a.Setting.prototype.silent_set=function(b,d){var e=this._value,f=a.state("saved")();return b=this._setter.apply(this,arguments),b=this.validate(b),null===b||c.isEqual(e,b)?this:(this._value=b,this._dirty=c.isUndefined(d)||!c.isBoolean(d)?this._dirty:d,this.callbacks.fireWith(this,[b,e,{silent:!0}]),a.state("saved")(f),this)}}(wp.customize,jQuery,_),function(a,b,c){a.bind("ready",function(){if(serverControlParams.isSkopOn){var d=a.previewer.query;a.previewer.query=function(e){if(!serverControlParams.isSkopOn)return d.apply(this);if(!c.has(a,"czr_skope"))return a.consoleLog("QUERY : SKOPE IS NOT FULLY READY YEY. FALLING BACK ON CORE QUERY"),d.apply(this);if("pending"==a.czr_initialSkopeCollectionPopulated.state())return a.consoleLog("QUERY : INITIAL SKOPE COLLECTION NOT POPULATED YET. FALLING BACK ON CORE QUERY"),d.apply(this);if("pending"==a.czr_isPreviewerSkopeAware.state()&&a.czr_isPreviewerSkopeAware.resolve(),!c.isObject(e)&&"resolved"==a.czr_initialSkopeCollectionPopulated.state()&&"resolved"==a.czr_initialSkopeCollectionPopulated.state())return d.apply(this);!c.isUndefined(e.skope_id)&&c.isString(e.skope_id)||(e.skope_id=a.czr_activeSkopeId()||a.czr_skopeBase.getGlobalSkopeId());var f,g={},h={},i={skope_id:null,action:null,the_dirties:{},dyn_type:null,opt_name:null};if(e=b.extend(i,e),!c.isObject(e.the_dirties))throw a.consoleLog("QUERY PARAMS : ",e),new Error("QUERY DIRTIES MUST BE AN OBJECT. Requested action : "+e.action);if("pending"!=a.czr_isPreviewerSkopeAware.state()&&c.isNull(e.skope_id))throw a.consoleLog("QUERY PARAMS : ",e),new Error("OVERRIDEN QUERY : NO SKOPE ID. FALLING BACK ON CORE QUERY. Requested action : "+e.action);if(!c.contains([null,"refresh","save","reset","changeset_update"],e.action))throw a.consoleLog("QUERY PARAMS : ",e),new Error("A REQUESTED QUERY HAS NO AUTHORIZED ACTION. Requested action : "+e.action);var j=function(){if("pending"==a.czr_initialSkopeCollectionPopulated.state())return{};var b={};return c.each(a.czr_currentSkopesCollection(),function(c){"global"!=c.skope&&(b[c.id]=a.czr_skopeBase.getSkopeDirties(c.id))}),b};switch(c.isNull(e.the_dirties)||c.isEmpty(e.the_dirties)?(g=a.dirtyValues({unsaved:e.excludeCustomizedSaved||!1}),h=j()):"global"==a.czr_skopeBase.getActiveSkopeName()?g=e.the_dirties:h[a.czr_activeSkopeId()]=e.the_dirties,e.action){case null:case"refresh":break;case"changeset_update":if(c.isUndefined(e.opt_name))throw new Error("Missing opt_name param in the changeset_update query for skope : "+e.skope_id);break;case"save":if(c.isNull(e.dyn_type)&&(e.dyn_type=a.czr_skope(e.skope_id)().dyn_type),c.isNull(e.dyn_type)||c.isUndefined(e.dyn_type))throw new Error("QUERY : A SAVE QUERY MUST HAVE A VALID DYN TYPE."+e.skope_id);break;case"reset":if(c.isNull(e.dyn_type)&&(e.dyn_type=a.czr_skope(e.skope_id)().dyn_type),c.isNull(e.dyn_type)||c.isUndefined(e.dyn_type))throw new Error("QUERY : A RESET QUERY MUST HAVE A VALID DYN TYPE."+e.skope_id)}var k={};return c.each(a.czr_currentSkopesCollection(),function(a){k[a.skope]={id:a.id,opt_name:a.opt_name}}),f={wp_customize:"on",customized:"{}"==JSON.stringify(g)?'{"__not_customized__"}':JSON.stringify(g),skopeCustomized:JSON.stringify(h),nonce:this.nonce.preview,skope:a.czr_skope(e.skope_id)().skope,level_id:a.czr_skope(e.skope_id)().level,skope_id:e.skope_id,dyn_type:e.dyn_type,opt_name:c.isNull(e.opt_name)?a.czr_skope(e.skope_id)().opt_name:e.opt_name,obj_id:a.czr_skope(e.skope_id)().obj_id,current_skopes:JSON.stringify(k)||{},channel:this.channel(),revisionIndex:a._latestRevision},f=a.czr_isChangeSetOn()?b.extend(f,{customize_theme:a.settings.theme.stylesheet,customize_changeset_uuid:a.settings.changeset.uuid}):b.extend(f,{theme:a.settings.theme.stylesheet})}}})}(wp.customize,jQuery,_),function(a,b,c){a.bind("czr-skope-started",function(){a.previewer.save=function(b){return a.czr_skopeSave.save()}})}(wp.customize,jQuery,_),function(a,b,c){if(serverControlParams.isSkopOn){a.Element.synchronizer.checkbox.update=function(a){this.element.prop("checked",a),this.element.iCheck("update")};var d=a.Element.synchronizer.val.update;a.Element.synchronizer.val.update=function(b){var c=this,e=function(){c.element.is("select")?c.element.val(b).trigger("change"):c.element.hasClass("wp-color-picker")?c.element.val(b).trigger("change"):c.element.val(b)};if(serverControlParams.isSkopOn){if("resolved"!=a.czr_skopeReady.state())return d.call(c,b);a.czr_skopeReady.then(function(){e()})}else e()},a.Element.synchronizer.val.refresh=function(){var a=this;return this.element.is("select")&&c.isNull(this.element.val())?c.isArray(a())?[]:c.isObject(a())?{}:"":this.element.val()}}}(wp.customize,jQuery,_),function(a,b,c){var d=a.Previewer.prototype.refresh,e=function(f){f=c.extend({waitSkopeSynced:!0,the_dirties:{}},f);var g=this,h=b.Deferred();if(!serverControlParams.isSkopOn)return h.resolve().promise();if(c.has(a,"czr_activeSkopeId")&&!c.isUndefined(a.czr_activeSkopeId())||a.consoleLog("The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method."),!c.has(a,"czr_activeSkopeId")&&"resolved"!=a.czr_skopeReady.state())return a.czr_skopeReady.done(function(){e.apply(a.previewer,f)}),d.apply(g),h.resolve().promise();g.send("loading-initiated"),g.abort();var i=a.czr_getSkopeQueryParams({skope_id:a.czr_activeSkopeId(),action:"refresh",the_dirties:f.the_dirties||{}});return g.loading=new a.PreviewFrame({url:g.url(),previewUrl:g.previewUrl(),query:g.query(i)||{},container:g.container,signature:"WP_CUSTOMIZER_SIGNATURE"}),g.settingsModifiedWhileLoading={},onSettingChange=function(a){g.settingsModifiedWhileLoading[a.id]=!0},a.bind("change",onSettingChange),g.loading.always(function(){a.unbind("change",onSettingChange)}),a.czr_isChangeSetOn()||(g._previousPreview=g._previousPreview||g.preview),g.loading.done(function(b){var c,d=this;g.preview=d,g.targetWindow(d.targetWindow()),g.channel(d.channel()),c=function(b){d.unbind("synced",c),d.unbind("czr-skopes-synced",c),g._previousPreview?g._previousPreview.destroy():g.preview&&g.preview.destroy(),g._previousPreview=g.preview,g.deferred.active.resolve(),delete g.loading,a.trigger("pre_refresh_done",{previewer:g,skopesServerData:b||{}}),h.resolve({previewer:g,skopesServerData:b||{}})},a.czr_isChangeSetOn()||g.send("sync",{scroll:g.scroll,settings:a.get()}),f.waitSkopeSynced?d.bind("czr-skopes-synced",c):d.bind("synced",c),g.trigger("ready",b)}),g.loading.fail(function(b,c){a.consoleLog("LOADING FAILED : ",arguments),g.send("loading-failed"),a.czr_isChangeSetOn()||"redirect"===b&&c&&g.previewUrl(c),"logged out"===b&&(g.preview&&(g.preview.destroy(),delete g.preview),g.login().done(g.refresh)),"cheatin"===b&&g.cheatin(),h.reject(b)}),h.promise()};a.bind("czr-skope-started",function(){czr_override_refresh_for_skope(),a.Previewer.prototype.refresh=e}),a.czr_getSkopeQueryParams=function(d){if(!a.czr_isChangeSetOn())return d;d=c.isObject(d)?d:{};var e=d.action||"refresh";switch(e){case"refresh":d=b.extend(d,{excludeCustomizedSaved:!0})}return d},czr_override_refresh_for_skope=function(){serverControlParams.isSkopOn&&(a.previewer.refresh=function(d){var f=b.Deferred(),g=function(b){var c,d=function(){return 0===a.state("processing").get()},g=function(){e.call(a.previewer,b).done(function(a){f.resolve(a)})};d()?g():(c=function(){d()&&(g(),a.state("processing").unbind(c))},a.state("processing").bind(c))};return g=c.debounce(g,a.previewer.refreshBuffer),g(d),f.promise()})}}(wp.customize,jQuery,_),function(a,b,c){serverControlParams.isSkopOn&&(a.dirtyValues=function(b){return a.czr_skopeBase.getSkopeDirties(a.czr_skopeBase.getGlobalSkopeId(),b)})}(wp.customize,jQuery,_),function(a,b,c){if(serverControlParams.isSkopOn&&a.czr_isChangeSetOn()){var d=a.requestChangesetUpdate;a.requestChangesetUpdate=function(e){var f=b.Deferred(),g=[],h=[],i=e||{},j=[],k=[],l=b.Deferred();if(!serverControlParams.isSkopOn)return d();(0===a._lastSavedRevision||c.isEmpty(a.state("changesetStatus")()))&&(i=c.extend(i,{blogname:{dummy_change:"dummy_change"}})),c.each(a.czr_currentSkopesCollection(),function(a){"global"!=a.skope&&g.push(a.id)});var m=function(d){if(c.isUndefined(g[d+1])&&h.length==g.length){if(c.isEmpty(j))l.resolve(k);else{var e=function(){var d=[];return c.each(j,function(b){d.push(a.czr_skopeBase.buildServerResponse(b))}),b.trim(d.join(" | "))};l.reject(e())}return!0}},n=function(b){return(c.isUndefined(b)||0==b)&&a.state("processing").set(1),b=b||0,c.isUndefined(g[b])?(a.consoleLog("Undefined Skope in changeset recursive call ",b,g,g[b]),l.resolve(k).promise()):(a._requestSkopeChangetsetUpdate(e,g[b]).always(function(){h.push(b)}).fail(function(c){j.push(c),a.consoleLog("CHANGESET UPDATE RECURSIVE FAIL FOR SKOPE : ",g[b]),m(b)||n(b+1)}).done(function(a){k.push(a),m(b)||n(b+1)}),l.promise())},o=a._lastSavedRevision;return d(i).fail(function(b){a.consoleLog("WP requestChangesetUpdateFail",b,a.czr_skopeBase.buildServerResponse(b)),a._lastSavedRevision=Math.max(a._latestRevision,a._lastSavedRevision),a.state("processing").set(0),f.reject(b),b=a.czr_skopeBase.buildServerResponse(b),a.czr_serverNotification({message:b,status:"error"})}).done(function(b){"pending"==a.czr_initialSkopeCollectionPopulated.state()&&f.resolve(b),a._lastSavedRevision=o,n().always(function(){a._lastSavedRevision=Math.max(a._latestRevision,a._lastSavedRevision),a.state("processing").set(0)}).fail(function(b){f.reject(b),a.consoleLog("CHANGESET UPDATE RECURSIVE PUSH FAIL",b,k),a.trigger("changeset-error",b),a.czr_serverNotification({message:b,status:"error"})}).done(function(){f.resolve(b)})}),f.promise()},a._requestSkopeChangetsetUpdate=function(d,e){if(c.isUndefined(e)||!a.czr_skope.has(e))throw new Error("In api._requestSkopeChangetsetUpdate() : a valid and registered skope_id must be provided");var f,g=new b.Deferred,h={};if(e=e||a.czr_activeSkopeId(),d&&c.extend(h,d),c.each(a.czr_skopeBase.getSkopeDirties(e),function(a,b){d&&null===d[b]||(h[b]=c.extend({},h[b]||{},{value:a}))}),c.isEmpty(h))return g.resolve({}),g.promise();if(a._latestRevision<=a._lastSavedRevision)return g.resolve({}),g.promise();a.trigger("skope-changeset-save",h);var i={skope_id:e,action:"changeset_update",opt_name:a.czr_skope(e).opt_name};return f=a.previewer.query(c.extend(i,{excludeCustomizedSaved:!0})),delete f.customized,c.extend(f,{nonce:a.settings.nonce.save,customize_changeset_data:JSON.stringify(h)}),wp.ajax.post("customize_skope_changeset_save",f).done(function(a){g.resolve(a)}).fail(function(b){a.consoleLog("SKOPE CHANGESET FAIL FOR SKOPE "+b.skope_id,b),g.reject(b)}).always(function(b){b.setting_validities&&a._handleSettingValidities({settingValidities:b.setting_validities})}),g.promise()}}}(wp.customize,jQuery,_),function(a,b,c){a.Setting.prototype.initialize=function(b,c,d){var e=this;a.Value.prototype.initialize.call(e,c,d),e.id=b,e.transport=e.transport||"refresh",e._dirty=d.dirty||!1,e.notifications=new a.Values({defaultConstructor:a.Notification}),e.bind(e.preview)},a.Setting.prototype.preview=function(d,e,f){var g,h=this,i=b.Deferred();return g=h.transport,serverControlParams.isSkopOn&&a.czr_isPreviewerSkopeAware&&"pending"==a.czr_isPreviewerSkopeAware.state()?(this.previewer.refresh(),i.resolve(arguments).promise()):c.isUndefined(e)||c.isEmpty(e)||c.isNull(e)||!c.isObject(f)||!0!==f.not_preview_sent?c.has(f,"silent")&&!1!==f.silent?i.resolve(arguments).promise():("postMessage"!==g||a.state("previewerAlive").get()||(g="refresh"),"postMessage"===g?(h.previewer.send("pre_setting",{set_id:h.id,data:f,value:d}),h.previewer.send("setting",[h.id,h()]),i.resolve(arguments)):"refresh"===g&&(serverControlParams.isSkopOn?h.previewer.refresh().always(function(){i.resolve(arguments)}):(h.previewer.refresh(),i.resolve(arguments))),i.promise()):i.resolve(arguments).promise()}}(wp.customize,jQuery,_),function(a,b,c){if("function"==typeof a.Section){var d=a.Section.prototype.initialize;a.Section.prototype.initialize=function(a,e){d.apply(this,[a,e]);var f=this;this.expanded.callbacks.add(function(a){if(a){var d=f.container.closest(".wp-full-overlay-sidebar-content"),e=f.container.find(".accordion-section-content");_resizeContentHeight=function(){e.css("height",d.innerHeight())},_resizeContentHeight(),b(window).on("resize.customizer-section",c.debounce(_resizeContentHeight,110))}})}}}(wp.customize,jQuery,_),function(a,b,c){a.CZR_Helpers=a.CZR_Helpers||{},a.CZR_Helpers=b.extend(a.CZR_Helpers,{getControlSettingId:function(b,d){return d="default",a.control.has(b)?!c.has(a.control(b),"settings")||c.isEmpty(a.control(b).settings)?b:c.has(a.control(b).settings,d)?c.isUndefined(a.control(b).settings[d].id)?(a.consoleLog("getControlSettingId : The requested control_id has no setting id assigned : "+b),b):a.control(b).settings[d].id:(a.consoleLog("getControlSettingId : The requested control_id does not have the requested setting type : "+b+" , "+d),b):(a.consoleLog("getControlSettingId : The requested control_id is not registered in the api yet : "+b),b)},getDocSearchLink:function(a){a=c.isString(a)?a:"";var b=a.replace(/ /g,"+"),d=[serverControlParams.docURL,"search?query=",b].join("");return['<a href="'+d+'" title="'+serverControlParams.i18n.readDocumentation+'" target="_blank">'," ",'<span class="fa fa-question-circle-o"></span>'].join("")},build_setId:function(a){return c.contains(serverControlParams.wpBuiltinSettings,a)?a:c.contains(serverControlParams.themeSettingList,a)&&-1==a.indexOf(serverControlParams.themeOptions)?[serverControlParams.themeOptions+"[",a,"]"].join(""):a},getOptionName:function(a){return-1==a.indexOf(serverControlParams.themeOptions)?a:a.replace(/\[|\]/g,"").replace(serverControlParams.themeOptions,"")},hasPartRefresh:function(b){if(c.has(a,"czr_partials"))return c.contains(c.map(a.czr_partials(),function(a,d){return c.contains(a.settings,b)}),!0)},getSectionControlIds:function(b){return b=b||a.czr_activeSectionId(),a.section.has(b)?c.map(a.section(b).controls(),function(a){return a.id}):[]},getSectionSettingIds:function(b){if(b=b||a.czr_activeSectionId(),a.section.has(b)){var d=this,e=[],f=d.getSectionControlIds(b);return c.each(f,function(b){c.each(a.control(b).settings,function(a,b){e.push(a.id)})}),e}},capitalize:function(a){return c.isString(a)?a.charAt(0).toUpperCase()+a.slice(1):a},truncate:function(a,b,d){if(!c.isString(a))return"";b=b||20;var e=a.length>b,f=e?a.substr(0,b-1):a;return f=d&&e?f.substr(0,f.lastIndexOf(" ")):f,e?f+"...":f},isMultiItemModule:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].crud||a.czrModuleMap[b].multi_item||!1}},isCrudModule:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].crud||!1}},hasModuleModOpt:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].has_mod_opt||!1}},setupInputCollectionFromDOM:function(){var d=this;if(!c.isFunction(d))throw new Error("setupInputCollectionFromDOM : inputParentInst is not valid.");var e=d.module,f=c.has(d(),"is_mod_opt");if(!c.has(d,"czr_Input")||c.isEmpty(d.inputCollection())){d.czr_Input=new a.Values,d.inputConstructor=f?e.inputModOptConstructor:e.inputConstructor;var g=f?d.defaultModOptModel:d.defaultItemModel;if(c.isEmpty(g)||c.isUndefined(g))throw new Error("No default model found in item or mod opt "+d.id+".");var h=b.extend(!0,{},d());h=c.isObject(h)?b.extend(g,h):g;var i={};return b("."+e.control.css_attr.sub_set_wrapper,d.container).each(function(g){var j=b(this).find("[data-type]").attr("data-type"),k=c.has(h,j)?h[j]:"";if(c.isUndefined(j)||c.isEmpty(j))return void a.consoleLog("setupInputCollectionFromDOM : missing data-type for "+e.id);if(!c.has(h,j))throw new Error("The item or mod opt property : "+j+" has been found in the DOM but not in the item or mod opt model : "+d.id+". The input can not be instantiated.");var l=b(this).attr("data-input-type"),m=b(this).attr("data-transport")||"inherit",n=c.has(e.inputOptions,l)?e.inputOptions[l]:{};d.czr_Input.add(j,new d.inputConstructor(j,{id:j,type:l,transport:m,input_value:k,input_options:n,container:b(this),input_parent:d,is_mod_opt:f,module:e})),d.czr_Input(j).ready(),i[j]=k}),d.inputCollection(i),d}},removeInputCollection:function(){var a=this;if(!c.isFunction(a))throw new Error("removeInputCollection : inputParentInst is not valid.");c.has(a,"czr_Input")&&(a.czr_Input.each(function(b){a.czr_Input.remove(b.id)}),a.inputCollection({}))},refreshModuleControl:function(c){var d=a.controlConstructor.czr_module,e=(a.control(c).params.type,a.settings.controls[c]);b.when(a.control(c).container.remove()).done(function(){a.control.remove(c),a.control.add(c,new d(c,{params:e,previewer:a.previewer}))})},hexToRgb:function(b){var c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;try{b=b.replace(c,function(a,b,c,d){return b+b+c+c+d+d})}catch(d){return a.errorLog("Error in Helpers::hexToRgb : "+d),b}var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b);return e=e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[],"rgb("+e.join(",")+")"},rgbToHex:function(a,b,c){var d=function(a){var b=a.toString(16);return 1==b.length?"0"+b:b};return"#"+d(a)+d(b)+d(c)}})}(wp.customize,jQuery,_),function(a,b,c){a.CZR_Helpers=a.CZR_Helpers||{},a.CZR_Helpers=b.extend(a.CZR_Helpers,{addActions:function(a,b,d){var e=this;d=d||e,d[a]=d[a]||[],new_event_map=c.clone(d[a]),d[a]=c.union(new_event_map,c.isArray(b)?b:[b])},doActions:function(a,b,c){b.trigger(a,c)},setupDOMListeners:function(d,e,f){var g=this,h={model:{},dom_el:{}};return f=f||g,c.isArray(d)?c.isObject(e)?(e=c.extend(h,e),!e.dom_el instanceof jQuery||1!=e.dom_el.length?void a.errorLog("setupDomListeners : dom element should be an existing dom element",e):void c.map(d,function(d){return!c.isString(d.selector)||c.isEmpty(d.selector)?void a.errorLog("setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : "+d.actions.join(",")):!c.isString(d.selector)||c.isEmpty(d.selector)?void a.errorLog("setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : "+d.actions.join(",")):void e.dom_el.on(d.trigger,d.selector,function(h,i){if(h.stopPropagation(),!a.utils.isKeydownButNotEnterEvent(h)){h.preventDefault();var j=b.extend(!0,{},e);if(c.has(j,"model")&&c.has(j.model,"id")&&(c.has(f,"get")?j.model=f():j.model=f.getModel(j.model.id)),b.extend(j,{event:d,dom_event:h}),b.extend(j,i),!c.has(j,"event")||!c.has(j.event,"actions"))return void a.errorLog("executeEventActionChain : missing obj.event or obj.event.actions");try{g.executeEventActionChain(j,f)}catch(k){a.errorLog("In setupDOMListeners : problem when trying to fire actions : "+j.event.actions),a.errorLog("Error : "+k)}}})})):void a.errorLog("setupDomListeners : args should be an object",d):void a.errorLog("setupDomListeners : event_map should be an array",e)},executeEventActionChain:function(a,b){var d=this;if("function"==typeof a.event.actions)return a.event.actions.call(b,a);c.isArray(a.event.actions)||(a.event.actions=[a.event.actions]);var e=!1;c.map(a.event.actions,function(f){if(!e){if("function"!=typeof b[f])throw new Error("executeEventActionChain : the action : "+f+" has not been found when firing event : "+a.event.selector);var g=c.has(a,"dom_el")&&-1!=a.dom_el.length?a.dom_el:d.container;g.trigger("before_"+f,c.omit(a,"event"));var h=b[f].call(b,a);!1===h&&(e=!0),g.trigger("after_"+f,c.omit(a,"event"))}})}})}(wp.customize,jQuery,_),function(a,b,c){a.czr_wpQueryDataReady=b.Deferred(),a.czr_wpQueryInfos=a.czr_wpQueryInfos||new a.Value,a.czr_partials=a.czr_partials||new a.Value,a.bind("ready",function(){a.previewer.bind("houston-widget-settings",function(b){var d=c.filter(b.registeredSidebars,function(a){return!c.findWhere(_wpCustomizeWidgetsSettings.registeredSidebars,{id:a.id})}),e=c.filter(b.registeredSidebars,function(a){return!c.has(b.renderedSidebars,a.id)});e=c.map(e,function(a){return a.id});var f=c.map(b.registeredSidebars,function(a){return a.id});a.czr_widgetZoneSettings=a.czr_widgetZoneSettings||new a.Value,a.czr_widgetZoneSettings.set({actives:b.renderedSidebars,inactives:e,registered:f,candidates:d,available_locations:b.availableWidgetLocations})}),a.previewer.bind("czr-query-data-ready",function(b){a.czr_wpQueryInfos(b),"pending"==a.czr_wpQueryDataReady.state()&&a.czr_wpQueryDataReady.resolve(b)}),a.previewer.bind("czr-partial-refresh-data",function(b){a.czr_partials.set(b)}),a.previewer.bind("czr-partial-refresh-done",function(b){if(c.has(b,"set_id")){var d=a.CZR_Helpers.build_setId(b.set_id);if(a.has(d)){var e=a.CZR_Helpers.getControlSettingId(d);a.control.has(e)&&a.control(e).trigger("czr-partial-refresh-done")}}})})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{initialize:function(d,e){if(c.isUndefined(e.input_parent)||c.isEmpty(e.input_parent))throw new Error("No input_parent assigned to input "+e.id+". Aborting");if(c.isUndefined(e.module))throw new Error("No module assigned to input "+e.id+". Aborting");a.Value.prototype.initialize.call(this,null,e);var f=this;if(b.extend(f,e||{}),f.isReady=b.Deferred(),c.isUndefined(e.input_value)||f.set(e.input_value),a.czrInputMap&&c.has(a.czrInputMap,f.type)){var g=a.czrInputMap[f.type];c.isFunction(f[g])&&f[g](e.input_options||null)}else a.consoleLog("Warning an input : "+f.id+" has no corresponding method defined in api.czrInputMap.");var h={text:"keyup",textarea:"keyup",password:"keyup",color:"colorpickerchange",range:"input propertychange"};f.input_event_map=[{trigger:b.trim(["change",h[f.type]||""].join(" ")),selector:"input[data-type], select[data-type], textarea[data-type]",name:"set_input_value",actions:function(a){if(!c.has(f.input_parent,"syncElements")||!c.has(f.input_parent.syncElements,f.id))throw new Error("WARNING : THE INPUT "+f.id+" HAS NO SYNCED ELEMENT.")}}],f.visible=new a.Value((!0)),f.isReady.done(function(){f.visible.bind(function(a){a?f.container.stop(!0,!0).slideDown(200):f.container.stop(!0,!0).slideUp(200)})}),f.enabled=new a.Value((!0)),f.isReady.done(function(){f.enabled.bind(function(a){f.container.toggleClass("disabled",!a)})})},ready:function(){var a=this;a.setupDOMListeners(a.input_event_map,{dom_el:a.container},a),a.callbacks.add(function(){return a.inputReact.apply(a,arguments)}),b.when(a.setupSynchronizer()).done(function(){a.isReady.resolve(a)})},setupSynchronizer:function(){var b=this,c=b.input_parent,d=b.container.find("[data-type]"),e=b.container.find("[data-type]").is("textarea");if(e)throw new Error("TO DO : THE TEXTAREA INPUT ARE NOT READY IN THE SYNCHRONIZER!");var f=new a.Element(d);c.syncElements=c.syncElements||{},c.syncElements[b.id]=f,f.sync(b),f.set(b())},inputReact:function(a,b,d){var e=this,f=e.input_parent(),g=c.clone(f),h=e.is_preItemInput;e.enabled()&&(g=!c.isObject(g)||c.isEmpty(g)?{}:g,g[e.id]=a,e.input_parent.set(g,{input_changed:e.id,input_transport:e.transport,not_preview_sent:"postMessage"===e.transport}),h||(e.input_parent.trigger(e.id+":changed",a),c.isEmpty(b)&&(c.isUndefined(b)||"postMessage"!==e.transport)||e.module.sendInputToPreview({input_id:e.id,input_parent_id:e.input_parent.id,to:a,from:b})))},setupColorPicker:function(){var a=this;a.container.find("input").iris({palettes:!0,hide:!1,change:function(a,c){b(this).val(c.color.toString()).trigger("colorpickerchange").trigger("change")}})},setupSelect:function(){var a=this;b("select",a.container).not(".no-selecter-js").each(function(){b(this).selecter({})})},setupIcheck:function(a){var c=this;b("input[type=checkbox]",c.container).each(function(a){0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",checkedClass:"checked",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},setupStepper:function(a){var c=this;b('input[type="number"]',c.container).each(function(a){b(this).stepper()})},setupRangeSlider:function(a){var c,d=this,e=function(a,b){a.textContent=b+"%"};b(d.container).find("input").rangeslider({polyfill:!1,rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",onInit:function(){c=b(".rangeslider__handle",this.$range),b(".rangeslider__handle",this.$range),e(c[0],this.value)}}).on("input",function(){e(c[0],this.value)})}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupImageUploader:function(){var a=this,c=a();return a.attachment={},a.container?(this.tmplRendered=b.Deferred(),this.setupContentRendering(c,{}),void this.tmplRendered.done(function(){a.czrImgUploaderBinding()})):this},setupContentRendering:function(a,b){var d,e=this;e.attachment.id!=a&&b!==a?(a||(e.attachment={},e.renderImageUploaderTemplate()),d=wp.media.attachment(a),c.isObject(d)&&c.has(d,"attributes")&&c.has(d.attributes,"sizes")?(e.attachment=d.attributes,e.renderImageUploaderTemplate()):wp.media.attachment(a).fetch().done(function(){e.attachment=this.attributes,e.renderImageUploaderTemplate()})):e.attachment.id&&e.attachment.id!==a||e.renderImageUploaderTemplate()},czrImgUploaderBinding:function(){var a=this;c.bindAll(a,"czrImgUploadRemoveFile","czrImgUploadOpenFrame","czrImgUploadSelect"),a.container.on("click keydown",".upload-button",a.czrImgUploadOpenFrame),a.container.on("click keydown",".thumbnail-image img",a.czrImgUploadOpenFrame),a.container.on("click keydown",".remove-button",a.czrImgUploadRemoveFile),
15
+ a.bind(a.id+":changed",function(c,d){a.tmplRendered=b.Deferred(),a.setupContentRendering(c,d)})},czrImgUploadOpenFrame:function(b){a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),this.frame||this.czrImgUploadInitFrame(),this.frame.open())},czrImgUploadInitFrame:function(){var a=this,b=this.getUploaderLabels();a.frame=wp.media({button:{text:b.frame_button},states:[new wp.media.controller.Library({title:b.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1})]}),a.frame.on("select",a.czrImgUploadSelect)},czrImgUploadRemoveFile:function(b){var c=this;a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),c.attachment={},c.set(""))},czrImgUploadSelect:function(){var a=this,b=a.frame.state().get("selection").first().toJSON();window._wpmejsSettings||{};a.attachment=b,a.set(b.id)},renderImageUploaderTemplate:function(){var a=this;if(0!==b("#tmpl-czr-input-img-uploader-view-content").length){var c=wp.template("czr-input-img-uploader-view-content");if(c&&a.container){var d=a.container.find("."+a.module.control.css_attr.img_upload_container);if(d.length){var e={button_labels:a.getUploaderLabels(),settings:a.id,attachment:a.attachment,canUpload:!0};return d.html(c(e)),a.tmplRendered.resolve(),a.container.trigger(a.id+":content_rendered"),!0}}}},getUploaderLabels:function(){var b=serverControlParams.i18n,d={select:b.select_image,change:b.change_image,remove:b.remove_image,"default":b.default_image,placeholder:b.placeholder_image,frame_title:b.frame_title_image,frame_button:b.frame_button_image};return c.each(d,function(b,d){if(c.isUndefined(b)){var e=this;return a.errorLog("A translated string is missing ( "+d+" ) for the image uploader input in module : "+e.module.id),""}}),d}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupContentPicker:function(d){var e=this,f=[];b.extend({post:"",taxonomy:""},c.isObject(d)?d:{}),e.wpObjectTypes=d,e.container.find(".czr-input").append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>'),f=[{trigger:"change",selector:"select[data-select-type]",name:"set_input_value",actions:function(d){var f=b(d.dom_event.currentTarget,d.dom_el),g=b(f,d.dom_el).select2("data"),h={},i={id:"",type_label:"",title:"",object_type:"",url:""};return g=c.isArray(g)?g[0]:g,!c.isObject(g)||c.isEmpty(g)?void a.errorLog("Content Picker Input : the picked value should be an object not empty."):(c.each(i,function(b,d){return"_custom_"===g.id||c.has(g,d)&&!c.isEmpty(g[d])?void(h[d]=g[d]):void a.errorLog("content_picker : missing input param : "+d)}),void e.set(h))}}],e.setupDOMListeners(f,{dom_el:e.container},e),e.isReady.done(function(){e.setupContentSelecter()})},setupContentSelecter:function(){var a=this;if(!c.isEmpty(a())){var d={value:a().id||"",title:a().title||"",selected:"selected"};a.container.find("select").append(b("<option>",d))}a.container.find("select").select2({placeholder:{id:"-1",title:"Select"},data:a.setupSelectedContents(),ajax:{url:serverControlParams.AjaxUrl,type:"POST",dataType:"json",delay:250,debug:!0,data:function(b){var c=b.page?b.page:0;return c=b.term?b.page:c,{action:b.term?"search-available-content-items-customizer":"load-available-content-items-customizer",search:b.term,wp_customize:"on",page:c,wp_object_types:JSON.stringify(a.wpObjectTypes),CZRCpNonce:serverControlParams.CZRCpNonce}},processResults:function(b,d){if(a.defaultContentPickerOption=a.defaultContentPickerOption||[],!b.success)return{results:a.defaultContentPickerOption};var e=b.data.items,f=[];return c.each(e,function(a){f.push({id:a.id,title:a.title,type_label:a.type_label,object_type:a.object,url:a.url})}),{results:f,pagination:{more:b.data.items.length>=10}}}},templateSelection:a.czrFormatContentSelected,templateResult:a.czrFormatContentSelected,escapeMarkup:function(a){return a}})},czrFormatContentSelected:function(a){if(a.loading)return a.text;var b="<div class='content-picker-item clearfix'><div class='content-item-bar'><span class='czr-picker-item-title'>"+a.title+"</span>";return a.type_label&&(b+="<span class='czr-picker-item-type'>"+a.type_label+"</span>"),b+="</div></div>"},setupSelectedContents:function(){var a=this,b=a();return b}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupTextEditor:function(){var c=this;c();if(!c.container)throw new Error("The input container is not set for WP text editor in module."+c.module.id);c.czrRenderInputTextEditorTemplate()&&(c.editor=tinyMCE("czr-customize-content_editor"),c.textarea=b("#czr-customize-content_editor"),c.editorPane=b("#czr-customize-content_editor-pane"),c.dragbar=b("#czr-customize-content_editor-dragbar"),c.editorFrame=b("#czr-customize-content_editor_ifr"),c.mceTools=b("#wp-czr-customize-content_editor-tools"),c.mceToolbar=c.editorPane.find(".mce-toolbar-grp"),c.mceStatusbar=c.editorPane.find(".mce-statusbar"),c.preview=b("#customize-preview"),c.collapse=b(".collapse-sidebar"),c.textpreview=c.container.find("textarea"),c.toggleButton=c.container.find("button.text_editor-button"),c.editorExpanded=new a.Value((!1)),c.czrUpdateTextPreview(),c.czrSetToggleButtonText(c.editorExpanded()),c.czrTextEditorBinding(),c.czrResizeEditorOnUserRequest())},czrTextEditorBinding:function(){var d=this,e=d.editor,f=d.textarea,g=d.toggleButton,h=(d.editorExpanded,d.editorPane);d.bind(d.id+":changed",d.czrUpdateTextPreview),c.bindAll(d,"czrOnVisualEditorChange","czrOnTextEditorChange","czrResizeEditorOnWindowResize"),g.on("click",function(){d.editorExpanded.set(!d.editorExpanded()),d.editorExpanded()&&e.focus()}),d.module.czr_ModuleState.bind(function(a){"expanded"!=a&&d.editorExpanded.set(!1)}),d.editorExpanded.bind(function(c){a.consoleLog("in input.editorExpanded",c,d()),e.locker&&e.locker!==d&&(e.locker.editorExpanded.set(!1),e.locker=null),e.locker&&e.locker!==d||(b(document.body).toggleClass("czr-customize-content_editor-pane-open",c),e.locker=d),d.czrSetToggleButtonText(c),c?(e.setContent(wp.editor.autop(d())),e.on("input change keyup",d.czrOnVisualEditorChange),f.on("input",d.czrOnTextEditorChange),d.czrResizeEditor(window.innerHeight-h.height()),b(window).on("resize",d.czrResizeEditorOnWindowResize)):(e.off("input change keyup",d.czrOnVisualEditorChange),f.off("input",d.czrOnTextEditorChange),b(window).off("resize",d.czrResizeEditorOnWindowResize),d.czrResizeReset())})},czrOnVisualEditorChange:function(){var a,b=this,c=b.editor;a=wp.editor.removep(c.getContent()),b.set(a)},czrOnTextEditorChange:function(){var a,b=this,c=b.textarea;a=c.val(),b.set(a)},czrUpdateTextPreview:function(){var a,b=this,c=b();a=c.replace(/(<([^>]+)>)/gi,""),a.length>30&&(a=a.substring(0,34)+"..."),b.textpreview.val(a)},czrRenderInputTextEditorTemplate:function(){var c=this;if(0===b("#tmpl-czr-input-text_editor-view-content").length)throw new Error("Missing js template for text editor input in module : "+c.module.id);var d=wp.template("czr-input-text_editor-view-content"),e=c.container.find("input");if(d&&c.container)return a.consoleLog("Model injected in text editor tmpl : ",c()),e.after(d(c())),!0},czrIsEditorExpanded:function(){return b(document.body).hasClass("czr-customize-content_editor-pane-open")},czrResizeReset:function(){var a=this,b=a.preview,c=a.collapse,d=a.container.closest("ul.accordion-section-content");d.css("padding-bottom",""),b.css("bottom",""),c.css("bottom","")},czrResizeEditor:function(a){var b=window.innerHeight,d=window.innerWidth,e=40,f=1,g=782,h=56,i=8,j=4,k={},l=this,m=l.container.closest("ul.accordion-section-content"),n=l.mceTools,o=l.mceToolbar,p=l.mceStatusbar,q=l.preview,r=l.collapse,s=l.editorPane,t=l.editorFrame;l.editorExpanded()&&(c.isNaN(a)||(resizeHeight=b-a),k.height=resizeHeight,k.components=n.outerHeight()+o.outerHeight()+p.outerHeight(),resizeHeight<e&&(k.height=e),resizeHeight>b-f&&(k.height=b-f),b<s.outerHeight()&&(k.height=b),q.css("bottom",k.height),s.css("height",k.height),t.css("height",k.height-k.components),r.css("bottom",k.height+i),h>b-k.height&&r.css("bottom",p.outerHeight()+j),d<=g?m.css("padding-bottom",k.height):m.css("padding-bottom",""))},czrResizeEditorOnWindowResize:function(){var a=this,b=50,d=a.editorPane;a.editorExpanded()&&c.delay(function(){a.czrResizeEditor(window.innerHeight-d.height())},b)},czrResizeEditorOnUserRequest:function(){var a=this,c=a.dragbar,d=a.editorFrame;c.on("mousedown",function(){a.editorExpanded()&&b(document).on("mousemove.czr-customize-content_editor",function(c){c.preventDefault(),b(document.body).addClass("czr-customize-content_editor-pane-resize"),d.css("pointer-events","none"),a.czrResizeEditor(c.pageY)})}),c.on("mouseup",function(){a.editorExpanded()&&(b(document).off("mousemove.czr-customize-content_editor"),b(document.body).removeClass("czr-customize-content_editor-pane-resize"),d.css("pointer-events",""))})},czrSetToggleButtonText:function(a){var b=this;b.toggleButton.text(serverControlParams.i18n.mods.textEditor[a?"Close Editor":"Edit"])}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{initialize:function(d,e){if(c.isUndefined(e.module)||c.isEmpty(e.module))throw new Error("No module assigned to item "+d+". Aborting");var f=this;a.Value.prototype.initialize.call(f,null,e),f.isReady=b.Deferred(),f.embedded=b.Deferred(),f.container=null,f.contentContainer=null,f.inputCollection=new a.Value({}),f.viewState=new a.Value("closed"),f.removeDialogVisible=new a.Value((!1)),b.extend(f,e||{}),f.defaultItemModel=c.clone(e.defaultItemModel)||{id:"",title:""};var g=b.extend(f.defaultItemModel,e.initial_item_model);f.set(g),f.userEventMap=new a.Value([{trigger:"click keydown",selector:["."+f.module.control.css_attr.display_alert_btn,"."+f.module.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:function(){var a=this.removeDialogVisible();this.module.closeRemoveDialogs(),this.removeDialogVisible(!a)}},{trigger:"click keydown",selector:"."+f.module.control.css_attr.remove_view_btn,name:"remove_item",actions:["removeItem"]},{trigger:"click keydown",selector:["."+f.module.control.css_attr.edit_view_btn,"."+f.module.control.css_attr.item_title].join(","),name:"edit_view",actions:["setViewVisibility"]},{trigger:"click keydown",selector:".tabs nav li",name:"tab_nav",actions:function(a){this.module.toggleTabVisibility.call(this,a)}}]),f.isReady.done(function(){f.module.updateItemsCollection({item:f()}),f.callbacks.add(function(){return f.itemReact.apply(f,arguments)}),f.bind("contentRendered",function(){if(!c.has(f,"czr_Input")||c.isEmpty(f.inputCollection()))try{a.CZR_Helpers.setupInputCollectionFromDOM.call(f),f.module.setupTabNav.call(f)}catch(b){a.errorLog("In item.isReady.done : "+b)}}),f.bind("contentRemoved",function(){c.has(f,"czr_Input")&&a.CZR_Helpers.removeInputCollection.call(f)}),f.mayBeRenderItemWrapper(),f.embedded.done(function(){f.itemWrapperViewSetup(g)})})},ready:function(){this.isReady.resolve()},itemReact:function(a,b,c){var d=this,e=d.module;c=c||{},e.updateItemsCollection({item:a,data:c}).done(function(){d.writeItemViewTitle(a,c)})}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{_sendItem:function(a,b){var d=this,e=d.module,f=[];c.each(b,function(b,c){b!=a[c]&&f.push(c)}),c.each(f,function(b){e.control.previewer.send("sub_setting",{set_id:e.control.id,id:a.id,changed_prop:b,value:a[b]}),e.trigger("item_sent",{item:a,dom_el:d.container,changed_prop:b})})},removeItem:function(){var a=this,d=this.module,e=c.clone(d.itemCollection());d.trigger("pre_item_dom_remove",a()),a._destroyView(),e=c.without(e,c.findWhere(e,{id:a.id})),d.itemCollection.set(e),d.trigger("pre_item_api_remove",a());var f=b.extend(!0,{},a());d.czr_Item.remove(a.id),d.trigger("item-removed",f)},getModel:function(a){return this()}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{mayBeRenderItemWrapper:function(){var a=this;"pending"==a.embedded.state()&&b.when(a.renderItemWrapper()).done(function(b){if(a.container=b,c.isUndefined(a.container)||!a.container.length)throw new Error("In mayBeRenderItemWrapper the Item view has not been rendered : "+a.id);a.embedded.resolve()})},itemWrapperViewSetup:function(d){var e=this,f=this.module;d=e()||e.initial_item_model,e.writeItemViewTitle();var g=function(a,b,d){if(c.isUndefined(a)||!1===a.length)throw new Error("Module : "+e.module.id+", the item content has not been rendered for "+e.id);e.trigger("contentRendered"),e.contentContainer=a,e.toggleItemExpansion(b,d)};e.module.isMultiItem()?e.viewState.callbacks.add(function(d,h){var i=-1!==d.indexOf("expanded");f.hasModOpt()&&i&&a.czr_ModOptVisible(!1),i?c.isObject(e.contentContainer)&&!1!==e.contentContainer.length?e.toggleItemExpansion(d,h):b.when(e.renderItemContent(e()||e.initial_item_model)).done(function(a){(g=c.debounce(g,50))(a,d,h)}):e.toggleItemExpansion(d,h).done(function(){c.isObject(e.contentContainer)&&!1!==e.contentContainer.length&&(e.trigger("beforeContenRemoved"),b("."+f.control.css_attr.item_content,e.container).children().each(function(){b(this).remove()}),b("."+f.control.css_attr.item_content,e.container).html(""),e.contentContainer=null,e.trigger("contentRemoved"))})}):(e.viewState.callbacks.add(function(a,b){e.toggleItemExpansion.apply(e,arguments)}),b.when(e.renderItemContent(d)).done(function(a){g(a,!0)})),a.CZR_Helpers.setupDOMListeners(e.userEventMap(),{model:d,dom_el:e.container},e),e.removeDialogVisible.bind(function(d){var f=e.module,g=b("."+f.control.css_attr.remove_alert_wrapper,e.container).first();if(d&&f.closeAllItems(),d&&f.hasModOpt()&&a.czr_ModOptVisible(!1),d&&c.has(f,"preItem")&&f.preItemExpanded(!1),b("."+f.control.css_attr.remove_alert_wrapper,e.container).not(g).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+f.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),d){if(!wp.template(f.AlertPart)||!e.container)return void a.consoleLog("No removal alert template available for items in module :"+f.id);g.html(wp.template(f.AlertPart)({title:e().title||e.id}))}var h=function(a){g.toggleClass("open",a),e.container.find("."+f.control.css_attr.display_alert_btn).toggleClass("active",a),a&&f._adjustScrollExpandedBlock(e.container)};d?g.stop(!0,!0).slideDown(200,function(){h(d)}):g.stop(!0,!0).slideUp(200,function(){h(d)})})},renderItemWrapper:function(a){var c=this,d=c.module;if(a=a||c(),$_view_el=b("<li>",{"class":d.control.css_attr.single_item,"data-id":a.id,id:a.id}),d.itemsWrapper.append($_view_el),d.isMultiItem()){var e=d.getTemplateEl("rudItemPart",a);if(0===b("#tmpl-"+e).length)throw new Error("Missing template for item "+c.id+". The provided template script has no been found : #tmpl-"+d.getTemplateEl("rudItemPart",a));$_view_el.append(b(wp.template(e)(a)))}return $_view_el.append(b("<div/>",{"class":d.control.css_attr.item_content})),$_view_el},renderItemContent:function(a){var c=this,d=this.module;if(a=a||c(),0===b("#tmpl-"+d.getTemplateEl("itemInputList",a)).length)throw new Error("No item content template defined for module "+d.id+". The template script id should be : #tmpl-"+d.getTemplateEl("itemInputList",a));var e=wp.template(d.getTemplateEl("itemInputList",a));return e?(b(e(a)).appendTo(b("."+d.control.css_attr.item_content,c.container)),b(b(e(a)),c.container)):this},writeItemViewTitle:function(d){var e=this,f=e.module,g=d||e(),h=c.has(g,"title")?a.CZR_Helpers.capitalize(g.title):g.id;h=a.CZR_Helpers.truncate(h,20),b("."+f.control.css_attr.item_title,e.container).text(h),a.CZR_Helpers.doActions("after_writeViewTitle",e.container,g,e)},setViewVisibility:function(a,b){var d=this,e=this.module;b?d.viewState.set("expanded_noscroll"):(e.closeAllItems(d.id),c.has(e,"preItem")&&e.preItemExpanded.set(!1),d.viewState.set("expanded"==d._getViewState()?"closed":"expanded"))},_getViewState:function(){return-1==this.viewState().indexOf("expanded")?"closed":"expanded"},toggleItemExpansion:function(a,c,d){var e="closed"!=a,f=this,g=this.module,h=b("."+g.control.css_attr.item_content,f.container).first(),i=b.Deferred(),j=function(b){f.container.toggleClass("open",b),b&&g.closeRemoveDialogs();var c=h.siblings().find("."+g.control.css_attr.edit_view_btn);c.toggleClass("active",b),b?c.removeClass("fa-pencil").addClass("fa-minus-square").attr("title",serverControlParams.i18n.close):c.removeClass("fa-minus-square").addClass("fa-pencil").attr("title",serverControlParams.i18n.edit),"expanded"==a&&g._adjustScrollExpandedBlock(f.container),i.resolve()};return e?h.stop(!0,!0).slideDown(d||200,function(){j(e)}):h.stop(!0,!0).slideUp(200,function(){j(e)}),i.promise()},_destroyView:function(a){this.container.fadeOut({duration:a||400,done:function(){b(this).remove()}})}})}(wp.customize,jQuery,_);var CZRModOptMths=CZRModOptMths||{};!function(a,b,c){b.extend(CZRModOptMths,{initialize:function(d){if(c.isUndefined(d.module)||c.isEmpty(d.module))throw new Error("No module assigned to modOpt.");var e=this;a.Value.prototype.initialize.call(e,null,d),e.isReady=b.Deferred(),e.container=null,e.inputCollection=new a.Value({}),b.extend(e,d||{}),e.defaultModOptModel=c.clone(d.defaultModOptModel)||{is_mod_opt:!0};var f=b.extend(e.defaultModOptModel,d.initial_modOpt_model),g=e.module.control;e.set(f),a.czr_ModOptVisible=new a.Value((!1)),a.czr_ModOptVisible.bind(function(d,g,h){h=h||{},d?(e.module.closeRemoveDialogs().closeAllItems(),e.modOptWrapperViewSetup(f).done(function(b){e.container=b;try{a.CZR_Helpers.setupInputCollectionFromDOM.call(e).toggleModPanelView(d)}catch(f){a.consoleLog(f)}h.module&&h.focus&&c.delay(function(){!c.isNull(h.module.czr_ModOpt.container)&&h.module.czr_ModOpt.container.find('[data-tab-id="'+h.focus+'"] a').length&&h.module.czr_ModOpt.container.find('[data-tab-id="'+h.focus+'"] a').trigger("click")},200)})):e.toggleModPanelView(d).done(function(){!1!==e.container.length?b.when(e.container.remove()).done(function(){a.CZR_Helpers.removeInputCollection.call(e)}):a.CZR_Helpers.removeInputCollection.call(e),e.container=null})}),e.isReady.done(function(){b("."+g.css_attr.edit_modopt_icon,g.container).length||b.when(g.container.find(".customize-control-title").first().append(b("<span/>",{"class":[g.css_attr.edit_modopt_icon,"fa fa-cog"].join(" "),title:serverControlParams.i18n.Settings}))).done(function(){b("."+g.css_attr.edit_modopt_icon,g.container).fadeIn(400)}),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:"."+g.css_attr.edit_modopt_icon,name:"toggle_mod_option",actions:function(){a.czr_ModOptVisible(!a.czr_ModOptVisible())}}],{dom_el:g.container},e)})},ready:function(){this.isReady.resolve()}})}(wp.customize,jQuery,_);var CZRModOptMths=CZRModOptMths||{};!function(a,b,c){b.extend(CZRModOptMths,{modOptWrapperViewSetup:function(d){var e=this,f=this.module,g=b.Deferred(),h=function(b){a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:"."+f.control.css_attr.close_modopt_icon,name:"close_mod_option",actions:function(){a.czr_ModOptVisible(!1)}},{trigger:"click keydown",selector:".tabs nav li",name:"tab_nav",actions:function(a){this.module.toggleTabVisibility.call(this,a)}}],{dom_el:b},e)};return d=e()||e.initial_modOpt_model,b.when(e.renderModOptContent(d)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module : "+e.module.id+", the modOpt content has not been rendered");h(a),g.resolve(a)}).then(function(){e.module.setupTabNav.call(e)}),g.promise()},renderModOptContent:function(c){var d=this,e=this.module;if(c=c||d(),0===b("#tmpl-"+e.getTemplateEl("modOptInputList",c)).length)return void a.errorLog("renderModOptContent : No modOpt content template defined for module "+e.id+". The template script id should be : #tmpl-"+e.getTemplateEl("modOptInputList",c));var f=wp.template(e.getTemplateEl("modOptInputList",c));if(!f)return this;var g="";try{g=[serverControlParams.i18n["Options for"],e.control.params.label].join(" ")}catch(h){a.errorLog("In renderModOptContent : "+h),g=serverControlParams.i18n.Settings}return b("#widgets-left").after(b("<div/>",{"class":e.control.css_attr.mod_opt_wrapper,html:[['<h2 class="mod-opt-title">',g,"</h2>"].join(""),'<span class="fa fa-times '+e.control.css_attr.close_modopt_icon+'" title="close"></span>'].join("")})),b("."+e.control.css_attr.mod_opt_wrapper).append(b(f(c))),b("."+e.control.css_attr.mod_opt_wrapper)},toggleModPanelView:function(a){var d=this.module,e=(d.control,b.Deferred());return d.control.container.toggleClass("czr-modopt-visible",a),b("body").toggleClass("czr-editing-modopt",a),c.delay(function(){e.resolve()},200),e.promise()}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{initialize:function(d,e){if(c.isUndefined(e.control)||c.isEmpty(e.control))throw new Error("No control assigned to module "+d);var f=this;a.Value.prototype.initialize.call(this,null,e),f.isReady=b.Deferred(),b.extend(f,e||{}),b.extend(f,{crudModulePart:"czr-crud-module-part",rudItemPart:"czr-rud-item-part",ruItemPart:"czr-ru-item-part",itemInputList:"",modOptInputList:"",AlertPart:"czr-rud-item-alert-part"}),f.embedded=b.Deferred(),f.itemsWrapper="",f.isInSektion()||(f.container=b(f.control.selector),f.embedded.resolve()),f.embedded.done(function(){b.when(f.renderModuleParts()).done(function(a){if(!1===a.length)throw new Error("The items wrapper has not been rendered for module : "+f.id);f.itemsWrapper=a})}),f.defaultAPImodOptModel={initial_modOpt_model:{},defaultModOptModel:{},control:{},module:{}},f.defaultModOptModel={},f.modOptConstructor=a.CZRModOpt,f.itemCollection=new a.Value([]),f.defaultAPIitemModel={id:"",initial_item_model:{},defaultItemModel:{},control:{},module:{},is_added_by_user:!1},f.defaultItemModel={id:"",title:""},f.itemConstructor=a.CZRItem,f.czr_Item=new a.Values,f.inputConstructor=a.CZRInput,f.hasModOpt()&&(f.inputModOptConstructor=a.CZRInput),f.inputOptions={},f.isReady.done(function(){f.isDirty=new a.Value(e.dirty||!1),f.initializeModuleModel(e).done(function(a){f.set(a)}).fail(function(b){a.consoleLog("Module : "+f.id+" initialize module model failed : ",b)}).always(function(a){f.callbacks.add(function(){return f.moduleReact.apply(f,arguments)}),f.control.isModuleRegistered(f.id)||f.control.updateModulesCollection({module:e,is_registered:!1}),f.bind("items-collection-populated",function(a){f.itemCollection.callbacks.add(function(){return f.itemCollectionReact.apply(f,arguments)}),f.isMultiItem()&&f._makeItemsSortable()}),f.isInSektion()||f.populateSavedItemCollection(),f.hasModOpt()&&f.instantiateModOpt()})})},ready:function(){var a=this;a.isReady.resolve()},initializeModuleModel:function(a){var d=this,e=b.Deferred();if(!d.isMultiItem()&&!d.isCrud()&&c.isEmpty(a.items)){var f=c.clone(d.defaultItemModel);a.items=[b.extend(f,{id:d.id})]}return e.resolve(a).promise()},itemCollectionReact:function(a,c,d){var e=this,f=e(),g=b.extend(!0,{},f);g.items=a,e.isDirty.set(!0),e.set(g,d||{})},moduleReact:function(a,d,e){var f=this,g=f.control;c.size(d.items)==c.size(a.items)&&!c.isEmpty(c.difference(a.items,d.items)),a.column_id!=d.column_id;g.updateModulesCollection({module:b.extend(!0,{},a),data:e})},getModuleSection:function(){return this.section},isInSektion:function(){var a=this;return c.has(a,"sektion_id")},isMultiItem:function(){return a.CZR_Helpers.isMultiItemModule(null,this)},isCrud:function(){return a.CZR_Helpers.isCrudModule(null,this)},hasModOpt:function(){return a.CZR_Helpers.hasModuleModOpt(null,this)},instantiateModOpt:function(){var a=this,c=a.prepareModOptForAPI(a().modOpt||{});a.czr_ModOpt=new a.modOptConstructor(c),a.czr_ModOpt.ready(),a.czr_ModOpt.callbacks.add(function(c,d,e){var f=a(),g=b.extend(!0,{},f);g.modOpt=c,a.isDirty(!0),a(g,e)})},prepareModOptForAPI:function(a){var b=this,d={};return a=c.isObject(a)?a:{},c.each(b.defaultAPImodOptModel,function(e,f){a[f];switch(f){case"initial_modOpt_model":c.each(b.getDefaultModOptModel(),function(b,d){c.has(a,d)||(a[d]=b)}),d[f]=a;break;case"defaultModOptModel":d[f]=c.clone(b.defaultModOptModel);break;case"control":d[f]=b.control;break;case"module":d[f]=b}}),d},getDefaultModOptModel:function(a){var d=this;return b.extend(c.clone(d.defaultModOptModel),{is_mod_opt:!0})},sendInputToPreview:function(d){var e=this;d=c.extend({input_id:"",input_parent_id:"",to:null,from:null},d),c.isEqual(d.to,d.from)||(e.control.previewer.send("czr_input",{set_id:a.CZR_Helpers.getControlSettingId(e.control.id),module_id:e.id,module:{items:b.extend(!0,{},e().items),modOpt:e.hasModOpt()?b.extend(!0,{},e().modOpt):{}},input_parent_id:d.input_parent_id,input_id:d.input_id,value:d.to,isPartialRefresh:d.isPartialRefresh}),e.trigger("input_sent",{input:d.to,dom_el:e.container}))},sendModuleInputsToPreview:function(a){var d=this,e=function(){var e=this,f=b.extend(!0,{},e());f=c.omit(f,"id"),c.each(f,function(b,c){d.sendInputToPreview({input_id:c,input_parent_id:e.id,to:b,from:null,isPartialRefresh:a.isPartialRefresh})})};d.czr_Item.each(function(a){e.call(a)}),d.hasModOpt()&&e.call(d.czr_ModOpt)}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{populateSavedItemCollection:function(){var b=this,d=[];return c.isArray(b().items)?(c.each(b().items,function(a,b){c.has(a,"id")&&!c.has(a,"is_mod_opt")&&d.push(a)}),c.each(d,function(c,d){try{b.instantiateItem(c).ready()}catch(e){a.errorLog("populateSavedItemCollection : "+e)}}),c.each(d,function(a){if(c.isUndefined(c.findWhere(b.itemCollection(),a.id)))throw new Error("populateSavedItemCollection : The saved items have not been properly populated in module : "+b.id)}),void b.trigger("items-collection-populated")):void a.errorLog("populateSavedItemCollection : The saved items collection must be an array in module :"+b.id)},instantiateItem:function(a,b){var d=this;if(item_candidate=d.prepareItemForAPI(a),!c.has(item_candidate,"id"))throw new Error("CZRModule::instantiateItem() : an item has no id and could not be added in the collection of : "+this.id);if(d.czr_Item.has(item_candidate.id))throw new Error("CZRModule::instantiateItem() : the following item id "+item_candidate.id+" already exists in module.czr_Item() for module "+this.id);if(d.czr_Item.add(item_candidate.id,new d.itemConstructor(item_candidate.id,item_candidate)),!d.czr_Item.has(item_candidate.id))throw new Error("CZRModule::instantiateItem() : instantiation failed for item id "+item_candidate.id+" for module "+this.id);return d.czr_Item(item_candidate.id)},prepareItemForAPI:function(a){var b=this,d={};return a=c.isObject(a)?a:{},c.each(b.defaultAPIitemModel,function(e,f){var g=a[f];switch(f){case"id":c.isEmpty(g)?d[f]=b.generateItemId(b.module_type):d[f]=g;break;case"initial_item_model":c.each(b.getDefaultItemModel(),function(b,d){c.has(a,d)||(a[d]=b)}),d[f]=a;break;case"defaultItemModel":d[f]=c.clone(b.defaultItemModel);break;case"control":d[f]=b.control;break;case"module":d[f]=b;break;case"is_added_by_user":d[f]=!!c.isBoolean(g)&&g}}),c.has(d,"id")||(d.id=b.generateItemId(b.module_type)),d.initial_item_model.id=d.id,d},generateItemId:function(a,b,d){if(d=d||1,d>100)throw new Error("Infinite loop when generating of a module id.");var e=this;b=b||e._getNextItemKeyInCollection();var f=a+"_"+b;if(!c.has(e,"itemCollection")||!c.isArray(e.itemCollection()))throw new Error("The item collection does not exist or is not properly set in module : "+e.id);return e.isItemRegistered(f)?(b++,d++,e.generateItemId(a,b,d)):f},_getNextItemKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.itemCollection())?d:(b=c.isArray(a.itemCollection())&&1===c.size(a.itemCollection())?a.itemCollection()[0]:c.max(a.itemCollection(),function(a){return c.isNumber(a.id.replace(/[^\/\d]/g,""))?parseInt(a.id.replace(/[^\/\d]/g,""),10):0}),!c.isUndefined(b)&&c.isNumber(b.id.replace(/[^\/\d]/g,""))&&(d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d)},isItemRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.itemCollection(),{id:a}))},updateItemsCollection:function(a){var d=this,e=d.itemCollection(),f=c.clone(e),g=b.Deferred();if(c.has(a,"collection"))return void d.itemCollection.set(a.collection);if(!c.has(a,"item"))throw new Error("updateItemsCollection, no item provided "+d.control.id+". Aborting");a=c.extend({data:{}},a);var h=c.clone(a.item);return c.findWhere(f,{id:h.id})?c.each(e,function(a,b){a.id==h.id&&(f[b]=h)}):f.push(h),d.itemCollection.set(f,a.data),g.resolve({collection:f,data:a.data}).promise()},_getSortedDOMItemCollection:function(){var a=this,d=c.clone(a.itemCollection()),e=[],f=b.Deferred();if(b("."+a.control.css_attr.single_item,a.container).each(function(a){var f=c.findWhere(d,{id:b(this).attr("data-id")});f&&(e[a]=f)}),d.length!=e.length)throw new Error("There was a problem when re-building the item collection from the DOM in module : "+a.id);return f.resolve(e).promise()},refreshItemCollection:function(){var c=this;c.czr_Item.each(function(a){b.when(c.czr_Item(a.id).container.remove()).done(function(){c.czr_Item.remove(a.id)})}),c.itemCollection=new a.Value([]),c.populateSavedItemCollection()}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{getDefaultItemModel:function(a){var d=this;return b.extend(c.clone(d.defaultItemModel),{id:a||""})},_initNewItem:function(a,d){var e,f=this,g={id:""};return d="undefined"!=typeof d?d:c.size(f.itemCollection()),c.isNumber(d)?e=f.module_type+"_"+d:(e=d,d=0),g=a&&!c.isEmpty(a)?b.extend(a,{id:e}):this.getDefaultItemModel(e),c.has(g,"id")&&f._isItemIdPossible(e)?(c.map(f.getDefaultItemModel(),function(a,b){c.has(g,b)||(g[b]=a)}),g):f._initNewItem(g,d+1)}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{renderModuleParts:function(){var a=this,c=a.isInSektion()?b(a.container).find(".czr-mod-content"):b(a.container);if(a.isCrud()){if(0===b("#tmpl-"+a.crudModulePart).length)throw new Error("No crud Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.crudModulePart);c.append(b(wp.template(a.crudModulePart)({})))}var d=b("<ul/>",{"class":[a.control.css_attr.items_wrapper,a.module_type,a.isMultiItem()?"multi-item-mod":"mono-item-mod",a.isCrud()?"crud-mod":"not-crud-mod"].join(" ")});return c.append(d),b(d,c)},getTemplateEl:function(a,b){var d,e=this;switch(a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"modOptInputList":d=e.modOptInputList;break;case"itemInputList":d=e.itemInputList}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl() "+e.id+". Aborting");return d},getViewEl:function(a){var c=this;return b('[data-id = "'+a+'"]',c.container)},closeAllItems:function(a){var b=this,d=c.clone(b.itemCollection()),e=c.filter(d,function(b){return b.id!=a});return c.each(e,function(a){b.czr_Item.has(a.id)&&"expanded"==b.czr_Item(a.id)._getViewState(a.id)&&b.czr_Item(a.id).viewState.set("closed")}),this},_adjustScrollExpandedBlock:function(a,d){if(a.length&&!c.isUndefined(this.getModuleSection())){var e,f=this,g=b(".accordion-section-content",f.section.container),h=g.scrollTop(),i=d||90;setTimeout(function(){a.offset().top+a.height()+i>b(window.top).height()&&(e=a.offset().top+a.height()+i-b(window.top).height(),e>0&&g.animate({scrollTop:h+e},500))},50)}},closeRemoveDialogs:function(){var a=this;if(c.isArray(a.itemCollection()))return a.czr_Item.each(function(a){a.removeDialogVisible(!1)}),this},_makeItemsSortable:function(d){if(!wp.media.isTouchDevice&&b.fn.sortable){var e=this;b("."+e.control.css_attr.items_wrapper,e.container).sortable({handle:"."+e.control.css_attr.item_sort_handle,start:function(){c.has(a,"czrModulePanelState")&&a.czrModulePanelState.set(!1),c.has(a,"czrSekSettingsPanelState")&&a.czrSekSettingsPanelState.set(!1)},update:function(b,d){var f=function(){c.has(e,"preItem")&&e.preItemExpanded.set(!1),e.closeAllItems().closeRemoveDialogs();var b=function(){
16
+ a.previewer.refresh()};"postMessage"!=a(e.control.id).transport||a.CZR_Helpers.hasPartRefresh(e.control.id)||(b=c.debounce(b,500))(),e.trigger("item-collection-sorted")};e._getSortedDOMItemCollection().done(function(a){e.itemCollection.set(a)}).then(function(){f()})}})}},toggleTabVisibility:function(a){var c=this,d=(b(c.container).find("li"),b(c.container).find("section"),b(a.dom_event.currentTarget,a.dom_el).attr("data-tab-id"));b(".tabs nav li",c.container).each(function(){b(this).removeClass("tab-current").addClass("tab-inactive")}),b(c.container).find('li[data-tab-id="'+d+'"]').addClass("tab-current").removeClass("tab-inactive"),b("section",c.container).each(function(){b(this).removeClass("content-current")}),b(c.container).find('section[id="'+d+'"]').addClass("content-current")},setupTabNav:function(){var a=this,c=function(){var c=b.Deferred(),d=b(".tabs nav li",a.container);d.each(function(){b(this).removeClass("tab-current").addClass("tab-inactive")}),d.first().addClass("tab-current").removeClass("tab-inactive"),b("section",a.container).first().addClass("content-current");var e=d.length;return d.each(function(){b(this).addClass(e>0?"cols-"+e:"")}),c.resolve().promise()};setTimeout(function(){c().done(function(){b(".tabs",a.container).fadeIn(450)})},20)}})}(wp.customize,jQuery,_);var CZRDynModuleMths=CZRDynModuleMths||{};!function(a,b,c){b.extend(CZRDynModuleMths,{initialize:function(c,d){var e=this;a.CZRModule.prototype.initialize.call(e,c,d),b.extend(e,{itemPreAddEl:""}),e.preItemsWrapper="",e.itemAddedMessage=serverControlParams.i18n.successMessage,e.userEventMap=new a.Value([{trigger:"click keydown",selector:["."+e.control.css_attr.open_pre_add_btn,"."+e.control.css_attr.cancel_pre_add_btn].join(","),name:"pre_add_item",actions:["closeAllItems","closeRemoveDialogs","renderPreItemView","setPreItemViewVisibility"]},{trigger:"click keydown",selector:"."+e.control.css_attr.add_new_btn,name:"add_item",actions:["closeRemoveDialogs","closeAllItems","addItem"]}])},ready:function(){var c=this;c.setupDOMListeners(c.userEventMap(),{dom_el:c.container}),c.preItem=new a.Value(c.getDefaultItemModel()),c.preItemEmbedded=b.Deferred(),c.preItemEmbedded.done(function(a){c.preItemsWrapper=a,c.setupPreItemInputCollection()}),c.preItemExpanded=new a.Value((!1)),c.preItemExpanded.callbacks.add(function(a,b){c._togglePreItemViewExpansion(a)}),a.CZRModule.prototype.ready.call(c)},setupPreItemInputCollection:function(){var c=this;c.preItem.czr_Input=new a.Values,b("."+c.control.css_attr.pre_add_wrapper,c.container).find("."+c.control.css_attr.sub_set_wrapper).each(function(a){var d=b(this).find("[data-type]").attr("data-type")||"sub_set_"+a;c.preItem.czr_Input.add(d,new c.inputConstructor(d,{id:d,type:b(this).attr("data-input-type"),container:b(this),input_parent:c.preItem,module:c,is_preItemInput:!0})),c.preItem.czr_Input(d).ready()})},addItem:function(d){var e=this,f=e.preItem(),g=function(){e.preItemExpanded.set(!1),e._resetPreItemInputs()},h=b.Deferred();return c.isEmpty(f)||!c.isObject(f)?(a.errorLog("addItem : an item should be an object and not empty. In : "+e.id+". Aborted."),h.resolve().promise()):(g=c.debounce(g,200),e.instantiateItem(f,!0).ready(),function(){return b.Deferred(function(){var b=this;e.czr_Item(f.id).isReady.then(function(){g(),e.trigger("item-added",f),"postMessage"!=a(e.control.id).transport||!c.has(d,"dom_event")||c.has(d.dom_event,"isTrigger")||a.CZR_Helpers.hasPartRefresh(e.control.id)?b.resolve():e.control.previewer.refresh().done(function(){b.resolve()})})}).promise()}().done(function(){e.czr_Item(f.id).viewState("expanded")}).always(function(){h.resolve()}),h.promise())},_resetPreItemInputs:function(){var a=this;a.preItem.set(a.getDefaultItemModel()),a.preItem.czr_Input.each(function(b){var d=b.id;c.has(a.getDefaultItemModel(),d)&&b.set(a.getDefaultItemModel()._input_id)})}})}(wp.customize,jQuery,_);var CZRDynModuleMths=CZRDynModuleMths||{};!function(a,b,c){b.extend(CZRDynModuleMths,{renderPreItemView:function(a){var d=this;if("pending"==d.preItemEmbedded.state()){if(!c.has(d,"itemPreAddEl")||0===b("#tmpl-"+d.itemPreAddEl).length)return this;var e=wp.template(d.itemPreAddEl);if(!e||!d.container)return this;var f=b("."+d.control.css_attr.pre_add_item_content,d.container);f.prepend(e()),d.preItemEmbedded.resolve(f)}},_getPreItemView:function(){var a=this;return b("."+a.control.css_attr.pre_add_item_content,a.container)},setPreItemViewVisibility:function(a){var b=this;b.preItemExpanded.set(!b.preItemExpanded())},_togglePreItemViewExpansion:function(a){var c=this,d=b("."+c.control.css_attr.pre_add_item_content,c.container);d.slideToggle({duration:200,done:function(){var d=b("."+c.control.css_attr.open_pre_add_btn,c.container);b(this).toggleClass("open",a),a?d.find(".fa").removeClass("fa-plus-square").addClass("fa-minus-square"):d.find(".fa").removeClass("fa-minus-square").addClass("fa-plus-square"),d.toggleClass("active",a),b(c.container).toggleClass(c.control.css_attr.adding_new,a),c._adjustScrollExpandedBlock(b(this),120)}})},toggleSuccessMessage:function(a){var c=this,d=c.itemAddedMessage,e=b("."+c.control.css_attr.pre_add_wrapper,c.container);return $_success_wrapper=b("."+c.control.css_attr.pre_add_success,c.container),"on"==a?($_success_wrapper.find("p").text(d),$_success_wrapper.css("z-index",1000001).css("height",e.height()+"px").css("line-height",e.height()+"px")):$_success_wrapper.attr("style",""),c.container.toggleClass("czr-model-added","on"==a),this}})}(wp.customize,jQuery,_);var CZRSocialModuleMths=CZRSocialModuleMths||{};!function(a,b,c){b.extend(CZRSocialModuleMths,{initialize:function(d,e){var f=this;a.CZRDynModule.prototype.initialize.call(f,d,e),b.extend(f,{itemPreAddEl:"czr-module-social-pre-add-view-content",itemInputList:"czr-module-social-item-content",modOptInputList:"czr-module-social-mod-opt"}),this.social_icons=["500px","adn","amazon","android","angellist","apple","behance","behance-square","bitbucket","bitbucket-square","black-tie","btc","buysellads","chrome","codepen","codiepie","connectdevelop","contao","dashcube","delicious","deviantart","digg","dribbble","dropbox","drupal","edge","empire","envelope","envelope-o","envelope-square","expeditedssl","facebook","facebook-f (alias)","facebook-official","facebook-square","firefox","flickr","fonticons","fort-awesome","forumbee","foursquare","get-pocket","gg","gg-circle","git","github","github-alt","github-square","gitlab","git-square","google","google-plus","google-plus-circle","google-plus-official","google-plus-square","google-wallet","gratipay","hacker-news","houzz","instagram","internet-explorer","ioxhost","joomla","jsfiddle","lastfm","lastfm-square","leanpub","linkedin","linkedin-square","linux","maxcdn","meanpath","medium","mixcloud","mobile","modx","odnoklassniki","odnoklassniki-square","opencart","openid","opera","optin-monster","pagelines","paypal","phone","phone-square","pied-piper","pied-piper-alt","pinterest","pinterest-p","pinterest-square","product-hunt","qq","rebel","reddit","reddit-alien","reddit-square","renren","rss","rss-square","safari","scribd","sellsy","share-alt","share-alt-square","shirtsinbulk","simplybuilt","skyatlas","skype","slack","slideshare","snapchat","soundcloud","spotify","stack-exchange","stack-overflow","steam","steam-square","stumbleupon","stumbleupon-circle","telegram","tencent-weibo","trello","tripadvisor","tumblr","tumblr-square","twitch","twitter","twitter-square","usb","viacoin","vimeo","vimeo-square","vine","vk","weibo","weixin","whatsapp","wikipedia-w","windows","wordpress","xing","xing-square","yahoo","y-combinator","yelp","youtube","youtube-play","youtube-square"],f.inputConstructor=a.CZRInput.extend(f.CZRSocialsInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZRSocialsItem||{}),this.defaultModOptModel={is_mod_opt:!0,module_id:f.id,"social-size":serverControlParams.social_el_params.defaultSocialSize||14},this.defaultItemModel={id:"",title:"","social-icon":"","social-link":"","social-color":serverControlParams.social_el_params.defaultSocialColor,"social-target":1},this.itemAddedMessage=serverControlParams.i18n.socialLinkAdded,c.has(a,"czr_activeSectionId")&&f.control.section()==a.czr_activeSectionId()&&"resolved"!=f.isReady.state()&&f.ready(),a.section(f.control.section()).expanded.bind(function(a){"resolved"!=f.isReady.state()&&f.ready()}),f.isReady.then(function(){f.preItem.bind(function(a,b){c.has(a,"social-icon")&&(c.isEqual(a["social-icon"],b["social-icon"])||f.updateItemModel(f.preItem,!0))})})},updateItemModel:function(a,d){var e=a;if(d=d||!1,c.has(e(),"social-icon")&&!c.isEmpty(e()["social-icon"])){var f,g,h;f=b.extend(!0,{},e()),g=this.getTitleFromIcon(f["social-icon"]),h=serverControlParams.social_el_params.defaultSocialColor,!d&&e.czr_Input.has("social-color")&&(h=e.czr_Input("social-color")()),g=[serverControlParams.i18n.followUs,g].join(" "),d?(f=b.extend(f,{title:g,"social-color":h}),e.set(f)):(e.czr_Input("title").set(g),e.czr_Input("social-color")&&e.czr_Input("social-color").set(h))}},getTitleFromIcon:function(b){return a.CZR_Helpers.capitalize(b.replace("fa-","").replace("envelope","email"))},getIconFromTitle:function(a){return"fa-".title.toLowerCase().replace("envelope","email")},CZRSocialsInputMths:{setupSelect:function(){function a(a){if(!a.id)return a.text;var c=b('<span class="fa '+a.element.value.toLowerCase()+'">&nbsp;&nbsp;'+a.text+"</span>");return c}var d=this,e=d.input_parent,f=d.module,g=f.social_icons,h=e(),i=c.isEmpty(h.id);i&&(g=c.union([serverControlParams.i18n.selectSocialIcon],g)),c.each(g,function(a,c){var e=i&&0===c?"":"fa-"+a.toLowerCase(),g={value:e,html:f.getTitleFromIcon(a)};e==h["social-icon"]&&b.extend(g,{selected:"selected"}),b('select[data-type="social-icon"]',d.container).append(b("<option>",g))}),b('select[data-type="social-icon"]',d.container).select2({templateResult:a,templateSelection:a})},setupColorPicker:function(a){var d=this,e=(d.input_parent,d.module),f=b('input[data-type="social-color"]',d.container);f.iris({palettes:!0,hide:!1,defaultColor:serverControlParams.social_el_params.defaultSocialColor||"rgba(255,255,255,0.7)",change:function(a,d){c.has(d,"color")&&16777215==d.color._color?b(this).val(serverControlParams.social_el_params.defaultSocialColor||"rgba(255,255,255,0.7)"):b(this).val(d.color.toString()),b(this).trigger("colorpickerchange").trigger("change")}}),f.closest("div").on("click keydown",function(){e._adjustScrollExpandedBlock(d.container)})}},CZRSocialsItem:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.bind("social-icon:changed",function(){b.module.updateItemModel(b)})},_buildTitle:function(b,c,d){var e=this,f=e.module;return b=b||("string"==typeof c?a.CZR_Helpers.capitalize(c.replace("fa-","")):""),b=a.CZR_Helpers.truncate(b,20),c=c||"fa-"+f.social_icons[0],d=d||serverControlParams.social_el_params.defaultSocialColor,'<div><span class="fa '+c+'" style="color:'+d+'"></span> '+b+"</div>"},writeItemViewTitle:function(a){var c=this,d=c.module,e=a||c(),f=d.getTitleFromIcon(e["social-icon"]);b("."+d.control.css_attr.item_title,c.container).html(c._buildTitle(f,e["social-icon"],e["social-color"]))}}})}(wp.customize,jQuery,_);var CZRWidgetAreaModuleMths=CZRWidgetAreaModuleMths||{};!function(a,b,c){b.extend(CZRWidgetAreaModuleMths,{initialize:function(d,e){var f=this;a.CZRDynModule.prototype.initialize.call(this,d,e),b.extend(f,{itemPreAddEl:"czr-module-widgets-pre-add-view-content",itemInputList:"czr-module-widgets-item-input-list",itemInputListReduced:"czr-module-widgets-item-input-list-reduced",ruItemPart:"czr-module-widgets-ru-item-part"}),f.inputConstructor=a.CZRInput.extend(f.CZRWZonesInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZRWZonesItem||{}),f.serverParams=serverControlParams.widget_area_el_params||{},f.contexts=c.has(f.serverParams,"sidebar_contexts")?f.serverParams.sidebar_contexts:{},f.context_match_map={is_404:"404",is_category:"archive-category",is_home:"home",is_page:"page",is_search:"search",is_single:"single"},f.locations=c.has(f.serverParams,"sidebar_locations")?f.serverParams.sidebar_locations:{},f.defaultItemModel={id:"",title:serverControlParams.i18n.widgetZone,contexts:c.without(c.keys(f.contexts),"_all_"),locations:[f.serverParams.defaultWidgetLocation],description:""},this.itemAddedMessage=serverControlParams.i18n.widgetZoneAdded,c.has(a,"sidebar_insights")||(a.sidebar_insights=new a.Values,a.sidebar_insights.create("candidates"),a.sidebar_insights.create("actives"),a.sidebar_insights.create("inactives"),a.sidebar_insights.create("registered"),a.sidebar_insights.create("available_locations")),this.listenToSidebarInsights(),a.czr_widgetZoneSettings=a.czr_widgetZoneSettings||new a.Value,a.czr_widgetZoneSettings.bind(function(b,d){f.isReady.then(function(){c.each(b,function(b,c){a.sidebar_insights(c).set(b)})})}),f.preItem_location_alert_view_state=new a.Value("closed"),f.preItem_location_alert_view_state.callbacks.add(function(a,b){f._toggleLocationAlertExpansion(f.container,a)}),f.bind("item-added",function(a){f.addWidgetSidebar(a)}),f.bind("pre_item_api_remove",function(a){f.removeWidgetSidebar(a)});var g=new a.Values;g.create("fixed_for_current_session"),g.create("value"),a.section(f.serverParams.dynWidgetSection).fixTopMargin=g,a.section(f.serverParams.dynWidgetSection).fixTopMargin("fixed_for_current_session").set(!1),a.panel("widgets").expanded.callbacks.add(function(a,b){f.widgetPanelReact(),"resolved"!=f.isReady.state()&&f.ready()})},ready:function(){var b=this;a.CZRDynModule.prototype.ready.call(b),b.preItemExpanded.callbacks.add(function(a,c){a&&(b.preItem.czr_Input("locations")._setupLocationSelect(!0),b.preItem.czr_Input("locations").mayBeDisplayModelAlert())})},initializeModuleModel:function(a){var d=this,e=b.Deferred();return a.items=c.union(c.has(d.serverParams,"default_zones")?d.serverParams.default_zones:[],a.items),e.resolve(a).promise()},CZRWZonesInputMths:{ready:function(){var b=this;b.bind("locations:changed",function(){b.mayBeDisplayModelAlert()}),a.CZRInput.prototype.ready.call(b)},setupSelect:function(){"locations"==this.id&&this._setupLocationSelect(),"contexts"==this.id&&this._setupContextSelect()},_setupContextSelect:function(){var a=this,d=a(),e=(a.input_parent,a.module);c.each(e.contexts,function(e,f){var g={value:f,html:e};(f==d||c.contains(d,f))&&b.extend(g,{selected:"selected"}),b('select[data-type="contexts"]',a.container).append(b("<option>",g))}),b('select[data-type="contexts"]',a.container).select2()},_setupLocationSelect:function(d){function e(a){if(!a.id)return a.text;if(c.contains(i,a.element.value))return a.text;var d=b('<span class="czr-unavailable-location fa fa-ban" title="'+serverControlParams.i18n.unavailableLocation+'">&nbsp;&nbsp;'+a.text+"</span>");return d}var f=this,g=f(),h=(f.input_parent,f.module),i=a.sidebar_insights("available_locations")();b('select[data-type="locations"]',f.container).children().length||c.each(h.locations,function(a,d){var e={value:d,html:a};(d==g||c.contains(g,d))&&b.extend(e,{selected:"selected"}),b('select[data-type="locations"]',f.container).append(b("<option>",e))}),d&&b('select[data-type="locations"]',f.container).select2("destroy"),b('select[data-type="locations"]',f.container).select2({templateResult:e,templateSelection:e})},mayBeDisplayModelAlert:function(){var d=this,e=d.input_parent,f=d.module;if(c.has(e(),"locations")&&!c.isEmpty(e().locations)){var g=b('select[data-type="locations"]',d.container).val(),h=a.sidebar_insights("available_locations")(),i=c.filter(g,function(a){return!c.contains(h,a)});!c.has(e(),"id")||c.isEmpty(e().id)?f.preItem_location_alert_view_state.set(c.isEmpty(i)?"closed":"expanded"):e.czr_itemLocationAlert.set(c.isEmpty(i)?"closed":"expanded")}}},CZRWZonesItem:{initialize:function(b,c){var d=this;d.module;d.czr_itemLocationAlert=new a.Value,a.CZRItem.prototype.initialize.call(d,null,c)},itemWrapperViewSetup:function(){var b=this,c=b.module;a.CZRItem.prototype.itemWrapperViewSetup.call(b),b.czr_itemLocationAlert.set("closed"),b.czr_itemLocationAlert.callbacks.add(function(a,d){c._toggleLocationAlertExpansion(b.container,a)}),b.writeSubtitleInfos(b()),b.viewState.callbacks.add(function(a,c){-1!=a.indexOf("expanded")&&b.bind("contentRendered",function(){b.czr_Input("locations")._setupLocationSelect(!0),b.czr_Input("locations").mayBeDisplayModelAlert()})})},itemReact:function(b,c){var d=this;a.CZRItem.prototype.itemReact.call(d,b,c),d.writeSubtitleInfos(b),d.updateSectionTitle(b).setModelUpdateTimer()},writeSubtitleInfos:function(a){var d=this,e=d.module,f=c.clone(a||d()),g=[],h=[],i="";if(!d.container.length)return this;f.locations=c.isString(f.locations)?[f.locations]:f.locations,c.each(f.locations,function(a){c.has(e.locations,a)?g.push(e.locations[a]):g.push(a)}),f.contexts=c.isString(f.contexts)?[f.contexts]:f.contexts,d._hasModelAllContexts(a)?h.push(e.contexts._all_):c.each(f.contexts,function(a){c.has(e.contexts,a)?h.push(e.contexts[a]):h.push(a)});var j=serverControlParams.i18n.locations,k=serverControlParams.i18n.contexts,l=serverControlParams.i18n.notset;if(g=c.isEmpty(g)?'<span style="font-weight: bold;">'+l+"</span>":g.join(", "),h=c.isEmpty(h)?'<span style="font-weight: bold;">'+l+"</span>":h.join(", "),i="<u>"+j+"</u> : "+g+" <strong>|</strong> <u>"+k+"</u> : "+h,b(".czr-zone-infos",d.container).length)b(".czr-zone-infos",d.container).html(i);else{var m=b("<div/>",{"class":["czr-zone-infos",e.control.css_attr.item_sort_handle].join(" "),html:i});b("."+e.control.css_attr.item_btns,d.container).after(m)}return this},updateSectionTitle:function(c){var d="sidebar-widgets-"+c.id,e=c.title;return a.section.has(d)?(b(".accordion-section-title",a.section(d).container).text(e),b(".customize-section-title h3",a.section(d).container).html('<span class="customize-action">'+a.section(d).params.customizeAction+"</span>"+e),this):this},setModelUpdateTimer:function(){var a=this,c=a.module;clearTimeout(b.data(this,"modelUpdateTimer")),b.data(this,"modelUpdateTimer",setTimeout(function(){c.control.refreshPreview()},1e3))},_hasModelAllContexts:function(a){var b=this,d=b.module,e=c.keys(d.contexts);if(a=a||this(),c.has(a,"contexts"))return!!c.contains(a.contexts,"_all_")||c.isEmpty(c.difference(c.without(e,"_all_"),a.contexts))},_getMatchingContexts:function(b){var d=this,e=a.czr_wpQueryInfos().conditional_tags||{},f=c.filter(d.context_match_map,function(a,b){return!0===e[b]});return c.isEmpty(f)?b:f}},addWidgetSidebar:function(d,e){if(!c.isObject(d)&&c.isEmpty(e))throw new Error("No valid input were provided to add a new Widget Zone.");var f=this,g=c.isEmpty(d)?e:c.clone(d),h=c.isEmpty(d)?e:b.extend(c.clone(c.findWhere(a.Widgets.data.registeredSidebars,{id:f.serverParams.defaultWidgetSidebar})),{name:g.title,id:g.id});a.Widgets.registeredSidebars.add(h);var i=b.extend(c.clone(a.section("sidebar-widgets-"+f.serverParams.defaultWidgetSidebar).params),{id:"sidebar-widgets-"+g.id,instanceNumber:c.max(a.settings.sections,function(a){return a.instanceNumber}).instanceNumber+1,sidebarId:h.id,title:h.name,description:"undefined"!=typeof e?e.description:a.section("sidebar-widgets-"+f.serverParams.defaultWidgetSidebar).params.description,priority:c.max(c.omit(a.settings.sections,f.serverParams.dynWidgetSection),function(a){return a.instanceNumber}).priority+1});a.section.add(i.id,new a.sectionConstructor[i.type](i.id,{params:i})),a.settings.sections[i.id]=i.id;var j="sidebars_widgets["+g.id+"]",k=b.extend(c.clone(a.settings.settings["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{value:[]});a.settings.settings[j]=k,a.create(j,j,k.value,{transport:k.transport,previewer:a.previewer,dirty:!1});var l=b.extend(c.clone(a.settings.controls["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{settings:{"default":j}}),m={};c.each(l,function(a,b){"string"==typeof a&&(a=a.replace(f.serverParams.defaultWidgetSidebar,g.id)),m[b]=a}),m.instanceNumber=c.max(a.settings.controls,function(a){return a.instanceNumber}).instanceNumber+1,a.settings.controls[j]=m,a.control.add(j,new a.controlConstructor[m.type](j,{params:m,previewer:a.previewer})),c.has(this,"container")&&this.container.trigger("widget_zone_created",{model:g,section_id:"sidebar-widgets-"+g.id,setting_id:j})},removeWidgetSidebar:function(d){var e=this;if(!c.isObject(d)||c.isEmpty(d))throw new Error("No valid data were provided to remove a Widget Zone.");a.Widgets.registeredSidebars.remove(d.id),a.section.has("sidebar-widgets-"+d.id)&&(a.section("sidebar-widgets-"+d.id).container.remove(),a.section.remove("sidebar-widgets-"+d.id),delete a.settings.sections["sidebar-widgets-"+d.id]),a.has("sidebars_widgets["+d.id+"]")&&(a.remove("sidebars_widgets["+d.id+"]"),delete a.settings.settings["sidebars_widgets["+d.id+"]"]),a.control.has("sidebars_widgets["+d.id+"]")&&(a.control("sidebars_widgets["+d.id+"]").container.remove(),a.control.remove("sidebars_widgets["+d.id+"]"),delete a.settings.controls["sidebars_widgets["+d.id+"]"]);var f=function(){a.previewer.refresh()};f=c.debounce(f,500),b.when(f()).done(function(){e.trigger("widget_zone_removed",{model:d,section_id:"sidebar-widgets-"+d.id,setting_id:"sidebars_widgets["+d.id+"]"})})},widgetPanelReact:function(){var b=this,d=a.panel("widgets").container.find(".control-panel-content").css("margin-top");a.section(b.serverParams.dynWidgetSection).fixTopMargin("value").set(d);var e=a.section(b.serverParams.dynWidgetSection).container.find(".accordion-section-content"),f=a.panel("widgets").container.find(".control-panel-content"),g=function(){e.css("margin-top",""),f.css("margin-top",a.section(b.serverParams.dynWidgetSection).fixTopMargin("value")())};a.bind("pane-contents-reflowed",c.debounce(function(){g()},150)),b.closeAllItems().closeRemoveDialogs(),c.has(b,"preItemExpanded")&&b.preItemExpanded.set(!1)},widgetSectionReact:function(c,d){var e=this,f=a.section(e.serverParams.dynWidgetSection),g=f.container.closest(".wp-full-overlay-sidebar-content"),h=f.container.find(".accordion-section-content"),i=f.container.closest(".wp-full-overlay"),j=(f.container.find(".customize-section-back"),f.container.find(".accordion-section-title").first());b("#customize-header-actions").height();c&&(i.removeClass("section-open"),h.css("height","auto"),j.attr("tabindex","0"),h.css("margin-top",""),g.scrollTop(0)),e.closeAllItems().closeRemoveDialogs(),h.slideToggle()},listenToSidebarInsights:function(){var d=this;a.sidebar_insights("registered").callbacks.add(function(a){var b=c.clone(d.itemCollection());c.each(b,function(b){d.getViewEl(b.id).length&&d.getViewEl(b.id).css("display",c.contains(a,b.id)?"block":"none")})}),a.sidebar_insights("inactives").callbacks.add(function(a){var e=c.clone(d.itemCollection());c.each(e,function(e){d.getViewEl(e.id).length&&(c.contains(a,e.id)?(d.getViewEl(e.id).addClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length||d.getViewEl(e.id).find(".czr-item-title").append(b("<span/>",{"class":"czr-inactive-alert",html:" [ "+serverControlParams.i18n.inactiveWidgetZone+" ]"}))):(d.getViewEl(e.id).removeClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length&&d.getViewEl(e.id).find(".czr-inactive-alert").remove()))})}),a.sidebar_insights("candidates").callbacks.add(function(b){c.isArray(b)&&c.each(b,function(b){c.isObject(b)&&(a.section.has("sidebar-widgets-"+b.id)||(d.addWidgetSidebar({},b),c.has(a.sidebar_insights("actives")(),b.id)&&a.section.has("sidebar-widgets-"+b.id)&&a.section("sidebar-widgets-"+b.id).activate()))})})},_adjustScrollExpandedBlock:function(a,c){if(a.length){var d,e=b(".wp-full-overlay-sidebar-content").scrollTop(),f=c||90;setTimeout(function(){a.offset().top+a.height()+f>b(window.top).height()&&(d=a.offset().top+a.height()+f-b(window.top).height(),b(".wp-full-overlay-sidebar-content").animate({scrollTop:e+d},600))},50)}},getDefaultItemModel:function(a){var d=this,e=d.itemCollection(),f=c.clone(d.defaultItemModel);f.contexts;return b.extend(f,{title:"Widget Zone "+(1*c.size(e)+1)})},getTemplateEl:function(a,b){var d,e=this;switch("rudItemPart"==a?a=c.has(b,"is_builtin")&&b.is_builtin?"ruItemPart":a:"itemInputList"==a&&(a=c.has(b,"is_builtin")&&b.is_builtin?"itemInputListReduced":a),a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"itemInputList":d=e.itemInputList;break;case"itemInputListReduced":d=e.itemInputListReduced}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl()");return d},_toggleLocationAlertExpansion:function(c,d){var e=c.find(".czr-location-alert");if(!e.length){var f=["<span>"+serverControlParams.i18n.locationWarning+"</span>",a.CZR_Helpers.getDocSearchLink(serverControlParams.i18n.locationWarning)].join("");e=b("<div/>",{"class":"czr-location-alert",html:f,style:"display:none"}),b('select[data-type="locations"]',c).closest("div").after(e)}e.toggle("expanded"==d)}})}(wp.customize,jQuery,_);var CZRBodyBgModuleMths=CZRBodyBgModuleMths||{};!function(a,b,c){b.extend(CZRBodyBgModuleMths,{initialize:function(d,e){var f=this;a.CZRModule.prototype.initialize.call(f,d,e),b.extend(f,{itemInputList:"czr-module-bodybg-item-content"}),f.inputConstructor=a.CZRInput.extend(f.CZRBodyBgInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZBodyBgItemMths||{}),f.defaultItemModel={"background-color":"#eaeaea","background-image":"","background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center center","background-size":"cover"},a.consoleLog("New module instantiated : ",f.id),c.has(a,"czr_activeSectionId")&&f.control.section()==a.czr_activeSectionId()&&"resolved"!=f.isReady.state()&&f.ready(),a.section(f.control.section()).expanded.bind(function(a){"resolved"!=f.isReady.state()&&f.ready()})},CZRBodyBgInputMths:{setupSelect:function(){var a=this,d={"background-repeat":"bg_repeat_options","background-attachment":"bg_attachment_options","background-position":"bg_position_options"},e=(a.input_parent,serverControlParams.body_bg_module_params),f={};a.module;c.has(d,a.id)&&(c.isUndefined(e)||c.isUndefined(e[d[a.id]])||(f=e[d[a.id]],c.isEmpty(f)||(c.each(f,function(d,e){var f={value:e,html:d};(e==a()||c.contains(a(),e))&&b.extend(f,{selected:"selected"}),b("select[data-type]",a.container).append(b("<option>",f))}),b("select[data-type]",a.container).select2())))}},CZBodyBgItemMths:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.inputCollection.bind(function(a){!c.isEmpty(_col)&&b.czr_Input&&b.czr_Input.has("background-image")&&b.czr_Input("background-image").isReady.done(function(a){var d=function(a){var d=!c.isEmpty(a)||c.isNumber(a);c.each(["background-repeat","background-attachment","background-position","background-size"],function(a){b.czr_Input(a).container.toggle(d||!1)})};d(a()),b.bind("background-image:changed",function(){d(b.czr_Input("background-image")())})})})}}})}(wp.customize,jQuery,_),function(a,b,c){a.czrModuleMap=a.czrModuleMap||{},b.extend(a.czrModuleMap,{czr_widget_areas_module:{mthds:CZRWidgetAreaModuleMths,crud:!0,sektion_allowed:!1,name:"Widget Areas"},czr_social_module:{mthds:CZRSocialModuleMths,crud:!0,name:"Social Icons",has_mod_opt:!0},czr_background:{mthds:CZRBodyBgModuleMths,crud:!1,multi_item:!1,name:"Slider"}})}(wp.customize,jQuery,_);var CZRBaseControlMths=CZRBaseControlMths||{};!function(a,b,c){b.extend(CZRBaseControlMths,{initialize:function(b,d){var e=this;e.css_attr=c.has(serverControlParams,"css_attr")?serverControlParams.css_attr:{},a.Control.prototype.initialize.call(e,b,d),e.bind("czr-partial-refresh-done",function(){c.has(e,"czr_moduleCollection")&&c.each(e.czr_moduleCollection(),function(a){e.czr_Module(a.id)&&e.czr_Module(a.id).sendModuleInputsToPreview({isPartialRefresh:!0})})})},refreshPreview:function(a){this.previewer.refresh()}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{initialize:function(d,e){var f=this;f.czr_Module=new a.Values,f.czr_moduleCollection=new a.Value,f.czr_moduleCollection.set([]),f.moduleCollectionReady=b.Deferred(),f.moduleCollectionReady.done(function(a){!f.isMultiModuleControl(e.params),f.czr_moduleCollection.callbacks.add(function(){return f.moduleCollectionReact.apply(f,arguments)})}),f.isMultiModuleControl(e.params)&&(f.syncSektionModule=new a.Value),a.CZRBaseControl.prototype.initialize.call(f,d,e),a.section(f.section()).expanded.bind(function(a){f.czr_Module.each(function(a){a.closeAllItems().closeRemoveDialogs(),c.has(a,"preItem")&&a.preItemExpanded(!1)})})},ready:function(){var b=this;if(b.isMultiModuleControl())b.syncSektionModule.bind(function(a,c){"resolved"!=b.moduleCollectionReady.state()&&(b.registerModulesOnInit(a),b.moduleCollectionReady.resolve())});else{var d={};c.each(b.getSavedModules(),function(c,e){d=c;try{b.instantiateModule(c,{})}catch(f){return void a.errorLog("Failed to instantiate module "+c.id+" "+f)}b.container.attr("data-module",c.id)}),b.moduleCollectionReady.resolve(d)}b.bind("user-module-candidate",function(c){var d;try{d=b.instantiateModule(c,{})}catch(e){return void a.errorLog("Failed to instantiate module "+c.id+" "+e)}d.ready(c.is_added_by_user)})},getDefaultModuleApiModel:function(){var a={id:"",module_type:"",modOpt:{},items:[],crud:!1,multi_item:!1,sortable:!1,control:{}};return this.isMultiModuleControl()?b.extend(a,{column_id:"",sektion:{},sektion_id:"",is_added_by_user:!1,dirty:!1}):b.extend(a,{section:""})},getDefaultModuleDBModel:function(){var a={items:[]};return this.isMultiModuleControl()?b.extend(a,{id:"",module_type:"",column_id:"",sektion_id:"",dirty:!1}):a},isMultiModuleControl:function(a){return"czr_multi_module"==(a||this.params).type},getSyncCollectionControl:function(){var b=this;if(c.isUndefined(b.params.syncCollection))throw new Error("Control "+b.id+" has no synchronized sektion control defined.");return a.control(a.CZR_Helpers.build_setId(b.params.syncCollection))},getSavedModules:function(){var d=this,e=[],f=d.params.module_type,g=[],h=[],i={};return d.isMultiModuleControl()?e=b.extend(!0,[],a(d.id)()):(!a.CZR_Helpers.isMultiItemModule(f)||c.isEmpty(a(d.id)())||c.isObject(a(d.id)())||a.consoleLog("Module Control Init for "+d.id+" : a mono item module control value should be an object if not empty."),g=c.isArray(a(d.id)())?a(d.id)():[a(d.id)()],c.each(g,function(b,e){a.CZR_Helpers.hasModuleModOpt(f)&&0===e&&(c.has(b,"id")?a.consoleLog("getSavedModules : the module "+f+" in control "+d.id+" has no mod_opt defined while it should."):i=b),c.has(b,"id")&&!c.has(b,"is_mod_opt")&&h.push(b)}),e.push({id:a.CZR_Helpers.getOptionName(d.id)+"_"+d.params.type,module_type:d.params.module_type,section:d.section(),modOpt:b.extend(!0,{},i),items:b.extend(!0,[],h)})),e},isModuleRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.czr_moduleCollection(),{id:a}))}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{instantiateModule:function(a,b){if(!c.has(a,"id"))throw new Error("CZRModule::instantiateModule() : a module has no id and could not be added in the collection of : "+this.id+". Aborted.");var d=this;if((c.isUndefined(b)||c.isEmpty(b))&&(b=d.getModuleConstructor(a)),!c.isEmpty(a.id)&&d.czr_Module.has(a.id))throw new Error("The module id already exists in the collection in control : "+d.id);var e=d.prepareModuleForAPI(a);if(d.czr_Module.add(e.id,new b(e.id,e)),!d.czr_Module.has(e.id))throw new Error("instantiateModule() : instantiation failed for module id "+e.id+" in control "+d.id);return d.czr_Module(e.id)},getModuleConstructor:function(b){var d=this,e={},f={};if(!c.has(b,"module_type"))throw new Error("CZRModule::getModuleConstructor : no module type found for module "+b.id);if(!c.has(a.czrModuleMap,b.module_type))throw new Error("Module type "+b.module_type+" is not listed in the module map api.czrModuleMap.");var g=a.czrModuleMap[b.module_type].mthds,h=a.czrModuleMap[b.module_type].crud,i=h?a.CZRDynModule:a.CZRModule;if(c.isEmpty(b.sektion_id)?f=i.extend(g):(e=i.extend(g),f=e.extend(d.getMultiModuleExtender(e))),
17
+ c.isUndefined(f)||c.isEmpty(f)||!f)throw new Error("CZRModule::getModuleConstructor : no constructor found for module type : "+b.module_type+".");return f},prepareModuleForAPI:function(b){if(!c.isObject(b))throw new Error("prepareModuleForAPI : a module must be an object to be instantiated.");var d=this,e={};return c.each(d.getDefaultModuleApiModel(),function(f,g){var h=b[g];switch(g){case"id":c.isEmpty(h)?e[g]=d.generateModuleId(b.module_type):e[g]=h;break;case"module_type":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module type must a string not empty");e[g]=h;break;case"items":if(!c.isArray(h))throw new Error("prepareModuleForAPI : a module item list must be an array");e[g]=h;break;case"modOpt":if(!c.isObject(h))throw new Error("prepareModuleForAPI : a module modOpt property must be an object");e[g]=h;break;case"crud":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "crud" must be a boolean');e[g]=h||!1;break;case"multi_item":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "multi_item" must be a boolean');e[g]=h||!1;break;case"sortable":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].sortable||a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "sortable" must be a boolean');e[g]=h||!1;break;case"control":e[g]=d;break;case"section":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module section must be a string not empty");e[g]=h;break;case"column_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module column id must a string not empty");e[g]=h;break;case"sektion":if(!c.isObject(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion must be an object not empty");e[g]=h;break;case"sektion_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion id must be a string not empty");e[g]=h;break;case"is_added_by_user":if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "is_added_by_user" must be a boolean');e[g]=h||!1;break;case"dirty":e[g]=h||!1}}),e},generateModuleId:function(a,b,d){if(d=d||1,d>100)throw new Error("Infinite loop when generating of a module id.");var e=this;b=b||e._getNextModuleKeyInCollection();var f=a+"_"+b;if(!c.has(e,"czr_moduleCollection")||!c.isArray(e.czr_moduleCollection()))throw new Error("The module collection does not exist or is not properly set in control : "+e.id);return e.isModuleRegistered(f)?(b++,d++,e.generateModuleId(a,b,d)):f},_getNextModuleKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.czr_moduleCollection())||(b=c.max(a.czr_moduleCollection(),function(a){return parseInt(a.id.replace(/[^\/\d]/g,""),10)}),d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{registerModulesOnInit:function(d){var e=this,f=[];c.each(e.getSavedModules(),function(g,h){if(!d.czr_Item.has(g.sektion_id))return a.errorLog("Warning Module "+g.id+" is orphan : it has no sektion to be embedded to. It Must be removed."),void f.push(g);var i=d.czr_Item(g.sektion_id);if(c.isUndefined(i))throw new Error("sektion instance missing. Impossible to instantiate module : "+g.id);b.extend(g,{sektion:i}),e.updateModulesCollection({module:g})}),e.moduleCollectionReady.then(function(){c.isEmpty(f)||e.moduleCollectionReact(e.czr_moduleCollection(),[],{orphans_module_removal:f})})},updateModulesCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);if(c.has(a,"collection"))return void d.czr_moduleCollection.set(a.collection,a.data||{});if(!c.has(a,"module"))throw new Error("updateModulesCollection, no module provided "+d.id+". Aborting");var g=d.prepareModuleForAPI(c.clone(a.module));c.findWhere(f,{id:g.id})?c.each(e,function(a,b){a.id==g.id&&(f[b]=g)}):f.push(g);var h={};c.has(a,"data")&&(h=b.extend(!0,{},a.data),b.extend(h,{module:g})),d.czr_moduleCollection.set(f,h)},moduleCollectionReact:function(d,e,f){var g=this,h=c.size(d)>c.size(e),i=c.size(e)>c.size(d);c.size(e)==c.size(d);if(is_collection_sorted=!1,i){var j=c.filter(e,function(a){return c.isUndefined(c.findWhere(d,{id:a.id}))});j=j[0],g.czr_Module.remove(j.id)}c.isObject(f)&&c.has(f,"module")&&(f.module_id=f.module.id,f.module=g.prepareModuleForDB(b.extend(!0,{},f.module))),!g.isMultiModuleControl()&&h||a(this.id).set(g.filterModuleCollectionBeforeAjax(d),f)},filterModuleCollectionBeforeAjax:function(a){var d,e=this,f=b.extend(!0,[],a);if(c.each(a,function(a,c){var d=b.extend(!0,{},a);f[c]=e.prepareModuleForDB(d)}),e.isMultiModuleControl())return f;if(c.size(a)>1)throw new Error("There should not be several modules in the collection of control : "+e.id);if(!c.isArray(a)||c.isEmpty(a)||!c.has(a[0],"items"))throw new Error("The setting value could not be populated in control : "+e.id);var g=a[0].id;if(!e.czr_Module.has(g))throw new Error("The single module control ("+e.id+") has no module registered with the id "+g);var h=e.czr_Module(g);if(!c.isArray(h().items))throw new Error("The module "+g+" should be an array in control : "+e.id);return d=h.isMultiItem()?h().items:h().items[0]||[],h.hasModOpt()?c.union([h().modOpt],d):d},prepareModuleForDB:function(a){if(!c.isObject(a))throw new Error("MultiModule Control::prepareModuleForDB : a module must be an object. Aborting.");var b=this,d={};return c.each(b.getDefaultModuleDBModel(),function(e,f){if(!c.has(a,f))throw new Error("MultiModule Control::prepareModuleForDB : a module is missing the property : "+f+" . Aborting.");var g=a[f];switch(f){case"items":if(!c.isArray(g))throw new Error("prepareModuleForDB : a module item list must be an array");d[f]=g;break;case"id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module id must a string not empty");d[f]=g;break;case"module_type":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module type must a string not empty");d[f]=g;break;case"column_id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module column id must a string not empty");d[f]=g;break;case"sektion_id":if(!c.isObject(a.sektion)||!c.has(a.sektion,"id"))throw new Error("prepareModuleForDB : a module sektion must be an object with an id.");d[f]=a.sektion.id;break;case"dirty":if(b.czr_Module.has(a.id)?d[f]=b.czr_Module(a.id).isDirty():d[f]=g,!c.isBoolean(d[f]))throw new Error("prepareModuleForDB : a module dirty state must be a boolean.")}}),d}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{initialize:function(b,c){var d=this;a.consoleLog("IN MULTI MODULE INITIALIZE ? ",c),a(b).callbacks.add(function(){return d.syncColumn.apply(d,arguments)}),a.CZRBaseModuleControl.prototype.initialize.call(d,b,c)},ready:function(){var b=this;a.consoleLog("MODULE-COLLECTION CONTROL READY",this.id),a.CZRBaseModuleControl.prototype.ready.apply(b,arguments)},syncColumn:function(d,e,f){if(a.consoleLog("IN SYNC COLUMN",d,e,f),(c.isUndefined(f)||!f.silent)&&(a.consoleLog("IN SYNXXX",a.control("hu_theme_options[module-collection]").syncSektionModule()(),this.syncSektionModule()(),this.id),!c.has(f,"orphans_module_removal"))){var g=a.control(this.id),h=c.filter(d,function(a,b){return!c.findWhere(e,{id:a.id})});c.isEmpty(h)||(a.consoleLog("ADDED MODULE?",h),c.each(h,function(a){g.syncSektionModule().czr_Column(a.column_id).updateColumnModuleCollection({module:a})}));var i=c.filter(e,function(a,b){return!c.findWhere(d,{id:a.id})});c.isEmpty(i)||c.each(i,function(a){g.syncSektionModule().czr_Column(a.column_id).removeModuleFromColumnCollection(a)}),c.size(e)==c.size(d)&&c.has(f,"module")&&c.has(f,"source_column")&&c.has(f,"target_column")&&b.when(g.syncSektionModule().moveModuleFromTo(f.module,f.source_column,f.target_column)).done(function(){g.syncSektionModule().control.trigger("module-moved",{module:f.module,source_column:f.source_column,target_column:f.target_column})}),g.trigger("columns-synchronized",d)}},removeModule:function(a){var b=this;b.czr_Module.has(a.id)&&"resolved"==b.czr_Module(a.id).embedded.state()&&b.czr_Module(a.id).container.remove(),b.removeModuleFromCollection(a)},removeModuleFromCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);f=c.filter(f,function(b){return b.id!=a.id}),d.czr_moduleCollection.set(f)}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{getMultiModuleExtender:function(d){var e=this;return b.extend(e.CZRModuleExtended,{initialize:function(c,e){var f=this;d.prototype.initialize.call(f,c,e),a.consoleLog("MODULE INSTANTIATED : ",f.id),b.extend(f,{singleModuleWrapper:"czr-single-module-wrapper",sektionModuleTitle:"czr-module-sektion-title-part",ruModuleEl:"czr-ru-module-sektion-content"}),f.czr_ModuleState=new a.Value((!1)),f.isReady.done(function(){f.setupModuleView()}),f.moduleTitleEmbedded=b.Deferred(),f.modColumn=new a.Value,f.modColumn.set(e.column_id),f.modColumn.bind(function(c,d){a.consoleLog("MODULE "+f.id+" HAS BEEN MOVED TO COLUMN",c,f());var e=f(),g=b.extend(!0,{},e);g.column_id=c,f.set(g,{target_column:c,source_column:d})})},ready:function(e){var f=this;a.consoleLog("MODULE READY IN EXTENDED MODULE CLASS : ",f.id),b.when(f.renderModuleWrapper(e)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module container has not been embedded for module :"+f.id);f.container=a,f.embedded.resolve()}),d.prototype.ready.call(f)}}),e.CZRModuleExtended},CZRModuleExtended:{renderModuleWrapper:function(a){var c=this;if("resolved"==c.embedded.state())return c.container;if(0===b("#tmpl-"+c.singleModuleWrapper).length)throw new Error("No template for module "+c.id+". The template script id should be : #tmpl-"+c.singleModuleWrapper);var d=wp.template(c.singleModuleWrapper),e={id:c.id,type:c.module_type},f=b(d(e));return a?b.when(b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").after(f)).done(function(){b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").remove()}):b(".czr-module-collection-wrapper",c._getColumn().container).append(f),f},setupModuleView:function(){var b=this;b.view_event_map=[{trigger:"click keydown",selector:[".czr-remove-mod","."+b.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:["toggleModuleRemoveAlert"]},{trigger:"click keydown",selector:"."+b.control.css_attr.remove_view_btn,name:"remove_module",actions:["removeModule"]},{trigger:"click keydown",selector:".czr-edit-mod",name:"edit_module",actions:["setModuleViewVisibility","sendEditModule"]},{trigger:"click keydown",selector:".czr-module-back",name:"back_to_column",actions:["setModuleViewVisibility"]},{trigger:"mouseenter",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("start_hovering_module",{id:b.id})}},{trigger:"mouseleave",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("stop_hovering_module",{id:b.id})}}],b.embedded.done(function(){b.czr_ModuleState.callbacks.add(function(){return b.setupModuleViewStateListeners.apply(b,arguments)}),a.CZR_Helpers.setupDOMListeners(b.view_event_map,{module:{id:b.id},dom_el:b.container},b)})},setModuleViewVisibility:function(c,d){var e=this;e.czr_ModuleState(!e.czr_ModuleState()),a.czrModulePanelState.set(!1),a.czrSekSettingsPanelState.set(!1),e.control.syncSektionModule().closeAllOtherSektions(b(c.dom_event.currentTarget,c.dom_el))},sendEditModule:function(a){var b=this;b.control.previewer.send("edit_module",{id:b.id})},setupModuleViewStateListeners:function(c){var d=this;a.czr_isModuleExpanded=a.czr_isModuleExpanded||new a.Value,c?a.czr_isModuleExpanded(d):a.czr_isModuleExpanded(!1),b.when(d.toggleModuleViewExpansion(c)).done(function(){c?(d.renderModuleTitle(),d.populateSavedItemCollection()):d.czr_Item.each(function(a){a.viewState.set("closed"),a._destroyView(0),d.czr_Item.remove(a.id)})})},renderModuleTitle:function(){var a=this;if("resolved"!=a.moduleTitleEmbedded.state()){if(0===b("#tmpl-"+a.sektionModuleTitle).length)throw new Error("No sektion title Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.sektionModuleTitle);b.when(b(a.container).find(".czr-mod-content").prepend(b(wp.template(a.sektionModuleTitle)({id:a.id})))).done(function(){a.moduleTitleEmbedded.resolve()})}},toggleModuleViewExpansion:function(a,c){var d=this;b(".czr-mod-content",d.container).slideToggle({duration:c||200,done:function(){var b=d.container.closest(".wp-full-overlay"),c=d.container.find(".czr-module-back"),e=d.container.find(".czr-module-title");d.container.toggleClass("open",a),b.toggleClass("czr-module-open",a),e.attr("tabindex",a?"-1":"0"),c.attr("tabindex",a?"0":"-1"),a?c.focus():e.focus(),a&&d._adjustScrollExpandedBlock(d.container)}})},toggleModuleRemoveAlert:function(a){var d=this,e=this.control,f=b("."+d.control.css_attr.remove_alert_wrapper,d.container).first(),g=(a.dom_event,e.syncSektionModule().czr_Column(d.column_id).container);if(c.has(d,"preItem")&&e.syncSektionModule().preItemExpanded.set(!1),b("."+d.control.css_attr.remove_alert_wrapper,g).not(f).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+d.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),!wp.template(d.AlertPart)||!d.container)throw new Error("No removal alert template available for module :"+d.id);f.html(wp.template(d.AlertPart)({title:d().title||d.id})),f.slideToggle({duration:200,done:function(){var c=!b(this).hasClass("open")&&b(this).is(":visible");b(this).toggleClass("open",c),b(a.dom_el).find("."+d.control.css_attr.display_alert_btn).toggleClass("active",c),c&&d._adjustScrollExpandedBlock(d.container)}})},removeModule:function(a){this.control.removeModule(a.module)},_getColumn:function(){var a=this;return a.control.syncSektionModule().czr_Column(a.modColumn())},_getSektion:function(){}}})}(wp.customize,jQuery,_);var CZRMultiplePickerMths=CZRMultiplePickerMths||{};!function(a,b,c){b.extend(CZRMultiplePickerMths,{ready:function(){function a(a){return a.text.replace(/\u2013|\u2014/g,"")}var c=this,d=this.container.find("select");d.select2({closeOnSelect:!1,templateSelection:a}),d.on("change",function(a){0===b(this).find("option:selected").length&&c.setting.set([])})}})}(wp.customize,jQuery,_);var CZRCroppedImageMths=CZRCroppedImageMths||{};!function(a,b,c){"function"==typeof wp.media.controller.Cropper&&"function"==typeof a.CroppedImageControl&&(wp.media.controller.CZRCustomizeImageCropper=wp.media.controller.Cropper.extend({doCrop:function(a){var b=a.get("cropDetails"),c=this.get("control");return b.dst_width=c.params.dst_width,b.dst_height=c.params.dst_height,wp.ajax.post("crop-image",{wp_customize:"on",nonce:a.get("nonces").edit,id:a.get("id"),context:c.id,cropDetails:b})}}),b.extend(CZRCroppedImageMths,{initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CZRCustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON();return a.mime&&a.mime.indexOf("image")>-1?void(c.contains(["image/svg+xml","image/gif"],a.mime)||this.params.width===a.width&&this.params.height===a.height&&!this.params.flex_width&&!this.params.flex_height?(this.setImageFromAttachment(a),this.frame.close()):this.frame.setState("cropper")):void this.frame.trigger("content:error")}}))}(wp.customize,jQuery,_);var CZRUploadMths=CZRUploadMths||{};!function(a,b,c){b.extend(CZRUploadMths,{ready:function(){var c=this;this.params.removed=this.params.removed||"",this.success=b.proxy(this.success,this),this.uploader=b.extend({container:this.container,browser:this.container.find(".czr-upload"),success:this.success,plupload:{},params:{}},this.uploader||{}),c.params.extensions&&(c.uploader.plupload.filters=[{title:a.l10n.allowedFiles,extensions:c.params.extensions}]),c.params.context&&(c.uploader.params["post_data[context]"]=this.params.context),a.settings.theme.stylesheet&&(c.uploader.params["post_data[theme]"]=a.settings.theme.stylesheet),this.uploader=new wp.Uploader(this.uploader),this.remover=this.container.find(".remove"),this.remover.on("click keydown",function(a){"keydown"===a.type&&13!==a.which||(c.setting.set(c.params.removed),a.preventDefault())}),this.removerVisibility=b.proxy(this.removerVisibility,this),this.setting.bind(this.removerVisibility),this.removerVisibility(this.setting())},success:function(a){this.setting.set(a.get("id"))},removerVisibility:function(a){this.remover.toggle(a!=this.params.removed)}})}(wp.customize,jQuery,_);var CZRLayoutSelectMths=CZRLayoutSelectMths||{};!function(a,b,c){b.extend(CZRLayoutSelectMths,{ready:function(){this.setupSelect()},setupSelect:function(a){function d(a){if(!a.id)return a.text;if(c.has(e.params.layouts,a.element.value)){var d=e.params.layouts[a.element.value],f=d.src,g=d.label,h=b('<img src="'+f+'" class="czr-layout-img" title="'+g+'" /><span class="czr-layout-title">'+g+"</span>");return h}}var e=this;$_select=this.container.find("select"),$_select.select2({templateResult:d,templateSelection:d,minimumResultsForSearch:1/0})}})}(wp.customize,jQuery,_),function(a,b,c){b.extend(CZRBaseControlMths,a.Events),b.extend(a.Control.prototype,a.Events),b.extend(CZRModuleMths,a.Events),b.extend(CZRItemMths,a.Events),b.extend(CZRModOptMths,a.Events),b.extend(CZRSkopeBaseMths,a.Events),b.extend(CZRSkopeMths,a.Events),b.extend(CZRBaseControlMths,a.CZR_Helpers),b.extend(CZRInputMths,a.CZR_Helpers),b.extend(CZRModuleMths,a.CZR_Helpers),b.extend(CZRSkopeMths,a.CZR_Helpers),a.CZR_skopeBase=a.Class.extend(CZRSkopeBaseMths),a.CZR_skopeSave=a.Class.extend(CZRSkopeSaveMths),a.CZR_skopeReset=a.Class.extend(CZRSkopeResetMths),a.CZR_skope=a.Value.extend(CZRSkopeMths),c.has(a,"HeaderTool")&&(a.czr_HeaderTool=b.extend(!0,{},a.HeaderTool)),a.CZRInput=a.Value.extend(CZRInputMths),a.CZRItem=a.Value.extend(CZRItemMths),a.CZRModOpt=a.Value.extend(CZRModOptMths),a.CZRModule=a.Value.extend(CZRModuleMths),a.CZRDynModule=a.CZRModule.extend(CZRDynModuleMths),c.isUndefined(window.CZRColumnMths)||(a.CZRColumn=a.Value.extend(CZRColumnMths)),a.CZRBaseControl=a.Control.extend(CZRBaseControlMths),a.CZRBaseModuleControl=a.CZRBaseControl.extend(CZRBaseModuleControlMths),a.CZRMultiModuleControl=a.CZRBaseModuleControl.extend(CZRMultiModuleControlMths),a.CZRUploadControl=a.Control.extend(CZRUploadMths),a.CZRLayoutControl=a.Control.extend(CZRLayoutSelectMths),a.CZRMultiplePickerControl=a.Control.extend(CZRMultiplePickerMths),b.extend(a.controlConstructor,{czr_upload:a.CZRUploadControl,czr_module:a.CZRBaseModuleControl,czr_multi_module:a.CZRMultiModuleControl,czr_multiple_picker:a.CZRMultiplePickerControl,czr_layouts:a.CZRLayoutControl}),"function"==typeof a.CroppedImageControl&&(a.CZRCroppedImageControl=a.CroppedImageControl.extend(CZRCroppedImageMths),b.extend(a.controlConstructor,{czr_cropped_image:a.CZRCroppedImageControl})),a.czrInputMap=a.czrInputMap||{},b.extend(a.czrInputMap,{text:"",textarea:"",check:"setupIcheck",select:"setupSelect",number:"setupStepper",upload:"setupImageUploader",color:"setupColorPicker",content_picker:"setupContentPicker",text_editor:"setupTextEditor",password:"",range_slider:"setupRangeSlider"})}(wp.customize,jQuery,_),function(a,b,c){var d=serverControlParams.i18n||{};a.czr_CrtlDependenciesReady=b.Deferred(),a.bind("ready",function(){c.has(a,"czr_ctrlDependencies")||(serverControlParams.isSkopOn?"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.done(function(){a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()}):(a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()))}),a.CZR_ctrlDependencies=a.Class.extend({dominiDeps:[],initialize:function(){var b=this;if(this.defaultDominusParams={dominus:"",servi:[],visibility:null,actions:null,onSectionExpand:!0},this.dominiDeps=c.extend(this.dominiDeps,this._getControlDeps()),!c.isArray(b.dominiDeps))throw new Error("Visibilities : the dominos dependency array is not an array.");a.czr_activeSectionId.bind(function(d){if(!c.isEmpty(d)&&a.section.has(d))try{b.setServiDependencies(d)}catch(e){a.errorLog("In api.CZR_ctrlDependencies : "+e)}}),a.bind("awaken-section",function(d){if(serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase"))a.czr_skopeBase.processSilentUpdates({candidates:{},section_id:d.target,refresh:!1}).then(function(){try{b.setServiDependencies(d.target,d.source)}catch(c){a.errorLog("On awaken-section, ctrl deps : "+c)}});else try{b.setServiDependencies(d.target,d.source)}catch(e){a.errorLog("On awaken-section, ctrl deps : "+e)}}),this._handleFaviconNote()},setServiDependencies:function(d,e,f){var g=this,h=b.Deferred();if(f=f||!1,c.isUndefined(d)||!a.section.has(d))throw new Error("Control Dependencies : the targetSectionId is missing or not registered : "+d);if(a.section(d).czr_ctrlDependenciesReady=a.section(d).czr_ctrlDependenciesReady||b.Deferred(),!f&&"resolved"==a.section(d).czr_ctrlDependenciesReady.state())return h.resolve().promise();c.each(g.dominiDeps,function(b){if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))throw new Error("Control Dependencies : a dominus control id must be a not empty string.");var e=a.CZR_Helpers.build_setId(b.dominus);a.control.has(e)&&a.control(e).section()==d&&(b=g._prepareDominusParams(b),c.isEmpty(b)||g._processDominusCallbacks(b.dominus,b,f).fail(function(){a.consoleLog("self._processDominusCallbacks fail for section "+d),h.reject()}).done(function(){h.resolve()}))});var i=a.CZR_Helpers.getSectionControlIds(d),j=function(b){var d=[];return c.each(g.dominiDeps,function(e){if(!c.has(e,"servi")||!c.isArray(e.servi)||!c.has(e,"dominus")||c.isEmpty(e.dominus))return void a.errorLog("Control Dependencies : wrong params in _getServusDomini.");if(c.contains(e.servi,b)&&!c.contains(d,e.dominus)){if(e=g._prepareDominusParams(e),c.isEmpty(e))return;d.push(e.dominus)}}),c.isArray(d)?d:[]},k=[];return c.each(i,function(a){c.isEmpty(j(a))||(k=c.union(k,j(a)))}),c.each(k,function(b){var c=a.CZR_Helpers.build_setId(b);a.control(c).section()!=d&&e!=a.control(c).section()&&a.trigger("awaken-section",{target:a.control(c).section(),source:d})}),h.always(function(){a.section(d).czr_ctrlDependenciesReady.resolve()}),h.promise()},_deferCallbackForControl:function(d,e,f){var g=b.Deferred();if(c.isEmpty(d)||!c.isString(d))throw new Error("_deferCallbackForControl : the control id is missing.");if(!c.isFunction(e))throw new Error("_deferCallbackForControl : callback must be a funtion.");return f=c.isUndefined(f)||!c.isArray(f)?[]:f,a.control.has(d)?"resolved"==a.control(d).deferred.embedded.state()?b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()}):a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})}):a.control.when(d,function(){a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})})}),g.promise()},_processDominusCallbacks:function(d,e,f){var g=this,h=a.CZR_Helpers.build_setId(d),i=a(h),j=b.Deferred(),k=!1;return c.each(e.servi,function(b){if(a.control.has(a.CZR_Helpers.build_setId(b))){var d=function(a,b,d,e){var f=arguments;c.each(d,function(a,b){switch(b){case"visibility":g._setVisibility.apply(null,f);break;case"actions":c.isFunction(a)&&a.apply(null,f)}})},f=function(c){c=c||i();var f=a.CZR_Helpers.build_setId(b);g._deferCallbackForControl(f,d,[c,b,e]).always(function(){k=!0}).fail(function(){j.reject()}).done(function(){j.resolve()})};f(),c.has(i,"czr_visibilityServi")||(i.czr_visibilityServi=new a.Value([]));var h=i.czr_visibilityServi();c.contains(h,b)||(i.bind(function(a){f(a)}),i.czr_visibilityServi(c.union(h,[b])))}}),k?j.promise():j.resolve().promise()},_setVisibility:function(b,d,e,f){var g=a.CZR_Helpers.build_setId(d),h=e.visibility(b,d,e.dominus);if(f=f||!1,c.isBoolean(h)&&("unchanged"!=h||f)){var i=function(){a.state.has("silent-update-processing")&&a.state("silent-update-processing")()||(a.control(g,function(a){var b={duration:"fast",completeCallback:function(){},unchanged:!1};c.has(a,"active")&&(h=h&&a.active()),c.has(a,"defaultActiveArguments")&&(b=control.defaultActiveArguments),a.onChangeActive(h,a.defaultActiveArguments)}),a.state.has("silent-update-processing")&&a.state("silent-update-processing").unbind(i))};a.state.has("silent-update-processing")&&a.state("silent-update-processing")()?a.state("silent-update-processing").bind(i):i()}},_getControlDeps:function(){return{}},_prepareDominusParams:function(b){var d=this,e={};if(!c.isObject(b))return a.errorLog("Visibilities : a dominus param definition must be an object."),e;if(!c.has(b,"visibility")&&!c.has(b,"actions"))return a.errorLog("Visibilities : a dominus definition must include a visibility or an actions callback."),e;if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))return a.errorLog("Visibilities : a dominus control id must be a not empty string."),e;var f=a.CZR_Helpers.build_setId(b.dominus);return a.control.has(f)?!c.has(b,"servi")||c.isUndefined(b.servi)||!c.isArray(b.servi)||c.isEmpty(b.servi)?(a.errorLog("Visibilities : servi must be set as an array not empty."),e):(c.each(d.defaultDominusParams,function(a,d){var f=b[d];switch(d){case"visibility":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus visibility callback must be a function : "+b.dominus);break;case"actions":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus actions callback must be a function : "+b.dominus);break;case"onSectionExpand":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isBoolean(f))throw new Error("Visibilities : a dominus onSectionExpand param must be a boolean : "+b.dominus)}e[d]=f}),e):(a.errorLog("Visibilities : a dominus control id is not registered : "+f),e)},_handleFaviconNote:function(){var b=this,c=a.CZR_Helpers.build_setId(serverControlParams.faviconOptionName);if(!(!a.has("site_icon")||!a.control("site_icon")||a.has(c)&&0===+a(c)()||+a("site_icon")()>0)){var e=a.control("site_icon").params.description;_newDes=["<strong>",d.faviconNote||"","</strong><br/><br/>"].join("")+e,b._printFaviconNote(_newDes),a("site_icon").callbacks.add(function(d){+d>0?(a.control("site_icon").container.find(".description").text(e),a.has(c)&&a(c).set("")):b._printFaviconNote(_newDes)})}},_printFaviconNote:function(b){a.control("site_icon").container.find(".description").html(b)}})}(wp.customize,jQuery,_),function(a,b){b(function(b){function c(a){var c=a.siblings(".open");0!==c.length&&c.offset().top<0&&b(".wp-full-overlay-sidebar-content").animate({scrollTop:-b("#customize-theme-controls").offset().top-c.height()+a.offset().top+b(".wp-full-overlay-sidebar-content").offset().top},700)}var d=a.customize||d;b(".accordion-section").not(".control-panel").click(function(){c(b(this))}),d.czrSetupCheckbox=function(a,c){b("input[type=checkbox]",d.control(a).container).each(function(){0===b(this).val()||"0"==b(this).val()||"off"==b(this).val()||_.isEmpty(b(this).val())?b(this).prop("checked",!1):b(this).prop("checked",!0),0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},d.czrSetupSelect=function(a,c){b("select[data-customize-setting-link]",d.control(a).container).not(".no-selecter-js").each(function(){b(this).selecter({})})},d.czrSetupStepper=function(a,c){b('input[type="number"]',d.control(a).container).each(function(){b(this).stepper()})},d.control.each(function(a){_.has(a,"id")&&("widget_"!=a.id.substring(0,"widget_".length)&&"nav_menu"!=a.id.substring(0,"nav_menu".length)&&d.czrSetupCheckbox(a.id),"nav_menu_locations"!=a.id.substring(0,"nav_menu_locations".length)&&d.czrSetupSelect(a.id),d.czrSetupStepper(a.id))});var e=function(){var a=b("<span/>",{"class":"customize-controls-home fa fa-home",html:'<span class="screen-reader-text">Home</span>'});b.when(b("#customize-header-actions").append(a)).done(function(){a.keydown(function(a){9!==a.which&&(13===a.which&&this.click(),a.preventDefault())}).on("click.customize-controls-home",function(){d.section.has(d.czr_activeSectionId())?d.section(d.czr_activeSectionId()).expanded(!1):d.section.each(function(a){a.expanded(!1)}),d.panel.each(function(a){a.expanded(!1)})})})};e()})}(wp,jQuery);
addons/assets/front/css/___OLD___hph-flickity-custom.css DELETED
@@ -1,144 +0,0 @@
1
- /* slider css */
2
-
3
- /* Slider stuff */
4
- .slider-text > h2 {
5
- margin: 0;
6
- line-height: 1.1;
7
- }
8
-
9
- .slider-text > h2 + h3 {
10
- margin-top: 0;
11
- margin-bottom: 1.25em;
12
- }
13
-
14
- .slider-nav .slider-prev {
15
- left: 0;
16
- border-top-left-radius: 0px;
17
- border-top-right-radius: 2px;
18
- border-bottom-right-radius: 2px;
19
- border-bottom-left-radius: 0px;
20
- }
21
- .slider-nav .slider-next {
22
- right: 0;
23
- border-top-left-radius: 2px;
24
- border-top-right-radius: 0px;
25
- border-bottom-right-radius: 0px;
26
- border-bottom-left-radius: 2px;
27
- }
28
-
29
- .slider-nav .slider-control {
30
- position: absolute;
31
- z-index: 2;
32
- top: calc((100% - 60px)/2);
33
- text-align: center;
34
- margin-top: 0px;
35
- -webkit-backface-visibility: hidden;
36
- -moz-backface-visibility: hidden;
37
- -ms-backface-visibility: hidden;
38
- -o-backface-visibility: hidden;
39
- backface-visibility: hidden;
40
- display: block;
41
- color: #fff;
42
- height: 60px;
43
- width: 50px;
44
- background-color: rgba(32, 32, 32, 0.2);
45
- -webkit-transition: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
46
- transition: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
47
- line-height: 60px;
48
- cursor: pointer;
49
- }
50
-
51
- .slider-nav .slider-control:hover {
52
- background-color: rgba(32, 32, 32, 0.9);
53
- opacity: 1;
54
- width: 100px;
55
- }
56
- [id^=hu-slider-] .flickity-page-dots {
57
- bottom: 30px;
58
- }
59
- .header-skin-dark .section-slider .flickity-page-dots .dot {
60
- background: #fff;
61
- }
62
- .header-skin-light .section-slider .flickity-page-dots .dot {
63
- background: #202020;
64
- }
65
-
66
- /* If automatic centering is enabled */
67
- .hu-carousel > .center-slides-enabled > .item > .carousel-image img {
68
- display: block;
69
- position: relative;
70
- }
71
-
72
- /* JS IMAGE CENTERING */
73
- img.h-centered {
74
- width: auto!important;
75
- max-width: none!important;
76
- position: relative;
77
- transform: translateZ(0) !important;
78
- }
79
- img.v-centered {
80
- height: auto!important;
81
- max-height: none!important;
82
- vertical-align: top;
83
- position: relative;
84
- transform: translateZ(0) !important;
85
- }
86
-
87
- /* FLICKITY SLIDER */
88
- /*.carousel { z-index: 4;}*/
89
- .carousel-cell { width: 100%;}
90
- .carousel img { min-width: 100%;}
91
-
92
- /* end took from customizer */
93
-
94
- .slider-nav { cursor: pointer;}
95
- .hu-carousel { position: relative; overflow: hidden;}
96
- .carousel-caption {
97
- height: auto;
98
- max-height: 80%;
99
- width: 80%;
100
- text-align: center;
101
- z-index: 3;
102
- overflow: hidden;
103
-
104
- /* temporary centering */
105
- transform: translate(-50%, -50%);
106
- transform: translate3d(-50%, -50%, 0);
107
- top: 50%;
108
- left: 50%;
109
- position: absolute;
110
-
111
- }
112
-
113
- .carousel-image img {
114
- width: 100%;
115
- height: auto;
116
- }
117
-
118
- .center-slides-disabled .carousel-image img {
119
- /* temporary CSS centering */
120
- transform: translate(-50%, -50%);
121
- transform: translate3d(-50%, -50%, 0);
122
- top: 50%;
123
- left: 50%;
124
- position: absolute;
125
- }
126
-
127
- [id^=hu-slider]:not(.full-page) {
128
- height: 500px !important;
129
- }
130
-
131
- .hu-carousel.full-page {
132
- width: 100%;
133
- height: 100vh!important;
134
- }
135
- .admin-bar .hu-carousel.full-page {
136
- height: calc( 100vh - 46px )!important;
137
- }
138
- @media screen and ( min-width: 783px ){
139
- .admin-bar .hu-carousel.full-page {
140
- height: calc( 100vh - 32px )!important;
141
- }
142
- }
143
- [id^=hu-slider-].hu-carousel .carousel-inner,
144
- [id^=hu-slider-].hu-carousel .carousel-cell { width: 100%; height: 100%; overflow: hidden;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addons/assets/front/css/hph-front.css DELETED
@@ -1,595 +0,0 @@
1
- /* HEADER STYLE */
2
- .pro-header-on #header {
3
- padding-bottom: 0px;
4
- background: none;
5
- position: absolute;
6
- z-index: 10000;
7
- width: 100%;
8
- }
9
- /* TOP MENU */
10
- .pro-header-on #nav-topbar.nav-container {
11
- background: rgba(0, 0, 0, 0.7);
12
- }
13
-
14
- .pro-header-on .search-expand {
15
- background: none;
16
- }
17
- /* HEADER MENU */
18
- .pro-header-on #nav-header.nav-container {
19
- background: none;
20
- }
21
- .pro-header-on #page {
22
- margin-top: 0px;
23
- }
24
-
25
- .pro-header-on #header .container-inner {
26
- margin: inherit;
27
- max-width: inherit;
28
- }
29
- .pro-header-on #header .nav-wrap {
30
- padding: inherit;
31
- }
32
-
33
- .pro-header-on .hu-branding {
34
- padding: 0 14px;
35
- }
36
-
37
- .pro-header-on #nav-header .container {
38
- padding: 0px;
39
- }
40
-
41
- .pro-header-on #nav-header .nav ul {
42
- background: rgba(0,0,0,.25);
43
- }
44
-
45
-
46
- /* LARGE HEADER WRAPPER */
47
- #ha-large-header.no-bg {
48
- background: #000;
49
- }
50
-
51
-
52
-
53
- /* SECTION SLIDER */
54
- .pc-section-slider {
55
- position: relative;
56
- overflow: hidden;
57
- -webkit-transform-style: preserve-3d;
58
- -moz-transform-style: preserve-3d;
59
- transform-style: preserve-3d;
60
- }
61
- .pc-section-slider.full-height {
62
- width: 100%;
63
- height: 100vh!important;
64
- }
65
- .admin-bar .pc-section-slider.full-height {
66
- height: calc( 100vh - 46px )!important;
67
- }
68
- @media screen and ( min-width: 783px ){
69
- .admin-bar .pc-section-slider.full-height {
70
- height: calc( 100vh - 32px )!important;
71
- }
72
- }
73
-
74
- .pc-section-slider:not(.full-height) {
75
- height: 500px;
76
- }
77
- /*
78
- .pc-section-slider .filter {
79
- color: #fff;
80
- }
81
- .pc-section-slider::before {
82
- content: '';
83
- left: 0;
84
- right: 0;
85
- bottom: 0;
86
- top: 0;
87
- position: absolute;
88
- background: rgba(32, 32, 32, 0.5);
89
- }
90
-
91
- .pc-section-slider .container {
92
- height: 100vh !important;
93
- }*/
94
-
95
- .pc-section-slider .carousel-inner, .pc-section-slider .carousel-cell { width: 100%; height: 100%; overflow: hidden;}
96
-
97
-
98
-
99
- /* INNER SECTION SLIDER */
100
- .carousel-cell { width: 100%;}
101
-
102
-
103
-
104
-
105
- /* FILTER AND SKIN */
106
- .pc-section-slider .filter::before {
107
- position: absolute;
108
- left: 0;
109
- right: 0;
110
- bottom: 0;
111
- top: 0;
112
- width: 100%;.
113
- height: 100%;
114
- display: block;
115
- z-index: 3;
116
- content: "";
117
-
118
- }
119
- .header-skin-dark .pc-section-slider .filter::before {
120
- background: rgba(34, 34, 34, 0.65);
121
- }
122
-
123
- .header-skin-dark .carousel-caption h2, .header-skin-dark .carousel-caption h3{
124
- color: #fff
125
- }
126
-
127
- .header-skin-light .pc-section-slider .filter::before {
128
- background: rgba(255, 255, 255, 0.75);
129
- }
130
- .header-skin-light .site-title a,
131
- .header-skin-light .site-description,
132
- .header-skin-light #nav-header .nav li a,
133
- .header-skin-light .carousel-caption h2,
134
- .header-skin-light .carousel-caption h3 {
135
- color: #000
136
- }
137
-
138
- .header-skin-light
139
-
140
-
141
- /* PARALLAX */
142
- /*.parallax {
143
- width: 100%;
144
- height: 100vh;
145
- overflow: hidden;
146
- display: block;
147
- margin-left: auto;
148
- margin-right: auto;
149
- position: relative;
150
- text-align: center;
151
- }*/
152
-
153
- /* VIDEO BACKGROUND */
154
- .pc-section-slider.full-height .hu-video {
155
- background-size: cover;
156
- background-position: center center;
157
- background-repeat: no-repeat;
158
- width: 100%;
159
- height: 100vh;
160
- z-index: 2;
161
- position: absolute;
162
- display: block;
163
- }
164
-
165
-
166
- /* IMAGE BACKGROUND */
167
- .carousel-image img {
168
- width: 100%;
169
- min-width: 100%;
170
- height: auto;
171
- }
172
-
173
- .center-slides-disabled .carousel-image img {
174
- /* temporary CSS centering */
175
- transform: translate(-50%, -50%);
176
- transform: translate3d(-50%, -50%, 0);
177
- top: 50%;
178
- left: 50%;
179
- position: absolute;
180
- }
181
-
182
-
183
-
184
-
185
- /* CAPTION AND TITLES */
186
- .carousel-caption {
187
- height: auto;
188
- max-height: 80%;
189
- width: 80%;
190
- text-align: center;
191
- z-index: 3;
192
- overflow: hidden;
193
-
194
- /* temporary centering */
195
- transform: translate(-50%, -50%);
196
- transform: translate3d(-50%, -50%, 0);
197
- top: 50%;
198
- left: 50%;
199
- position: absolute;
200
- }
201
-
202
-
203
- .pc-section-slider .carousel-caption > h2 {
204
- margin: 0;
205
- line-height: 1.1;
206
- font-weight: 700;
207
- font-size: 2.98598em;
208
- }
209
- .pc-section-slider h2.very-big {
210
- font-size: 80px;
211
- line-height: 125px;
212
- font-family: "Poppins", sans-serif;
213
- }
214
- .carousel-caption > h2 + h3 {
215
- margin-top: 0;
216
- margin-bottom: 1.25em;
217
- font-size: 1.928em;
218
- font-family: "Poppins", sans-serif;
219
- }
220
-
221
-
222
- /* METAS FOR SINGLE POSTS */
223
- .pc-section-slider .meta-single {
224
- position: relative;
225
- /* top: 36%;
226
- -webkit-transform: translateY(-36%);
227
- -ms-transform: translateY(-36%);
228
- transform: translateY(-36%);*/
229
- }
230
-
231
- .pc-section-slider .carousel-caption a {
232
- color: #ddd;
233
- color: rgba(255,255,255,.7);
234
- text-transform: uppercase;
235
- font-weight: 600;
236
- }
237
- .pc-section-slider .meta-single a {
238
- margin: 0 1.25em;
239
- padding-right: 1.25em;
240
- }
241
-
242
- .parallax .meta-single li {
243
- display: inline-block;
244
- }
245
-
246
- .hph-single-author-date {
247
- position: relative;
248
- top: 51%;
249
- -webkit-transform: translateY(-51%);
250
- -ms-transform: translateY(-51%);
251
- transform: translateY(-51%);
252
- }
253
- .hph-single-author-date .post-byline {
254
- font-weight: 600;
255
- letter-spacing: 0.05em;
256
- text-transform: uppercase;
257
- color: #fff;
258
- }
259
-
260
-
261
-
262
- /* BUTTON */
263
- .btn {
264
- display: inline-block;
265
- font-weight: normal;
266
- line-height: 1.25;
267
- text-align: center;
268
- white-space: nowrap;
269
- vertical-align: middle;
270
- cursor: pointer;
271
- -webkit-user-select: none;
272
- -moz-user-select: none;
273
- -ms-user-select: none;
274
- user-select: none;
275
- border: 1px solid transparent;
276
- padding: 0.5rem 1rem;
277
- font-size: 1rem;
278
- border-radius: 0.25rem;
279
- }
280
- .btn-skin {
281
- color: #fff;
282
- background-color: #284AFF;
283
- }
284
- .btn, .btn-skin {
285
- border-top-right-radius: 2px;
286
- border-top-left-radius: 2px;
287
- border-bottom-right-radius: 2px;
288
- border-bottom-left-radius: 2px;
289
- border-bottom-left-radius: 2px;
290
- border-top-left-radius: 2px;
291
- border-bottom-right-radius: 2px;
292
- border-top-right-radius: 2px;
293
- font-family: "Karla", sans-serif;
294
- }
295
-
296
-
297
-
298
- /* If automatic centering is enabled */
299
- .hu-carousel > .center-slides-enabled > .item > .carousel-image img {
300
- display: block;
301
- position: relative;
302
- }
303
-
304
-
305
- /* JS IMAGE CENTERING */
306
- img.h-centered {
307
- width: auto!important;
308
- max-width: none!important;
309
- position: relative;
310
- transform: translateZ(0) !important;
311
- }
312
- img.v-centered {
313
- height: auto!important;
314
- max-height: none!important;
315
- vertical-align: top;
316
- position: relative;
317
- transform: translateZ(0) !important;
318
- }
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
-
334
-
335
- /* SLIDER CONTROL */
336
- .slider-nav { cursor: pointer;}
337
- .slider-nav .slider-prev {
338
- left: 0;
339
- border-top-left-radius: 0px;
340
- border-top-right-radius: 2px;
341
- border-bottom-right-radius: 2px;
342
- border-bottom-left-radius: 0px;
343
- }
344
- .slider-nav .slider-next {
345
- right: 0;
346
- border-top-left-radius: 2px;
347
- border-top-right-radius: 0px;
348
- border-bottom-right-radius: 0px;
349
- border-bottom-left-radius: 2px;
350
- }
351
-
352
- .slider-nav .slider-control {
353
- position: absolute;
354
- z-index: 2;
355
- top: calc((100% - 60px)/2);
356
- text-align: center;
357
- margin-top: 0px;
358
- -webkit-backface-visibility: hidden;
359
- -moz-backface-visibility: hidden;
360
- -ms-backface-visibility: hidden;
361
- -o-backface-visibility: hidden;
362
- backface-visibility: hidden;
363
- display: block;
364
- color: #fff;
365
- height: 60px;
366
- width: 50px;
367
- background-color: rgba(32, 32, 32, 0.2);
368
- -webkit-transition: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
369
- transition: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
370
- line-height: 60px;
371
- cursor: pointer;
372
- }
373
-
374
- .slider-nav .slider-control:hover {
375
- background-color: rgba(32, 32, 32, 0.9);
376
- opacity: 1;
377
- width: 100px;
378
- }
379
- .pc-section-slider .flickity-page-dots {
380
- bottom: 30px;
381
- }
382
- .header-skin-dark .pc-section-slider .flickity-page-dots .dot {
383
- background: #fff;
384
- }
385
- .header-skin-light .pc-section-slider .flickity-page-dots .dot {
386
- background: #202020;
387
- }
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
- /* @MEDIAS */
400
- @media only screen and (min-width: 720px) {
401
- .pro-header-on #nav-header.nav-container {
402
- background: none!important;
403
- -webkit-box-shadow:none;
404
- box-shadow: none;
405
- }
406
- }
407
-
408
- @media only screen and (max-width: 719px) {
409
- .pro-header-on #nav-topbar.nav-container {
410
- background:none;
411
- }
412
- .pro-header-on #header {
413
- padding-bottom: 0px;
414
- background: rgba(0, 0, 0, 0.7);
415
- /*background: #33363b;
416
- position: relative;*/
417
- }
418
- /* .pc-section-slider h2.very-big {
419
- font-size: 70px;
420
- line-height: 145px;
421
- }
422
- .carousel-caption > h2 + h3 {
423
- margin-top: 0;
424
- margin-bottom: 1.25em;
425
- font-size: 1.728em;
426
- }*/
427
- /*.pro-header-on #header {
428
- position: relative;
429
- }*/
430
- }
431
- @media only screen and (max-width: 480px) {
432
- /*.pc-section-slider h2.very-big {
433
- font-size: 50px;
434
- line-height: 60px;
435
- }
436
- .carousel-caption > h2 + h3 {
437
- margin-top: 0;
438
- margin-bottom: 1.25em;
439
- font-size: 1.428em;
440
- }*/
441
-
442
- }
443
-
444
-
445
-
446
-
447
-
448
-
449
-
450
-
451
- /*! Flickity v2.0.2
452
- http://flickity.metafizzy.co
453
- ---------------------------------------------- */
454
-
455
- .flickity-enabled {
456
- position: relative;
457
- }
458
-
459
- .flickity-enabled:focus { outline: none; }
460
-
461
- .flickity-viewport {
462
- overflow: hidden;
463
- position: relative;
464
- height: 100%;
465
- }
466
-
467
- .flickity-slider {
468
- position: absolute;
469
- width: 100%;
470
- height: 100%;
471
- }
472
-
473
- /* draggable */
474
-
475
- .flickity-enabled.is-draggable {
476
- -webkit-tap-highlight-color: transparent;
477
- tap-highlight-color: transparent;
478
- -webkit-user-select: none;
479
- -moz-user-select: none;
480
- -ms-user-select: none;
481
- user-select: none;
482
- }
483
-
484
- .flickity-enabled.is-draggable .flickity-viewport {
485
- cursor: move;
486
- cursor: -webkit-grab;
487
- cursor: grab;
488
- }
489
-
490
- .flickity-enabled.is-draggable .flickity-viewport.is-pointer-down {
491
- cursor: -webkit-grabbing;
492
- cursor: grabbing;
493
- }
494
-
495
- /* ---- previous/next buttons ---- */
496
-
497
- .flickity-prev-next-button {
498
- position: absolute;
499
- top: 50%;
500
- width: 44px;
501
- height: 44px;
502
- border: none;
503
- border-radius: 50%;
504
- background: white;
505
- background: hsla(0, 0%, 100%, 0.75);
506
- cursor: pointer;
507
- /* vertically center */
508
- -webkit-transform: translateY(-50%);
509
- transform: translateY(-50%);
510
- }
511
-
512
- .flickity-prev-next-button:hover { background: white; }
513
-
514
- .flickity-prev-next-button:focus {
515
- outline: none;
516
- box-shadow: 0 0 0 5px #09F;
517
- }
518
-
519
- .flickity-prev-next-button:active {
520
- opacity: 0.6;
521
- }
522
-
523
- .flickity-prev-next-button.previous { left: 10px; }
524
- .flickity-prev-next-button.next { right: 10px; }
525
- /* right to left */
526
- .flickity-rtl .flickity-prev-next-button.previous {
527
- left: auto;
528
- right: 10px;
529
- }
530
- .flickity-rtl .flickity-prev-next-button.next {
531
- right: auto;
532
- left: 10px;
533
- }
534
-
535
- .flickity-prev-next-button:disabled {
536
- opacity: 0.3;
537
- cursor: auto;
538
- }
539
-
540
- .flickity-prev-next-button svg {
541
- position: absolute;
542
- left: 20%;
543
- top: 20%;
544
- width: 60%;
545
- height: 60%;
546
- }
547
-
548
- .flickity-prev-next-button .arrow {
549
- fill: #333;
550
- }
551
-
552
- /* ---- page dots ---- */
553
-
554
- .flickity-page-dots {
555
- position: absolute;
556
- width: 100%;
557
- bottom: -25px;
558
- padding: 0;
559
- margin: 0;
560
- list-style: none;
561
- text-align: center;
562
- line-height: 1;
563
- }
564
-
565
- .flickity-rtl .flickity-page-dots { direction: rtl; }
566
-
567
- .flickity-page-dots .dot {
568
- display: inline-block;
569
- width: 10px;
570
- height: 10px;
571
- margin: 0 8px;
572
- background: #333;
573
- border-radius: 50%;
574
- opacity: 0.25;
575
- cursor: pointer;
576
- }
577
-
578
- .flickity-page-dots .dot.is-selected {
579
- opacity: 1;
580
- }
581
-
582
- /* FLICKITY CUSTOM */
583
-
584
- .lazy-load-on .carousel-cell img {
585
- -webkit-transition: opacity 0.4s;
586
- -moz-transition: opacity 0.4s;
587
- -ms-transition: opacity 0.4s;
588
- -o-transition: opacity 0.4s;
589
- transition: opacity 0.4s;
590
- opacity: 0;
591
- }
592
- .lazy-load-on .carousel-cell img.flickity-lazyloaded,
593
- .lazy-load-on .carousel-cell img.flickity-lazyerror {
594
- opacity: 1;
595
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addons/assets/front/js/___OLD___hph-flickity-custom.js DELETED
@@ -1,133 +0,0 @@
1
- jQuery( function($) {
2
- //center slider
3
- //SLIDER IMG + VARIOUS
4
- setTimeout( function() {
5
- //centering per slider
6
- $.each( $( '.hu-carousel .carousel-inner') , function() {
7
- $( this ).centerImages( {
8
- enableCentering : 1, // == HUParams.centerSliderImg,
9
- imgSel : '.carousel-image img',
10
- /* To check settle.flickity is working, it should according to the docs */
11
- oncustom : ['settle.flickity', 'simple_load'],
12
- defaultCSSVal : { width : '100%' , height : 'auto' },
13
- useImgAttr : true,
14
- zeroTopAdjust: 0
15
- });
16
- //fade out the loading icon per slider with a little delay
17
- //mostly for retina devices (the retina image will be downloaded afterwards
18
- //and this may cause the re-centering of the image)
19
- /*
20
- var self = this;
21
- setTimeout( function() {
22
- $( self ).prevAll('.czr-slider-loader-wrapper').fadeOut();
23
- }, 500 );
24
- */
25
- });
26
- } , 50);
27
-
28
- /*
29
- * slider parallax on flickity ready
30
- * we parallax only the flickity-viewport, so that we don't parallax the carouasel-dots
31
- */
32
- czrapp.$_body.on( 'hu-flickity-ready.flickity', '.hu-parallax-slider', function( evt ) {
33
- $(evt.target).children('.flickity-viewport').czrParallax();
34
- });
35
-
36
-
37
- /* Flickity ready
38
- * see https://github.com/metafizzy/flickity/issues/493#issuecomment-262658287
39
- */
40
- var activate = Flickity.prototype.activate;
41
- Flickity.prototype.activate = function() {
42
- if ( this.isActive ) {
43
- return;
44
- }
45
- activate.apply( this, arguments );
46
- this.dispatchEvent('hu-flickity-ready');
47
- };
48
-
49
- /*Handle custom nav */
50
- // previous
51
- czrapp.$_body.on( 'click tap prev.hu-slider', '.slider-prev', slider_previous );
52
- // next
53
- czrapp.$_body.on( 'click tap next.hu-slider', '.slider-next', slider_next );
54
-
55
- /* Test only !!!!!! MAIN SLIDER */
56
- $('.carousel-inner', '[id^="hu-slider-main"]').flickity({
57
- prevNextButtons: false,
58
- pageDots: true,
59
- /*
60
- * From flickity docs
61
- * At the end of cells, wrap-around to the other end for infinite scrolling.
62
- */
63
- wrapAround: true,
64
- imagesLoaded: true,
65
- //lazyLoad ?
66
- /*
67
- * From flickity docs
68
- * Sets the height of the carousel to the height of the tallest cell. Enabled by default setGallerySize: true.
69
- */
70
- setGallerySize: false,
71
- cellSelector: '.carousel-cell',
72
- /*
73
- * From flickity docs
74
- * The number of pixels a mouse or touch has to move before dragging begins.
75
- * Increase dragThreshold to allow for more wiggle room for vertical page scrolling on touch devices.
76
- * Default dragThreshold: 3.
77
- */
78
- dragThreshold: 10,
79
- /*
80
- * From flickity docs
81
- * Auto-playing will pause when mouse is hovered over,
82
- * and resume when mouse is hovered off. Auto-playing will stop when
83
- * the carousel is clicked or a cell is selected.
84
- */
85
- autoPlay: true, // {Number in milliseconds }
86
- /*
87
- * Set accessibility to false as it produces the following issue:
88
- * - flickity, when accessibiity is set to true, sets the "carousel" tabindex property
89
- * - dragging a slide the carousel is focused with focus(), because of the tabindex the page scrolls to top
90
- * and flickity re-scrolls to the correct position.
91
- * The scroll to top (due to the focus) for some reason conflicts with the #customizr-slider-* overflow:hidden property
92
- * when parallaxing.
93
- * Basically the parallaxed item, despite the top property is set to Y <> 0, appears as it had Y = 0.
94
- * Plus absoluted elements referring to the #customizr-slider-* seems to be shifted up of -Y
95
- * very weird behavior to investigate on :/
96
- */
97
- accessibility: false,
98
- });
99
-
100
- /* Handle sliders nav */
101
- /*Handle custom nav */
102
- // previous
103
- function slider_previous(evt) {
104
- evt.preventDefault();
105
-
106
- var $_this = $(this),
107
- _flickity = $_this.data( 'controls' );
108
-
109
- //if not already done, cache the slider this control controls as data-controls attribute
110
- if ( ! _flickity ) {
111
- _flickity = $_this.closest('.hu-carousel').find('.flickity-enabled').data('flickity');
112
- $_this.data( 'controls', _flickity );
113
- }
114
-
115
- _flickity.previous();
116
- }
117
-
118
- // next
119
- function slider_next(evt) {
120
- //evt.preventDefault();
121
-
122
- var $_this = $(this),
123
- _flickity = $_this.data( 'controls' );
124
-
125
- //if not already done, cache the slider this control controls as data-controls attribute
126
- if ( ! _flickity ) {
127
- _flickity = $_this.closest('.hu-carousel').find('.flickity-enabled').data('flickity');
128
- $_this.data( 'controls', _flickity );
129
- }
130
-
131
- _flickity.next();
132
- }
133
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
addons/assets/front/js/___OLD___hph-flickity-custom.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(function(a){function b(b){b.preventDefault();var c=a(this),d=c.data("controls");d||(d=c.closest(".hu-carousel").find(".flickity-enabled").data("flickity"),c.data("controls",d)),d.previous()}function c(b){var c=a(this),d=c.data("controls");d||(d=c.closest(".hu-carousel").find(".flickity-enabled").data("flickity"),c.data("controls",d)),d.next()}setTimeout(function(){a.each(a(".hu-carousel .carousel-inner"),function(){a(this).centerImages({enableCentering:1,imgSel:".carousel-image img",oncustom:["settle.flickity","simple_load"],defaultCSSVal:{width:"100%",height:"auto"},useImgAttr:!0,zeroTopAdjust:0})})},50),czrapp.$_body.on("hu-flickity-ready.flickity",".hu-parallax-slider",function(b){a(b.target).children(".flickity-viewport").czrParallax()});var d=Flickity.prototype.activate;Flickity.prototype.activate=function(){this.isActive||(d.apply(this,arguments),this.dispatchEvent("hu-flickity-ready"))},czrapp.$_body.on("click tap prev.hu-slider",".slider-prev",b),czrapp.$_body.on("click tap next.hu-slider",".slider-next",c),a(".carousel-inner",'[id^="hu-slider-main"]').flickity({prevNextButtons:!1,pageDots:!0,wrapAround:!0,imagesLoaded:!0,setGallerySize:!1,cellSelector:".carousel-cell",dragThreshold:10,autoPlay:!0,accessibility:!1})});
 
addons/assets/front/js/hph-flickity-custom.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(function(a){function b(b){b.preventDefault();var c=a(this),d=c.data("controls");d||(d=c.closest(".hu-carousel").find(".flickity-enabled").data("flickity"),c.data("controls",d)),d.previous()}function c(b){var c=a(this),d=c.data("controls");d||(d=c.closest(".hu-carousel").find(".flickity-enabled").data("flickity"),c.data("controls",d)),d.next()}setTimeout(function(){a.each(a(".hu-carousel .carousel-inner"),function(){a(this).centerImages({enableCentering:1,imgSel:".carousel-image img",oncustom:["settle.flickity","simple_load"],defaultCSSVal:{width:"100%",height:"auto"},useImgAttr:!0,zeroTopAdjust:0})})},50),czrapp.$_body.on("hu-flickity-ready.flickity",".hu-parallax-slider",function(b){a(b.target).children(".flickity-viewport").czrParallax()});var d=Flickity.prototype.activate;Flickity.prototype.activate=function(){this.isActive||(d.apply(this,arguments),this.dispatchEvent("hu-flickity-ready"))},czrapp.$_body.on("click tap prev.hu-slider",".slider-prev",b),czrapp.$_body.on("click tap next.hu-slider",".slider-next",c),a(".carousel-inner",'[id^="hu-slider-main"]').flickity({prevNextButtons:!1,pageDots:!0,wrapAround:!0,imagesLoaded:!0,setGallerySize:!1,cellSelector:".carousel-cell",dragThreshold:10,autoPlay:!0,accessibility:!1})});
 
addons/assets/front/js/jQuerySharrre.min.js CHANGED
@@ -1,7 +1,7 @@
1
- /*!
2
- * Sharrre.com - Make your sharing widget!
3
- * Version: 2.0.1
4
- * Author: Julien Hany
5
- * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License
6
- */
7
  var SharrrePlatform=SharrrePlatform||function(){var a={};return{register:function(b,c){a[b]=c},get:function(b,c){return a[b]?new a[b](c):(console.error("Sharrre - No platform found for "+b),!1)}}}();!function(a,b){"undefined"!=typeof a&&(b.register("linkedin",function(b){return defaultSettings={url:"",urlCount:!1,counter:"",count:!0,popup:{width:550,height:550}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?"},trackingAction:{site:"linkedin",action:"share"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button linkedin"><script type="IN/share" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-counter="'+c.counter+'"></script></div>');var d=0;"undefined"==typeof window.IN&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.linkedin.com/in.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):"undefined"!=typeof window.IN&&window.IN.parse&&IN.parse(document)},tracking:function(){},popup:function(a){window.open("https://www.linkedin.com/cws/share?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&token=&isFramed=true","linkedin","toolbar=no, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("facebook",function(b){return defaultSettings={url:"",urlCount:!1,action:"like",layout:"button_count",count:!0,width:"",send:"false",faces:"false",colorscheme:"",font:"",lang:"en_US",share:"",appId:"",popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://graph.facebook.com/?id={url}&callback=?"},trackingAction:{site:"facebook",action:"like"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-send="'+c.send+'" data-layout="'+c.layout+'" data-width="'+c.width+'" data-show-faces="'+c.faces+'" data-action="'+c.action+'" data-colorscheme="'+c.colorscheme+'" data-font="'+c.font+'" data-via="'+c.via+'" data-share="'+c.share+'"></div></div>');var d=0;"undefined"==typeof FB&&0===d?(d=1,function(a,b,d){var e,f=a.getElementsByTagName(b)[0];a.getElementById(d)||(e=a.createElement(b),e.id=d,e.src="https://connect.facebook.net/"+c.lang+"/all.js#xfbml=1",c.appId&&(e.src+="&appId="+c.appId),f.parentNode.insertBefore(e,f))}(document,"script","facebook-jssdk")):FB.XFBML.parse()},tracking:function(){fb=window.setInterval(function(){"undefined"!=typeof FB&&"undefined"!=typeof _gaq&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}),clearInterval(fb))},1e3)},popup:function(a){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&t="+a.text,"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("googlePlus",function(b){return defaultSettings={url:"",urlCount:!1,size:"medium",lang:"en-US",annotation:"",count:!0,popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return a+"?url={url}&type=googlePlus"},trackingAction:{site:"Google",action:"+1"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button googleplus"><div class="g-plusone" data-size="'+c.size+'" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-annotation="'+c.annotation+'"></div></div>'),window.___gcfg={lang:c.lang};var d=0;"undefined"!=typeof gapi&&"undefined"!=typeof gapi.plusone||0!==d?gapi.plusone.go():(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://apis.google.com/js/plusone.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}())},tracking:function(){},popup:function(a){window.open("https://plus.google.com/share?hl="+this.settings.lang+"&url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url),"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("pinterest",function(b){return defaultSettings={url:"",media:"",description:"",layout:"horizontal",popup:{width:700,height:300}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://api.pinterest.com/v1/urls/count.json?url={url}&callback=?"},trackingAction:{site:"pinterest",action:"pin"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button pinterest"><a href="https://www.pinterest.com/pin/create/button/?url='+(""!==c.url?c.url:b.options.url)+"&media="+c.media+"&description="+c.description+'" data-pin-do="buttonBookmark" count-layout="'+c.layout+'">Pin It</a></div>'),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://assets.pinterest.com/js/pinit.js",a.setAttribute("data-pin-build","parsePinBtns");var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}(),window.parsePinBtns&&window.parsePinBtns(),a(b.element).find(".pinterest").on("click",function(){b.openPopup("pinterest")})},tracking:function(){},popup:function(a){window.open("https://pinterest.com/pin/create/button/?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&media="+encodeURIComponent(this.settings.media)+"&description="+this.settings.description,"pinterest","toolbar=no,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitter",function(b){return defaultSettings={url:"",urlCount:!1,count:!1,hashtags:"",via:"",related:"",lang:"en",popup:{width:650,height:360}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"tweet"},url:function(a){return"http://opensharecount.com/count.json?url={url}"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-count="'+c.count+'" data-text="'+b.options.text+'" data-via="'+c.via+'" data-hashtags="'+c.hashtags+'" data-related="'+c.related+'" data-lang="'+c.lang+'">Tweet</a></div>');var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){tw=window.setInterval(function(){"undefined"!=typeof twttr&&(twttr.events.bind("tweet",function(a){a&&"undefined"!=typeof _gaq&&_gaq.push(["_trackSocial","twitter","tweet"])}),clearInterval(tw))},1e3)},popup:function(a){window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(a.text)+"&url="+encodeURIComponent(""!==this.settings.url?this.setting.url:a.url)+(""!==this.settings.via?"&via="+this.settings.via:""),"","toolbar=0, status=0,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitterFollow",function(b){return defaultSettings={url:"",urlCount:!1,count:!0,display:"horizontal",lang:"en",popup:{width:650,height:360},user:"",size:"default",showCount:"false"},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"follow"},url:function(a){return""},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitterFollow"><a href="https://twitter.com/'+c.user+'" class="twitter-follow-button"" data-size="'+c.size+'" data-show-count="'+c.showCount+'" data-lang="'+c.lang+'">Follow @'+c.user+"</a></div>");var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){},popup:function(a){window.open("https://twitter.com/intent/follow?screen_name="+encodeURIComponent(this.settings.user),"","toolbar=0, status=0, ,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}))}(window.jQuery,SharrrePlatform),function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend(!0,{},g,c),this.options.share=c.share,this._defaults=g,this._name=f,this.platforms={},this.init()}var f="sharrre",g={className:"sharrre",share:{},shareTotal:0,template:"",title:"",url:c.location.href,text:c.title,urlCurl:"sharrre.php",count:{},total:0,shorterTotal:!0,enableHover:!0,enableCounter:!0,enableTracking:!1,defaultUrl:"javascript:void(0);",popup:{width:900,height:500},hover:function(){},hide:function(){},click:function(){},render:function(){}};e.prototype.init=function(){var b=this;a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a]=SharrrePlatform.get(a,b.options.buttons[a]))}),a(this.element).addClass(this.options.className),"undefined"!=typeof a(this.element).data("title")&&(this.options.title=a(this.element).attr("data-title")),"undefined"!=typeof a(this.element).data("url")&&(this.options.url=a(this.element).data("url")),"undefined"!=typeof a(this.element).data("text")&&(this.options.text=a(this.element).data("text")),a.each(this.options.share,function(a,c){c===!0&&b.options.shareTotal++}),b.options.enableCounter===!0?a.each(this.options.share,function(a,c){if(c===!0)try{b.getSocialJson(a)}catch(d){}}):""!==b.options.template&&(b.renderer(),b.options.count[name]=0,b.rendererPerso()),""!==b.options.template?this.options.render(this,this.options):this.loadButtons(),a(this.element).on("mouseenter",function(){0===a(this).find(".buttons").length&&b.options.enableHover===!0&&b.loadButtons(),b.options.hover(b,b.options)}).on("mouseleave",function(){b.options.hide(b,b.options)}),a(this.element).click(function(a){return a.preventDefault(),b.options.click(b,b.options),!1})},e.prototype.loadButtons=function(){var b=this;a(this.element).append('<div class="buttons"></div>'),a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a].load(b),b.options.enableTracking===!0&&b.platforms[a].tracking())})},e.prototype.getSocialJson=function(b){var c=this,d=0,e=c.platforms[b].settings,f=c.platforms[b].url(this.options.urlCurl),g=encodeURIComponent(this.options.url);e.url.length&&(f=e.url),e.urlCount===!0&&""!==f&&(g=f),e.count===!1&&(f=""),url=f.replace("{url}",g),"twitter"==b&&(f=c.platforms[b].url()),""!==url?a.getJSON(url,function(a){if("undefined"!=typeof a.count){var e=a.count+"";e=e.replace(" ",""),d+=parseInt(e,10)}else"undefined"!=typeof a.share&&"undefined"!=typeof a.share.share_count?d+=parseInt(a.share.share_count,10):"undefined"!=typeof a[0]?d+=parseInt(a[0].total_posts,10):"undefined"!=typeof a[0];c.options.count[b]=d,c.options.total+=d,c.renderer(),c.rendererPerso()}).error(function(){c.options.count[b]=0,c.rendererPerso()}):(c.renderer(),c.options.count[b]=0,c.rendererPerso())},e.prototype.rendererPerso=function(){var a=0;for(var b in this.options.count)a++;a===this.options.shareTotal&&this.options.render(this,this.options)},e.prototype.renderer=function(){var b=this.options.total,c=this.options.template;this.options.shorterTotal===!0&&(b=this.shorterTotal(b)),""!==c?(c=c.replace("{total}",b),a(this.element).html(c)):a(this.element).html('<div class="box"><a class="count" href="'+this.options.defaultUrl+'">'+b+"</a>"+(""!==this.options.title?'<a class="share" href="'+this.options.defaultUrl+'">'+this.options.title+"</a>":"")+"</div>")},e.prototype.shorterTotal=function(a){return a>=1e6?a=(a/1e6).toFixed(2)+"M":a>=1e3&&(a=(a/1e3).toFixed(1)+"k"),a},e.prototype.openPopup=function(a){this.platforms[a].popup(this.options),this.options.enableTracking===!0&&"undefined"!=typeof _gaq&&(infos=this.platforms[a].trackingAction,_gaq.push(["_trackSocial",infos.site,infos.action]))},e.prototype.simulateClick=function(){var b=a(this.element).html();a(this.element).html(b.replace(this.options.total,this.options.total+1))},e.prototype.update=function(a,b){""!==a&&(this.options.url=a),""!==b&&(this.options.text=b)},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a(this).data("plugin_"+f)||a(this).data("plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a(this).data("plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(c,1))}):void 0}}(window.jQuery||window.Zepto,window,document);
1
+ /*!
2
+ * Sharrre.com - Make your sharing widget!
3
+ * Version: 2.0.1
4
+ * Author: Julien Hany
5
+ * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License
6
+ */
7
  var SharrrePlatform=SharrrePlatform||function(){var a={};return{register:function(b,c){a[b]=c},get:function(b,c){return a[b]?new a[b](c):(console.error("Sharrre - No platform found for "+b),!1)}}}();!function(a,b){"undefined"!=typeof a&&(b.register("linkedin",function(b){return defaultSettings={url:"",urlCount:!1,counter:"",count:!0,popup:{width:550,height:550}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?"},trackingAction:{site:"linkedin",action:"share"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button linkedin"><script type="IN/share" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-counter="'+c.counter+'"></script></div>');var d=0;"undefined"==typeof window.IN&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.linkedin.com/in.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):"undefined"!=typeof window.IN&&window.IN.parse&&IN.parse(document)},tracking:function(){},popup:function(a){window.open("https://www.linkedin.com/cws/share?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&token=&isFramed=true","linkedin","toolbar=no, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("facebook",function(b){return defaultSettings={url:"",urlCount:!1,action:"like",layout:"button_count",count:!0,width:"",send:"false",faces:"false",colorscheme:"",font:"",lang:"en_US",share:"",appId:"",popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://graph.facebook.com/?id={url}&callback=?"},trackingAction:{site:"facebook",action:"like"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-send="'+c.send+'" data-layout="'+c.layout+'" data-width="'+c.width+'" data-show-faces="'+c.faces+'" data-action="'+c.action+'" data-colorscheme="'+c.colorscheme+'" data-font="'+c.font+'" data-via="'+c.via+'" data-share="'+c.share+'"></div></div>');var d=0;"undefined"==typeof FB&&0===d?(d=1,function(a,b,d){var e,f=a.getElementsByTagName(b)[0];a.getElementById(d)||(e=a.createElement(b),e.id=d,e.src="https://connect.facebook.net/"+c.lang+"/all.js#xfbml=1",c.appId&&(e.src+="&appId="+c.appId),f.parentNode.insertBefore(e,f))}(document,"script","facebook-jssdk")):FB.XFBML.parse()},tracking:function(){fb=window.setInterval(function(){"undefined"!=typeof FB&&"undefined"!=typeof _gaq&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}),clearInterval(fb))},1e3)},popup:function(a){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&t="+a.text,"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("googlePlus",function(b){return defaultSettings={url:"",urlCount:!1,size:"medium",lang:"en-US",annotation:"",count:!0,popup:{width:900,height:500}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return a+"?url={url}&type=googlePlus"},trackingAction:{site:"Google",action:"+1"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button googleplus"><div class="g-plusone" data-size="'+c.size+'" data-href="'+(""!==c.url?c.url:b.options.url)+'" data-annotation="'+c.annotation+'"></div></div>'),window.___gcfg={lang:c.lang};var d=0;"undefined"!=typeof gapi&&"undefined"!=typeof gapi.plusone||0!==d?gapi.plusone.go():(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://apis.google.com/js/plusone.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}())},tracking:function(){},popup:function(a){window.open("https://plus.google.com/share?hl="+this.settings.lang+"&url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url),"","toolbar=0, status=0, width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("pinterest",function(b){return defaultSettings={url:"",media:"",description:"",layout:"horizontal",popup:{width:700,height:300}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,url:function(a){return"https://api.pinterest.com/v1/urls/count.json?url={url}&callback=?"},trackingAction:{site:"pinterest",action:"pin"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button pinterest"><a href="https://www.pinterest.com/pin/create/button/?url='+(""!==c.url?c.url:b.options.url)+"&media="+c.media+"&description="+c.description+'" data-pin-do="buttonBookmark" count-layout="'+c.layout+'">Pin It</a></div>'),function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://assets.pinterest.com/js/pinit.js",a.setAttribute("data-pin-build","parsePinBtns");var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}(),window.parsePinBtns&&window.parsePinBtns(),a(b.element).find(".pinterest").on("click",function(){b.openPopup("pinterest")})},tracking:function(){},popup:function(a){window.open("https://pinterest.com/pin/create/button/?url="+encodeURIComponent(""!==this.settings.url?this.settings.url:a.url)+"&media="+encodeURIComponent(this.settings.media)+"&description="+this.settings.description,"pinterest","toolbar=no,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitter",function(b){return defaultSettings={url:"",urlCount:!1,count:!1,hashtags:"",via:"",related:"",lang:"en",popup:{width:650,height:360}},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"tweet"},url:function(a){return"http://opensharecount.com/count.json?url={url}"},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(""!==c.url?c.url:b.options.url)+'" data-count="'+c.count+'" data-text="'+b.options.text+'" data-via="'+c.via+'" data-hashtags="'+c.hashtags+'" data-related="'+c.related+'" data-lang="'+c.lang+'">Tweet</a></div>');var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){tw=window.setInterval(function(){"undefined"!=typeof twttr&&(twttr.events.bind("tweet",function(a){a&&"undefined"!=typeof _gaq&&_gaq.push(["_trackSocial","twitter","tweet"])}),clearInterval(tw))},1e3)},popup:function(a){window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(a.text)+"&url="+encodeURIComponent(""!==this.settings.url?this.setting.url:a.url)+(""!==this.settings.via?"&via="+this.settings.via:""),"","toolbar=0, status=0,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}),b.register("twitterFollow",function(b){return defaultSettings={url:"",urlCount:!1,count:!0,display:"horizontal",lang:"en",popup:{width:650,height:360},user:"",size:"default",showCount:"false"},defaultSettings=a.extend(!0,{},defaultSettings,b),{settings:defaultSettings,trackingAction:{site:"twitter",action:"follow"},url:function(a){return""},load:function(b){var c=this.settings;a(b.element).find(".buttons").append('<div class="button twitterFollow"><a href="https://twitter.com/'+c.user+'" class="twitter-follow-button"" data-size="'+c.size+'" data-show-count="'+c.showCount+'" data-lang="'+c.lang+'">Follow @'+c.user+"</a></div>");var d=0;"undefined"==typeof twttr&&0===d?(d=1,function(){var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src="https://platform.twitter.com/widgets.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)}()):a.ajax({url:"https://platform.twitter.com/widgets.js",dataType:"script",cache:!0})},tracking:function(){},popup:function(a){window.open("https://twitter.com/intent/follow?screen_name="+encodeURIComponent(this.settings.user),"","toolbar=0, status=0, ,width="+this.settings.popup.width+", height="+this.settings.popup.height)}}}))}(window.jQuery,SharrrePlatform),function(a,b,c,d){function e(b,c){this.element=b,this.options=a.extend(!0,{},g,c),this.options.share=c.share,this._defaults=g,this._name=f,this.platforms={},this.init()}var f="sharrre",g={className:"sharrre",share:{},shareTotal:0,template:"",title:"",url:c.location.href,text:c.title,urlCurl:"sharrre.php",count:{},total:0,shorterTotal:!0,enableHover:!0,enableCounter:!0,enableTracking:!1,defaultUrl:"javascript:void(0);",popup:{width:900,height:500},hover:function(){},hide:function(){},click:function(){},render:function(){}};e.prototype.init=function(){var b=this;a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a]=SharrrePlatform.get(a,b.options.buttons[a]))}),a(this.element).addClass(this.options.className),"undefined"!=typeof a(this.element).data("title")&&(this.options.title=a(this.element).attr("data-title")),"undefined"!=typeof a(this.element).data("url")&&(this.options.url=a(this.element).data("url")),"undefined"!=typeof a(this.element).data("text")&&(this.options.text=a(this.element).data("text")),a.each(this.options.share,function(a,c){c===!0&&b.options.shareTotal++}),b.options.enableCounter===!0?a.each(this.options.share,function(a,c){if(c===!0)try{b.getSocialJson(a)}catch(d){}}):""!==b.options.template&&(b.renderer(),b.options.count[name]=0,b.rendererPerso()),""!==b.options.template?this.options.render(this,this.options):this.loadButtons(),a(this.element).on("mouseenter",function(){0===a(this).find(".buttons").length&&b.options.enableHover===!0&&b.loadButtons(),b.options.hover(b,b.options)}).on("mouseleave",function(){b.options.hide(b,b.options)}),a(this.element).click(function(a){return a.preventDefault(),b.options.click(b,b.options),!1})},e.prototype.loadButtons=function(){var b=this;a(this.element).append('<div class="buttons"></div>'),a.each(b.options.share,function(a,c){c===!0&&(b.platforms[a].load(b),b.options.enableTracking===!0&&b.platforms[a].tracking())})},e.prototype.getSocialJson=function(b){var c=this,d=0,e=c.platforms[b].settings,f=c.platforms[b].url(this.options.urlCurl),g=encodeURIComponent(this.options.url);e.url.length&&(f=e.url),e.urlCount===!0&&""!==f&&(g=f),e.count===!1&&(f=""),url=f.replace("{url}",g),"twitter"==b&&(f=c.platforms[b].url()),""!==url?a.getJSON(url,function(a){if("undefined"!=typeof a.count){var e=a.count+"";e=e.replace(" ",""),d+=parseInt(e,10)}else"undefined"!=typeof a.share&&"undefined"!=typeof a.share.share_count?d+=parseInt(a.share.share_count,10):"undefined"!=typeof a[0]?d+=parseInt(a[0].total_posts,10):"undefined"!=typeof a[0];c.options.count[b]=d,c.options.total+=d,c.renderer(),c.rendererPerso()}).error(function(){c.options.count[b]=0,c.rendererPerso()}):(c.renderer(),c.options.count[b]=0,c.rendererPerso())},e.prototype.rendererPerso=function(){var a=0;for(var b in this.options.count)a++;a===this.options.shareTotal&&this.options.render(this,this.options)},e.prototype.renderer=function(){var b=this.options.total,c=this.options.template;this.options.shorterTotal===!0&&(b=this.shorterTotal(b)),""!==c?(c=c.replace("{total}",b),a(this.element).html(c)):a(this.element).html('<div class="box"><a class="count" href="'+this.options.defaultUrl+'">'+b+"</a>"+(""!==this.options.title?'<a class="share" href="'+this.options.defaultUrl+'">'+this.options.title+"</a>":"")+"</div>")},e.prototype.shorterTotal=function(a){return a>=1e6?a=(a/1e6).toFixed(2)+"M":a>=1e3&&(a=(a/1e3).toFixed(1)+"k"),a},e.prototype.openPopup=function(a){this.platforms[a].popup(this.options),this.options.enableTracking===!0&&"undefined"!=typeof _gaq&&(infos=this.platforms[a].trackingAction,_gaq.push(["_trackSocial",infos.site,infos.action]))},e.prototype.simulateClick=function(){var b=a(this.element).html();a(this.element).html(b.replace(this.options.total,this.options.total+1))},e.prototype.update=function(a,b){""!==a&&(this.options.url=a),""!==b&&(this.options.text=b)},a.fn[f]=function(b){var c=arguments;return b===d||"object"==typeof b?this.each(function(){a(this).data("plugin_"+f)||a(this).data("plugin_"+f,new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var d=a(this).data("plugin_"+f);d instanceof e&&"function"==typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(c,1))}):void 0}}(window.jQuery||window.Zepto,window,document);
addons/assets/front/js/vendors/flickity.js ADDED
@@ -0,0 +1,4639 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Flickity PACKAGED v2.0.5
3
+ * Touch, responsive, flickable carousels
4
+ *
5
+ * Licensed GPLv3 for open source use
6
+ * or Flickity Commercial License for commercial use
7
+ *
8
+ * http://flickity.metafizzy.co
9
+ * Copyright 2016 Metafizzy
10
+ */
11
+
12
+ /**
13
+ * Bridget makes jQuery widgets
14
+ * v2.0.1
15
+ * MIT license
16
+ */
17
+
18
+ /* jshint browser: true, strict: true, undef: true, unused: true */
19
+
20
+ ( function( window, factory ) {
21
+ // universal module definition
22
+ /*jshint strict: false */ /* globals define, module, require */
23
+ if ( typeof define == 'function' && define.amd ) {
24
+ // AMD
25
+ define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) {
26
+ return factory( window, jQuery );
27
+ });
28
+ } else if ( typeof module == 'object' && module.exports ) {
29
+ // CommonJS
30
+ module.exports = factory(
31
+ window,
32
+ require('jquery')
33
+ );
34
+ } else {
35
+ // browser global
36
+ window.jQueryBridget = factory(
37
+ window,
38
+ window.jQuery
39
+ );
40
+ }
41
+
42
+ }( window, function factory( window, jQuery ) {
43
+ 'use strict';
44
+
45
+ // ----- utils ----- //
46
+
47
+ var arraySlice = Array.prototype.slice;
48
+
49
+ // helper function for logging errors
50
+ // $.error breaks jQuery chaining
51
+ var console = window.console;
52
+ var logError = typeof console == 'undefined' ? function() {} :
53
+ function( message ) {
54
+ console.error( message );
55
+ };
56
+
57
+ // ----- jQueryBridget ----- //
58
+
59
+ function jQueryBridget( namespace, PluginClass, $ ) {
60
+ $ = $ || jQuery || window.jQuery;
61
+ if ( !$ ) {
62
+ return;
63
+ }
64
+
65
+ // add option method -> $().plugin('option', {...})
66
+ if ( !PluginClass.prototype.option ) {
67
+ // option setter
68
+ PluginClass.prototype.option = function( opts ) {
69
+ // bail out if not an object
70
+ if ( !$.isPlainObject( opts ) ){
71
+ return;
72
+ }
73
+ this.options = $.extend( true, this.options, opts );
74
+ };
75
+ }
76
+
77
+ // make jQuery plugin
78
+ $.fn[ namespace ] = function( arg0 /*, arg1 */ ) {
79
+ if ( typeof arg0 == 'string' ) {
80
+ // method call $().plugin( 'methodName', { options } )
81
+ // shift arguments by 1
82
+ var args = arraySlice.call( arguments, 1 );
83
+ return methodCall( this, arg0, args );
84
+ }
85
+ // just $().plugin({ options })
86
+ plainCall( this, arg0 );
87
+ return this;
88
+ };
89
+
90
+ // $().plugin('methodName')
91
+ function methodCall( $elems, methodName, args ) {
92
+ var returnValue;
93
+ var pluginMethodStr = '$().' + namespace + '("' + methodName + '")';
94
+
95
+ $elems.each( function( i, elem ) {
96
+ // get instance
97
+ var instance = $.data( elem, namespace );
98
+ if ( !instance ) {
99
+ logError( namespace + ' not initialized. Cannot call methods, i.e. ' +
100
+ pluginMethodStr );
101
+ return;
102
+ }
103
+
104
+ var method = instance[ methodName ];
105
+ if ( !method || methodName.charAt(0) == '_' ) {
106
+ logError( pluginMethodStr + ' is not a valid method' );
107
+ return;
108
+ }
109
+
110
+ // apply method, get return value
111
+ var value = method.apply( instance, args );
112
+ // set return value if value is returned, use only first value
113
+ returnValue = returnValue === undefined ? value : returnValue;
114
+ });
115
+
116
+ return returnValue !== undefined ? returnValue : $elems;
117
+ }
118
+
119
+ function plainCall( $elems, options ) {
120
+ $elems.each( function( i, elem ) {
121
+ var instance = $.data( elem, namespace );
122
+ if ( instance ) {
123
+ // set options & init
124
+ instance.option( options );
125
+ instance._init();
126
+ } else {
127
+ // initialize new instance
128
+ instance = new PluginClass( elem, options );
129
+ $.data( elem, namespace, instance );
130
+ }
131
+ });
132
+ }
133
+
134
+ updateJQuery( $ );
135
+
136
+ }
137
+
138
+ // ----- updateJQuery ----- //
139
+
140
+ // set $.bridget for v1 backwards compatibility
141
+ function updateJQuery( $ ) {
142
+ if ( !$ || ( $ && $.bridget ) ) {
143
+ return;
144
+ }
145
+ $.bridget = jQueryBridget;
146
+ }
147
+
148
+ updateJQuery( jQuery || window.jQuery );
149
+
150
+ // ----- ----- //
151
+
152
+ return jQueryBridget;
153
+
154
+ }));
155
+
156
+ /**
157
+ * EvEmitter v1.0.3
158
+ * Lil' event emitter
159
+ * MIT License
160
+ */
161
+
162
+ /* jshint unused: true, undef: true, strict: true */
163
+
164
+ ( function( global, factory ) {
165
+ // universal module definition
166
+ /* jshint strict: false */ /* globals define, module, window */
167
+ if ( typeof define == 'function' && define.amd ) {
168
+ // AMD - RequireJS
169
+ define( 'ev-emitter/ev-emitter',factory );
170
+ } else if ( typeof module == 'object' && module.exports ) {
171
+ // CommonJS - Browserify, Webpack
172
+ module.exports = factory();
173
+ } else {
174
+ // Browser globals
175
+ global.EvEmitter = factory();
176
+ }
177
+
178
+ }( typeof window != 'undefined' ? window : this, function() {
179
+
180
+
181
+
182
+ function EvEmitter() {}
183
+
184
+ var proto = EvEmitter.prototype;
185
+
186
+ proto.on = function( eventName, listener ) {
187
+ if ( !eventName || !listener ) {
188
+ return;
189
+ }
190
+ // set events hash
191
+ var events = this._events = this._events || {};
192
+ // set listeners array
193
+ var listeners = events[ eventName ] = events[ eventName ] || [];
194
+ // only add once
195
+ if ( listeners.indexOf( listener ) == -1 ) {
196
+ listeners.push( listener );
197
+ }
198
+
199
+ return this;
200
+ };
201
+
202
+ proto.once = function( eventName, listener ) {
203
+ if ( !eventName || !listener ) {
204
+ return;
205
+ }
206
+ // add event
207
+ this.on( eventName, listener );
208
+ // set once flag
209
+ // set onceEvents hash
210
+ var onceEvents = this._onceEvents = this._onceEvents || {};
211
+ // set onceListeners object
212
+ var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
213
+ // set flag
214
+ onceListeners[ listener ] = true;
215
+
216
+ return this;
217
+ };
218
+
219
+ proto.off = function( eventName, listener ) {
220
+ var listeners = this._events && this._events[ eventName ];
221
+ if ( !listeners || !listeners.length ) {
222
+ return;
223
+ }
224
+ var index = listeners.indexOf( listener );
225
+ if ( index != -1 ) {
226
+ listeners.splice( index, 1 );
227
+ }
228
+
229
+ return this;
230
+ };
231
+
232
+ proto.emitEvent = function( eventName, args ) {
233
+ var listeners = this._events && this._events[ eventName ];
234
+ if ( !listeners || !listeners.length ) {
235
+ return;
236
+ }
237
+ var i = 0;
238
+ var listener = listeners[i];
239
+ args = args || [];
240
+ // once stuff
241
+ var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
242
+
243
+ while ( listener ) {
244
+ var isOnce = onceListeners && onceListeners[ listener ];
245
+ if ( isOnce ) {
246
+ // remove listener
247
+ // remove before trigger to prevent recursion
248
+ this.off( eventName, listener );
249
+ // unset once flag
250
+ delete onceListeners[ listener ];
251
+ }
252
+ // trigger listener
253
+ listener.apply( this, args );
254
+ // get next listener
255
+ i += isOnce ? 0 : 1;
256
+ listener = listeners[i];
257
+ }
258
+
259
+ return this;
260
+ };
261
+
262
+ return EvEmitter;
263
+
264
+ }));
265
+
266
+ /*!
267
+ * getSize v2.0.2
268
+ * measure size of elements
269
+ * MIT license
270
+ */
271
+
272
+ /*jshint browser: true, strict: true, undef: true, unused: true */
273
+ /*global define: false, module: false, console: false */
274
+
275
+ ( function( window, factory ) {
276
+ 'use strict';
277
+
278
+ if ( typeof define == 'function' && define.amd ) {
279
+ // AMD
280
+ define( 'get-size/get-size',[],function() {
281
+ return factory();
282
+ });
283
+ } else if ( typeof module == 'object' && module.exports ) {
284
+ // CommonJS
285
+ module.exports = factory();
286
+ } else {
287
+ // browser global
288
+ window.getSize = factory();
289
+ }
290
+
291
+ })( window, function factory() {
292
+ 'use strict';
293
+
294
+ // -------------------------- helpers -------------------------- //
295
+
296
+ // get a number from a string, not a percentage
297
+ function getStyleSize( value ) {
298
+ var num = parseFloat( value );
299
+ // not a percent like '100%', and a number
300
+ var isValid = value.indexOf('%') == -1 && !isNaN( num );
301
+ return isValid && num;
302
+ }
303
+
304
+ function noop() {}
305
+
306
+ var logError = typeof console == 'undefined' ? noop :
307
+ function( message ) {
308
+ console.error( message );
309
+ };
310
+
311
+ // -------------------------- measurements -------------------------- //
312
+
313
+ var measurements = [
314
+ 'paddingLeft',
315
+ 'paddingRight',
316
+ 'paddingTop',
317
+ 'paddingBottom',
318
+ 'marginLeft',
319
+ 'marginRight',
320
+ 'marginTop',
321
+ 'marginBottom',
322
+ 'borderLeftWidth',
323
+ 'borderRightWidth',
324
+ 'borderTopWidth',
325
+ 'borderBottomWidth'
326
+ ];
327
+
328
+ var measurementsLength = measurements.length;
329
+
330
+ function getZeroSize() {
331
+ var size = {
332
+ width: 0,
333
+ height: 0,
334
+ innerWidth: 0,
335
+ innerHeight: 0,
336
+ outerWidth: 0,
337
+ outerHeight: 0
338
+ };
339
+ for ( var i=0; i < measurementsLength; i++ ) {
340
+ var measurement = measurements[i];
341
+ size[ measurement ] = 0;
342
+ }
343
+ return size;
344
+ }
345
+
346
+ // -------------------------- getStyle -------------------------- //
347
+
348
+ /**
349
+ * getStyle, get style of element, check for Firefox bug
350
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
351
+ */
352
+ function getStyle( elem ) {
353
+ var style = getComputedStyle( elem );
354
+ if ( !style ) {
355
+ logError( 'Style returned ' + style +
356
+ '. Are you running this code in a hidden iframe on Firefox? ' +
357
+ 'See http://bit.ly/getsizebug1' );
358
+ }
359
+ return style;
360
+ }
361
+
362
+ // -------------------------- setup -------------------------- //
363
+
364
+ var isSetup = false;
365
+
366
+ var isBoxSizeOuter;
367
+
368
+ /**
369
+ * setup
370
+ * check isBoxSizerOuter
371
+ * do on first getSize() rather than on page load for Firefox bug
372
+ */
373
+ function setup() {
374
+ // setup once
375
+ if ( isSetup ) {
376
+ return;
377
+ }
378
+ isSetup = true;
379
+
380
+ // -------------------------- box sizing -------------------------- //
381
+
382
+ /**
383
+ * WebKit measures the outer-width on style.width on border-box elems
384
+ * IE & Firefox<29 measures the inner-width
385
+ */
386
+ var div = document.createElement('div');
387
+ div.style.width = '200px';
388
+ div.style.padding = '1px 2px 3px 4px';
389
+ div.style.borderStyle = 'solid';
390
+ div.style.borderWidth = '1px 2px 3px 4px';
391
+ div.style.boxSizing = 'border-box';
392
+
393
+ var body = document.body || document.documentElement;
394
+ body.appendChild( div );
395
+ var style = getStyle( div );
396
+
397
+ getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;
398
+ body.removeChild( div );
399
+
400
+ }
401
+
402
+ // -------------------------- getSize -------------------------- //
403
+
404
+ function getSize( elem ) {
405
+ setup();
406
+
407
+ // use querySeletor if elem is string
408
+ if ( typeof elem == 'string' ) {
409
+ elem = document.querySelector( elem );
410
+ }
411
+
412
+ // do not proceed on non-objects
413
+ if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
414
+ return;
415
+ }
416
+
417
+ var style = getStyle( elem );
418
+
419
+ // if hidden, everything is 0
420
+ if ( style.display == 'none' ) {
421
+ return getZeroSize();
422
+ }
423
+
424
+ var size = {};
425
+ size.width = elem.offsetWidth;
426
+ size.height = elem.offsetHeight;
427
+
428
+ var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
429
+
430
+ // get all measurements
431
+ for ( var i=0; i < measurementsLength; i++ ) {
432
+ var measurement = measurements[i];
433
+ var value = style[ measurement ];
434
+ var num = parseFloat( value );
435
+ // any 'auto', 'medium' value will be 0
436
+ size[ measurement ] = !isNaN( num ) ? num : 0;
437
+ }
438
+
439
+ var paddingWidth = size.paddingLeft + size.paddingRight;
440
+ var paddingHeight = size.paddingTop + size.paddingBottom;
441
+ var marginWidth = size.marginLeft + size.marginRight;
442
+ var marginHeight = size.marginTop + size.marginBottom;
443
+ var borderWidth = size.borderLeftWidth + size.borderRightWidth;
444
+ var borderHeight = size.borderTopWidth + size.borderBottomWidth;
445
+
446
+ var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
447
+
448
+ // overwrite width and height if we can get it from style
449
+ var styleWidth = getStyleSize( style.width );
450
+ if ( styleWidth !== false ) {
451
+ size.width = styleWidth +
452
+ // add padding and border unless it's already including it
453
+ ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
454
+ }
455
+
456
+ var styleHeight = getStyleSize( style.height );
457
+ if ( styleHeight !== false ) {
458
+ size.height = styleHeight +
459
+ // add padding and border unless it's already including it
460
+ ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
461
+ }
462
+
463
+ size.innerWidth = size.width - ( paddingWidth + borderWidth );
464
+ size.innerHeight = size.height - ( paddingHeight + borderHeight );
465
+
466
+ size.outerWidth = size.width + marginWidth;
467
+ size.outerHeight = size.height + marginHeight;
468
+
469
+ return size;
470
+ }
471
+
472
+ return getSize;
473
+
474
+ });
475
+
476
+ /**
477
+ * matchesSelector v2.0.1
478
+ * matchesSelector( element, '.selector' )
479
+ * MIT license
480
+ */
481
+
482
+ /*jshint browser: true, strict: true, undef: true, unused: true */
483
+
484
+ ( function( window, factory ) {
485
+ /*global define: false, module: false */
486
+ 'use strict';
487
+ // universal module definition
488
+ if ( typeof define == 'function' && define.amd ) {
489
+ // AMD
490
+ define( 'desandro-matches-selector/matches-selector',factory );
491
+ } else if ( typeof module == 'object' && module.exports ) {
492
+ // CommonJS
493
+ module.exports = factory();
494
+ } else {
495
+ // browser global
496
+ window.matchesSelector = factory();
497
+ }
498
+
499
+ }( window, function factory() {
500
+ 'use strict';
501
+
502
+ var matchesMethod = ( function() {
503
+ var ElemProto = Element.prototype;
504
+ // check for the standard method name first
505
+ if ( ElemProto.matches ) {
506
+ return 'matches';
507
+ }
508
+ // check un-prefixed
509
+ if ( ElemProto.matchesSelector ) {
510
+ return 'matchesSelector';
511
+ }
512
+ // check vendor prefixes
513
+ var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
514
+
515
+ for ( var i=0; i < prefixes.length; i++ ) {
516
+ var prefix = prefixes[i];
517
+ var method = prefix + 'MatchesSelector';
518
+ if ( ElemProto[ method ] ) {
519
+ return method;
520
+ }
521
+ }
522
+ })();
523
+
524
+ return function matchesSelector( elem, selector ) {
525
+ return elem[ matchesMethod ]( selector );
526
+ };
527
+
528
+ }));
529
+
530
+ /**
531
+ * Fizzy UI utils v2.0.3
532
+ * MIT license
533
+ */
534
+
535
+ /*jshint browser: true, undef: true, unused: true, strict: true */
536
+
537
+ ( function( window, factory ) {
538
+ // universal module definition
539
+ /*jshint strict: false */ /*globals define, module, require */
540
+
541
+ if ( typeof define == 'function' && define.amd ) {
542
+ // AMD
543
+ define( 'fizzy-ui-utils/utils',[
544
+ 'desandro-matches-selector/matches-selector'
545
+ ], function( matchesSelector ) {
546
+ return factory( window, matchesSelector );
547
+ });
548
+ } else if ( typeof module == 'object' && module.exports ) {
549
+ // CommonJS
550
+ module.exports = factory(
551
+ window,
552
+ require('desandro-matches-selector')
553
+ );
554
+ } else {
555
+ // browser global
556
+ window.fizzyUIUtils = factory(
557
+ window,
558
+ window.matchesSelector
559
+ );
560
+ }
561
+
562
+ }( window, function factory( window, matchesSelector ) {
563
+
564
+
565
+
566
+ var utils = {};
567
+
568
+ // ----- extend ----- //
569
+
570
+ // extends objects
571
+ utils.extend = function( a, b ) {
572
+ for ( var prop in b ) {
573
+ a[ prop ] = b[ prop ];
574
+ }
575
+ return a;
576
+ };
577
+
578
+ // ----- modulo ----- //
579
+
580
+ utils.modulo = function( num, div ) {
581
+ return ( ( num % div ) + div ) % div;
582
+ };
583
+
584
+ // ----- makeArray ----- //
585
+
586
+ // turn element or nodeList into an array
587
+ utils.makeArray = function( obj ) {
588
+ var ary = [];
589
+ if ( Array.isArray( obj ) ) {
590
+ // use object if already an array
591
+ ary = obj;
592
+ } else if ( obj && typeof obj.length == 'number' ) {
593
+ // convert nodeList to array
594
+ for ( var i=0; i < obj.length; i++ ) {
595
+ ary.push( obj[i] );
596
+ }
597
+ } else {
598
+ // array of single index
599
+ ary.push( obj );
600
+ }
601
+ return ary;
602
+ };
603
+
604
+ // ----- removeFrom ----- //
605
+
606
+ utils.removeFrom = function( ary, obj ) {
607
+ var index = ary.indexOf( obj );
608
+ if ( index != -1 ) {
609
+ ary.splice( index, 1 );
610
+ }
611
+ };
612
+
613
+ // ----- getParent ----- //
614
+
615
+ utils.getParent = function( elem, selector ) {
616
+ while ( elem != document.body ) {
617
+ elem = elem.parentNode;
618
+ if ( matchesSelector( elem, selector ) ) {
619
+ return elem;
620
+ }
621
+ }
622
+ };
623
+
624
+ // ----- getQueryElement ----- //
625
+
626
+ // use element as selector string
627
+ utils.getQueryElement = function( elem ) {
628
+ if ( typeof elem == 'string' ) {
629
+ return document.querySelector( elem );
630
+ }
631
+ return elem;
632
+ };
633
+
634
+ // ----- handleEvent ----- //
635
+
636
+ // enable .ontype to trigger from .addEventListener( elem, 'type' )
637
+ utils.handleEvent = function( event ) {
638
+ var method = 'on' + event.type;
639
+ if ( this[ method ] ) {
640
+ this[ method ]( event );
641
+ }
642
+ };
643
+
644
+ // ----- filterFindElements ----- //
645
+
646
+ utils.filterFindElements = function( elems, selector ) {
647
+ // make array of elems
648
+ elems = utils.makeArray( elems );
649
+ var ffElems = [];
650
+
651
+ elems.forEach( function( elem ) {
652
+ // check that elem is an actual element
653
+ if ( !( elem instanceof HTMLElement ) ) {
654
+ return;
655
+ }
656
+ // add elem if no selector
657
+ if ( !selector ) {
658
+ ffElems.push( elem );
659
+ return;
660
+ }
661
+ // filter & find items if we have a selector
662
+ // filter
663
+ if ( matchesSelector( elem, selector ) ) {
664
+ ffElems.push( elem );
665
+ }
666
+ // find children
667
+ var childElems = elem.querySelectorAll( selector );
668
+ // concat childElems to filterFound array
669
+ for ( var i=0; i < childElems.length; i++ ) {
670
+ ffElems.push( childElems[i] );
671
+ }
672
+ });
673
+
674
+ return ffElems;
675
+ };
676
+
677
+ // ----- debounceMethod ----- //
678
+
679
+ utils.debounceMethod = function( _class, methodName, threshold ) {
680
+ // original method
681
+ var method = _class.prototype[ methodName ];
682
+ var timeoutName = methodName + 'Timeout';
683
+
684
+ _class.prototype[ methodName ] = function() {
685
+ var timeout = this[ timeoutName ];
686
+ if ( timeout ) {
687
+ clearTimeout( timeout );
688
+ }
689
+ var args = arguments;
690
+
691
+ var _this = this;
692
+ this[ timeoutName ] = setTimeout( function() {
693
+ method.apply( _this, args );
694
+ delete _this[ timeoutName ];
695
+ }, threshold || 100 );
696
+ };
697
+ };
698
+
699
+ // ----- docReady ----- //
700
+
701
+ utils.docReady = function( callback ) {
702
+ var readyState = document.readyState;
703
+ if ( readyState == 'complete' || readyState == 'interactive' ) {
704
+ // do async to allow for other scripts to run. metafizzy/flickity#441
705
+ setTimeout( callback );
706
+ } else {
707
+ document.addEventListener( 'DOMContentLoaded', callback );
708
+ }
709
+ };
710
+
711
+ // ----- htmlInit ----- //
712
+
713
+ // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
714
+ utils.toDashed = function( str ) {
715
+ return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
716
+ return $1 + '-' + $2;
717
+ }).toLowerCase();
718
+ };
719
+
720
+ var console = window.console;
721
+ /**
722
+ * allow user to initialize classes via [data-namespace] or .js-namespace class
723
+ * htmlInit( Widget, 'widgetName' )
724
+ * options are parsed from data-namespace-options
725
+ */
726
+ utils.htmlInit = function( WidgetClass, namespace ) {
727
+ utils.docReady( function() {
728
+ var dashedNamespace = utils.toDashed( namespace );
729
+ var dataAttr = 'data-' + dashedNamespace;
730
+ var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
731
+ var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
732
+ var elems = utils.makeArray( dataAttrElems )
733
+ .concat( utils.makeArray( jsDashElems ) );
734
+ var dataOptionsAttr = dataAttr + '-options';
735
+ var jQuery = window.jQuery;
736
+
737
+ elems.forEach( function( elem ) {
738
+ var attr = elem.getAttribute( dataAttr ) ||
739
+ elem.getAttribute( dataOptionsAttr );
740
+ var options;
741
+ try {
742
+ options = attr && JSON.parse( attr );
743
+ } catch ( error ) {
744
+ // log error, do not initialize
745
+ if ( console ) {
746
+ console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
747
+ ': ' + error );
748
+ }
749
+ return;
750
+ }
751
+ // initialize
752
+ var instance = new WidgetClass( elem, options );
753
+ // make available via $().data('namespace')
754
+ if ( jQuery ) {
755
+ jQuery.data( elem, namespace, instance );
756
+ }
757
+ });
758
+
759
+ });
760
+ };
761
+
762
+ // ----- ----- //
763
+
764
+ return utils;
765
+
766
+ }));
767
+
768
+ // Flickity.Cell
769
+ ( function( window, factory ) {
770
+ // universal module definition
771
+ /* jshint strict: false */
772
+ if ( typeof define == 'function' && define.amd ) {
773
+ // AMD
774
+ define( 'flickity/js/cell',[
775
+ 'get-size/get-size'
776
+ ], function( getSize ) {
777
+ return factory( window, getSize );
778
+ });
779
+ } else if ( typeof module == 'object' && module.exports ) {
780
+ // CommonJS
781
+ module.exports = factory(
782
+ window,
783
+ require('get-size')
784
+ );
785
+ } else {
786
+ // browser global
787
+ window.Flickity = window.Flickity || {};
788
+ window.Flickity.Cell = factory(
789
+ window,
790
+ window.getSize
791
+ );
792
+ }
793
+
794
+ }( window, function factory( window, getSize ) {
795
+
796
+
797
+
798
+ function Cell( elem, parent ) {
799
+ this.element = elem;
800
+ this.parent = parent;
801
+
802
+ this.create();
803
+ }
804
+
805
+ var proto = Cell.prototype;
806
+
807
+ proto.create = function() {
808
+ this.element.style.position = 'absolute';
809
+ this.x = 0;
810
+ this.shift = 0;
811
+ };
812
+
813
+ proto.destroy = function() {
814
+ // reset style
815
+ this.element.style.position = '';
816
+ var side = this.parent.originSide;
817
+ this.element.style[ side ] = '';
818
+ };
819
+
820
+ proto.getSize = function() {
821
+ this.size = getSize( this.element );
822
+ };
823
+
824
+ proto.setPosition = function( x ) {
825
+ this.x = x;
826
+ this.updateTarget();
827
+ this.renderPosition( x );
828
+ };
829
+
830
+ // setDefaultTarget v1 method, backwards compatibility, remove in v3
831
+ proto.updateTarget = proto.setDefaultTarget = function() {
832
+ var marginProperty = this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight';
833
+ this.target = this.x + this.size[ marginProperty ] +
834
+ this.size.width * this.parent.cellAlign;
835
+ };
836
+
837
+ proto.renderPosition = function( x ) {
838
+ // render position of cell with in slider
839
+ var side = this.parent.originSide;
840
+ this.element.style[ side ] = this.parent.getPositionValue( x );
841
+ };
842
+
843
+ /**
844
+ * @param {Integer} factor - 0, 1, or -1
845
+ **/
846
+ proto.wrapShift = function( shift ) {
847
+ this.shift = shift;
848
+ this.renderPosition( this.x + this.parent.slideableWidth * shift );
849
+ };
850
+
851
+ proto.remove = function() {
852
+ this.element.parentNode.removeChild( this.element );
853
+ };
854
+
855
+ return Cell;
856
+
857
+ }));
858
+
859
+ // slide
860
+ ( function( window, factory ) {
861
+ // universal module definition
862
+ /* jshint strict: false */
863
+ if ( typeof define == 'function' && define.amd ) {
864
+ // AMD
865
+ define( 'flickity/js/slide',factory );
866
+ } else if ( typeof module == 'object' && module.exports ) {
867
+ // CommonJS
868
+ module.exports = factory();
869
+ } else {
870
+ // browser global
871
+ window.Flickity = window.Flickity || {};
872
+ window.Flickity.Slide = factory();
873
+ }
874
+
875
+ }( window, function factory() {
876
+ 'use strict';
877
+
878
+ function Slide( parent ) {
879
+ this.parent = parent;
880
+ this.isOriginLeft = parent.originSide == 'left';
881
+ this.cells = [];
882
+ this.outerWidth = 0;
883
+ this.height = 0;
884
+ }
885
+
886
+ var proto = Slide.prototype;
887
+
888
+ proto.addCell = function( cell ) {
889
+ this.cells.push( cell );
890
+ this.outerWidth += cell.size.outerWidth;
891
+ this.height = Math.max( cell.size.outerHeight, this.height );
892
+ // first cell stuff
893
+ if ( this.cells.length == 1 ) {
894
+ this.x = cell.x; // x comes from first cell
895
+ var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight';
896
+ this.firstMargin = cell.size[ beginMargin ];
897
+ }
898
+ };
899
+
900
+ proto.updateTarget = function() {
901
+ var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft';
902
+ var lastCell = this.getLastCell();
903
+ var lastMargin = lastCell ? lastCell.size[ endMargin ] : 0;
904
+ var slideWidth = this.outerWidth - ( this.firstMargin + lastMargin );
905
+ this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign;
906
+ };
907
+
908
+ proto.getLastCell = function() {
909
+ return this.cells[ this.cells.length - 1 ];
910
+ };
911
+
912
+ proto.select = function() {
913
+ this.changeSelectedClass('add');
914
+ };
915
+
916
+ proto.unselect = function() {
917
+ this.changeSelectedClass('remove');
918
+ };
919
+
920
+ proto.changeSelectedClass = function( method ) {
921
+ this.cells.forEach( function( cell ) {
922
+ cell.element.classList[ method ]('is-selected');
923
+ });
924
+ };
925
+
926
+ proto.getCellElements = function() {
927
+ return this.cells.map( function( cell ) {
928
+ return cell.element;
929
+ });
930
+ };
931
+
932
+ return Slide;
933
+
934
+ }));
935
+
936
+ // animate
937
+ ( function( window, factory ) {
938
+ // universal module definition
939
+ /* jshint strict: false */
940
+ if ( typeof define == 'function' && define.amd ) {
941
+ // AMD
942
+ define( 'flickity/js/animate',[
943
+ 'fizzy-ui-utils/utils'
944
+ ], function( utils ) {
945
+ return factory( window, utils );
946
+ });
947
+ } else if ( typeof module == 'object' && module.exports ) {
948
+ // CommonJS
949
+ module.exports = factory(
950
+ window,
951
+ require('fizzy-ui-utils')
952
+ );
953
+ } else {
954
+ // browser global
955
+ window.Flickity = window.Flickity || {};
956
+ window.Flickity.animatePrototype = factory(
957
+ window,
958
+ window.fizzyUIUtils
959
+ );
960
+ }
961
+
962
+ }( window, function factory( window, utils ) {
963
+
964
+
965
+
966
+ // -------------------------- requestAnimationFrame -------------------------- //
967
+
968
+ // get rAF, prefixed, if present
969
+ var requestAnimationFrame = window.requestAnimationFrame ||
970
+ window.webkitRequestAnimationFrame;
971
+
972
+ // fallback to setTimeout
973
+ var lastTime = 0;
974
+ if ( !requestAnimationFrame ) {
975
+ requestAnimationFrame = function( callback ) {
976
+ var currTime = new Date().getTime();
977
+ var timeToCall = Math.max( 0, 16 - ( currTime - lastTime ) );
978
+ var id = setTimeout( callback, timeToCall );
979
+ lastTime = currTime + timeToCall;
980
+ return id;
981
+ };
982
+ }
983
+
984
+ // -------------------------- animate -------------------------- //
985
+
986
+ var proto = {};
987
+
988
+ proto.startAnimation = function() {
989
+ if ( this.isAnimating ) {
990
+ return;
991
+ }
992
+
993
+ this.isAnimating = true;
994
+ this.restingFrames = 0;
995
+ this.animate();
996
+ };
997
+
998
+ proto.animate = function() {
999
+ this.applyDragForce();
1000
+ this.applySelectedAttraction();
1001
+
1002
+ var previousX = this.x;
1003
+
1004
+ this.integratePhysics();
1005
+ this.positionSlider();
1006
+ this.settle( previousX );
1007
+ // animate next frame
1008
+ if ( this.isAnimating ) {
1009
+ var _this = this;
1010
+ requestAnimationFrame( function animateFrame() {
1011
+ _this.animate();
1012
+ });
1013
+ }
1014
+ };
1015
+
1016
+
1017
+ var transformProperty = ( function () {
1018
+ var style = document.documentElement.style;
1019
+ if ( typeof style.transform == 'string' ) {
1020
+ return 'transform';
1021
+ }
1022
+ return 'WebkitTransform';
1023
+ })();
1024
+
1025
+ proto.positionSlider = function() {
1026
+ var x = this.x;
1027
+ // wrap position around
1028
+ if ( this.options.wrapAround && this.cells.length > 1 ) {
1029
+ x = utils.modulo( x, this.slideableWidth );
1030
+ x = x - this.slideableWidth;
1031
+ this.shiftWrapCells( x );
1032
+ }
1033
+
1034
+ x = x + this.cursorPosition;
1035
+ // reverse if right-to-left and using transform
1036
+ x = this.options.rightToLeft && transformProperty ? -x : x;
1037
+ var value = this.getPositionValue( x );
1038
+ // use 3D tranforms for hardware acceleration on iOS
1039
+ // but use 2D when settled, for better font-rendering
1040
+ this.slider.style[ transformProperty ] = this.isAnimating ?
1041
+ 'translate3d(' + value + ',0,0)' : 'translateX(' + value + ')';
1042
+
1043
+ // scroll event
1044
+ var firstSlide = this.slides[0];
1045
+ if ( firstSlide ) {
1046
+ var positionX = -this.x - firstSlide.target;
1047
+ var progress = positionX / this.slidesWidth;
1048
+ this.dispatchEvent( 'scroll', null, [ progress, positionX ] );
1049
+ }
1050
+ };
1051
+
1052
+ proto.positionSliderAtSelected = function() {
1053
+ if ( !this.cells.length ) {
1054
+ return;
1055
+ }
1056
+ this.x = -this.selectedSlide.target;
1057
+ this.positionSlider();
1058
+ };
1059
+
1060
+ proto.getPositionValue = function( position ) {
1061
+ if ( this.options.percentPosition ) {
1062
+ // percent position, round to 2 digits, like 12.34%
1063
+ return ( Math.round( ( position / this.size.innerWidth ) * 10000 ) * 0.01 )+ '%';
1064
+ } else {
1065
+ // pixel positioning
1066
+ return Math.round( position ) + 'px';
1067
+ }
1068
+ };
1069
+
1070
+ proto.settle = function( previousX ) {
1071
+ // keep track of frames where x hasn't moved
1072
+ if ( !this.isPointerDown && Math.round( this.x * 100 ) == Math.round( previousX * 100 ) ) {
1073
+ this.restingFrames++;
1074
+ }
1075
+ // stop animating if resting for 3 or more frames
1076
+ if ( this.restingFrames > 2 ) {
1077
+ this.isAnimating = false;
1078
+ delete this.isFreeScrolling;
1079
+ // render position with translateX when settled
1080
+ this.positionSlider();
1081
+ this.dispatchEvent('settle');
1082
+ }
1083
+ };
1084
+
1085
+ proto.shiftWrapCells = function( x ) {
1086
+ // shift before cells
1087
+ var beforeGap = this.cursorPosition + x;
1088
+ this._shiftCells( this.beforeShiftCells, beforeGap, -1 );
1089
+ // shift after cells
1090
+ var afterGap = this.size.innerWidth - ( x + this.slideableWidth + this.cursorPosition );
1091
+ this._shiftCells( this.afterShiftCells, afterGap, 1 );
1092
+ };
1093
+
1094
+ proto._shiftCells = function( cells, gap, shift ) {
1095
+ for ( var i=0; i < cells.length; i++ ) {
1096
+ var cell = cells[i];
1097
+ var cellShift = gap > 0 ? shift : 0;
1098
+ cell.wrapShift( cellShift );
1099
+ gap -= cell.size.outerWidth;
1100
+ }
1101
+ };
1102
+
1103
+ proto._unshiftCells = function( cells ) {
1104
+ if ( !cells || !cells.length ) {
1105
+ return;
1106
+ }
1107
+ for ( var i=0; i < cells.length; i++ ) {
1108
+ cells[i].wrapShift( 0 );
1109
+ }
1110
+ };
1111
+
1112
+ // -------------------------- physics -------------------------- //
1113
+
1114
+ proto.integratePhysics = function() {
1115
+ this.x += this.velocity;
1116
+ this.velocity *= this.getFrictionFactor();
1117
+ };
1118
+
1119
+ proto.applyForce = function( force ) {
1120
+ this.velocity += force;
1121
+ };
1122
+
1123
+ proto.getFrictionFactor = function() {
1124
+ return 1 - this.options[ this.isFreeScrolling ? 'freeScrollFriction' : 'friction' ];
1125
+ };
1126
+
1127
+ proto.getRestingPosition = function() {
1128
+ // my thanks to Steven Wittens, who simplified this math greatly
1129
+ return this.x + this.velocity / ( 1 - this.getFrictionFactor() );
1130
+ };
1131
+
1132
+ proto.applyDragForce = function() {
1133
+ if ( !this.isPointerDown ) {
1134
+ return;
1135
+ }
1136
+ // change the position to drag position by applying force
1137
+ var dragVelocity = this.dragX - this.x;
1138
+ var dragForce = dragVelocity - this.velocity;
1139
+ this.applyForce( dragForce );
1140
+ };
1141
+
1142
+ proto.applySelectedAttraction = function() {
1143
+ // do not attract if pointer down or no cells
1144
+ if ( this.isPointerDown || this.isFreeScrolling || !this.cells.length ) {
1145
+ return;
1146
+ }
1147
+ var distance = this.selectedSlide.target * -1 - this.x;
1148
+ var force = distance * this.options.selectedAttraction;
1149
+ this.applyForce( force );
1150
+ };
1151
+
1152
+ return proto;
1153
+
1154
+ }));
1155
+
1156
+ // Flickity main
1157
+ ( function( window, factory ) {
1158
+ // universal module definition
1159
+ /* jshint strict: false */
1160
+ if ( typeof define == 'function' && define.amd ) {
1161
+ // AMD
1162
+ define( 'flickity/js/flickity',[
1163
+ 'ev-emitter/ev-emitter',
1164
+ 'get-size/get-size',
1165
+ 'fizzy-ui-utils/utils',
1166
+ './cell',
1167
+ './slide',
1168
+ './animate'
1169
+ ], function( EvEmitter, getSize, utils, Cell, Slide, animatePrototype ) {
1170
+ return factory( window, EvEmitter, getSize, utils, Cell, Slide, animatePrototype );
1171
+ });
1172
+ } else if ( typeof module == 'object' && module.exports ) {
1173
+ // CommonJS
1174
+ module.exports = factory(
1175
+ window,
1176
+ require('ev-emitter'),
1177
+ require('get-size'),
1178
+ require('fizzy-ui-utils'),
1179
+ require('./cell'),
1180
+ require('./slide'),
1181
+ require('./animate')
1182
+ );
1183
+ } else {
1184
+ // browser global
1185
+ var _Flickity = window.Flickity;
1186
+
1187
+ window.Flickity = factory(
1188
+ window,
1189
+ window.EvEmitter,
1190
+ window.getSize,
1191
+ window.fizzyUIUtils,
1192
+ _Flickity.Cell,
1193
+ _Flickity.Slide,
1194
+ _Flickity.animatePrototype
1195
+ );
1196
+ }
1197
+
1198
+ }( window, function factory( window, EvEmitter, getSize,
1199
+ utils, Cell, Slide, animatePrototype ) {
1200
+
1201
+
1202
+
1203
+ // vars
1204
+ var jQuery = window.jQuery;
1205
+ var getComputedStyle = window.getComputedStyle;
1206
+ var console = window.console;
1207
+
1208
+ function moveElements( elems, toElem ) {
1209
+ elems = utils.makeArray( elems );
1210
+ while ( elems.length ) {
1211
+ toElem.appendChild( elems.shift() );
1212
+ }
1213
+ }
1214
+
1215
+ // -------------------------- Flickity -------------------------- //
1216
+
1217
+ // globally unique identifiers
1218
+ var GUID = 0;
1219
+ // internal store of all Flickity intances
1220
+ var instances = {};
1221
+
1222
+ function Flickity( element, options ) {
1223
+ var queryElement = utils.getQueryElement( element );
1224
+ if ( !queryElement ) {
1225
+ if ( console ) {
1226
+ console.error( 'Bad element for Flickity: ' + ( queryElement || element ) );
1227
+ }
1228
+ return;
1229
+ }
1230
+ this.element = queryElement;
1231
+ // do not initialize twice on same element
1232
+ if ( this.element.flickityGUID ) {
1233
+ var instance = instances[ this.element.flickityGUID ];
1234
+ instance.option( options );
1235
+ return instance;
1236
+ }
1237
+
1238
+ // add jQuery
1239
+ if ( jQuery ) {
1240
+ this.$element = jQuery( this.element );
1241
+ }
1242
+ // options
1243
+ this.options = utils.extend( {}, this.constructor.defaults );
1244
+ this.option( options );
1245
+
1246
+ // kick things off
1247
+ this._create();
1248
+ }
1249
+
1250
+ Flickity.defaults = {
1251
+ accessibility: true,
1252
+ // adaptiveHeight: false,
1253
+ cellAlign: 'center',
1254
+ // cellSelector: undefined,
1255
+ // contain: false,
1256
+ freeScrollFriction: 0.075, // friction when free-scrolling
1257
+ friction: 0.28, // friction when selecting
1258
+ namespaceJQueryEvents: true,
1259
+ // initialIndex: 0,
1260
+ percentPosition: true,
1261
+ resize: true,
1262
+ selectedAttraction: 0.025,
1263
+ setGallerySize: true
1264
+ // watchCSS: false,
1265
+ // wrapAround: false
1266
+ };
1267
+
1268
+ // hash of methods triggered on _create()
1269
+ Flickity.createMethods = [];
1270
+
1271
+ var proto = Flickity.prototype;
1272
+ // inherit EventEmitter
1273
+ utils.extend( proto, EvEmitter.prototype );
1274
+
1275
+ proto._create = function() {
1276
+ // add id for Flickity.data
1277
+ var id = this.guid = ++GUID;
1278
+ this.element.flickityGUID = id; // expando
1279
+ instances[ id ] = this; // associate via id
1280
+ // initial properties
1281
+ this.selectedIndex = 0;
1282
+ // how many frames slider has been in same position
1283
+ this.restingFrames = 0;
1284
+ // initial physics properties
1285
+ this.x = 0;
1286
+ this.velocity = 0;
1287
+ this.originSide = this.options.rightToLeft ? 'right' : 'left';
1288
+ // create viewport & slider
1289
+ this.viewport = document.createElement('div');
1290
+ this.viewport.className = 'flickity-viewport';
1291
+ this._createSlider();
1292
+
1293
+ if ( this.options.resize || this.options.watchCSS ) {
1294
+ window.addEventListener( 'resize', this );
1295
+ }
1296
+
1297
+ Flickity.createMethods.forEach( function( method ) {
1298
+ this[ method ]();
1299
+ }, this );
1300
+
1301
+ if ( this.options.watchCSS ) {
1302
+ this.watchCSS();
1303
+ } else {
1304
+ this.activate();
1305
+ }
1306
+
1307
+ };
1308
+
1309
+ /**
1310
+ * set options
1311
+ * @param {Object} opts
1312
+ */
1313
+ proto.option = function( opts ) {
1314
+ utils.extend( this.options, opts );
1315
+ };
1316
+
1317
+ proto.activate = function() {
1318
+ if ( this.isActive ) {
1319
+ return;
1320
+ }
1321
+ this.isActive = true;
1322
+ this.element.classList.add('flickity-enabled');
1323
+ if ( this.options.rightToLeft ) {
1324
+ this.element.classList.add('flickity-rtl');
1325
+ }
1326
+
1327
+ this.getSize();
1328
+ // move initial cell elements so they can be loaded as cells
1329
+ var cellElems = this._filterFindCellElements( this.element.children );
1330
+ moveElements( cellElems, this.slider );
1331
+ this.viewport.appendChild( this.slider );
1332
+ this.element.appendChild( this.viewport );
1333
+ // get cells from children
1334
+ this.reloadCells();
1335
+
1336
+ if ( this.options.accessibility ) {
1337
+ // allow element to focusable
1338
+ this.element.tabIndex = 0;
1339
+ // listen for key presses
1340
+ this.element.addEventListener( 'keydown', this );
1341
+ }
1342
+
1343
+ this.emitEvent('activate');
1344
+
1345
+ var index;
1346
+ var initialIndex = this.options.initialIndex;
1347
+ if ( this.isInitActivated ) {
1348
+ index = this.selectedIndex;
1349
+ } else if ( initialIndex !== undefined ) {
1350
+ index = this.cells[ initialIndex ] ? initialIndex : 0;
1351
+ } else {
1352
+ index = 0;
1353
+ }
1354
+ // select instantly
1355
+ this.select( index, false, true );
1356
+ // flag for initial activation, for using initialIndex
1357
+ this.isInitActivated = true;
1358
+ };
1359
+
1360
+ // slider positions the cells
1361
+ proto._createSlider = function() {
1362
+ // slider element does all the positioning
1363
+ var slider = document.createElement('div');
1364
+ slider.className = 'flickity-slider';
1365
+ slider.style[ this.originSide ] = 0;
1366
+ this.slider = slider;
1367
+ };
1368
+
1369
+ proto._filterFindCellElements = function( elems ) {
1370
+ return utils.filterFindElements( elems, this.options.cellSelector );
1371
+ };
1372
+
1373
+ // goes through all children
1374
+ proto.reloadCells = function() {
1375
+ // collection of item elements
1376
+ this.cells = this._makeCells( this.slider.children );
1377
+ this.positionCells();
1378
+ this._getWrapShiftCells();
1379
+ this.setGallerySize();
1380
+ };
1381
+
1382
+ /**
1383
+ * turn elements into Flickity.Cells
1384
+ * @param {Array or NodeList or HTMLElement} elems
1385
+ * @returns {Array} items - collection of new Flickity Cells
1386
+ */
1387
+ proto._makeCells = function( elems ) {
1388
+ var cellElems = this._filterFindCellElements( elems );
1389
+
1390
+ // create new Flickity for collection
1391
+ var cells = cellElems.map( function( cellElem ) {
1392
+ return new Cell( cellElem, this );
1393
+ }, this );
1394
+
1395
+ return cells;
1396
+ };
1397
+
1398
+ proto.getLastCell = function() {
1399
+ return this.cells[ this.cells.length - 1 ];
1400
+ };
1401
+
1402
+ proto.getLastSlide = function() {
1403
+ return this.slides[ this.slides.length - 1 ];
1404
+ };
1405
+
1406
+ // positions all cells
1407
+ proto.positionCells = function() {
1408
+ // size all cells
1409
+ this._sizeCells( this.cells );
1410
+ // position all cells
1411
+ this._positionCells( 0 );
1412
+ };
1413
+
1414
+ /**
1415
+ * position certain cells
1416
+ * @param {Integer} index - which cell to start with
1417
+ */
1418
+ proto._positionCells = function( index ) {
1419
+ index = index || 0;
1420
+ // also measure maxCellHeight
1421
+ // start 0 if positioning all cells
1422
+ this.maxCellHeight = index ? this.maxCellHeight || 0 : 0;
1423
+ var cellX = 0;
1424
+ // get cellX
1425
+ if ( index > 0 ) {
1426
+ var startCell = this.cells[ index - 1 ];
1427
+ cellX = startCell.x + startCell.size.outerWidth;
1428
+ }
1429
+ var len = this.cells.length;
1430
+ for ( var i=index; i < len; i++ ) {
1431
+ var cell = this.cells[i];
1432
+ cell.setPosition( cellX );
1433
+ cellX += cell.size.outerWidth;
1434
+ this.maxCellHeight = Math.max( cell.size.outerHeight, this.maxCellHeight );
1435
+ }
1436
+ // keep track of cellX for wrap-around
1437
+ this.slideableWidth = cellX;
1438
+ // slides
1439
+ this.updateSlides();
1440
+ // contain slides target
1441
+ this._containSlides();
1442
+ // update slidesWidth
1443
+ this.slidesWidth = len ? this.getLastSlide().target - this.slides[0].target : 0;
1444
+ };
1445
+
1446
+ /**
1447
+ * cell.getSize() on multiple cells
1448
+ * @param {Array} cells
1449
+ */
1450
+ proto._sizeCells = function( cells ) {
1451
+ cells.forEach( function( cell ) {
1452
+ cell.getSize();
1453
+ });
1454
+ };
1455
+
1456
+ // -------------------------- -------------------------- //
1457
+
1458
+ proto.updateSlides = function() {
1459
+ this.slides = [];
1460
+ if ( !this.cells.length ) {
1461
+ return;
1462
+ }
1463
+
1464
+ var slide = new Slide( this );
1465
+ this.slides.push( slide );
1466
+ var isOriginLeft = this.originSide == 'left';
1467
+ var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft';
1468
+
1469
+ var canCellFit = this._getCanCellFit();
1470
+
1471
+ this.cells.forEach( function( cell, i ) {
1472
+ // just add cell if first cell in slide
1473
+ if ( !slide.cells.length ) {
1474
+ slide.addCell( cell );
1475
+ return;
1476
+ }
1477
+
1478
+ var slideWidth = ( slide.outerWidth - slide.firstMargin ) +
1479
+ ( cell.size.outerWidth - cell.size[ nextMargin ] );
1480
+
1481
+ if ( canCellFit.call( this, i, slideWidth ) ) {
1482
+ slide.addCell( cell );
1483
+ } else {
1484
+ // doesn't fit, new slide
1485
+ slide.updateTarget();
1486
+
1487
+ slide = new Slide( this );
1488
+ this.slides.push( slide );
1489
+ slide.addCell( cell );
1490
+ }
1491
+ }, this );
1492
+ // last slide
1493
+ slide.updateTarget();
1494
+ // update .selectedSlide
1495
+ this.updateSelectedSlide();
1496
+ };
1497
+
1498
+ proto._getCanCellFit = function() {
1499
+ var groupCells = this.options.groupCells;
1500
+ if ( !groupCells ) {
1501
+ return function() {
1502
+ return false;
1503
+ };
1504
+ } else if ( typeof groupCells == 'number' ) {
1505
+ // group by number. 3 -> [0,1,2], [3,4,5], ...
1506
+ var number = parseInt( groupCells, 10 );
1507
+ return function( i ) {
1508
+ return ( i % number ) !== 0;
1509
+ };
1510
+ }
1511
+ // default, group by width of slide
1512
+ // parse '75%
1513
+ var percentMatch = typeof groupCells == 'string' &&
1514
+ groupCells.match(/^(\d+)%$/);
1515
+ var percent = percentMatch ? parseInt( percentMatch[1], 10 ) / 100 : 1;
1516
+ return function( i, slideWidth ) {
1517
+ return slideWidth <= ( this.size.innerWidth + 1 ) * percent;
1518
+ };
1519
+ };
1520
+
1521
+ // alias _init for jQuery plugin .flickity()
1522
+ proto._init =
1523
+ proto.reposition = function() {
1524
+ this.positionCells();
1525
+ this.positionSliderAtSelected();
1526
+ };
1527
+
1528
+ proto.getSize = function() {
1529
+ this.size = getSize( this.element );
1530
+ this.setCellAlign();
1531
+ this.cursorPosition = this.size.innerWidth * this.cellAlign;
1532
+ };
1533
+
1534
+ var cellAlignShorthands = {
1535
+ // cell align, then based on origin side
1536
+ center: {
1537
+ left: 0.5,
1538
+ right: 0.5
1539
+ },
1540
+ left: {
1541
+ left: 0,
1542
+ right: 1
1543
+ },
1544
+ right: {
1545
+ right: 0,
1546
+ left: 1
1547
+ }
1548
+ };
1549
+
1550
+ proto.setCellAlign = function() {
1551
+ var shorthand = cellAlignShorthands[ this.options.cellAlign ];
1552
+ this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign;
1553
+ };
1554
+
1555
+ proto.setGallerySize = function() {
1556
+ if ( this.options.setGallerySize ) {
1557
+ var height = this.options.adaptiveHeight && this.selectedSlide ?
1558
+ this.selectedSlide.height : this.maxCellHeight;
1559
+ this.viewport.style.height = height + 'px';
1560
+ }
1561
+ };
1562
+
1563
+ proto._getWrapShiftCells = function() {
1564
+ // only for wrap-around
1565
+ if ( !this.options.wrapAround ) {
1566
+ return;
1567
+ }
1568
+ // unshift previous cells
1569
+ this._unshiftCells( this.beforeShiftCells );
1570
+ this._unshiftCells( this.afterShiftCells );
1571
+ // get before cells
1572
+ // initial gap
1573
+ var gapX = this.cursorPosition;
1574
+ var cellIndex = this.cells.length - 1;
1575
+ this.beforeShiftCells = this._getGapCells( gapX, cellIndex, -1 );
1576
+ // get after cells
1577
+ // ending gap between last cell and end of gallery viewport
1578
+ gapX = this.size.innerWidth - this.cursorPosition;
1579
+ // start cloning at first cell, working forwards
1580
+ this.afterShiftCells = this._getGapCells( gapX, 0, 1 );
1581
+ };
1582
+
1583
+ proto._getGapCells = function( gapX, cellIndex, increment ) {
1584
+ // keep adding cells until the cover the initial gap
1585
+ var cells = [];
1586
+ while ( gapX > 0 ) {
1587
+ var cell = this.cells[ cellIndex ];
1588
+ if ( !cell ) {
1589
+ break;
1590
+ }
1591
+ cells.push( cell );
1592
+ cellIndex += increment;
1593
+ gapX -= cell.size.outerWidth;
1594
+ }
1595
+ return cells;
1596
+ };
1597
+
1598
+ // ----- contain ----- //
1599
+
1600
+ // contain cell targets so no excess sliding
1601
+ proto._containSlides = function() {
1602
+ if ( !this.options.contain || this.options.wrapAround || !this.cells.length ) {
1603
+ return;
1604
+ }
1605
+ var isRightToLeft = this.options.rightToLeft;
1606
+ var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft';
1607
+ var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight';
1608
+ var contentWidth = this.slideableWidth - this.getLastCell().size[ endMargin ];
1609
+ // content is less than gallery size
1610
+ var isContentSmaller = contentWidth < this.size.innerWidth;
1611
+ // bounds
1612
+ var beginBound = this.cursorPosition + this.cells[0].size[ beginMargin ];
1613
+ var endBound = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign );
1614
+ // contain each cell target
1615
+ this.slides.forEach( function( slide ) {
1616
+ if ( isContentSmaller ) {
1617
+ // all cells fit inside gallery
1618
+ slide.target = contentWidth * this.cellAlign;
1619
+ } else {
1620
+ // contain to bounds
1621
+ slide.target = Math.max( slide.target, beginBound );
1622
+ slide.target = Math.min( slide.target, endBound );
1623
+ }
1624
+ }, this );
1625
+ };
1626
+
1627
+ // ----- ----- //
1628
+
1629
+ /**
1630
+ * emits events via eventEmitter and jQuery events
1631
+ * @param {String} type - name of event
1632
+ * @param {Event} event - original event
1633
+ * @param {Array} args - extra arguments
1634
+ */
1635
+ proto.dispatchEvent = function( type, event, args ) {
1636
+ var emitArgs = event ? [ event ].concat( args ) : args;
1637
+ this.emitEvent( type, emitArgs );
1638
+
1639
+ if ( jQuery && this.$element ) {
1640
+ // default trigger with type if no event
1641
+ type += this.options.namespaceJQueryEvents ? '.flickity' : '';
1642
+ var $event = type;
1643
+ if ( event ) {
1644
+ // create jQuery event
1645
+ var jQEvent = jQuery.Event( event );
1646
+ jQEvent.type = type;
1647
+ $event = jQEvent;
1648
+ }
1649
+ this.$element.trigger( $event, args );
1650
+ }
1651
+ };
1652
+
1653
+ // -------------------------- select -------------------------- //
1654
+
1655
+ /**
1656
+ * @param {Integer} index - index of the slide
1657
+ * @param {Boolean} isWrap - will wrap-around to last/first if at the end
1658
+ * @param {Boolean} isInstant - will immediately set position at selected cell
1659
+ */
1660
+ proto.select = function( index, isWrap, isInstant ) {
1661
+ if ( !this.isActive ) {
1662
+ return;
1663
+ }
1664
+ index = parseInt( index, 10 );
1665
+ this._wrapSelect( index );
1666
+
1667
+ if ( this.options.wrapAround || isWrap ) {
1668
+ index = utils.modulo( index, this.slides.length );
1669
+ }
1670
+ // bail if invalid index
1671
+ if ( !this.slides[ index ] ) {
1672
+ return;
1673
+ }
1674
+ this.selectedIndex = index;
1675
+ this.updateSelectedSlide();
1676
+ if ( isInstant ) {
1677
+ this.positionSliderAtSelected();
1678
+ } else {
1679
+ this.startAnimation();
1680
+ }
1681
+ if ( this.options.adaptiveHeight ) {
1682
+ this.setGallerySize();
1683
+ }
1684
+
1685
+ this.dispatchEvent('select');
1686
+ // old v1 event name, remove in v3
1687
+ this.dispatchEvent('cellSelect');
1688
+ };
1689
+
1690
+ // wraps position for wrapAround, to move to closest slide. #113
1691
+ proto._wrapSelect = function( index ) {
1692
+ var len = this.slides.length;
1693
+ var isWrapping = this.options.wrapAround && len > 1;
1694
+ if ( !isWrapping ) {
1695
+ return index;
1696
+ }
1697
+ var wrapIndex = utils.modulo( index, len );
1698
+ // go to shortest
1699
+ var delta = Math.abs( wrapIndex - this.selectedIndex );
1700
+ var backWrapDelta = Math.abs( ( wrapIndex + len ) - this.selectedIndex );
1701
+ var forewardWrapDelta = Math.abs( ( wrapIndex - len ) - this.selectedIndex );
1702
+ if ( !this.isDragSelect && backWrapDelta < delta ) {
1703
+ index += len;
1704
+ } else if ( !this.isDragSelect && forewardWrapDelta < delta ) {
1705
+ index -= len;
1706
+ }
1707
+ // wrap position so slider is within normal area
1708
+ if ( index < 0 ) {
1709
+ this.x -= this.slideableWidth;
1710
+ } else if ( index >= len ) {
1711
+ this.x += this.slideableWidth;
1712
+ }
1713
+ };
1714
+
1715
+ proto.previous = function( isWrap, isInstant ) {
1716
+ this.select( this.selectedIndex - 1, isWrap, isInstant );
1717
+ };
1718
+
1719
+ proto.next = function( isWrap, isInstant ) {
1720
+ this.select( this.selectedIndex + 1, isWrap, isInstant );
1721
+ };
1722
+
1723
+ proto.updateSelectedSlide = function() {
1724
+ var slide = this.slides[ this.selectedIndex ];
1725
+ // selectedIndex could be outside of slides, if triggered before resize()
1726
+ if ( !slide ) {
1727
+ return;
1728
+ }
1729
+ // unselect previous selected slide
1730
+ this.unselectSelectedSlide();
1731
+ // update new selected slide
1732
+ this.selectedSlide = slide;
1733
+ slide.select();
1734
+ this.selectedCells = slide.cells;
1735
+ this.selectedElements = slide.getCellElements();
1736
+ // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility
1737
+ // Remove in v3?
1738
+ this.selectedCell = slide.cells[0];
1739
+ this.selectedElement = this.selectedElements[0];
1740
+ };
1741
+
1742
+ proto.unselectSelectedSlide = function() {
1743
+ if ( this.selectedSlide ) {
1744
+ this.selectedSlide.unselect();
1745
+ }
1746
+ };
1747
+
1748
+ /**
1749
+ * select slide from number or cell element
1750
+ * @param {Element or Number} elem
1751
+ */
1752
+ proto.selectCell = function( value, isWrap, isInstant ) {
1753
+ // get cell
1754
+ var cell;
1755
+ if ( typeof value == 'number' ) {
1756
+ cell = this.cells[ value ];
1757
+ } else {
1758
+ // use string as selector
1759
+ if ( typeof value == 'string' ) {
1760
+ value = this.element.querySelector( value );
1761
+ }
1762
+ // get cell from element
1763
+ cell = this.getCell( value );
1764
+ }
1765
+ // select slide that has cell
1766
+ for ( var i=0; cell && i < this.slides.length; i++ ) {
1767
+ var slide = this.slides[i];
1768
+ var index = slide.cells.indexOf( cell );
1769
+ if ( index != -1 ) {
1770
+ this.select( i, isWrap, isInstant );
1771
+ return;
1772
+ }
1773
+ }
1774
+ };
1775
+
1776
+ // -------------------------- get cells -------------------------- //
1777
+
1778
+ /**
1779
+ * get Flickity.Cell, given an Element
1780
+ * @param {Element} elem
1781
+ * @returns {Flickity.Cell} item
1782
+ */
1783
+ proto.getCell = function( elem ) {
1784
+ // loop through cells to get the one that matches
1785
+ for ( var i=0; i < this.cells.length; i++ ) {
1786
+ var cell = this.cells[i];
1787
+ if ( cell.element == elem ) {
1788
+ return cell;
1789
+ }
1790
+ }
1791
+ };
1792
+
1793
+ /**
1794
+ * get collection of Flickity.Cells, given Elements
1795
+ * @param {Element, Array, NodeList} elems
1796
+ * @returns {Array} cells - Flickity.Cells
1797
+ */
1798
+ proto.getCells = function( elems ) {
1799
+ elems = utils.makeArray( elems );
1800
+ var cells = [];
1801
+ elems.forEach( function( elem ) {
1802
+ var cell = this.getCell( elem );
1803
+ if ( cell ) {
1804
+ cells.push( cell );
1805
+ }
1806
+ }, this );
1807
+ return cells;
1808
+ };
1809
+
1810
+ /**
1811
+ * get cell elements
1812
+ * @returns {Array} cellElems
1813
+ */
1814
+ proto.getCellElements = function() {
1815
+ return this.cells.map( function( cell ) {
1816
+ return cell.element;
1817
+ });
1818
+ };
1819
+
1820
+ /**
1821
+ * get parent cell from an element
1822
+ * @param {Element} elem
1823
+ * @returns {Flickit.Cell} cell
1824
+ */
1825
+ proto.getParentCell = function( elem ) {
1826
+ // first check if elem is cell
1827
+ var cell = this.getCell( elem );
1828
+ if ( cell ) {
1829
+ return cell;
1830
+ }
1831
+ // try to get parent cell elem
1832
+ elem = utils.getParent( elem, '.flickity-slider > *' );
1833
+ return this.getCell( elem );
1834
+ };
1835
+
1836
+ /**
1837
+ * get cells adjacent to a slide
1838
+ * @param {Integer} adjCount - number of adjacent slides
1839
+ * @param {Integer} index - index of slide to start
1840
+ * @returns {Array} cells - array of Flickity.Cells
1841
+ */
1842
+ proto.getAdjacentCellElements = function( adjCount, index ) {
1843
+ if ( !adjCount ) {
1844
+ return this.selectedSlide.getCellElements();
1845
+ }
1846
+ index = index === undefined ? this.selectedIndex : index;
1847
+
1848
+ var len = this.slides.length;
1849
+ if ( 1 + ( adjCount * 2 ) >= len ) {
1850
+ return this.getCellElements();
1851
+ }
1852
+
1853
+ var cellElems = [];
1854
+ for ( var i = index - adjCount; i <= index + adjCount ; i++ ) {
1855
+ var slideIndex = this.options.wrapAround ? utils.modulo( i, len ) : i;
1856
+ var slide = this.slides[ slideIndex ];
1857
+ if ( slide ) {
1858
+ cellElems = cellElems.concat( slide.getCellElements() );
1859
+ }
1860
+ }
1861
+ return cellElems;
1862
+ };
1863
+
1864
+ // -------------------------- events -------------------------- //
1865
+
1866
+ proto.uiChange = function() {
1867
+ this.emitEvent('uiChange');
1868
+ };
1869
+
1870
+ proto.childUIPointerDown = function( event ) {
1871
+ this.emitEvent( 'childUIPointerDown', [ event ] );
1872
+ };
1873
+
1874
+ // ----- resize ----- //
1875
+
1876
+ proto.onresize = function() {
1877
+ this.watchCSS();
1878
+ this.resize();
1879
+ };
1880
+
1881
+ utils.debounceMethod( Flickity, 'onresize', 150 );
1882
+
1883
+ proto.resize = function() {
1884
+ if ( !this.isActive ) {
1885
+ return;
1886
+ }
1887
+ this.getSize();
1888
+ // wrap values
1889
+ if ( this.options.wrapAround ) {
1890
+ this.x = utils.modulo( this.x, this.slideableWidth );
1891
+ }
1892
+ this.positionCells();
1893
+ this._getWrapShiftCells();
1894
+ this.setGallerySize();
1895
+ this.emitEvent('resize');
1896
+ // update selected index for group slides, instant
1897
+ // TODO: position can be lost between groups of various numbers
1898
+ var selectedElement = this.selectedElements && this.selectedElements[0];
1899
+ this.selectCell( selectedElement, false, true );
1900
+ };
1901
+
1902
+ // watches the :after property, activates/deactivates
1903
+ proto.watchCSS = function() {
1904
+ var watchOption = this.options.watchCSS;
1905
+ if ( !watchOption ) {
1906
+ return;
1907
+ }
1908
+
1909
+ var afterContent = getComputedStyle( this.element, ':after' ).content;
1910
+ // activate if :after { content: 'flickity' }
1911
+ if ( afterContent.indexOf('flickity') != -1 ) {
1912
+ this.activate();
1913
+ } else {
1914
+ this.deactivate();
1915
+ }
1916
+ };
1917
+
1918
+ // ----- keydown ----- //
1919
+
1920
+ // go previous/next if left/right keys pressed
1921
+ proto.onkeydown = function( event ) {
1922
+ // only work if element is in focus
1923
+ if ( !this.options.accessibility ||
1924
+ ( document.activeElement && document.activeElement != this.element ) ) {
1925
+ return;
1926
+ }
1927
+
1928
+ if ( event.keyCode == 37 ) {
1929
+ // go left
1930
+ var leftMethod = this.options.rightToLeft ? 'next' : 'previous';
1931
+ this.uiChange();
1932
+ this[ leftMethod ]();
1933
+ } else if ( event.keyCode == 39 ) {
1934
+ // go right
1935
+ var rightMethod = this.options.rightToLeft ? 'previous' : 'next';
1936
+ this.uiChange();
1937
+ this[ rightMethod ]();
1938
+ }
1939
+ };
1940
+
1941
+ // -------------------------- destroy -------------------------- //
1942
+
1943
+ // deactivate all Flickity functionality, but keep stuff available
1944
+ proto.deactivate = function() {
1945
+ if ( !this.isActive ) {
1946
+ return;
1947
+ }
1948
+ this.element.classList.remove('flickity-enabled');
1949
+ this.element.classList.remove('flickity-rtl');
1950
+ // destroy cells
1951
+ this.cells.forEach( function( cell ) {
1952
+ cell.destroy();
1953
+ });
1954
+ this.unselectSelectedSlide();
1955
+ this.element.removeChild( this.viewport );
1956
+ // move child elements back into element
1957
+ moveElements( this.slider.children, this.element );
1958
+ if ( this.options.accessibility ) {
1959
+ this.element.removeAttribute('tabIndex');
1960
+ this.element.removeEventListener( 'keydown', this );
1961
+ }
1962
+ // set flags
1963
+ this.isActive = false;
1964
+ this.emitEvent('deactivate');
1965
+ };
1966
+
1967
+ proto.destroy = function() {
1968
+ this.deactivate();
1969
+ window.removeEventListener( 'resize', this );
1970
+ this.emitEvent('destroy');
1971
+ if ( jQuery && this.$element ) {
1972
+ jQuery.removeData( this.element, 'flickity' );
1973
+ }
1974
+ delete this.element.flickityGUID;
1975
+ delete instances[ this.guid ];
1976
+ };
1977
+
1978
+ // -------------------------- prototype -------------------------- //
1979
+
1980
+ utils.extend( proto, animatePrototype );
1981
+
1982
+ // -------------------------- extras -------------------------- //
1983
+
1984
+ /**
1985
+ * get Flickity instance from element
1986
+ * @param {Element} elem
1987
+ * @returns {Flickity}
1988
+ */
1989
+ Flickity.data = function( elem ) {
1990
+ elem = utils.getQueryElement( elem );
1991
+ var id = elem && elem.flickityGUID;
1992
+ return id && instances[ id ];
1993
+ };
1994
+
1995
+ utils.htmlInit( Flickity, 'flickity' );
1996
+
1997
+ if ( jQuery && jQuery.bridget ) {
1998
+ jQuery.bridget( 'flickity', Flickity );
1999
+ }
2000
+
2001
+ Flickity.Cell = Cell;
2002
+
2003
+ return Flickity;
2004
+
2005
+ }));
2006
+
2007
+ /*!
2008
+ * Unipointer v2.1.0
2009
+ * base class for doing one thing with pointer event
2010
+ * MIT license
2011
+ */
2012
+
2013
+ /*jshint browser: true, undef: true, unused: true, strict: true */
2014
+
2015
+ ( function( window, factory ) {
2016
+ // universal module definition
2017
+ /* jshint strict: false */ /*global define, module, require */
2018
+ if ( typeof define == 'function' && define.amd ) {
2019
+ // AMD
2020
+ define( 'unipointer/unipointer',[
2021
+ 'ev-emitter/ev-emitter'
2022
+ ], function( EvEmitter ) {
2023
+ return factory( window, EvEmitter );
2024
+ });
2025
+ } else if ( typeof module == 'object' && module.exports ) {
2026
+ // CommonJS
2027
+ module.exports = factory(
2028
+ window,
2029
+ require('ev-emitter')
2030
+ );
2031
+ } else {
2032
+ // browser global
2033
+ window.Unipointer = factory(
2034
+ window,
2035
+ window.EvEmitter
2036
+ );
2037
+ }
2038
+
2039
+ }( window, function factory( window, EvEmitter ) {
2040
+
2041
+
2042
+
2043
+ function noop() {}
2044
+
2045
+ function Unipointer() {}
2046
+
2047
+ // inherit EvEmitter
2048
+ var proto = Unipointer.prototype = Object.create( EvEmitter.prototype );
2049
+
2050
+ proto.bindStartEvent = function( elem ) {
2051
+ this._bindStartEvent( elem, true );
2052
+ };
2053
+
2054
+ proto.unbindStartEvent = function( elem ) {
2055
+ this._bindStartEvent( elem, false );
2056
+ };
2057
+
2058
+ /**
2059
+ * works as unbinder, as you can ._bindStart( false ) to unbind
2060
+ * @param {Boolean} isBind - will unbind if falsey
2061
+ */
2062
+ proto._bindStartEvent = function( elem, isBind ) {
2063
+ // munge isBind, default to true
2064
+ isBind = isBind === undefined ? true : !!isBind;
2065
+ var bindMethod = isBind ? 'addEventListener' : 'removeEventListener';
2066
+
2067
+ if ( window.navigator.pointerEnabled ) {
2068
+ // W3C Pointer Events, IE11. See https://coderwall.com/p/mfreca
2069
+ elem[ bindMethod ]( 'pointerdown', this );
2070
+ } else if ( window.navigator.msPointerEnabled ) {
2071
+ // IE10 Pointer Events
2072
+ elem[ bindMethod ]( 'MSPointerDown', this );
2073
+ } else {
2074
+ // listen for both, for devices like Chrome Pixel
2075
+ elem[ bindMethod ]( 'mousedown', this );
2076
+ elem[ bindMethod ]( 'touchstart', this );
2077
+ }
2078
+ };
2079
+
2080
+ // trigger handler methods for events
2081
+ proto.handleEvent = function( event ) {
2082
+ var method = 'on' + event.type;
2083
+ if ( this[ method ] ) {
2084
+ this[ method ]( event );
2085
+ }
2086
+ };
2087
+
2088
+ // returns the touch that we're keeping track of
2089
+ proto.getTouch = function( touches ) {
2090
+ for ( var i=0; i < touches.length; i++ ) {
2091
+ var touch = touches[i];
2092
+ if ( touch.identifier == this.pointerIdentifier ) {
2093
+ return touch;
2094
+ }
2095
+ }
2096
+ };
2097
+
2098
+ // ----- start event ----- //
2099
+
2100
+ proto.onmousedown = function( event ) {
2101
+ // dismiss clicks from right or middle buttons
2102
+ var button = event.button;
2103
+ if ( button && ( button !== 0 && button !== 1 ) ) {
2104
+ return;
2105
+ }
2106
+ this._pointerDown( event, event );
2107
+ };
2108
+
2109
+ proto.ontouchstart = function( event ) {
2110
+ this._pointerDown( event, event.changedTouches[0] );
2111
+ };
2112
+
2113
+ proto.onMSPointerDown =
2114
+ proto.onpointerdown = function( event ) {
2115
+ this._pointerDown( event, event );
2116
+ };
2117
+
2118
+ /**
2119
+ * pointer start
2120
+ * @param {Event} event
2121
+ * @param {Event or Touch} pointer
2122
+ */
2123
+ proto._pointerDown = function( event, pointer ) {
2124
+ // dismiss other pointers
2125
+ if ( this.isPointerDown ) {
2126
+ return;
2127
+ }
2128
+
2129
+ this.isPointerDown = true;
2130
+ // save pointer identifier to match up touch events
2131
+ this.pointerIdentifier = pointer.pointerId !== undefined ?
2132
+ // pointerId for pointer events, touch.indentifier for touch events
2133
+ pointer.pointerId : pointer.identifier;
2134
+
2135
+ this.pointerDown( event, pointer );
2136
+ };
2137
+
2138
+ proto.pointerDown = function( event, pointer ) {
2139
+ this._bindPostStartEvents( event );
2140
+ this.emitEvent( 'pointerDown', [ event, pointer ] );
2141
+ };
2142
+
2143
+ // hash of events to be bound after start event
2144
+ var postStartEvents = {
2145
+ mousedown: [ 'mousemove', 'mouseup' ],
2146
+ touchstart: [ 'touchmove', 'touchend', 'touchcancel' ],
2147
+ pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ],
2148
+ MSPointerDown: [ 'MSPointerMove', 'MSPointerUp', 'MSPointerCancel' ]
2149
+ };
2150
+
2151
+ proto._bindPostStartEvents = function( event ) {
2152
+ if ( !event ) {
2153
+ return;
2154
+ }
2155
+ // get proper events to match start event
2156
+ var events = postStartEvents[ event.type ];
2157
+ // bind events to node
2158
+ events.forEach( function( eventName ) {
2159
+ window.addEventListener( eventName, this );
2160
+ }, this );
2161
+ // save these arguments
2162
+ this._boundPointerEvents = events;
2163
+ };
2164
+
2165
+ proto._unbindPostStartEvents = function() {
2166
+ // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug)
2167
+ if ( !this._boundPointerEvents ) {
2168
+ return;
2169
+ }
2170
+ this._boundPointerEvents.forEach( function( eventName ) {
2171
+ window.removeEventListener( eventName, this );
2172
+ }, this );
2173
+
2174
+ delete this._boundPointerEvents;
2175
+ };
2176
+
2177
+ // ----- move event ----- //
2178
+
2179
+ proto.onmousemove = function( event ) {
2180
+ this._pointerMove( event, event );
2181
+ };
2182
+
2183
+ proto.onMSPointerMove =
2184
+ proto.onpointermove = function( event ) {
2185
+ if ( event.pointerId == this.pointerIdentifier ) {
2186
+ this._pointerMove( event, event );
2187
+ }
2188
+ };
2189
+
2190
+ proto.ontouchmove = function( event ) {
2191
+ var touch = this.getTouch( event.changedTouches );
2192
+ if ( touch ) {
2193
+ this._pointerMove( event, touch );
2194
+ }
2195
+ };
2196
+
2197
+ /**
2198
+ * pointer move
2199
+ * @param {Event} event
2200
+ * @param {Event or Touch} pointer
2201
+ * @private
2202
+ */
2203
+ proto._pointerMove = function( event, pointer ) {
2204
+ this.pointerMove( event, pointer );
2205
+ };
2206
+
2207
+ // public
2208
+ proto.pointerMove = function( event, pointer ) {
2209
+ this.emitEvent( 'pointerMove', [ event, pointer ] );
2210
+ };
2211
+
2212
+ // ----- end event ----- //
2213
+
2214
+
2215
+ proto.onmouseup = function( event ) {
2216
+ this._pointerUp( event, event );
2217
+ };
2218
+
2219
+ proto.onMSPointerUp =
2220
+ proto.onpointerup = function( event ) {
2221
+ if ( event.pointerId == this.pointerIdentifier ) {
2222
+ this._pointerUp( event, event );
2223
+ }
2224
+ };
2225
+
2226
+ proto.ontouchend = function( event ) {
2227
+ var touch = this.getTouch( event.changedTouches );
2228
+ if ( touch ) {
2229
+ this._pointerUp( event, touch );
2230
+ }
2231
+ };
2232
+
2233
+ /**
2234
+ * pointer up
2235
+ * @param {Event} event
2236
+ * @param {Event or Touch} pointer
2237
+ * @private
2238
+ */
2239
+ proto._pointerUp = function( event, pointer ) {
2240
+ this._pointerDone();
2241
+ this.pointerUp( event, pointer );
2242
+ };
2243
+
2244
+ // public
2245
+ proto.pointerUp = function( event, pointer ) {
2246
+ this.emitEvent( 'pointerUp', [ event, pointer ] );
2247
+ };
2248
+
2249
+ // ----- pointer done ----- //
2250
+
2251
+ // triggered on pointer up & pointer cancel
2252
+ proto._pointerDone = function() {
2253
+ // reset properties
2254
+ this.isPointerDown = false;
2255
+ delete this.pointerIdentifier;
2256
+ // remove events
2257
+ this._unbindPostStartEvents();
2258
+ this.pointerDone();
2259
+ };
2260
+
2261
+ proto.pointerDone = noop;
2262
+
2263
+ // ----- pointer cancel ----- //
2264
+
2265
+ proto.onMSPointerCancel =
2266
+ proto.onpointercancel = function( event ) {
2267
+ if ( event.pointerId == this.pointerIdentifier ) {
2268
+ this._pointerCancel( event, event );
2269
+ }
2270
+ };
2271
+
2272
+ proto.ontouchcancel = function( event ) {
2273
+ var touch = this.getTouch( event.changedTouches );
2274
+ if ( touch ) {
2275
+ this._pointerCancel( event, touch );
2276
+ }
2277
+ };
2278
+
2279
+ /**
2280
+ * pointer cancel
2281
+ * @param {Event} event
2282
+ * @param {Event or Touch} pointer
2283
+ * @private
2284
+ */
2285
+ proto._pointerCancel = function( event, pointer ) {
2286
+ this._pointerDone();
2287
+ this.pointerCancel( event, pointer );
2288
+ };
2289
+
2290
+ // public
2291
+ proto.pointerCancel = function( event, pointer ) {
2292
+ this.emitEvent( 'pointerCancel', [ event, pointer ] );
2293
+ };
2294
+
2295
+ // ----- ----- //
2296
+
2297
+ // utility function for getting x/y coords from event
2298
+ Unipointer.getPointerPoint = function( pointer ) {
2299
+ return {
2300
+ x: pointer.pageX,
2301
+ y: pointer.pageY
2302
+ };
2303
+ };
2304
+
2305
+ // ----- ----- //
2306
+
2307
+ return Unipointer;
2308
+
2309
+ }));
2310
+
2311
+ /*!
2312
+ * Unidragger v2.1.0
2313
+ * Draggable base class
2314
+ * MIT license
2315
+ */
2316
+
2317
+ /*jshint browser: true, unused: true, undef: true, strict: true */
2318
+
2319
+ ( function( window, factory ) {
2320
+ // universal module definition
2321
+ /*jshint strict: false */ /*globals define, module, require */
2322
+
2323
+ if ( typeof define == 'function' && define.amd ) {
2324
+ // AMD
2325
+ define( 'unidragger/unidragger',[
2326
+ 'unipointer/unipointer'
2327
+ ], function( Unipointer ) {
2328
+ return factory( window, Unipointer );
2329
+ });
2330
+ } else if ( typeof module == 'object' && module.exports ) {
2331
+ // CommonJS
2332
+ module.exports = factory(
2333
+ window,
2334
+ require('unipointer')
2335
+ );
2336
+ } else {
2337
+ // browser global
2338
+ window.Unidragger = factory(
2339
+ window,
2340
+ window.Unipointer
2341
+ );
2342
+ }
2343
+
2344
+ }( window, function factory( window, Unipointer ) {
2345
+
2346
+
2347
+
2348
+ // ----- ----- //
2349
+
2350
+ function noop() {}
2351
+
2352
+ // -------------------------- Unidragger -------------------------- //
2353
+
2354
+ function Unidragger() {}
2355
+
2356
+ // inherit Unipointer & EvEmitter
2357
+ var proto = Unidragger.prototype = Object.create( Unipointer.prototype );
2358
+
2359
+ // ----- bind start ----- //
2360
+
2361
+ proto.bindHandles = function() {
2362
+ this._bindHandles( true );
2363
+ };
2364
+
2365
+ proto.unbindHandles = function() {
2366
+ this._bindHandles( false );
2367
+ };
2368
+
2369
+ var navigator = window.navigator;
2370
+ /**
2371
+ * works as unbinder, as you can .bindHandles( false ) to unbind
2372
+ * @param {Boolean} isBind - will unbind if falsey
2373
+ */
2374
+ proto._bindHandles = function( isBind ) {
2375
+ // munge isBind, default to true
2376
+ isBind = isBind === undefined ? true : !!isBind;
2377
+ // extra bind logic
2378
+ var binderExtra;
2379
+ if ( navigator.pointerEnabled ) {
2380
+ binderExtra = function( handle ) {
2381
+ // disable scrolling on the element
2382
+ handle.style.touchAction = isBind ? 'none' : '';
2383
+ };
2384
+ } else if ( navigator.msPointerEnabled ) {
2385
+ binderExtra = function( handle ) {
2386
+ // disable scrolling on the element
2387
+ handle.style.msTouchAction = isBind ? 'none' : '';
2388
+ };
2389
+ } else {
2390
+ binderExtra = noop;
2391
+ }
2392
+ // bind each handle
2393
+ var bindMethod = isBind ? 'addEventListener' : 'removeEventListener';
2394
+ for ( var i=0; i < this.handles.length; i++ ) {
2395
+ var handle = this.handles[i];
2396
+ this._bindStartEvent( handle, isBind );
2397
+ binderExtra( handle );
2398
+ handle[ bindMethod ]( 'click', this );
2399
+ }
2400
+ };
2401
+
2402
+ // ----- start event ----- //
2403
+
2404
+ /**
2405
+ * pointer start
2406
+ * @param {Event} event
2407
+ * @param {Event or Touch} pointer
2408
+ */
2409
+ proto.pointerDown = function( event, pointer ) {
2410
+ // dismiss range sliders
2411
+ if ( event.target.nodeName == 'INPUT' && event.target.type == 'range' ) {
2412
+ // reset pointerDown logic
2413
+ this.isPointerDown = false;
2414
+ delete this.pointerIdentifier;
2415
+ return;
2416
+ }
2417
+
2418
+ this._dragPointerDown( event, pointer );
2419
+ // kludge to blur focused inputs in dragger
2420
+ var focused = document.activeElement;
2421
+ if ( focused && focused.blur ) {
2422
+ focused.blur();
2423
+ }
2424
+ // bind move and end events
2425
+ this._bindPostStartEvents( event );
2426
+ this.emitEvent( 'pointerDown', [ event, pointer ] );
2427
+ };
2428
+
2429
+ // base pointer down logic
2430
+ proto._dragPointerDown = function( event, pointer ) {
2431
+ // track to see when dragging starts
2432
+ this.pointerDownPoint = Unipointer.getPointerPoint( pointer );
2433
+
2434
+ var canPreventDefault = this.canPreventDefaultOnPointerDown( event, pointer );
2435
+ if ( canPreventDefault ) {
2436
+ event.preventDefault();
2437
+ }
2438
+ };
2439
+
2440
+ // overwriteable method so Flickity can prevent for scrolling
2441
+ proto.canPreventDefaultOnPointerDown = function( event ) {
2442
+ // prevent default, unless touchstart or <select>
2443
+ return event.target.nodeName != 'SELECT';
2444
+ };
2445
+
2446
+ // ----- move event ----- //
2447
+
2448
+ /**
2449
+ * drag move
2450
+ * @param {Event} event
2451
+ * @param {Event or Touch} pointer
2452
+ */
2453
+ proto.pointerMove = function( event, pointer ) {
2454
+ var moveVector = this._dragPointerMove( event, pointer );
2455
+ this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] );
2456
+ this._dragMove( event, pointer, moveVector );
2457
+ };
2458
+
2459
+ // base pointer move logic
2460
+ proto._dragPointerMove = function( event, pointer ) {
2461
+ var movePoint = Unipointer.getPointerPoint( pointer );
2462
+ var moveVector = {
2463
+ x: movePoint.x - this.pointerDownPoint.x,
2464
+ y: movePoint.y - this.pointerDownPoint.y
2465
+ };
2466
+ // start drag if pointer has moved far enough to start drag
2467
+ if ( !this.isDragging && this.hasDragStarted( moveVector ) ) {
2468
+ this._dragStart( event, pointer );
2469
+ }
2470
+ return moveVector;
2471
+ };
2472
+
2473
+ // condition if pointer has moved far enough to start drag
2474
+ proto.hasDragStarted = function( moveVector ) {
2475
+ return Math.abs( moveVector.x ) > 3 || Math.abs( moveVector.y ) > 3;
2476
+ };
2477
+
2478
+
2479
+ // ----- end event ----- //
2480
+
2481
+ /**
2482
+ * pointer up
2483
+ * @param {Event} event
2484
+ * @param {Event or Touch} pointer
2485
+ */
2486
+ proto.pointerUp = function( event, pointer ) {
2487
+ this.emitEvent( 'pointerUp', [ event, pointer ] );
2488
+ this._dragPointerUp( event, pointer );
2489
+ };
2490
+
2491
+ proto._dragPointerUp = function( event, pointer ) {
2492
+ if ( this.isDragging ) {
2493
+ this._dragEnd( event, pointer );
2494
+ } else {
2495
+ // pointer didn't move enough for drag to start
2496
+ this._staticClick( event, pointer );
2497
+ }
2498
+ };
2499
+
2500
+ // -------------------------- drag -------------------------- //
2501
+
2502
+ // dragStart
2503
+ proto._dragStart = function( event, pointer ) {
2504
+ this.isDragging = true;
2505
+ this.dragStartPoint = Unipointer.getPointerPoint( pointer );
2506
+ // prevent clicks
2507
+ this.isPreventingClicks = true;
2508
+
2509
+ this.dragStart( event, pointer );
2510
+ };
2511
+
2512
+ proto.dragStart = function( event, pointer ) {
2513
+ this.emitEvent( 'dragStart', [ event, pointer ] );
2514
+ };
2515
+
2516
+ // dragMove
2517
+ proto._dragMove = function( event, pointer, moveVector ) {
2518
+ // do not drag if not dragging yet
2519
+ if ( !this.isDragging ) {
2520
+ return;
2521
+ }
2522
+
2523
+ this.dragMove( event, pointer, moveVector );
2524
+ };
2525
+
2526
+ proto.dragMove = function( event, pointer, moveVector ) {
2527
+ event.preventDefault();
2528
+ this.emitEvent( 'dragMove', [ event, pointer, moveVector ] );
2529
+ };
2530
+
2531
+ // dragEnd
2532
+ proto._dragEnd = function( event, pointer ) {
2533
+ // set flags
2534
+ this.isDragging = false;
2535
+ // re-enable clicking async
2536
+ setTimeout( function() {
2537
+ delete this.isPreventingClicks;
2538
+ }.bind( this ) );
2539
+
2540
+ this.dragEnd( event, pointer );
2541
+ };
2542
+
2543
+ proto.dragEnd = function( event, pointer ) {
2544
+ this.emitEvent( 'dragEnd', [ event, pointer ] );
2545
+ };
2546
+
2547
+ // ----- onclick ----- //
2548
+
2549
+ // handle all clicks and prevent clicks when dragging
2550
+ proto.onclick = function( event ) {
2551
+ if ( this.isPreventingClicks ) {
2552
+ event.preventDefault();
2553
+ }
2554
+ };
2555
+
2556
+ // ----- staticClick ----- //
2557
+
2558
+ // triggered after pointer down & up with no/tiny movement
2559
+ proto._staticClick = function( event, pointer ) {
2560
+ // ignore emulated mouse up clicks
2561
+ if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {
2562
+ return;
2563
+ }
2564
+
2565
+ // allow click in <input>s and <textarea>s
2566
+ var nodeName = event.target.nodeName;
2567
+ if ( nodeName == 'INPUT' || nodeName == 'TEXTAREA' ) {
2568
+ event.target.focus();
2569
+ }
2570
+ this.staticClick( event, pointer );
2571
+
2572
+ // set flag for emulated clicks 300ms after touchend
2573
+ if ( event.type != 'mouseup' ) {
2574
+ this.isIgnoringMouseUp = true;
2575
+ // reset flag after 300ms
2576
+ setTimeout( function() {
2577
+ delete this.isIgnoringMouseUp;
2578
+ }.bind( this ), 400 );
2579
+ }
2580
+ };
2581
+
2582
+ proto.staticClick = function( event, pointer ) {
2583
+ this.emitEvent( 'staticClick', [ event, pointer ] );
2584
+ };
2585
+
2586
+ // ----- utils ----- //
2587
+
2588
+ Unidragger.getPointerPoint = Unipointer.getPointerPoint;
2589
+
2590
+ // ----- ----- //
2591
+
2592
+ return Unidragger;
2593
+
2594
+ }));
2595
+
2596
+ // drag
2597
+ ( function( window, factory ) {
2598
+ // universal module definition
2599
+ /* jshint strict: false */
2600
+ if ( typeof define == 'function' && define.amd ) {
2601
+ // AMD
2602
+ define( 'flickity/js/drag',[
2603
+ './flickity',
2604
+ 'unidragger/unidragger',
2605
+ 'fizzy-ui-utils/utils'
2606
+ ], function( Flickity, Unidragger, utils ) {
2607
+ return factory( window, Flickity, Unidragger, utils );
2608
+ });
2609
+ } else if ( typeof module == 'object' && module.exports ) {
2610
+ // CommonJS
2611
+ module.exports = factory(
2612
+ window,
2613
+ require('./flickity'),
2614
+ require('unidragger'),
2615
+ require('fizzy-ui-utils')
2616
+ );
2617
+ } else {
2618
+ // browser global
2619
+ window.Flickity = factory(
2620
+ window,
2621
+ window.Flickity,
2622
+ window.Unidragger,
2623
+ window.fizzyUIUtils
2624
+ );
2625
+ }
2626
+
2627
+ }( window, function factory( window, Flickity, Unidragger, utils ) {
2628
+
2629
+
2630
+
2631
+ // ----- defaults ----- //
2632
+
2633
+ utils.extend( Flickity.defaults, {
2634
+ draggable: true,
2635
+ dragThreshold: 3,
2636
+ });
2637
+
2638
+ // ----- create ----- //
2639
+
2640
+ Flickity.createMethods.push('_createDrag');
2641
+
2642
+ // -------------------------- drag prototype -------------------------- //
2643
+
2644
+ var proto = Flickity.prototype;
2645
+ utils.extend( proto, Unidragger.prototype );
2646
+
2647
+ // -------------------------- -------------------------- //
2648
+
2649
+ var isTouch = 'createTouch' in document;
2650
+ var isTouchmoveScrollCanceled = false;
2651
+
2652
+ proto._createDrag = function() {
2653
+ this.on( 'activate', this.bindDrag );
2654
+ this.on( 'uiChange', this._uiChangeDrag );
2655
+ this.on( 'childUIPointerDown', this._childUIPointerDownDrag );
2656
+ this.on( 'deactivate', this.unbindDrag );
2657
+ // HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior
2658
+ // #457, RubaXa/Sortable#973
2659
+ if ( isTouch && !isTouchmoveScrollCanceled ) {
2660
+ window.addEventListener( 'touchmove', function() {});
2661
+ isTouchmoveScrollCanceled = true;
2662
+ }
2663
+ };
2664
+
2665
+ proto.bindDrag = function() {
2666
+ if ( !this.options.draggable || this.isDragBound ) {
2667
+ return;
2668
+ }
2669
+ this.element.classList.add('is-draggable');
2670
+ this.handles = [ this.viewport ];
2671
+ this.bindHandles();
2672
+ this.isDragBound = true;
2673
+ };
2674
+
2675
+ proto.unbindDrag = function() {
2676
+ if ( !this.isDragBound ) {
2677
+ return;
2678
+ }
2679
+ this.element.classList.remove('is-draggable');
2680
+ this.unbindHandles();
2681
+ delete this.isDragBound;
2682
+ };
2683
+
2684
+ proto._uiChangeDrag = function() {
2685
+ delete this.isFreeScrolling;
2686
+ };
2687
+
2688
+ proto._childUIPointerDownDrag = function( event ) {
2689
+ event.preventDefault();
2690
+ this.pointerDownFocus( event );
2691
+ };
2692
+
2693
+ // -------------------------- pointer events -------------------------- //
2694
+
2695
+ // nodes that have text fields
2696
+ var cursorNodes = {
2697
+ TEXTAREA: true,
2698
+ INPUT: true,
2699
+ OPTION: true,
2700
+ };
2701
+
2702
+ // input types that do not have text fields
2703
+ var clickTypes = {
2704
+ radio: true,
2705
+ checkbox: true,
2706
+ button: true,
2707
+ submit: true,
2708
+ image: true,
2709
+ file: true,
2710
+ };
2711
+
2712
+ proto.pointerDown = function( event, pointer ) {
2713
+ // dismiss inputs with text fields. #403, #404
2714
+ var isCursorInput = cursorNodes[ event.target.nodeName ] &&
2715
+ !clickTypes[ event.target.type ];
2716
+ if ( isCursorInput ) {
2717
+ // reset pointerDown logic
2718
+ this.isPointerDown = false;
2719
+ delete this.pointerIdentifier;
2720
+ return;
2721
+ }
2722
+
2723
+ this._dragPointerDown( event, pointer );
2724
+
2725
+ // kludge to blur focused inputs in dragger
2726
+ var focused = document.activeElement;
2727
+ if ( focused && focused.blur && focused != this.element &&
2728
+ // do not blur body for IE9 & 10, #117
2729
+ focused != document.body ) {
2730
+ focused.blur();
2731
+ }
2732
+ this.pointerDownFocus( event );
2733
+ // stop if it was moving
2734
+ this.dragX = this.x;
2735
+ this.viewport.classList.add('is-pointer-down');
2736
+ // bind move and end events
2737
+ this._bindPostStartEvents( event );
2738
+ // track scrolling
2739
+ this.pointerDownScroll = getScrollPosition();
2740
+ window.addEventListener( 'scroll', this );
2741
+
2742
+ this.dispatchEvent( 'pointerDown', event, [ pointer ] );
2743
+ };
2744
+
2745
+ var touchStartEvents = {
2746
+ touchstart: true,
2747
+ MSPointerDown: true
2748
+ };
2749
+
2750
+ var focusNodes = {
2751
+ INPUT: true,
2752
+ SELECT: true
2753
+ };
2754
+
2755
+ proto.pointerDownFocus = function( event ) {
2756
+ // focus element, if not touch, and its not an input or select
2757
+ if ( !this.options.accessibility || touchStartEvents[ event.type ] ||
2758
+ focusNodes[ event.target.nodeName ] ) {
2759
+ return;
2760
+ }
2761
+ var prevScrollY = window.pageYOffset;
2762
+ this.element.focus();
2763
+ // hack to fix scroll jump after focus, #76
2764
+ if ( window.pageYOffset != prevScrollY ) {
2765
+ window.scrollTo( window.pageXOffset, prevScrollY );
2766
+ }
2767
+ };
2768
+
2769
+ proto.canPreventDefaultOnPointerDown = function( event ) {
2770
+ // prevent default, unless touchstart or <select>
2771
+ var isTouchstart = event.type == 'touchstart';
2772
+ var targetNodeName = event.target.nodeName;
2773
+ return !isTouchstart && targetNodeName != 'SELECT';
2774
+ };
2775
+
2776
+ // ----- move ----- //
2777
+
2778
+ proto.hasDragStarted = function( moveVector ) {
2779
+ return Math.abs( moveVector.x ) > this.options.dragThreshold;
2780
+ };
2781
+
2782
+ // ----- up ----- //
2783
+
2784
+ proto.pointerUp = function( event, pointer ) {
2785
+ delete this.isTouchScrolling;
2786
+ this.viewport.classList.remove('is-pointer-down');
2787
+ this.dispatchEvent( 'pointerUp', event, [ pointer ] );
2788
+ this._dragPointerUp( event, pointer );
2789
+ };
2790
+
2791
+ proto.pointerDone = function() {
2792
+ window.removeEventListener( 'scroll', this );
2793
+ delete this.pointerDownScroll;
2794
+ };
2795
+
2796
+ // -------------------------- dragging -------------------------- //
2797
+
2798
+ proto.dragStart = function( event, pointer ) {
2799
+ this.dragStartPosition = this.x;
2800
+ this.startAnimation();
2801
+ window.removeEventListener( 'scroll', this );
2802
+ this.dispatchEvent( 'dragStart', event, [ pointer ] );
2803
+ };
2804
+
2805
+ proto.pointerMove = function( event, pointer ) {
2806
+ var moveVector = this._dragPointerMove( event, pointer );
2807
+ this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] );
2808
+ this._dragMove( event, pointer, moveVector );
2809
+ };
2810
+
2811
+ proto.dragMove = function( event, pointer, moveVector ) {
2812
+ event.preventDefault();
2813
+
2814
+ this.previousDragX = this.dragX;
2815
+ // reverse if right-to-left
2816
+ var direction = this.options.rightToLeft ? -1 : 1;
2817
+ var dragX = this.dragStartPosition + moveVector.x * direction;
2818
+
2819
+ if ( !this.options.wrapAround && this.slides.length ) {
2820
+ // slow drag
2821
+ var originBound = Math.max( -this.slides[0].target, this.dragStartPosition );
2822
+ dragX = dragX > originBound ? ( dragX + originBound ) * 0.5 : dragX;
2823
+ var endBound = Math.min( -this.getLastSlide().target, this.dragStartPosition );
2824
+ dragX = dragX < endBound ? ( dragX + endBound ) * 0.5 : dragX;
2825
+ }
2826
+
2827
+ this.dragX = dragX;
2828
+
2829
+ this.dragMoveTime = new Date();
2830
+ this.dispatchEvent( 'dragMove', event, [ pointer, moveVector ] );
2831
+ };
2832
+
2833
+ proto.dragEnd = function( event, pointer ) {
2834
+ if ( this.options.freeScroll ) {
2835
+ this.isFreeScrolling = true;
2836
+ }
2837
+ // set selectedIndex based on where flick will end up
2838
+ var index = this.dragEndRestingSelect();
2839
+
2840
+ if ( this.options.freeScroll && !this.options.wrapAround ) {
2841
+ // if free-scroll & not wrap around
2842
+ // do not free-scroll if going outside of bounding slides
2843
+ // so bounding slides can attract slider, and keep it in bounds
2844
+ var restingX = this.getRestingPosition();
2845
+ this.isFreeScrolling = -restingX > this.slides[0].target &&
2846
+ -restingX < this.getLastSlide().target;
2847
+ } else if ( !this.options.freeScroll && index == this.selectedIndex ) {
2848
+ // boost selection if selected index has not changed
2849
+ index += this.dragEndBoostSelect();
2850
+ }
2851
+ delete this.previousDragX;
2852
+ // apply selection
2853
+ // TODO refactor this, selecting here feels weird
2854
+ // HACK, set flag so dragging stays in correct direction
2855
+ this.isDragSelect = this.options.wrapAround;
2856
+ this.select( index );
2857
+ delete this.isDragSelect;
2858
+ this.dispatchEvent( 'dragEnd', event, [ pointer ] );
2859
+ };
2860
+
2861
+ proto.dragEndRestingSelect = function() {
2862
+ var restingX = this.getRestingPosition();
2863
+ // how far away from selected slide
2864
+ var distance = Math.abs( this.getSlideDistance( -restingX, this.selectedIndex ) );
2865
+ // get closet resting going up and going down
2866
+ var positiveResting = this._getClosestResting( restingX, distance, 1 );
2867
+ var negativeResting = this._getClosestResting( restingX, distance, -1 );
2868
+ // use closer resting for wrap-around
2869
+ var index = positiveResting.distance < negativeResting.distance ?
2870
+ positiveResting.index : negativeResting.index;
2871
+ return index;
2872
+ };
2873
+
2874
+ /**
2875
+ * given resting X and distance to selected cell
2876
+ * get the distance and index of the closest cell
2877
+ * @param {Number} restingX - estimated post-flick resting position
2878
+ * @param {Number} distance - distance to selected cell
2879
+ * @param {Integer} increment - +1 or -1, going up or down
2880
+ * @returns {Object} - { distance: {Number}, index: {Integer} }
2881
+ */
2882
+ proto._getClosestResting = function( restingX, distance, increment ) {
2883
+ var index = this.selectedIndex;
2884
+ var minDistance = Infinity;
2885
+ var condition = this.options.contain && !this.options.wrapAround ?
2886
+ // if contain, keep going if distance is equal to minDistance
2887
+ function( d, md ) { return d <= md; } : function( d, md ) { return d < md; };
2888
+ while ( condition( distance, minDistance ) ) {
2889
+ // measure distance to next cell
2890
+ index += increment;
2891
+ minDistance = distance;
2892
+ distance = this.getSlideDistance( -restingX, index );
2893
+ if ( distance === null ) {
2894
+ break;
2895
+ }
2896
+ distance = Math.abs( distance );
2897
+ }
2898
+ return {
2899
+ distance: minDistance,
2900
+ // selected was previous index
2901
+ index: index - increment
2902
+ };
2903
+ };
2904
+
2905
+ /**
2906
+ * measure distance between x and a slide target
2907
+ * @param {Number} x
2908
+ * @param {Integer} index - slide index
2909
+ */
2910
+ proto.getSlideDistance = function( x, index ) {
2911
+ var len = this.slides.length;
2912
+ // wrap around if at least 2 slides
2913
+ var isWrapAround = this.options.wrapAround && len > 1;
2914
+ var slideIndex = isWrapAround ? utils.modulo( index, len ) : index;
2915
+ var slide = this.slides[ slideIndex ];
2916
+ if ( !slide ) {
2917
+ return null;
2918
+ }
2919
+ // add distance for wrap-around slides
2920
+ var wrap = isWrapAround ? this.slideableWidth * Math.floor( index / len ) : 0;
2921
+ return x - ( slide.target + wrap );
2922
+ };
2923
+
2924
+ proto.dragEndBoostSelect = function() {
2925
+ // do not boost if no previousDragX or dragMoveTime
2926
+ if ( this.previousDragX === undefined || !this.dragMoveTime ||
2927
+ // or if drag was held for 100 ms
2928
+ new Date() - this.dragMoveTime > 100 ) {
2929
+ return 0;
2930
+ }
2931
+
2932
+ var distance = this.getSlideDistance( -this.dragX, this.selectedIndex );
2933
+ var delta = this.previousDragX - this.dragX;
2934
+ if ( distance > 0 && delta > 0 ) {
2935
+ // boost to next if moving towards the right, and positive velocity
2936
+ return 1;
2937
+ } else if ( distance < 0 && delta < 0 ) {
2938
+ // boost to previous if moving towards the left, and negative velocity
2939
+ return -1;
2940
+ }
2941
+ return 0;
2942
+ };
2943
+
2944
+ // ----- staticClick ----- //
2945
+
2946
+ proto.staticClick = function( event, pointer ) {
2947
+ // get clickedCell, if cell was clicked
2948
+ var clickedCell = this.getParentCell( event.target );
2949
+ var cellElem = clickedCell && clickedCell.element;
2950
+ var cellIndex = clickedCell && this.cells.indexOf( clickedCell );
2951
+ this.dispatchEvent( 'staticClick', event, [ pointer, cellElem, cellIndex ] );
2952
+ };
2953
+
2954
+ // ----- scroll ----- //
2955
+
2956
+ proto.onscroll = function() {
2957
+ var scroll = getScrollPosition();
2958
+ var scrollMoveX = this.pointerDownScroll.x - scroll.x;
2959
+ var scrollMoveY = this.pointerDownScroll.y - scroll.y;
2960
+ // cancel click/tap if scroll is too much
2961
+ if ( Math.abs( scrollMoveX ) > 3 || Math.abs( scrollMoveY ) > 3 ) {
2962
+ this._pointerDone();
2963
+ }
2964
+ };
2965
+
2966
+ // ----- utils ----- //
2967
+
2968
+ function getScrollPosition() {
2969
+ return {
2970
+ x: window.pageXOffset,
2971
+ y: window.pageYOffset
2972
+ };
2973
+ }
2974
+
2975
+ // ----- ----- //
2976
+
2977
+ return Flickity;
2978
+
2979
+ }));
2980
+
2981
+ /*!
2982
+ * Tap listener v2.0.0
2983
+ * listens to taps
2984
+ * MIT license
2985
+ */
2986
+
2987
+ /*jshint browser: true, unused: true, undef: true, strict: true */
2988
+
2989
+ ( function( window, factory ) {
2990
+ // universal module definition
2991
+ /*jshint strict: false*/ /*globals define, module, require */
2992
+
2993
+ if ( typeof define == 'function' && define.amd ) {
2994
+ // AMD
2995
+ define( 'tap-listener/tap-listener',[
2996
+ 'unipointer/unipointer'
2997
+ ], function( Unipointer ) {
2998
+ return factory( window, Unipointer );
2999
+ });
3000
+ } else if ( typeof module == 'object' && module.exports ) {
3001
+ // CommonJS
3002
+ module.exports = factory(
3003
+ window,
3004
+ require('unipointer')
3005
+ );
3006
+ } else {
3007
+ // browser global
3008
+ window.TapListener = factory(
3009
+ window,
3010
+ window.Unipointer
3011
+ );
3012
+ }
3013
+
3014
+ }( window, function factory( window, Unipointer ) {
3015
+
3016
+
3017
+
3018
+ // -------------------------- TapListener -------------------------- //
3019
+
3020
+ function TapListener( elem ) {
3021
+ this.bindTap( elem );
3022
+ }
3023
+
3024
+ // inherit Unipointer & EventEmitter
3025
+ var proto = TapListener.prototype = Object.create( Unipointer.prototype );
3026
+
3027
+ /**
3028
+ * bind tap event to element
3029
+ * @param {Element} elem
3030
+ */
3031
+ proto.bindTap = function( elem ) {
3032
+ if ( !elem ) {
3033
+ return;
3034
+ }
3035
+ this.unbindTap();
3036
+ this.tapElement = elem;
3037
+ this._bindStartEvent( elem, true );
3038
+ };
3039
+
3040
+ proto.unbindTap = function() {
3041
+ if ( !this.tapElement ) {
3042
+ return;
3043
+ }
3044
+ this._bindStartEvent( this.tapElement, true );
3045
+ delete this.tapElement;
3046
+ };
3047
+
3048
+ /**
3049
+ * pointer up
3050
+ * @param {Event} event
3051
+ * @param {Event or Touch} pointer
3052
+ */
3053
+ proto.pointerUp = function( event, pointer ) {
3054
+ // ignore emulated mouse up clicks
3055
+ if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) {
3056
+ return;
3057
+ }
3058
+
3059
+ var pointerPoint = Unipointer.getPointerPoint( pointer );
3060
+ var boundingRect = this.tapElement.getBoundingClientRect();
3061
+ var scrollX = window.pageXOffset;
3062
+ var scrollY = window.pageYOffset;
3063
+ // calculate if pointer is inside tapElement
3064
+ var isInside = pointerPoint.x >= boundingRect.left + scrollX &&
3065
+ pointerPoint.x <= boundingRect.right + scrollX &&
3066
+ pointerPoint.y >= boundingRect.top + scrollY &&
3067
+ pointerPoint.y <= boundingRect.bottom + scrollY;
3068
+ // trigger callback if pointer is inside element
3069
+ if ( isInside ) {
3070
+ this.emitEvent( 'tap', [ event, pointer ] );
3071
+ }
3072
+
3073
+ // set flag for emulated clicks 300ms after touchend
3074
+ if ( event.type != 'mouseup' ) {
3075
+ this.isIgnoringMouseUp = true;
3076
+ // reset flag after 300ms
3077
+ var _this = this;
3078
+ setTimeout( function() {
3079
+ delete _this.isIgnoringMouseUp;
3080
+ }, 400 );
3081
+ }
3082
+ };
3083
+
3084
+ proto.destroy = function() {
3085
+ this.pointerDone();
3086
+ this.unbindTap();
3087
+ };
3088
+
3089
+ // ----- ----- //
3090
+
3091
+ return TapListener;
3092
+
3093
+ }));
3094
+
3095
+ // prev/next buttons
3096
+ ( function( window, factory ) {
3097
+ // universal module definition
3098
+ /* jshint strict: false */
3099
+ if ( typeof define == 'function' && define.amd ) {
3100
+ // AMD
3101
+ define( 'flickity/js/prev-next-button',[
3102
+ './flickity',
3103
+ 'tap-listener/tap-listener',
3104
+ 'fizzy-ui-utils/utils'
3105
+ ], function( Flickity, TapListener, utils ) {
3106
+ return factory( window, Flickity, TapListener, utils );
3107
+ });
3108
+ } else if ( typeof module == 'object' && module.exports ) {
3109
+ // CommonJS
3110
+ module.exports = factory(
3111
+ window,
3112
+ require('./flickity'),
3113
+ require('tap-listener'),
3114
+ require('fizzy-ui-utils')
3115
+ );
3116
+ } else {
3117
+ // browser global
3118
+ factory(
3119
+ window,
3120
+ window.Flickity,
3121
+ window.TapListener,
3122
+ window.fizzyUIUtils
3123
+ );
3124
+ }
3125
+
3126
+ }( window, function factory( window, Flickity, TapListener, utils ) {
3127
+ 'use strict';
3128
+
3129
+ var svgURI = 'http://www.w3.org/2000/svg';
3130
+
3131
+ // -------------------------- PrevNextButton -------------------------- //
3132
+
3133
+ function PrevNextButton( direction, parent ) {
3134
+ this.direction = direction;
3135
+ this.parent = parent;
3136
+ this._create();
3137
+ }
3138
+
3139
+ PrevNextButton.prototype = new TapListener();
3140
+
3141
+ PrevNextButton.prototype._create = function() {
3142
+ // properties
3143
+ this.isEnabled = true;
3144
+ this.isPrevious = this.direction == -1;
3145
+ var leftDirection = this.parent.options.rightToLeft ? 1 : -1;
3146
+ this.isLeft = this.direction == leftDirection;
3147
+
3148
+ var element = this.element = document.createElement('button');
3149
+ element.className = 'flickity-prev-next-button';
3150
+ element.className += this.isPrevious ? ' previous' : ' next';
3151
+ // prevent button from submitting form http://stackoverflow.com/a/10836076/182183
3152
+ element.setAttribute( 'type', 'button' );
3153
+ // init as disabled
3154
+ this.disable();
3155
+
3156
+ element.setAttribute( 'aria-label', this.isPrevious ? 'previous' : 'next' );
3157
+
3158
+ // create arrow
3159
+ var svg = this.createSVG();
3160
+ element.appendChild( svg );
3161
+ // events
3162
+ this.on( 'tap', this.onTap );
3163
+ this.parent.on( 'select', this.update.bind( this ) );
3164
+ this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) );
3165
+ };
3166
+
3167
+ PrevNextButton.prototype.activate = function() {
3168
+ this.bindTap( this.element );
3169
+ // click events from keyboard
3170
+ this.element.addEventListener( 'click', this );
3171
+ // add to DOM
3172
+ this.parent.element.appendChild( this.element );
3173
+ };
3174
+
3175
+ PrevNextButton.prototype.deactivate = function() {
3176
+ // remove from DOM
3177
+ this.parent.element.removeChild( this.element );
3178
+ // do regular TapListener destroy
3179
+ TapListener.prototype.destroy.call( this );
3180
+ // click events from keyboard
3181
+ this.element.removeEventListener( 'click', this );
3182
+ };
3183
+
3184
+ PrevNextButton.prototype.createSVG = function() {
3185
+ var svg = document.createElementNS( svgURI, 'svg');
3186
+ svg.setAttribute( 'viewBox', '0 0 100 100' );
3187
+ var path = document.createElementNS( svgURI, 'path');
3188
+ var pathMovements = getArrowMovements( this.parent.options.arrowShape );
3189
+ path.setAttribute( 'd', pathMovements );
3190
+ path.setAttribute( 'class', 'arrow' );
3191
+ // rotate arrow
3192
+ if ( !this.isLeft ) {
3193
+ path.setAttribute( 'transform', 'translate(100, 100) rotate(180) ' );
3194
+ }
3195
+ svg.appendChild( path );
3196
+ return svg;
3197
+ };
3198
+
3199
+ // get SVG path movmement
3200
+ function getArrowMovements( shape ) {
3201
+ // use shape as movement if string
3202
+ if ( typeof shape == 'string' ) {
3203
+ return shape;
3204
+ }
3205
+ // create movement string
3206
+ return 'M ' + shape.x0 + ',50' +
3207
+ ' L ' + shape.x1 + ',' + ( shape.y1 + 50 ) +
3208
+ ' L ' + shape.x2 + ',' + ( shape.y2 + 50 ) +
3209
+ ' L ' + shape.x3 + ',50 ' +
3210
+ ' L ' + shape.x2 + ',' + ( 50 - shape.y2 ) +
3211
+ ' L ' + shape.x1 + ',' + ( 50 - shape.y1 ) +
3212
+ ' Z';
3213
+ }
3214
+
3215
+ PrevNextButton.prototype.onTap = function() {
3216
+ if ( !this.isEnabled ) {
3217
+ return;
3218
+ }
3219
+ this.parent.uiChange();
3220
+ var method = this.isPrevious ? 'previous' : 'next';
3221
+ this.parent[ method ]();
3222
+ };
3223
+
3224
+ PrevNextButton.prototype.handleEvent = utils.handleEvent;
3225
+
3226
+ PrevNextButton.prototype.onclick = function() {
3227
+ // only allow clicks from keyboard
3228
+ var focused = document.activeElement;
3229
+ if ( focused && focused == this.element ) {
3230
+ this.onTap();
3231
+ }
3232
+ };
3233
+
3234
+ // ----- ----- //
3235
+
3236
+ PrevNextButton.prototype.enable = function() {
3237
+ if ( this.isEnabled ) {
3238
+ return;
3239
+ }
3240
+ this.element.disabled = false;
3241
+ this.isEnabled = true;
3242
+ };
3243
+
3244
+ PrevNextButton.prototype.disable = function() {
3245
+ if ( !this.isEnabled ) {
3246
+ return;
3247
+ }
3248
+ this.element.disabled = true;
3249
+ this.isEnabled = false;
3250
+ };
3251
+
3252
+ PrevNextButton.prototype.update = function() {
3253
+ // index of first or last slide, if previous or next
3254
+ var slides = this.parent.slides;
3255
+ // enable is wrapAround and at least 2 slides
3256
+ if ( this.parent.options.wrapAround && slides.length > 1 ) {
3257
+ this.enable();
3258
+ return;
3259
+ }
3260
+ var lastIndex = slides.length ? slides.length - 1 : 0;
3261
+ var boundIndex = this.isPrevious ? 0 : lastIndex;
3262
+ var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable';
3263
+ this[ method ]();
3264
+ };
3265
+
3266
+ PrevNextButton.prototype.destroy = function() {
3267
+ this.deactivate();
3268
+ };
3269
+
3270
+ // -------------------------- Flickity prototype -------------------------- //
3271
+
3272
+ utils.extend( Flickity.defaults, {
3273
+ prevNextButtons: true,
3274
+ arrowShape: {
3275
+ x0: 10,
3276
+ x1: 60, y1: 50,
3277
+ x2: 70, y2: 40,
3278
+ x3: 30
3279
+ }
3280
+ });
3281
+
3282
+ Flickity.createMethods.push('_createPrevNextButtons');
3283
+ var proto = Flickity.prototype;
3284
+
3285
+ proto._createPrevNextButtons = function() {
3286
+ if ( !this.options.prevNextButtons ) {
3287
+ return;
3288
+ }
3289
+
3290
+ this.prevButton = new PrevNextButton( -1, this );
3291
+ this.nextButton = new PrevNextButton( 1, this );
3292
+
3293
+ this.on( 'activate', this.activatePrevNextButtons );
3294
+ };
3295
+
3296
+ proto.activatePrevNextButtons = function() {
3297
+ this.prevButton.activate();
3298
+ this.nextButton.activate();
3299
+ this.on( 'deactivate', this.deactivatePrevNextButtons );
3300
+ };
3301
+
3302
+ proto.deactivatePrevNextButtons = function() {
3303
+ this.prevButton.deactivate();
3304
+ this.nextButton.deactivate();
3305
+ this.off( 'deactivate', this.deactivatePrevNextButtons );
3306
+ };
3307
+
3308
+ // -------------------------- -------------------------- //
3309
+
3310
+ Flickity.PrevNextButton = PrevNextButton;
3311
+
3312
+ return Flickity;
3313
+
3314
+ }));
3315
+
3316
+ // page dots
3317
+ ( function( window, factory ) {
3318
+ // universal module definition
3319
+ /* jshint strict: false */
3320
+ if ( typeof define == 'function' && define.amd ) {
3321
+ // AMD
3322
+ define( 'flickity/js/page-dots',[
3323
+ './flickity',
3324
+ 'tap-listener/tap-listener',
3325
+ 'fizzy-ui-utils/utils'
3326
+ ], function( Flickity, TapListener, utils ) {
3327
+ return factory( window, Flickity, TapListener, utils );
3328
+ });
3329
+ } else if ( typeof module == 'object' && module.exports ) {
3330
+ // CommonJS
3331
+ module.exports = factory(
3332
+ window,
3333
+ require('./flickity'),
3334
+ require('tap-listener'),
3335
+ require('fizzy-ui-utils')
3336
+ );
3337
+ } else {
3338
+ // browser global
3339
+ factory(
3340
+ window,
3341
+ window.Flickity,
3342
+ window.TapListener,
3343
+ window.fizzyUIUtils
3344
+ );
3345
+ }
3346
+
3347
+ }( window, function factory( window, Flickity, TapListener, utils ) {
3348
+
3349
+ // -------------------------- PageDots -------------------------- //
3350
+
3351
+
3352
+
3353
+ function PageDots( parent ) {
3354
+ this.parent = parent;
3355
+ this._create();
3356
+ }
3357
+
3358
+ PageDots.prototype = new TapListener();
3359
+
3360
+ PageDots.prototype._create = function() {
3361
+ // create holder element
3362
+ this.holder = document.createElement('ol');
3363
+ this.holder.className = 'flickity-page-dots';
3364
+ // create dots, array of elements
3365
+ this.dots = [];
3366
+ // events
3367
+ this.on( 'tap', this.onTap );
3368
+ this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) );
3369
+ };
3370
+
3371
+ PageDots.prototype.activate = function() {
3372
+ this.setDots();
3373
+ this.bindTap( this.holder );
3374
+ // add to DOM
3375
+ this.parent.element.appendChild( this.holder );
3376
+ };
3377
+
3378
+ PageDots.prototype.deactivate = function() {
3379
+ // remove from DOM
3380
+ this.parent.element.removeChild( this.holder );
3381
+ TapListener.prototype.destroy.call( this );
3382
+ };
3383
+
3384
+ PageDots.prototype.setDots = function() {
3385
+ // get difference between number of slides and number of dots
3386
+ var delta = this.parent.slides.length - this.dots.length;
3387
+ if ( delta > 0 ) {
3388
+ this.addDots( delta );
3389
+ } else if ( delta < 0 ) {
3390
+ this.removeDots( -delta );
3391
+ }
3392
+ };
3393
+
3394
+ PageDots.prototype.addDots = function( count ) {
3395
+ var fragment = document.createDocumentFragment();
3396
+ var newDots = [];
3397
+ while ( count ) {
3398
+ var dot = document.createElement('li');
3399
+ dot.className = 'dot';
3400
+ fragment.appendChild( dot );
3401
+ newDots.push( dot );
3402
+ count--;
3403
+ }
3404
+ this.holder.appendChild( fragment );
3405
+ this.dots = this.dots.concat( newDots );
3406
+ };
3407
+
3408
+ PageDots.prototype.removeDots = function( count ) {
3409
+ // remove from this.dots collection
3410
+ var removeDots = this.dots.splice( this.dots.length - count, count );
3411
+ // remove from DOM
3412
+ removeDots.forEach( function( dot ) {
3413
+ this.holder.removeChild( dot );
3414
+ }, this );
3415
+ };
3416
+
3417
+ PageDots.prototype.updateSelected = function() {
3418
+ // remove selected class on previous
3419
+ if ( this.selectedDot ) {
3420
+ this.selectedDot.className = 'dot';
3421
+ }
3422
+ // don't proceed if no dots
3423
+ if ( !this.dots.length ) {
3424
+ return;
3425
+ }
3426
+ this.selectedDot = this.dots[ this.parent.selectedIndex ];
3427
+ this.selectedDot.className = 'dot is-selected';
3428
+ };
3429
+
3430
+ PageDots.prototype.onTap = function( event ) {
3431
+ var target = event.target;
3432
+ // only care about dot clicks
3433
+ if ( target.nodeName != 'LI' ) {
3434
+ return;
3435
+ }
3436
+
3437
+ this.parent.uiChange();
3438
+ var index = this.dots.indexOf( target );
3439
+ this.parent.select( index );
3440
+ };
3441
+
3442
+ PageDots.prototype.destroy = function() {
3443
+ this.deactivate();
3444
+ };
3445
+
3446
+ Flickity.PageDots = PageDots;
3447
+
3448
+ // -------------------------- Flickity -------------------------- //
3449
+
3450
+ utils.extend( Flickity.defaults, {
3451
+ pageDots: true
3452
+ });
3453
+
3454
+ Flickity.createMethods.push('_createPageDots');
3455
+
3456
+ var proto = Flickity.prototype;
3457
+
3458
+ proto._createPageDots = function() {
3459
+ if ( !this.options.pageDots ) {
3460
+ return;
3461
+ }
3462
+ this.pageDots = new PageDots( this );
3463
+ // events
3464
+ this.on( 'activate', this.activatePageDots );
3465
+ this.on( 'select', this.updateSelectedPageDots );
3466
+ this.on( 'cellChange', this.updatePageDots );
3467
+ this.on( 'resize', this.updatePageDots );
3468
+ this.on( 'deactivate', this.deactivatePageDots );
3469
+ };
3470
+
3471
+ proto.activatePageDots = function() {
3472
+ this.pageDots.activate();
3473
+ };
3474
+
3475
+ proto.updateSelectedPageDots = function() {
3476
+ this.pageDots.updateSelected();
3477
+ };
3478
+
3479
+ proto.updatePageDots = function() {
3480
+ this.pageDots.setDots();
3481
+ };
3482
+
3483
+ proto.deactivatePageDots = function() {
3484
+ this.pageDots.deactivate();
3485
+ };
3486
+
3487
+ // ----- ----- //
3488
+
3489
+ Flickity.PageDots = PageDots;
3490
+
3491
+ return Flickity;
3492
+
3493
+ }));
3494
+
3495
+ // player & autoPlay
3496
+ ( function( window, factory ) {
3497
+ // universal module definition
3498
+ /* jshint strict: false */
3499
+ if ( typeof define == 'function' && define.amd ) {
3500
+ // AMD
3501
+ define( 'flickity/js/player',[
3502
+ 'ev-emitter/ev-emitter',
3503
+ 'fizzy-ui-utils/utils',
3504
+ './flickity'
3505
+ ], function( EvEmitter, utils, Flickity ) {
3506
+ return factory( EvEmitter, utils, Flickity );
3507
+ });
3508
+ } else if ( typeof module == 'object' && module.exports ) {
3509
+ // CommonJS
3510
+ module.exports = factory(
3511
+ require('ev-emitter'),
3512
+ require('fizzy-ui-utils'),
3513
+ require('./flickity')
3514
+ );
3515
+ } else {
3516
+ // browser global
3517
+ factory(
3518
+ window.EvEmitter,
3519
+ window.fizzyUIUtils,
3520
+ window.Flickity
3521
+ );
3522
+ }
3523
+
3524
+ }( window, function factory( EvEmitter, utils, Flickity ) {
3525
+
3526
+
3527
+
3528
+ // -------------------------- Page Visibility -------------------------- //
3529
+ // https://developer.mozilla.org/en-US/docs/Web/Guide/User_experience/Using_the_Page_Visibility_API
3530
+
3531
+ var hiddenProperty, visibilityEvent;
3532
+ if ( 'hidden' in document ) {
3533
+ hiddenProperty = 'hidden';
3534
+ visibilityEvent = 'visibilitychange';
3535
+ } else if ( 'webkitHidden' in document ) {
3536
+ hiddenProperty = 'webkitHidden';
3537
+ visibilityEvent = 'webkitvisibilitychange';
3538
+ }
3539
+
3540
+ // -------------------------- Player -------------------------- //
3541
+
3542
+ function Player( parent ) {
3543
+ this.parent = parent;
3544
+ this.state = 'stopped';
3545
+ // visibility change event handler
3546
+ if ( visibilityEvent ) {
3547
+ this.onVisibilityChange = function() {
3548
+ this.visibilityChange();
3549
+ }.bind( this );
3550
+ this.onVisibilityPlay = function() {
3551
+ this.visibilityPlay();
3552
+ }.bind( this );
3553
+ }
3554
+ }
3555
+
3556
+ Player.prototype = Object.create( EvEmitter.prototype );
3557
+
3558
+ // start play
3559
+ Player.prototype.play = function() {
3560
+ if ( this.state == 'playing' ) {
3561
+ return;
3562
+ }
3563
+ // do not play if page is hidden, start playing when page is visible
3564
+ var isPageHidden = document[ hiddenProperty ];
3565
+ if ( visibilityEvent && isPageHidden ) {
3566
+ document.addEventListener( visibilityEvent, this.onVisibilityPlay );
3567
+ return;
3568
+ }
3569
+
3570
+ this.state = 'playing';
3571
+ // listen to visibility change
3572
+ if ( visibilityEvent ) {
3573
+ document.addEventListener( visibilityEvent, this.onVisibilityChange );
3574
+ }
3575
+ // start ticking
3576
+ this.tick();
3577
+ };
3578
+
3579
+ Player.prototype.tick = function() {
3580
+ // do not tick if not playing
3581
+ if ( this.state != 'playing' ) {
3582
+ return;
3583
+ }
3584
+
3585
+ var time = this.parent.options.autoPlay;
3586
+ // default to 3 seconds
3587
+ time = typeof time == 'number' ? time : 3000;
3588
+ var _this = this;
3589
+ // HACK: reset ticks if stopped and started within interval
3590
+ this.clear();
3591
+ this.timeout = setTimeout( function() {
3592
+ _this.parent.next( true );
3593
+ _this.tick();
3594
+ }, time );
3595
+ };
3596
+
3597
+ Player.prototype.stop = function() {
3598
+ this.state = 'stopped';
3599
+ this.clear();
3600
+ // remove visibility change event
3601
+ if ( visibilityEvent ) {
3602
+ document.removeEventListener( visibilityEvent, this.onVisibilityChange );
3603
+ }
3604
+ };
3605
+
3606
+ Player.prototype.clear = function() {
3607
+ clearTimeout( this.timeout );
3608
+ };
3609
+
3610
+ Player.prototype.pause = function() {
3611
+ if ( this.state == 'playing' ) {
3612
+ this.state = 'paused';
3613
+ this.clear();
3614
+ }
3615
+ };
3616
+
3617
+ Player.prototype.unpause = function() {
3618
+ // re-start play if paused
3619
+ if ( this.state == 'paused' ) {
3620
+ this.play();
3621
+ }
3622
+ };
3623
+
3624
+ // pause if page visibility is hidden, unpause if visible
3625
+ Player.prototype.visibilityChange = function() {
3626
+ var isPageHidden = document[ hiddenProperty ];
3627
+ this[ isPageHidden ? 'pause' : 'unpause' ]();
3628
+ };
3629
+
3630
+ Player.prototype.visibilityPlay = function() {
3631
+ this.play();
3632
+ document.removeEventListener( visibilityEvent, this.onVisibilityPlay );
3633
+ };
3634
+
3635
+ // -------------------------- Flickity -------------------------- //
3636
+
3637
+ utils.extend( Flickity.defaults, {
3638
+ pauseAutoPlayOnHover: true
3639
+ });
3640
+
3641
+ Flickity.createMethods.push('_createPlayer');
3642
+ var proto = Flickity.prototype;
3643
+
3644
+ proto._createPlayer = function() {
3645
+ this.player = new Player( this );
3646
+
3647
+ this.on( 'activate', this.activatePlayer );
3648
+ this.on( 'uiChange', this.stopPlayer );
3649
+ this.on( 'pointerDown', this.stopPlayer );
3650
+ this.on( 'deactivate', this.deactivatePlayer );
3651
+ };
3652
+
3653
+ proto.activatePlayer = function() {
3654
+ if ( !this.options.autoPlay ) {
3655
+ return;
3656
+ }
3657
+ this.player.play();
3658
+ this.element.addEventListener( 'mouseenter', this );
3659
+ };
3660
+
3661
+ // Player API, don't hate the ... thanks I know where the door is
3662
+
3663
+ proto.playPlayer = function() {
3664
+ this.player.play();
3665
+ };
3666
+
3667
+ proto.stopPlayer = function() {
3668
+ this.player.stop();
3669
+ };
3670
+
3671
+ proto.pausePlayer = function() {
3672
+ this.player.pause();
3673
+ };
3674
+
3675
+ proto.unpausePlayer = function() {
3676
+ this.player.unpause();
3677
+ };
3678
+
3679
+ proto.deactivatePlayer = function() {
3680
+ this.player.stop();
3681
+ this.element.removeEventListener( 'mouseenter', this );
3682
+ };
3683
+
3684
+ // ----- mouseenter/leave ----- //
3685
+
3686
+ // pause auto-play on hover
3687
+ proto.onmouseenter = function() {
3688
+ if ( !this.options.pauseAutoPlayOnHover ) {
3689
+ return;
3690
+ }
3691
+ this.player.pause();
3692
+ this.element.addEventListener( 'mouseleave', this );
3693
+ };
3694
+
3695
+ // resume auto-play on hover off
3696
+ proto.onmouseleave = function() {
3697
+ this.player.unpause();
3698
+ this.element.removeEventListener( 'mouseleave', this );
3699
+ };
3700
+
3701
+ // ----- ----- //
3702
+
3703
+ Flickity.Player = Player;
3704
+
3705
+ return Flickity;
3706
+
3707
+ }));
3708
+
3709
+ // add, remove cell
3710
+ ( function( window, factory ) {
3711
+ // universal module definition
3712
+ /* jshint strict: false */
3713
+ if ( typeof define == 'function' && define.amd ) {
3714
+ // AMD
3715
+ define( 'flickity/js/add-remove-cell',[
3716
+ './flickity',
3717
+ 'fizzy-ui-utils/utils'
3718
+ ], function( Flickity, utils ) {
3719
+ return factory( window, Flickity, utils );
3720
+ });
3721
+ } else if ( typeof module == 'object' && module.exports ) {
3722
+ // CommonJS
3723
+ module.exports = factory(
3724
+ window,
3725
+ require('./flickity'),
3726
+ require('fizzy-ui-utils')
3727
+ );
3728
+ } else {
3729
+ // browser global
3730
+ factory(
3731
+ window,
3732
+ window.Flickity,
3733
+ window.fizzyUIUtils
3734
+ );
3735
+ }
3736
+
3737
+ }( window, function factory( window, Flickity, utils ) {
3738
+
3739
+
3740
+
3741
+ // append cells to a document fragment
3742
+ function getCellsFragment( cells ) {
3743
+ var fragment = document.createDocumentFragment();
3744
+ cells.forEach( function( cell ) {
3745
+ fragment.appendChild( cell.element );
3746
+ });
3747
+ return fragment;
3748
+ }
3749
+
3750
+ // -------------------------- add/remove cell prototype -------------------------- //
3751
+
3752
+ var proto = Flickity.prototype;
3753
+
3754
+ /**
3755
+ * Insert, prepend, or append cells
3756
+ * @param {Element, Array, NodeList} elems
3757
+ * @param {Integer} index
3758
+ */
3759
+ proto.insert = function( elems, index ) {
3760
+ var cells = this._makeCells( elems );
3761
+ if ( !cells || !cells.length ) {
3762
+ return;
3763
+ }
3764
+ var len = this.cells.length;
3765
+ // default to append
3766
+ index = index === undefined ? len : index;
3767
+ // add cells with document fragment
3768
+ var fragment = getCellsFragment( cells );
3769
+ // append to slider
3770
+ var isAppend = index == len;
3771
+ if ( isAppend ) {
3772
+ this.slider.appendChild( fragment );
3773
+ } else {
3774
+ var insertCellElement = this.cells[ index ].element;
3775
+ this.slider.insertBefore( fragment, insertCellElement );
3776
+ }
3777
+ // add to this.cells
3778
+ if ( index === 0 ) {
3779
+ // prepend, add to start
3780
+ this.cells = cells.concat( this.cells );
3781
+ } else if ( isAppend ) {
3782
+ // append, add to end
3783
+ this.cells = this.cells.concat( cells );
3784
+ } else {
3785
+ // insert in this.cells
3786
+ var endCells = this.cells.splice( index, len - index );
3787
+ this.cells = this.cells.concat( cells ).concat( endCells );
3788
+ }
3789
+
3790
+ this._sizeCells( cells );
3791
+
3792
+ var selectedIndexDelta = index > this.selectedIndex ? 0 : cells.length;
3793
+ this._cellAddedRemoved( index, selectedIndexDelta );
3794
+ };
3795
+
3796
+ proto.append = function( elems ) {
3797
+ this.insert( elems, this.cells.length );
3798
+ };
3799
+
3800
+ proto.prepend = function( elems ) {
3801
+ this.insert( elems, 0 );
3802
+ };
3803
+
3804
+ /**
3805
+ * Remove cells
3806
+ * @param {Element, Array, NodeList} elems
3807
+ */
3808
+ proto.remove = function( elems ) {
3809
+ var cells = this.getCells( elems );
3810
+ var selectedIndexDelta = 0;
3811
+ var len = cells.length;
3812
+ var i, cell;
3813
+ // calculate selectedIndexDelta, easier if done in seperate loop
3814
+ for ( i=0; i < len; i++ ) {
3815
+ cell = cells[i];
3816
+ var wasBefore = this.cells.indexOf( cell ) < this.selectedIndex;
3817
+ selectedIndexDelta -= wasBefore ? 1 : 0;
3818
+ }
3819
+
3820
+ for ( i=0; i < len; i++ ) {
3821
+ cell = cells[i];
3822
+ cell.remove();
3823
+ // remove item from collection
3824
+ utils.removeFrom( this.cells, cell );
3825
+ }
3826
+
3827
+ if ( cells.length ) {
3828
+ // update stuff
3829
+ this._cellAddedRemoved( 0, selectedIndexDelta );
3830
+ }
3831
+ };
3832
+
3833
+ // updates when cells are added or removed
3834
+ proto._cellAddedRemoved = function( changedCellIndex, selectedIndexDelta ) {
3835
+ // TODO this math isn't perfect with grouped slides
3836
+ selectedIndexDelta = selectedIndexDelta || 0;
3837
+ this.selectedIndex += selectedIndexDelta;
3838
+ this.selectedIndex = Math.max( 0, Math.min( this.slides.length - 1, this.selectedIndex ) );
3839
+
3840
+ this.cellChange( changedCellIndex, true );
3841
+ // backwards compatibility
3842
+ this.emitEvent( 'cellAddedRemoved', [ changedCellIndex, selectedIndexDelta ] );
3843
+ };
3844
+
3845
+ /**
3846
+ * logic to be run after a cell's size changes
3847
+ * @param {Element} elem - cell's element
3848
+ */
3849
+ proto.cellSizeChange = function( elem ) {
3850
+ var cell = this.getCell( elem );
3851
+ if ( !cell ) {
3852
+ return;
3853
+ }
3854
+ cell.getSize();
3855
+
3856
+ var index = this.cells.indexOf( cell );
3857
+ this.cellChange( index );
3858
+ };
3859
+
3860
+ /**
3861
+ * logic any time a cell is changed: added, removed, or size changed
3862
+ * @param {Integer} changedCellIndex - index of the changed cell, optional
3863
+ */
3864
+ proto.cellChange = function( changedCellIndex, isPositioningSlider ) {
3865
+ var prevSlideableWidth = this.slideableWidth;
3866
+ this._positionCells( changedCellIndex );
3867
+ this._getWrapShiftCells();
3868
+ this.setGallerySize();
3869
+ this.emitEvent( 'cellChange', [ changedCellIndex ] );
3870
+ // position slider
3871
+ if ( this.options.freeScroll ) {
3872
+ // shift x by change in slideableWidth
3873
+ // TODO fix position shifts when prepending w/ freeScroll
3874
+ var deltaX = prevSlideableWidth - this.slideableWidth;
3875
+ this.x += deltaX * this.cellAlign;
3876
+ this.positionSlider();
3877
+ } else {
3878
+ // do not position slider after lazy load
3879
+ if ( isPositioningSlider ) {
3880
+ this.positionSliderAtSelected();
3881
+ }
3882
+ this.select( this.selectedIndex );
3883
+ }
3884
+ };
3885
+
3886
+ // ----- ----- //
3887
+
3888
+ return Flickity;
3889
+
3890
+ }));
3891
+
3892
+ // lazyload
3893
+ ( function( window, factory ) {
3894
+ // universal module definition
3895
+ /* jshint strict: false */
3896
+ if ( typeof define == 'function' && define.amd ) {
3897
+ // AMD
3898
+ define( 'flickity/js/lazyload',[
3899
+ './flickity',
3900
+ 'fizzy-ui-utils/utils'
3901
+ ], function( Flickity, utils ) {
3902
+ return factory( window, Flickity, utils );
3903
+ });
3904
+ } else if ( typeof module == 'object' && module.exports ) {
3905
+ // CommonJS
3906
+ module.exports = factory(
3907
+ window,
3908
+ require('./flickity'),
3909
+ require('fizzy-ui-utils')
3910
+ );
3911
+ } else {
3912
+ // browser global
3913
+ factory(
3914
+ window,
3915
+ window.Flickity,
3916
+ window.fizzyUIUtils
3917
+ );
3918
+ }
3919
+
3920
+ }( window, function factory( window, Flickity, utils ) {
3921
+ 'use strict';
3922
+
3923
+ Flickity.createMethods.push('_createLazyload');
3924
+ var proto = Flickity.prototype;
3925
+
3926
+ proto._createLazyload = function() {
3927
+ this.on( 'select', this.lazyLoad );
3928
+ };
3929
+
3930
+ proto.lazyLoad = function() {
3931
+ var lazyLoad = this.options.lazyLoad;
3932
+ if ( !lazyLoad ) {
3933
+ return;
3934
+ }
3935
+ // get adjacent cells, use lazyLoad option for adjacent count
3936
+ var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0;
3937
+ var cellElems = this.getAdjacentCellElements( adjCount );
3938
+ // get lazy images in those cells
3939
+ var lazyImages = [];
3940
+ cellElems.forEach( function( cellElem ) {
3941
+ var lazyCellImages = getCellLazyImages( cellElem );
3942
+ lazyImages = lazyImages.concat( lazyCellImages );
3943
+ });
3944
+ // load lazy images
3945
+ lazyImages.forEach( function( img ) {
3946
+ new LazyLoader( img, this );
3947
+ }, this );
3948
+ };
3949
+
3950
+ function getCellLazyImages( cellElem ) {
3951
+ // check if cell element is lazy image
3952
+ if ( cellElem.nodeName == 'IMG' &&
3953
+ cellElem.getAttribute('data-flickity-lazyload') ) {
3954
+ return [ cellElem ];
3955
+ }
3956
+ // select lazy images in cell
3957
+ var imgs = cellElem.querySelectorAll('img[data-flickity-lazyload]');
3958
+ return utils.makeArray( imgs );
3959
+ }
3960
+
3961
+ // -------------------------- LazyLoader -------------------------- //
3962
+
3963
+ /**
3964
+ * class to handle loading images
3965
+ */
3966
+ function LazyLoader( img, flickity ) {
3967
+ this.img = img;
3968
+ this.flickity = flickity;
3969
+ this.load();
3970
+ }
3971
+
3972
+ LazyLoader.prototype.handleEvent = utils.handleEvent;
3973
+
3974
+ LazyLoader.prototype.load = function() {
3975
+ this.img.addEventListener( 'load', this );
3976
+ this.img.addEventListener( 'error', this );
3977
+ // load image
3978
+ this.img.src = this.img.getAttribute('data-flickity-lazyload');
3979
+ // remove attr
3980
+ this.img.removeAttribute('data-flickity-lazyload');
3981
+ };
3982
+
3983
+ LazyLoader.prototype.onload = function( event ) {
3984
+ this.complete( event, 'flickity-lazyloaded' );
3985
+ };
3986
+
3987
+ LazyLoader.prototype.onerror = function( event ) {
3988
+ this.complete( event, 'flickity-lazyerror' );
3989
+ };
3990
+
3991
+ LazyLoader.prototype.complete = function( event, className ) {
3992
+ // unbind events
3993
+ this.img.removeEventListener( 'load', this );
3994
+ this.img.removeEventListener( 'error', this );
3995
+
3996
+ var cell = this.flickity.getParentCell( this.img );
3997
+ var cellElem = cell && cell.element;
3998
+ this.flickity.cellSizeChange( cellElem );
3999
+
4000
+ this.img.classList.add( className );
4001
+ this.flickity.dispatchEvent( 'lazyLoad', event, cellElem );
4002
+ };
4003
+
4004
+ // ----- ----- //
4005
+
4006
+ Flickity.LazyLoader = LazyLoader;
4007
+
4008
+ return Flickity;
4009
+
4010
+ }));
4011
+
4012
+ /*!
4013
+ * Flickity v2.0.5
4014
+ * Touch, responsive, flickable carousels
4015
+ *
4016
+ * Licensed GPLv3 for open source use
4017
+ * or Flickity Commercial License for commercial use
4018
+ *
4019
+ * http://flickity.metafizzy.co
4020
+ * Copyright 2016 Metafizzy
4021
+ */
4022
+
4023
+ ( function( window, factory ) {
4024
+ // universal module definition
4025
+ /* jshint strict: false */
4026
+ if ( typeof define == 'function' && define.amd ) {
4027
+ // AMD
4028
+ define( 'flickity/js/index',[
4029
+ './flickity',
4030
+ './drag',
4031
+ './prev-next-button',
4032
+ './page-dots',
4033
+ './player',
4034
+ './add-remove-cell',
4035
+ './lazyload'
4036
+ ], factory );
4037
+ } else if ( typeof module == 'object' && module.exports ) {
4038
+ // CommonJS
4039
+ module.exports = factory(
4040
+ require('./flickity'),
4041
+ require('./drag'),
4042
+ require('./prev-next-button'),
4043
+ require('./page-dots'),
4044
+ require('./player'),
4045
+ require('./add-remove-cell'),
4046
+ require('./lazyload')
4047
+ );
4048
+ }
4049
+
4050
+ })( window, function factory( Flickity ) {
4051
+ /*jshint strict: false*/
4052
+ return Flickity;
4053
+ });
4054
+
4055
+ /*!
4056
+ * Flickity asNavFor v2.0.1
4057
+ * enable asNavFor for Flickity
4058
+ */
4059
+
4060
+ /*jshint browser: true, undef: true, unused: true, strict: true*/
4061
+
4062
+ ( function( window, factory ) {
4063
+ // universal module definition
4064
+ /*jshint strict: false */ /*globals define, module, require */
4065
+ if ( typeof define == 'function' && define.amd ) {
4066
+ // AMD
4067
+ define( 'flickity-as-nav-for/as-nav-for',[
4068
+ 'flickity/js/index',
4069
+ 'fizzy-ui-utils/utils'
4070
+ ], factory );
4071
+ } else if ( typeof module == 'object' && module.exports ) {
4072
+ // CommonJS
4073
+ module.exports = factory(
4074
+ require('flickity'),
4075
+ require('fizzy-ui-utils')
4076
+ );
4077
+ } else {
4078
+ // browser global
4079
+ window.Flickity = factory(
4080
+ window.Flickity,
4081
+ window.fizzyUIUtils
4082
+ );
4083
+ }
4084
+
4085
+ }( window, function factory( Flickity, utils ) {
4086
+
4087
+
4088
+
4089
+ // -------------------------- asNavFor prototype -------------------------- //
4090
+
4091
+ // Flickity.defaults.asNavFor = null;
4092
+
4093
+ Flickity.createMethods.push('_createAsNavFor');
4094
+
4095
+ var proto = Flickity.prototype;
4096
+
4097
+ proto._createAsNavFor = function() {
4098
+ this.on( 'activate', this.activateAsNavFor );
4099
+ this.on( 'deactivate', this.deactivateAsNavFor );
4100
+ this.on( 'destroy', this.destroyAsNavFor );
4101
+
4102
+ var asNavForOption = this.options.asNavFor;
4103
+ if ( !asNavForOption ) {
4104
+ return;
4105
+ }
4106
+ // HACK do async, give time for other flickity to be initalized
4107
+ var _this = this;
4108
+ setTimeout( function initNavCompanion() {
4109
+ _this.setNavCompanion( asNavForOption );
4110
+ });
4111
+ };
4112
+
4113
+ proto.setNavCompanion = function( elem ) {
4114
+ elem = utils.getQueryElement( elem );
4115
+ var companion = Flickity.data( elem );
4116
+ // stop if no companion or companion is self
4117
+ if ( !companion || companion == this ) {
4118
+ return;
4119
+ }
4120
+
4121
+ this.navCompanion = companion;
4122
+ // companion select
4123
+ var _this = this;
4124
+ this.onNavCompanionSelect = function() {
4125
+ _this.navCompanionSelect();
4126
+ };
4127
+ companion.on( 'select', this.onNavCompanionSelect );
4128
+ // click
4129
+ this.on( 'staticClick', this.onNavStaticClick );
4130
+
4131
+ this.navCompanionSelect( true );
4132
+ };
4133
+
4134
+ proto.navCompanionSelect = function( isInstant ) {
4135
+ if ( !this.navCompanion ) {
4136
+ return;
4137
+ }
4138
+ // select slide that matches first cell of slide
4139
+ var selectedCell = this.navCompanion.selectedCells[0];
4140
+ var firstIndex = this.navCompanion.cells.indexOf( selectedCell );
4141
+ var lastIndex = firstIndex + this.navCompanion.selectedCells.length - 1;
4142
+ var selectIndex = Math.floor( lerp( firstIndex, lastIndex,
4143
+ this.navCompanion.cellAlign ) );
4144
+ this.selectCell( selectIndex, false, isInstant );
4145
+ // set nav selected class
4146
+ this.removeNavSelectedElements();
4147
+ // stop if companion has more cells than this one
4148
+ if ( selectIndex >= this.cells.length ) {
4149
+ return;
4150
+ }
4151
+
4152
+ var selectedCells = this.cells.slice( firstIndex, lastIndex + 1 );
4153
+ this.navSelectedElements = selectedCells.map( function( cell ) {
4154
+ return cell.element;
4155
+ });
4156
+ this.changeNavSelectedClass('add');
4157
+ };
4158
+
4159
+ function lerp( a, b, t ) {
4160
+ return ( b - a ) * t + a;
4161
+ }
4162
+
4163
+ proto.changeNavSelectedClass = function( method ) {
4164
+ this.navSelectedElements.forEach( function( navElem ) {
4165
+ navElem.classList[ method ]('is-nav-selected');
4166
+ });
4167
+ };
4168
+
4169
+ proto.activateAsNavFor = function() {
4170
+ this.navCompanionSelect( true );
4171
+ };
4172
+
4173
+ proto.removeNavSelectedElements = function() {
4174
+ if ( !this.navSelectedElements ) {
4175
+ return;
4176
+ }
4177
+ this.changeNavSelectedClass('remove');
4178
+ delete this.navSelectedElements;
4179
+ };
4180
+
4181
+ proto.onNavStaticClick = function( event, pointer, cellElement, cellIndex ) {
4182
+ if ( typeof cellIndex == 'number' ) {
4183
+ this.navCompanion.selectCell( cellIndex );
4184
+ }
4185
+ };
4186
+
4187
+ proto.deactivateAsNavFor = function() {
4188
+ this.removeNavSelectedElements();
4189
+ };
4190
+
4191
+ proto.destroyAsNavFor = function() {
4192
+ if ( !this.navCompanion ) {
4193
+ return;
4194
+ }
4195
+ this.navCompanion.off( 'select', this.onNavCompanionSelect );
4196
+ this.off( 'staticClick', this.onNavStaticClick );
4197
+ delete this.navCompanion;
4198
+ };
4199
+
4200
+ // ----- ----- //
4201
+
4202
+ return Flickity;
4203
+
4204
+ }));
4205
+
4206
+ /*!
4207
+ * imagesLoaded v4.1.1
4208
+ * JavaScript is all like "You images are done yet or what?"
4209
+ * MIT License
4210
+ */
4211
+
4212
+ ( function( window, factory ) { 'use strict';
4213
+ // universal module definition
4214
+
4215
+ /*global define: false, module: false, require: false */
4216
+
4217
+ if ( typeof define == 'function' && define.amd ) {
4218
+ // AM